From 12391d89735b1677f147d536b6077eacf6a87df1 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 23 Mar 2020 18:53:25 -0400 Subject: [PATCH] Add a helper script to publish the NPM package. --- build.sh | 1 - doc/dev.md | 9 +++++++++ package.json | 3 +-- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 doc/dev.md diff --git a/build.sh b/build.sh index e251b72..6349158 100755 --- 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 index 0000000..be22b40 --- /dev/null +++ b/doc/dev.md @@ -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 diff --git a/package.json b/package.json index e5b6d18..5f66075 100644 --- a/package.json +++ b/package.json @@ -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", -- 2.43.5