@bonvoy/plugin-conventional
v0.12.1
Published
π’ Conventional commits plugin for bonvoy
Maintainers
Readme
@bonvoy/plugin-conventional π’
Conventional commits plugin for bonvoy
Analyzes conventional commit messages to automatically determine semantic version bumps for your packages.
Features
- β
Robust Parsing - Uses
conventional-commits-parser - π₯ Breaking Changes - Supports
feat!:syntax andBREAKING CHANGE:footer - ποΈ Configurable Presets - Angular, Conventional, Atom, or custom
- π¦ Monorepo Ready - Per-package commit filtering
- π‘οΈ Graceful Fallbacks - Handles malformed commits without crashing
Installation
npm install @bonvoy/plugin-conventionalThis plugin is included by default in bonvoy, so you typically don't need to install it separately.
Usage
Default Configuration
The plugin works out of the box with the Angular preset:
// bonvoy.config.js
export default {
plugins: [
'@bonvoy/plugin-conventional', // Uses Angular preset by default
],
};Custom Configuration
// bonvoy.config.js
export default {
plugins: [
['@bonvoy/plugin-conventional', {
preset: 'conventional', // 'angular' | 'conventional' | 'atom' | 'custom'
types: {
// Only used when preset: 'custom'
feat: 'minor',
fix: 'patch',
breaking: 'major',
perf: 'patch',
}
}]
],
};Supported Commit Types
Angular Preset (default)
| Type | Bump | Example |
|------|------|---------|
| feat | minor | feat: add new API endpoint |
| fix | patch | fix: resolve memory leak |
| perf | patch | perf: optimize database queries |
| feat! | major | feat!: remove deprecated API |
| BREAKING CHANGE | major | Any commit with BREAKING CHANGE: in body |
Breaking Changes
Breaking changes can be indicated in two ways:
- Exclamation mark:
feat!: remove old API - Footer: Any commit with
BREAKING CHANGE:in the body
feat: add new authentication system
BREAKING CHANGE: The old auth API has been removed.
Use the new `authenticate()` method instead.Examples
Commits that trigger releases:
git commit -m "feat: add user authentication" # β minor bump
git commit -m "fix: resolve login bug" # β patch bump
git commit -m "feat!: remove legacy API" # β major bump
git commit -m "perf: optimize queries" # β patch bumpCommits that DON'T trigger releases:
git commit -m "docs: update README" # β no bump
git commit -m "chore: update dependencies" # β no bump
git commit -m "style: fix formatting" # β no bump
git commit -m "test: add unit tests" # β no bumpPresets
Angular (default)
featβ minorfixβ patchperfβ patch
Conventional
featβ minorfixβ patchperfβ patch
Atom
:sparkles:β minor:bug:β patch:racehorse:β patch
Custom
Define your own commit types and their corresponding bumps.
Monorepo Support
The plugin automatically filters commits based on the files they modify, ensuring each package only gets bumped for relevant changes.
# This commit only affects @myorg/core
git commit -m "feat(core): add new feature" packages/core/src/feature.ts
# This commit affects both packages
git commit -m "feat: add shared utility" packages/core/src/util.ts packages/cli/src/util.tsAPI
import ConventionalPlugin from '@bonvoy/plugin-conventional';
interface ConventionalConfig {
preset?: 'angular' | 'conventional' | 'atom' | 'custom';
types?: Record<string, SemverBump>;
}
const plugin = new ConventionalPlugin({
preset: 'angular',
types: {
feat: 'minor',
fix: 'patch',
}
});License
MIT
