@rockholla/git-npm-release
A helper around packaging and pushing an npm and git release for a project
Branch | Status |
---|---|
develop |
|
master |
Usage
npm install --save-dev @rockholla/git-npm-release
When you're done developing everything for a release on your project and have it all committed:
./node_modules/.bin/git-npm-release [public|restricted (default = public)]
The command will do the following:
- Ensure that no changes are unstaged in your project
- Ask you whether this is a major, minor, or patch release so that
package.json
can be updated accordingly. You can also just opt to use whatever version is currently inpackage.json
- Run an
npm install
to update the lock file. Create a git commit after updating thepackage.json
(and lock file) version - If you're on a branch other than
master
(e.g. using git-flow and ondevelop
), it will merge your branch into themaster
branch - Create a tag based on your
package.json
version - Push all updated branches and tags
- Finally, run
npm publish
You might also consider making an npm script to call the git-npm-release command:
"scripts": {
"release": "git-npm-release [public|restricted]"
}