calver-bump
v1.0.0
Published
Release CLI for internal applications using readable CalVer versions.
Readme
calver-bump
Release CLI for applications and internal tools that use readable CalVer versions.
Default version and tag format:
YY.MMDDExample:
26.0529What it does
- Bumps
package.jsonto the next CalVer version. - Updates
package-lock.jsonornpm-shrinkwrap.jsonwhen present. - Warns when
pnpm-lock.yamloryarn.lockis present, because those lockfiles do not store the root package version consistently. - Creates or prepends a
CHANGELOG.mdentry from conventional commits since the nearest reachable tag. - Prints the git commands needed to commit, tag, and push the reviewed release.
Usage
npx calver-bumpBy default, calver-bump updates files only. Review CHANGELOG.md, then run the printed git commands when the release notes are correct.
Preview the planned release without writing files:
npx calver-bump --dry-runPrint help:
npx calver-bump --helpPrint the installed calver-bump package version:
npx calver-bump --versionUse compact CalVer instead:
npx calver-bump --format compactUse long CalVer instead:
npx calver-bump --format longCreate a v-prefixed git tag while keeping package.json unprefixed:
npx calver-bump --tag-prefix vPush the release commit and annotated tag:
npx calver-bump --pushPush to a different remote:
npx calver-bump --push --remote upstreamOnly include selected conventional commit types:
npx calver-bump --types feat,fix,perfUse an explicit changelog base tag:
npx calver-bump --from v1.35.0Use local tags only without fetching from the configured remote:
npx calver-bump --no-fetchUpdate only package.json and supported npm lockfiles:
npx calver-bump --version-onlyUpdate only CHANGELOG.md:
npx calver-bump --changelog-onlyCreate a release commit after updating files:
npx calver-bump --commitCreate a release commit and annotated tag after updating files:
npx calver-bump --tagExplicitly update files without creating a release commit or tag:
npx calver-bump --skip-commitConfiguration
Project defaults can be stored in .calverbumprc.json:
{
"format": "short",
"tagPrefix": "v",
"remote": "origin",
"types": ["feat", "fix", "perf"],
"changelogSections": {
"perf": "Performance",
"security": "Security"
}
}Runtime support
calver-bump supports Node.js LTS lines only. The current supported runtime range is Node.js 22 and Node.js 24.
Publishing
The package includes a manual GitHub Actions publish workflow. Run the Publish workflow from GitHub after the package version has been bumped, tests pass, and the npm automation token is available as NPM_TOKEN.
Notes
- The default
shortformat isYY.MMDDfor the first release of the day, thenYY.MMDD.1,YY.MMDD.2, etc. - The optional
compactformat isYYMMDDfor the first release of the day, thenYYMMDD.1,YYMMDD.2, etc. - The optional
longformat isYYYY.MM.DDfor the first release of the day, thenYYYY.MM.DD.1,YYYY.MM.DD.2, etc. - Changelog release headings use the CalVer version only and do not append a separate
YYYY-MM-DDdate. - Existing
v-prefixed tags are considered when calculating the next sequence number. - Changelog ranges start from the nearest reachable tag, even when it is not a CalVer tag.
- Changelog entries include conventional commit subjects only, such as
feat:,fix(scope):, orchore!:. - Changelog entries are grouped into
Features,Fixes, andOther Changesby default. UsechangelogSectionsto assign additional conventional commit types to named sections. - Changelog entries link to GitHub pull requests or GitLab merge requests when the local git message includes references such as
#123,Merge pull request #123,!123, orSee merge request group/project!123. - Changelog entries fall back to commit hash links for GitHub and GitLab-style remotes when no pull/merge request reference is found.
- Release entries include a
Full Changelogsection with a deduped list of pull/merge requests found in the release range, including the local commit title when available. - Later releases prepend only commits since the previous nearest reachable tag.
- Plain
calver-bumpdoes not commit or tag by default; it prints the follow-upgit add,git commit,git tag, andgit push --follow-tagscommands. - Use
--committo create only the release commit. - Use
--tagto create the release commit and annotated tag. - Use
--pushto create the release commit, create the annotated tag, and push both. - Release tags are annotated so
git push --follow-tags <remote> <branch>pushes them. - The working tree must be clean before creating a real release.
- Existing release tags are rejected before files are written.
- If tag creation fails after the release commit, the CLI undoes its own commit and leaves the file changes in the working tree for inspection or recovery.
