cz-commands-extension
v1.0.0
Published
<p align="center"><img width="300px" height="280px" src="https://raw.githubusercontent.com/tyankatsu0105/cz-commands-extension/main/assets/logo.png" alt="cz format extension"></p>
Downloads
10
Readme
⚠️ This library is a fork of cz-format-extension
Usage
npm install -D commitizen cz-commands-extension
Make .czrc
or add config
fields into package.json
.czrc
{
"path": "cz-commands-extension"
}
package.json
{
"config": {
"commitizen": {
"path": "cz-commands-extension"
}
}
}
Create Config file
Make .czferc.js
module.exports = {
questions({inquirer, gitInfo}) {
return [
{...},
{...},
]
},
commitMessage({answers, gitInfo}) {
return ...
}
}
- questions
- params
- inquirer
- gitInfo +
not_added
,created
,deleted
,modified
,renamed
,staged
from StatusResult of simple-git
- return
- params
- commitMessage
- params
- answers
- gitInfo +
not_added
,created
,deleted
,modified
,renamed
,staged
from StatusResult of simple-git
- return
- string
- params
We prepare the example.
Tips: Configuration settings with types
If you love to develop with types, you can use that with JSDocs
.
/**
* @typedef {{questionType1: string; questionType2: string}} Answers
*/
/** @type import('cz-commands-extension').Config<Answers> */
module.exports = {
questions({inquirer, gitInfo}) {
return [
{
type: "list",
name: "questionType1",
message: "Select answer",
choices: [
{...},
{...}
]
},
]
},
commitMessage({answers, gitInfo}) {
return `${answers.questionType1}${answers.questionType2}`
}
}