It takes several steps to configure commitizen before,for example, commitizen needs to be initialized first and choice commitizen adapter,then you need to install commitlint,finally, you may need husky to configure git hooks。
Now, it only takes two steps to finish the above work and make everything easier.
npm install cz-relax --save-dev
// or
yarn add cz-relax --dev
npx cz-relax init
If you are using chinese:
npx cz-relax init --language zh
If you are using yarn:
npx cz-relax init --yarn
It's simple,then you can perform normal git commit
.At this time, commitizen takes effect.
Usage: cz-relax [options]
-V, --version
: output the version number-f, --force
: For commitizen while a previous adapter and husky is already configured. Use --force to override--yarn
: use yarn manage package-l, --language <type>
: need to set a profile type (choices: "zh", "en", default: "zh")-a, --adapter <npmName>
: need to set a adapter npm name (default: "cz-git")-h, --help
: display help for command
Example call:
$ cz-relax init
$ cz-relax init --force
$ cz-relax init --yarn
$ cz-relax init --language zh
$ cz-relax init --language en --force
$ cz-relax init --language zh --force --adapter cz-conventional-changelog
For commitizen while a previous adapter and husky is already configured. Use --force to override. For example:
npx cz-relax init --force
Because, husky initialized by husky-init
, it add pre-commit sample: set('.husky/pre-commit', 'npm test')
. If you have a test
command in package.json
,please check how test
work.
The cz-relax default adapter used fro initialize is cz-git.
You can also use other adapters, for example, cz-conventional-changelog
. However, you need to create your own configuration file for commitizen. I will improve it in the furture.