🚢 Core hook system for bonvoy release automation
npm install @bonvoy/core> Core hook system for bonvoy release automation
The heart of bonvoy - provides the plugin architecture, configuration system, and workspace detection for npm monorepos.
- 🔌 Plugin Architecture - Extensible hook system using tapable
- 📦 Monorepo Support - npm workspaces detection and management
- ⚙️ Configuration - Flexible config loading with cosmiconfig
- 🛡️ Type Safety - Runtime validation with Zod
- 📋 Schema Generation - JSON Schema for IDE autocompletion
``bash`
npm install @bonvoy/core
`typescript
import { Bonvoy, BonvoyPlugin } from '@bonvoy/core';
class MyPlugin implements BonvoyPlugin {
name = 'my-plugin';
apply(bonvoy: Bonvoy) {
bonvoy.hooks.beforeShipIt.tap(this.name, (context) => {
console.log('Starting release...');
});
}
}
const bonvoy = new Bonvoy();
bonvoy.use(new MyPlugin());
`
`typescript
import { loadConfig } from '@bonvoy/core';
const config = await loadConfig();
console.log(config.versioning); // 'independent' | 'fixed'
`
`typescript
import { detectWorkspaces } from '@bonvoy/core';
const packages = await detectWorkspaces('/path/to/monorepo');
console.log(packages.map(p => p.name));
`
Available hooks for plugins:
- beforeShipIt - Before starting release processvalidateRepo
- - Validate repository stategetVersion
- - Determine version bump for packagesversion
- - Apply version changesafterVersion
- - After version changes appliedbeforeChangelog
- - Before generating changeloggenerateChangelog
- - Generate changelog contentafterChangelog
- - After changelog generatedbeforePublish
- - Before publishing packagespublish
- - Publish packagesafterPublish
- - After packages publishedbeforeRelease
- - Before creating releasesmakeRelease
- - Create releasesafterRelease
- - After releases created
`typescript``
interface BonvoyConfig {
versioning?: 'independent' | 'fixed';
rootVersionStrategy?: 'max' | 'patch' | 'none';
commitMessage?: string;
tagFormat?: string;
changelog?: {
global?: boolean;
sections?: Record
};
workflow?: 'direct' | 'pr';
baseBranch?: string;
plugins?: (string | [string, object])[];
}
MIT