Skip to content

Introduction

conventional-recommended-bump inspects the commits since your last release and recommends whether the next version should be a major, minor, or patch — following a preset’s rules (a breaking change → major, a new feature → minor, otherwise patch). It decides how much to bump; pair it with conventional-changelog to write the notes.

  1. Install conventional-recommended-bump together with a preset:

    pnpm add -D conventional-recommended-bump conventional-changelog-conventionalcommits
  2. Make commits following the convention as you work:

    feat(api): add async write() generator
    fix(cli): resolve config path relative to cwd
  3. Run it with your preset. The recommended release type is printed to stdout:

    pnpm conventional-recommended-bump -p conventionalcommits
  4. Get the recommended bump. A feat is present, so the change is a minor:

    minor

    Add --verbose (-v) to also print the reasoning:

    minor
    Reason: There are 0 BREAKING CHANGES and 1 features

The rules come from the preset. For Conventional Commits (and Angular):

Commits since the last releaseRecommended bump
Any breaking change (! or a BREAKING CHANGE: footer)major
At least one featminor
Otherwise (fix, perf, …)patch

If nothing warrants a release, no bump is printed. The preMajor option softens these rules for projects still on 0.x.

Feed the result straight into npm version:

npm version "$(npx conventional-recommended-bump -p conventionalcommits)"

The same recommendation is available through the Bumper class:

import { Bumper } from 'conventional-recommended-bump'
const bumper = new Bumper()
.loadPreset('conventionalcommits')
const { releaseType, reason } = await bumper.bump()
console.log(releaseType) // 'minor'

See the JS API page for the full builder interface.