This tool is for quick config on commitizen. Setting your repo to use AngularJS's commit message convention also known as conventional-changelog.
// commit msg format:
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
npm install -g quick-commitizen
// All you need to do is
quickcm
// or
quickcm -p yarn
The above command does:
- Installs
commitizen cz-conventional-changelog @commitlint/cli husky conventional-changelog-cli
module - Saves it to devDependencies
- adds belowe keys to the root of your package.json
{
...
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"scripts": {
"std-cm": 'git-cz',
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md"
}
}
- adds the
commitlint.config.js
to root directory.
Now, you can use
npm run std-cm
insteadgit commit
. you'll be you'll be prompted to fill in any required fields and your commit messages will be formatted according to the standards defined by project maintainers. details. like:
when you release a version, you can run npm run changelog
to generate CHANGELOG.md that contains your commit messages.
- conventional-changelog – Generate a changelog from conventional commit history
- commitlint - Lint commit messages