Skip to content

plugin-conventional

@bonvoy/plugin-conventional — Default plugin

Parses conventional commit messages to determine semantic version bumps automatically.

Commit Format

<type>[optional scope][!]: <description>

[optional body]

[optional footer(s)]

Supported Commit Types

CommitBumpExample
feat:minorfeat: add user authentication
fix:patchfix: resolve memory leak
perf:patchperf: optimize database queries
feat!:majorfeat!: remove deprecated API
fix!:majorfix!: change return type
BREAKING CHANGE: in footermajorAny commit with BREAKING CHANGE: in body

Commits with other types (docs:, chore:, style:, refactor:, test:, ci:) do not trigger a release.

Configuration

javascript
export default {
  conventional: {
    preset: 'angular',  // default
  },
};

Presets

PresetDescription
angularStandard Angular convention (default)
conventionalSame as angular
atomAtom editor convention (emoji-based)
customDefine your own type-to-bump mapping

Custom Types

javascript
export default {
  conventional: {
    preset: 'custom',
    types: {
      feat: 'minor',
      fix: 'patch',
      perf: 'patch',
      refactor: 'patch',   // refactor triggers a patch
      breaking: 'major',
    },
  },
};

How It Works

  1. Reads all commits since the last git tag
  2. Parses each commit message with conventional-commits-parser
  3. Maps the commit type to a bump level
  4. Returns the highest bump across all commits

In a monorepo, commits are filtered per package based on which files were modified.

Hook

HookAction
getVersionReturns the calculated SemverBump for the current package

Released under the MIT License.