Add a helper script to publish the NPM package.
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 23 Mar 2020 22:53:25 +0000 (18:53 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 23 Mar 2020 23:18:10 +0000 (19:18 -0400)
build.sh
doc/dev.md [new file with mode: 0644]
package.json

index e251b728483b34b6c319149378ebc91ee9240a40..63491589c9eedf60f77cc3fa9c24b4722c928473 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -24,4 +24,3 @@ cp LICENSE.txt $OUTDIR
 # "Preprocess" the dist package.json.
 cp ./package.json $OUTDIR
 sed -i '' -e s@\"dist/@\"@ $OUTDIR/package.json
-sed -i '' -e 's@"prepare": ".*",@@' $OUTDIR/package.json
diff --git a/doc/dev.md b/doc/dev.md
new file mode 100644 (file)
index 0000000..be22b40
--- /dev/null
@@ -0,0 +1,9 @@
+# Developer Workflows
+
+## Publishing Releases
+
+Only the dist/ directory, containing the compiled TypeScript files are put into the NPM package. The
+`build.sh` script copies non-`tsc`-processed files, and does some processing of the `package.json`.
+To publish a new release, just run:
+
+    npm run npm-publish
index e5b6d181af88003ef8b4903c7c73c5100860789c..5f660754d2e9ae988f31d95916708faa72acf5da 100644 (file)
@@ -4,10 +4,9 @@
   "description": "A library for modeling individual US tax returns.",
   "repository": "https://github.com/rsesek/ustaxlib",
   "scripts": {
-    "prepare": "./build.sh",
+    "npm-publish": "./build.sh && npm publish dist",
     "dev": "jest --watch",
     "test": "jest",
-    "check": "tsc --noEmit",
     "debug": "node --inspect-brk --stack-trace-limit=1000 node_modules/.bin/jest --coverage=false"
   },
   "author": "Robert Sesek",