@zumerbox/bump
v1.3.0
Published
Interactive semver bump driven by [Conventional Commits](https://www.conventionalcommits.org/). Reads commits since the last tag, classifies them, suggests `major` / `minor` / `patch`, and runs `npm version` for you. Supports prereleases and a non-interac
Readme
@zumerbox/bump
Interactive semver bump driven by Conventional Commits. Reads commits since the last tag, classifies them, suggests major / minor / patch, and runs npm version for you. Supports prereleases and a non-interactive mode for CI.
Install
npm install @zumerbox/bump --save-devUsage
Interactive (default)
npx @zumerbox/bumpThe tool will:
- Refuse to run if the working tree is dirty.
- List the commits since the last tag, grouped by conventional type:
- 🔥 BREAKING CHANGE —
feat!:,fix(scope)!:, or any commit withBREAKING CHANGEin the body. - ✨
feat:— minor bump. - 🛠
fix:— patch bump. - 📦
chore:/docs:/refactor:/perf:/ci:/test:/build:/style:/revert:— informational only. - ❓ commits without a conventional prefix.
- 🔥 BREAKING CHANGE —
- Suggest the next version. Press Enter to accept or type your own.
- Ask if it should be a prerelease, and if so the tag (default
beta) — auto-numbers-beta.0,-beta.1, etc. - Run
npm version <new>, which creates the commit and tag.
Non-interactive (CI)
bump --patch # bump 1.2.3 → 1.2.4
bump --minor # bump 1.2.3 → 1.3.0
bump --major # bump 1.2.3 → 2.0.0
bump --major --prerelease=rc # 1.2.3 → 2.0.0-rc.0 (auto-increments)
bump --prerelease # use the suggested bump, tag as -beta.N
bump --dry-run --patch # prints the npm version command, runs nothing--dry-run (-d) prints npm version … instead of running it. Useful in --patch/--minor/--major mode to preview the bump.
Help
bump --helpConventional commit detection
A commit subject is classified as breaking when it matches:
^<type>(\(scope\))?!:(e.g.feat!:,fix(api)!:)- or contains the literal phrase
BREAKING CHANGE
The earlier 1.x versions used a looser pattern that flagged any line containing !, producing false positives on subjects like fix: handle ! in regex. 2.x is strict.
Pairing with @zumerbox/changelog
A typical release script in your package.json:
{
"scripts": {
"bump": "npx @zumerbox/bump",
"postversion": "npx @zumerbox/changelog && git add CHANGELOG.md && git commit -m \"Update changelog\" && git push --follow-tags"
}
}npm run bump triggers npm version internally, which runs postversion after creating the version commit and tag.
License
MIT
