THRIFT-4757: fix npm identified security vulnerability in transient dependency on sync-exec
diff --git a/lib/ts/Makefile.am b/lib/ts/Makefile.am
index 9ea20a4..62ea206 100644
--- a/lib/ts/Makefile.am
+++ b/lib/ts/Makefile.am
@@ -21,10 +21,38 @@
# We call install twice to work around npm issues
#
if HAVE_NPM
-SUBDIRS = test
-check-local: all
+prereq:
$(NPM) install || $(NPM) install
$(NPM) list
+
+check-local: prereq all
./node_modules/.bin/grunt
+
+doc: prereq
+ ./node_modules/.bin/grunt jsdoc
+
endif
+
+clean-local:
+ $(RM) -r dist
+ $(RM) -r doc
+ $(RM) -r node_modules
+ $(RM) -r test/build/
+ $(RM) -r test/gen-*/
+
+dist-hook:
+ $(RM) -r $(distdir)/dist/
+ $(RM) -r $(distdir)/doc/
+ $(RM) -r $(distdir)/node_modules/
+ $(RM) -r $(distdir)/test/build/
+ $(RM) -r $(distdir)/test/gen-*/
+
+EXTRA_DIST = \
+ coding_standards.md \
+ Gruntfile.js \
+ package.json \
+ package-lock.json \
+ thrift.d.ts \
+ tsconfig.json
+