cz-relax
v0.2.1
Published
A better commitizen practice
Downloads
8
Readme
Introduction
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.
Getting started
1. Install cz-relax in the workspace
npm install cz-relax --save-dev
// or
yarn add cz-relax --dev
2. Initialize
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
Usage: cz-relax [options]
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
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
FAQ
Why is it prompted to use --force
during initialize?
For commitizen while a previous adapter and husky is already configured. Use --force to override. For example:
npx cz-relax init --force
Why report an error: Error: no test specified
?
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.
What commitizen adapter is used default for initialization?
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.