@bonvoy/plugin-git
v0.12.2
Published
🚢 Git operations plugin for bonvoy
Readme
@bonvoy/plugin-git 🚢
Git operations plugin for bonvoy
Handles git commit, tag, push, and branch operations during the release process.
Installation
npm install @bonvoy/plugin-gitFeatures
- ✅ Commits version bumps and changelog updates
- ✅ Creates git tags for each released package
- ✅ Pushes commits and tags to remote
- ✅ Branch creation and checkout for PR workflow
- ✅ Configurable commit message and tag format
- ✅ Dry-run support
Configuration
// bonvoy.config.js
export default {
git: {
commitMessage: 'chore: :bookmark: release', // default
tagFormat: '{name}@{version}', // default
push: true, // default
},
};Placeholders
| Placeholder | Description |
|-------------|-------------|
| {packages} | Comma-separated list of released package names (for subject) |
| {details} | Package list with versions, one per line (for body) |
| {name} | Package name (for tag format) |
| {version} | Package version (for tag format) |
Note: If neither
{details}is used in the commit message, package details are automatically appended as the commit body.
Hooks
This plugin taps into the following hooks:
| Hook | Action |
|------|--------|
| beforePublish | Commits changes, creates tags, pushes to remote |
Operations
The plugin provides these git operations:
add(files, cwd)- Stage filescommit(message, cwd)- Create committag(name, cwd)- Create tagpush(cwd, branch?)- Push to remotepushTags(tags, cwd)- Push tagscheckout(branch, cwd, create?)- Checkout or create branchgetCurrentBranch(cwd)- Get current branch namegetLastTag(cwd)- Get most recent taggetCommitsSinceTag(tag, cwd)- Get commits since tag
Default Behavior
This plugin is loaded automatically by bonvoy. During beforePublish:
- Stage all changes (
git add .) - Commit with the configured message
- Create tags for each released package
- Push commits and tags to the remote
License
MIT
