Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@semantic-release/release-notes-generator
Advanced tools
Customizable release-notes-generator plugin for semantic-release
The @semantic-release/release-notes-generator package is a plugin for the semantic-release system. It automates the generation of release notes based on your project's commit history, adhering to the Semantic Versioning specification. This tool parses commit messages, groups them into sections, and formats them into a markdown document, which can then be used in release documentation.
Generate release notes
This feature automates the creation of release notes from commits. The code sample shows how to use the release-notes-generator in a Node.js script to generate release notes by providing plugin configuration and context.
const generateNotes = require('@semantic-release/release-notes-generator');
async function generateReleaseNotes(pluginConfig, context) {
const notes = await generateNotes(pluginConfig, context);
console.log(notes);
}
Like @semantic-release/release-notes-generator, conventional-changelog generates changelogs and release notes from a project's commit messages, following the conventional commit format. It offers more extensive customization options and plugins for different release systems, making it versatile but potentially more complex to configure.
Lerna-changelog is specifically designed for monorepos managed with Lerna and generates changelogs based on PR titles and labels. It's less flexible than @semantic-release/release-notes-generator for non-monorepo projects but is an excellent fit for projects using Lerna.
Customizable release-notes-generator plugin for semantic-release based on conventional-changelog
By default release-notes-generator
uses the angular
format described in Angular convention.
Additionnal options can be set within the plugin definition in package.json
to use a different commit format and to customize it:
{
"release": {
"generateNotes": {
"preset": "angular",
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
},
"writerOpts": {
"commitsSort": ["subject", "scope"],
}
}
}
}
Option | Description | Default |
---|---|---|
preset | conventional-changelog preset (Possible values: angular , atom , codemirror , ember , eslint , express , jquery , jscs , jshint ). | angular |
config | NPM package name of a custom conventional-changelog preset. | - |
parserOpts | Additional conventional-commits-parser options that will extends ones loaded by preset or config . See Parser options. | - |
writerOpts | Additional conventional-commits-writer options that will extends ones loaded by preset or config . See Writer options. | - |
NOTE: options.config
will be overwritten by the values of preset. You should use either preset
or config
, but not both. Individual properties of parserOpts
and writerOpts
will overwrite ones loaded with preset
or config
.
Allow to overwrite specific conventional-commits-parser options. This is convenient to use a conventional-changelog preset with some customizations without having to create a new module.
The following example uses Angular convention but will consider a commit to be a breaking change if it's body contains BREAKING CHANGE
, BREAKING CHANGES
or BREAKING
. By default the preset checks only for BREAKING CHANGE
and BREAKING CHANGES
.
{
"release": {
"generateNotes": {
"preset": "angular",
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"],
}
}
}
}
Allow to overwrite specific conventional-commits-writer options. This is convenient to use a conventional-changelog preset with some customizations without having to create a new module.
The following example uses Angular convention but will sort the commits in the changelog by subject
then scope
. By default the preset sort the commits in the changelog by scope
then subject
.
{
"release": {
"generateNotes": {
"preset": "angular",
"writerOpts": {
"commitsSort": ["subject", "scope"],
}
}
}
}
FAQs
semantic-release plugin to generate changelog content with conventional-changelog
The npm package @semantic-release/release-notes-generator receives a total of 1,175,067 weekly downloads. As such, @semantic-release/release-notes-generator popularity was classified as popular.
We found that @semantic-release/release-notes-generator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.