1
0
Fork 0

Makefile.am (check-ts-out): New check for TS->JS compilation

tsc handles its own incremental builds, and if a file is removed, it isn't
always regenerated.  This resulted in a bad distribution being generated and
published to npm.
master
Mike Gerwitz 2019-11-08 11:25:47 -05:00
parent 6cc72d9d11
commit c8c7dfda5d
1 changed files with 14 additions and 1 deletions

View File

@ -51,8 +51,21 @@ modindex: $(nsindex)
@echo "# THIS FILE IS GENERATED; DO NOT MODIFY!" > $@
( cd $*/ && find . -name '*.ts' -printf "%P\n" | sed 's/\.ts$$/.js/' ) >> $@
# tsc handles its own incremental builds, and in the past has gotten into
# states where it did not recognize missing files as needing to be
# built. Since those files are not part of _our_ dependency graph here, we
# need to double-check.
check-ts-out:
find $(path_src) $(path_test) -name '*.ts' -a ! -name '*.d.ts' \
| while read f; do \
test -f "$${f%%.ts}.js" || { \
echo "error: missing tsc output for $$f" >&2; \
exit 1; \
}; \
done
test: check
check: $(tsout)
check: $(tsout) check-ts-out
PATH="$(PATH):$(CURDIR)/node_modules/mocha/bin" \
mocha @NODE_DESTRUCTURE@ \
--require $(path_test)/pre.js \