conventional-changelog
Generate changelogs and release notes from a project's commit messages and metadata.
Top Related Projects
:package::rocket: Fully automated version management and package publishing
🚀 Automate versioning and package publishing
:dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.
The commitizen command line utility. #BlackLivesMatter
Git hooks made easy 🐶 woof!
Quick Overview
Conventional Changelog is a tool that generates changelogs and release notes from a project's commit messages and metadata. It follows the Conventional Commits specification, which provides a standardized format for commit messages, making it easier to automate the process of generating changelogs and determining version bumps.
Pros
- Automates the creation of changelogs, saving time and reducing human error
- Encourages consistent commit message formatting across a project
- Integrates well with semantic versioning practices
- Customizable to fit different project needs and preferences
Cons
- Requires team members to adhere to the Conventional Commits format, which may have a learning curve
- May not capture all relevant information if commit messages are not detailed enough
- Can be overly rigid for some projects or teams that prefer more flexibility in their commit messages
Code Examples
- Basic usage with the CLI:
# Install globally
npm install -g conventional-changelog-cli
# Generate changelog
conventional-changelog -p angular -i CHANGELOG.md -s
- Using the Node.js API:
const conventionalChangelog = require('conventional-changelog');
conventionalChangelog({
preset: 'angular',
releaseCount: 0
})
.pipe(process.stdout); // output to console
- Customizing the changelog generator:
const conventionalChangelog = require('conventional-changelog');
conventionalChangelog({
preset: 'angular',
releaseCount: 0,
transform: (commit, context) => {
// Custom transform function
if (commit.type === 'feat') {
commit.type = 'Feature';
} else if (commit.type === 'fix') {
commit.type = 'Bug Fix';
}
return commit;
}
})
.pipe(process.stdout);
Getting Started
To get started with Conventional Changelog:
-
Install the CLI tool:
npm install -g conventional-changelog-cli
-
Navigate to your project directory and run:
conventional-changelog -p angular -i CHANGELOG.md -s
-
To generate the entire changelog from scratch:
conventional-changelog -p angular -i CHANGELOG.md -s -r 0
For more advanced usage, consider integrating Conventional Changelog into your build process or using it programmatically via the Node.js API.
Competitor Comparisons
:package::rocket: Fully automated version management and package publishing
Pros of semantic-release
- Fully automated version management and package publishing
- Integrates with CI/CD pipelines for seamless releases
- Enforces semantic versioning based on commit messages
Cons of semantic-release
- Steeper learning curve for initial setup and configuration
- Less flexibility in customizing changelog format
- Requires strict adherence to commit message conventions
Code Comparison
semantic-release configuration:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
}
conventional-changelog usage:
const conventionalChangelog = require('conventional-changelog');
conventionalChangelog({
preset: 'angular',
releaseCount: 0
}).pipe(process.stdout);
Both projects aim to automate versioning and changelog generation, but they differ in their approach. semantic-release focuses on full automation of the release process, including version bumping and package publishing. It integrates well with CI/CD pipelines and enforces semantic versioning based on commit messages.
conventional-changelog, on the other hand, primarily focuses on generating changelogs from commit messages. It offers more flexibility in customizing the changelog format and can be easily integrated into existing workflows.
While semantic-release provides a more comprehensive solution for release management, it may require more initial setup and stricter adherence to commit conventions. conventional-changelog is simpler to use and integrate but lacks the automated versioning and publishing features of semantic-release.
🚀 Automate versioning and package publishing
Pros of release-it
- More comprehensive release automation, including Git operations and npm publishing
- Supports multiple version control systems (Git, GitLab, GitHub)
- Highly configurable with extensive plugin system
Cons of release-it
- Steeper learning curve due to more complex configuration options
- May be overkill for projects only needing changelog generation
- Requires more setup for basic usage compared to conventional-changelog
Code Comparison
release-it configuration:
{
"git": {
"commitMessage": "chore: release v${version}",
"tagName": "v${version}"
},
"npm": {
"publish": true
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular"
}
}
}
conventional-changelog usage:
const conventionalChangelog = require('conventional-changelog');
conventionalChangelog({
preset: 'angular',
releaseCount: 0
})
.pipe(process.stdout);
While conventional-changelog focuses primarily on generating changelogs based on commit messages, release-it offers a more comprehensive release management solution. release-it includes features like version bumping, Git tagging, and npm publishing, in addition to changelog generation. However, this broader scope comes with increased complexity and setup requirements. conventional-changelog remains a simpler option for projects that only need changelog generation without additional release automation.
:dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.
Pros of Lerna
- Manages multiple packages within a single repository (monorepo)
- Automates versioning and publishing of packages
- Provides tools for running commands across multiple packages
Cons of Lerna
- Steeper learning curve for developers new to monorepo management
- Can be overkill for smaller projects or single-package repositories
- Less focused on changelog generation compared to Conventional Changelog
Code Comparison
Lerna (lerna.json):
{
"version": "independent",
"npmClient": "npm",
"command": {
"publish": {
"ignoreChanges": ["ignored-file", "*.md"],
"message": "chore(release): publish"
}
}
}
Conventional Changelog (.conventionalchangelogrc):
{
"preset": "angular",
"releaseCount": 0,
"outputUnreleased": true,
"skipUnstable": false
}
Key Differences
- Lerna focuses on monorepo management and package publishing
- Conventional Changelog specializes in generating changelogs based on commit messages
- Lerna has built-in versioning and publishing features
- Conventional Changelog is more flexible for various project structures
- Lerna requires more configuration for multi-package setups
- Conventional Changelog is easier to integrate into existing single-package projects
Use Cases
- Choose Lerna for managing complex monorepo structures with multiple packages
- Opt for Conventional Changelog when primarily focused on generating detailed changelogs
- Consider using both tools together for comprehensive monorepo management with detailed changelog generation
The commitizen command line utility. #BlackLivesMatter
Pros of cz-cli
- Interactive CLI tool for guided commit message creation
- Customizable prompts and commit message formats
- Integrates well with various development workflows and CI/CD pipelines
Cons of cz-cli
- Requires additional setup and configuration compared to conventional-changelog
- May introduce a learning curve for team members unfamiliar with the tool
- Limited to command-line usage, which might not suit all developers' preferences
Code Comparison
cz-cli:
module.exports = {
types: [
{ value: 'feat', name: 'feat: A new feature' },
{ value: 'fix', name: 'fix: A bug fix' },
// ... more types
],
// ... other configuration options
};
conventional-changelog:
const config = require('conventional-changelog-conventionalcommits');
module.exports = config({
types: [
{ type: 'feat', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' },
// ... more types
],
});
Both projects aim to standardize commit messages and generate changelogs, but they approach the task differently. cz-cli focuses on guiding developers through the commit process, while conventional-changelog is more about parsing existing commits and generating changelogs. The choice between them depends on team preferences and workflow requirements.
Git hooks made easy 🐶 woof!
Pros of Husky
- Focuses on Git hooks, allowing easy setup of pre-commit, pre-push, and other hooks
- Simpler configuration and setup process
- Integrates well with npm scripts and package.json
Cons of Husky
- Limited to Git hook management, less versatile than Conventional Changelog
- Doesn't provide changelog generation or versioning features
- May require additional tools for comprehensive commit message linting
Code Comparison
Husky configuration in package.json:
{
"husky": {
"hooks": {
"pre-commit": "npm test",
"pre-push": "npm run lint"
}
}
}
Conventional Changelog usage:
const conventionalChangelog = require('conventional-changelog');
conventionalChangelog({
preset: 'angular'
}).pipe(process.stdout);
Summary
Husky excels in simplifying Git hook management, making it easy to enforce coding standards and run tests before commits or pushes. It's more focused and easier to set up than Conventional Changelog.
Conventional Changelog, on the other hand, offers a broader range of features related to changelog generation and versioning based on commit messages. It's more versatile but may require more setup and configuration.
Choose Husky for straightforward Git hook management, or Conventional Changelog for comprehensive changelog and versioning automation based on commit history.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Conventional Changelog
Generate a CHANGELOG from git metadata.
About this Repo
The conventional-changelog repo is managed as a monorepo; it's composed of many npm packages.
The original conventional-changelog/conventional-changelog
API repo can be
found in packages/conventional-changelog.
Getting started
It's recommended you use the high level commit-and-tag-version library, which is a drop-in replacement for npm's version
command, handling automated version bumping, tagging and CHANGELOG generation.
Alternatively, if you'd like to move towards completely automating your release process as an output from CI/CD, consider using semantic-release.
You can also use one of the plugins if you are already using the tool:
Plugins Supporting Conventional Changelog
Modules Important to Conventional Changelog Ecosystem
- conventional-changelog-cli - the full-featured command line interface
- standard-changelog - command line interface for the angular commit format.
- conventional-github-releaser - Make a new GitHub release from git metadata
- conventional-recommended-bump - Get a recommended version bump based on conventional commits
- conventional-commits-detector - Detect what commit message convention your repository is using
- commitizen - Simple commit conventions for internet citizens.
- commitlint - Lint commit messages
Node Support Policy
We only support Long-Term Support versions of Node.
We specifically limit our support to LTS versions of Node, not because this package won't work on other versions, but because we have a limited amount of time, and supporting LTS offers the greatest return on that investment.
It's possible this package will work correctly on newer versions of Node. It may even be possible to use this package on older versions of Node, though that's more unlikely as we'll make every effort to take advantage of features available in the oldest LTS version we support.
As each Node LTS version reaches its end-of-life we will remove that version from the node
engines
property of our package's package.json
file. Removing a Node version is considered a breaking change and will entail the publishing of a new major version of this package. We will not accept any requests to support an end-of-life version of Node. Any merge requests or issues supporting an end-of-life version of Node will be closed.
We will accept code that allows this package to run on newer, non-LTS, versions of Node. Furthermore, we will attempt to ensure our own changes work on the latest version of Node. To help in that commitment, our continuous integration setup runs against all LTS versions of Node in addition the most recent Node release; called current.
JavaScript package managers should allow you to install this package with any version of Node, with, at most, a warning if your version of Node does not fall within the range specified by our node
engines
property. If you encounter issues installing this package, please report the issue to your package manager.
Top Related Projects
:package::rocket: Fully automated version management and package publishing
🚀 Automate versioning and package publishing
:dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.
The commitizen command line utility. #BlackLivesMatter
Git hooks made easy 🐶 woof!
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot