Rust script to handle npm publish
This CLI Tool runs:
npm run build
- runs your project's build script for production- this will need to be in your package.json "scripts"
- read more here: npm docs
npm version $ver
- based on argument passed- acceptable versions
major
,minor
,patch
,premajor
,preminor
,prepatch
,prerelease
- read more here Semantic Versioning
- acceptable versions
git push
- pushes to git repo set inremote
git rev-parse --abbrev-ref HEAD
- to get current branchgit push origin $branch
npm publish
- publishes to npmjs.com via details inpackage.json
- Download binary executable
- move it to
/usr/local/bin/
or
- Install rustlang
- or with homebrew:
brew install rustup
- or with homebrew:
- clone repo
cd
to local directory and runcargo build --release
cp target/release/npm_pub /usr/local/bin/
This is all assuming that /usr/local/bin/
is in your $PATH
variable
- Project must
- be a valid npm project with
- package.json
- build script (webpack, etc)
- be an initiated Git repo
- with a remote repo (Github, etc)
- be a valid npm project with
- User must be logged in to npm via terminal
npm login
In your command line (terminal, iterm, etc) run:
$ cd /path/to/project
$ npm_pub [major, minor, patch]