From c8c7dfda5d06dbff55b0cdffa61ac348a27e8327 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Fri, 8 Nov 2019 11:25:47 -0500 Subject: [PATCH] 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. --- Makefile.am | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 \