diff --git a/README.md b/README.md index b59d9c90..a4143d0a 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,30 @@ Like commitizen, you specify the configuration of cz-conventional-changelog thro "title": "Features" }, ... - } + }, + "additionalTypes": {} } } // ... } ``` + +The `additionalTypes` property can be used to add custom types in addition to those defined by **conventional-commit-types**: + +``` + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog", + "additionalTypes": { + "mycustomtype": { + "description": "A custom commit type for custom changes", + "title": "My Custom Changes" + } + } + } + } +``` + ### Environment variables The following environment varibles can be used to override any default configuration or package.json based configuration. diff --git a/index.js b/index.js index d86155bc..02ec59e4 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,11 @@ var configLoader = require('commitizen').configLoader; var config = configLoader.load() || {}; var options = { - types: config.types || conventionalCommitTypes.types, + types: Object.assign( + {}, + config.types || conventionalCommitTypes.types, + config.additionalTypes + ), defaultType: process.env.CZ_TYPE || config.defaultType, defaultScope: process.env.CZ_SCOPE || config.defaultScope, defaultSubject: process.env.CZ_SUBJECT || config.defaultSubject,