Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@ryansg.com>2019-11-08 11:25:47 -0500
committerMike Gerwitz <mike.gerwitz@ryansg.com>2019-11-08 11:26:35 -0500
commitc8c7dfda5d06dbff55b0cdffa61ac348a27e8327 (patch)
tree63fce6225ee599eef2675e4cd19477ac60877917
parent6cc72d9d1106927e899059335f6396df865963b5 (diff)
downloadliza-c8c7dfda5d06dbff55b0cdffa61ac348a27e8327.tar.gz
liza-c8c7dfda5d06dbff55b0cdffa61ac348a27e8327.tar.bz2
liza-c8c7dfda5d06dbff55b0cdffa61ac348a27e8327.zip
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.
-rw-r--r--Makefile.am15
1 files changed, 14 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index ad29592..581080e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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 \