Skip to content

Commit aae2548

Browse files
feat(types): add suport for custom types (#104)
1 parent 2aae317 commit aae2548

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

README.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,33 @@ Like commitizen, you specify the configuration of cz-conventional-changelog thro
1717
{
1818
// ... default values
1919
"config": {
20-
"commitizen": {
20+
"commitizen": {
2121
"path": "./node_modules/cz-conventional-changelog",
2222
"maxHeaderWidth": 100,
2323
"maxLineWidth": 100,
2424
"defaultType": "",
25-
"defaultScope": "",
25+
"defaultScope": "",
2626
"defaultSubject": "",
2727
"defaultBody": "",
28-
"defaultIssues": ""
28+
"defaultIssues": "",
29+
"types": {
30+
...
31+
"feat": {
32+
"description": "A new feature",
33+
"title": "Features"
34+
},
35+
...
36+
}
2937
}
3038
}
31-
// ...
39+
// ...
3240
}
33-
```
41+
```
3442
### Environment variables
3543

3644
The following environment varibles can be used to override any default configuration or package.json based configuration.
3745

38-
* CZ_TYPE = defaultType
46+
* CZ_TYPE = defaultType
3947
* CZ_SCOPE = defaultScope
4048
* CZ_SUBJECT = defaultSubject
4149
* CZ_BODY = defaultBody

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var configLoader = require('commitizen').configLoader;
66

77
var config = configLoader.load() || {};
88
var options = {
9-
types: conventionalCommitTypes.types,
9+
types: config.types || conventionalCommitTypes.types,
1010
defaultType: process.env.CZ_TYPE || config.defaultType,
1111
defaultScope: process.env.CZ_SCOPE || config.defaultScope,
1212
defaultSubject: process.env.CZ_SUBJECT || config.defaultSubject,

0 commit comments

Comments
 (0)