What is cz-conventional-changelog?
The cz-conventional-changelog package is an adapter for Commitizen that prompts developers to follow the Conventional Commits specification when making commits. This helps in generating consistent and meaningful commit messages, which can be used to automate the release process and generate changelogs.
Commit Message Prompting
This feature provides a set of prompts to guide the developer in writing a commit message that adheres to the Conventional Commits specification. The prompts include selecting the type of change, writing a short description, and optionally providing a longer description, listing breaking changes, and referencing issues.
module.exports = {
types: [
{ value: 'feat', name: 'feat: A new feature' },
{ value: 'fix', name: 'fix: A bug fix' },
{ value: 'docs', name: 'docs: Documentation only changes' },
{ value: 'style', name: 'style: Changes that do not affect the meaning of the code' },
{ value: 'refactor', name: 'refactor: A code change that neither fixes a bug nor adds a feature' },
{ value: 'perf', name: 'perf: A code change that improves performance' },
{ value: 'test', name: 'test: Adding missing tests or correcting existing tests' },
{ value: 'build', name: 'build: Changes that affect the build system or external dependencies' },
{ value: 'ci', name: 'ci: Changes to our CI configuration files and scripts' },
{ value: 'chore', name: 'chore: Other changes that don't modify src or test files' },
{ value: 'revert', name: 'revert: Reverts a previous commit' }
],
messages: {
type: "Select the type of change that you're committing:",
subject: 'Write a short, imperative tense description of the change (max 94 chars):',
body: 'Provide a longer description of the change (optional). Use "|" to break new line:',
breaking: 'List any breaking changes (optional):',
footer: 'Issues this commit closes, e.g., #31, #34 (optional):'
}
};