Created
August 12, 2022 22:22
-
-
Save mcollina/ba08a2e941e37a48a6f496e26f498607 to your computer and use it in GitHub Desktop.
npm workspace publish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
VERSION=$1 | |
MODULES=`node -e "console.log(require('./package.json').workspaces.join(' '))"` | |
for MODULE in $MODULES; do | |
echo "Building $MODULE" | |
pushd $MODULE | |
npm version $VERSION --save | |
NAME=`node -e "console.log(require('./package.json').name)"` | |
echo $NAME | |
popd | |
npm publish --workspace $MODULE | |
npm i --workspaces --save $NAME | |
done | |
rm -rf node_modules | |
rm -rf packages/*/node_modules | |
npm i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment