@bzelip/bump
v1.0.2
Published
Automate the version bumping and git committing for new releases of node.js projects
Downloads
4
Readme
Bump 🍑
Automate new releases for node.js projects on the command line.
A new release is defined as:
- An incremental increase to the version property in the package.json and package-lock.json files.
- A commit of the two json files with a descriptive message about the reason for the version bump.
- The optional creation of a tag with a descriptive message.
Install
npm install --global @bzelip/bump
This will install bump globally so that it can be run from the command line.
Use
There are two main commands:
bump <strategy> <message>
bump undo
bump
Bump your version based on a strategy, and include a description of the reason for the bump in the generated commit message.
bump <strategy> <message>
major
minor
patch
Example
Input
# current version 0.4.0
bump minor "create custom slider"
Output
🍑: Successfully minor bumped version to 0.5.0 with the commit message:
"package*: v0.5.0 Bump minor for create custom slider 🎉"
Note bump
does not push, it only commits locally.
undo
Undo a bump.
bump undo
This command is an alias for running:
git reset HEAD~
git checkout -- package*
Note Be sure to only use bump undo
immediately after bump <strategy> <message>
to have the desired action.
Assumptions
- your project is git tracked
- you are following Semantic Versioning
- your current working directory includes both package.json and package-lock.json files
TODO
- [ ] add the create tag with message option
- [ ] add tests
My release protocol
My current release protocol includes:
- git
- a Semantic Versioning approach
- a changelog.md
- once a feature branch's work is finalized and documented in changelog.md:
- open package.json, bump the version accordingly
- open package-lock.json, bump the version accordingly
- commit with message of the form
package*: v${version} ${strategy} bump for ${message} 🎉
- TODO: create new tag with command of the form:
tag v${version} -m ${message}
- push to remote, and start the PR process (do this manually after bump.js)
- push new tag to remote (do this manually after bump.js)