What is conventional-changelog-conventionalcommits?
The conventional-changelog-conventionalcommits package is a preset for the conventional-changelog tool that formats changelogs according to the Conventional Commits specification. This specification outlines a set of rules for creating an explicit commit history, which makes it easier to automate the generation of release notes.
What are conventional-changelog-conventionalcommits's main functionalities?
Generating changelogs
This feature allows you to generate a changelog from git metadata using the conventional commits specification. The code sample demonstrates how to create a changelog stream and write it to a file.
const conventionalChangelog = require('conventional-changelog');
const fs = require('fs');
const stream = fs.createWriteStream('CHANGELOG.md');
conventionalChangelog({
preset: 'conventionalcommits'
}).pipe(stream);
Customizing changelog generation
This feature allows for customization of the changelog generation process. The code sample shows how to generate a changelog with all releases and includes a placeholder for additional configuration options.
const conventionalChangelog = require('conventional-changelog');
const fs = require('fs');
const stream = fs.createWriteStream('CHANGELOG.md');
conventionalChangelog({
preset: 'conventionalcommits',
releaseCount: 0, // Generate all releases
config: {
// Custom configuration here
}
}).pipe(stream);
Other packages similar to conventional-changelog-conventionalcommits
standard-version
standard-version is a utility for versioning using semver and CHANGELOG generation powered by conventional-changelog. It automates the versioning process and generates a changelog based on the conventions outlined in the Conventional Commits specification. It is similar to conventional-changelog-conventionalcommits but includes additional features for versioning and releasing.
lerna-changelog
lerna-changelog is a changelog generator for monorepos that use Lerna. It's tailored for repositories that use the Lerna tool and can group changes by Lerna packages. While it also generates changelogs based on commit messages, it is specifically designed for monorepo workflows and may not be as flexible as conventional-changelog-conventionalcommits for other types of projects.
semantic-release
semantic-release automates the whole package release workflow including determining the next version number, generating the release notes, and publishing the package. It uses the Conventional Commits specification to determine version bumps and changelog content. It provides a more comprehensive solution compared to conventional-changelog-conventionalcommits, which focuses solely on changelog generation.
conventionalcommits.org convention
A concrete implementation of the specification described at
conventionalcommits.org for automated
CHANGELOG generation and version management.
Indirect Usage (as preset)
Use the Conventional Changelog CLI Quick Start with the -p conventionalcommits
option.
Direct Usage (as a base preset so you can customize it)
If you want to use this package directly and pass options, you can use the Conventional Changelog CLI Quick Start and with the --config
or -n
parameter, pass a js config that looks like this
'use strict'
const config = require('conventional-changelog-conventionalcommits')
module.exports = config({
"issuePrefixes": ["TEST-"],
"issueUrlFormat": "myBugTracker.com/{prefix}{id}"
})
or json config like that:
{
"options": {
"preset": {
"name": "conventionalchangelog",
"issuePrefixes": ["TEST-"],
"issueUrlFormat": "myBugTracker.com/{prefix}{id}"
}
}
}
This last json config way passes the preset
object to the conventional-changelog-preset-loader
package, that in turn, passes this same preset
object as the config for the conventional-changelog-conventionalcommits
.
See conventional-changelog-config-spec for available
configuration options.