@microature/publisher-release-notes-plugin
v0.4.0
Published
Release notes generation plugin for @microature/publisher
Maintainers
Readme
@microature/publisher-release-notes-plugin
Release notes generation plugin for @microature/publisher.
Installation
npm install @microature/publisher-release-notes-pluginUsage
import { ReleaseNotesPlugin } from '@microature/publisher-release-notes-plugin'
const plugin = new ReleaseNotesPlugin()
// Generate release notes from commit messages
const releaseNotes = await plugin.generateReleaseNotes(
[
'feat: add new user authentication system',
'fix: resolve memory leak in data processing',
'docs: update API documentation'
],
{
version: '1.2.0',
currentTag: 'v1.2.0',
previousTag: 'v1.1.0',
repository: 'https://gitlab.com/your-org/your-project'
}
)
console.log(releaseNotes)Configuration
The plugin accepts the following configuration options:
interface ReleaseNotesConfig {
preset?: string // Conventional changelog preset (default: 'angular')
template?: string // Custom template
includeBreakingChanges?: boolean // Include breaking changes section (default: true)
includeDeprecations?: boolean // Include deprecations (default: true)
customSections?: Array<{ // Custom sections
title: string
match: (commit: any) => boolean
}>
}Features
- ✅ Conventional commits support
- ✅ Breaking changes detection
- ✅ Categorized changelog sections
- ✅ Multiple preset support (Angular, Atom, etc.)
- ✅ Custom templates
- ✅ Scoped commit support
- ✅ Fallback for non-conventional commits
Generated Sections
- ⚠️ BREAKING CHANGES - Breaking changes
- ✨ Features - New features (
feat:) - 🐛 Bug Fixes - Bug fixes (
fix:) - ⚡ Performance Improvements - Performance improvements (
perf:) - 📚 Documentation - Documentation changes (
docs:) - 🔨 Code Refactoring - Refactoring (
refactor:) - ✅ Tests - Test changes (
test:) - 📋 Other Changes - Other commits
Examples
Basic Usage
const plugin = new ReleaseNotesPlugin()
const notes = await plugin.generateReleaseNotes(commits, context)With Custom Configuration
const notes = await plugin.generateReleaseNotes(
commits,
context,
{
preset: 'atom',
includeBreakingChanges: true,
customSections: [
{
title: 'Security',
match: (commit) => commit.type === 'security'
}
]
}
)Check for Breaking Changes
const hasBreaking = plugin.hasBreakingChanges(commits)
if (hasBreaking) {
// Handle major version bump
}Requirements
- Node.js >= 18.0.0
License
MIT
