1.0.0 ā¢ Published 5 years ago
cz-emoji-mini v1.0.0
cz-emoji-mini
Commitizen adapter formatting commit messages using emojis.
This is a fork of cz-emoji, with less emoji options.
cz-emoji-mini allows you to easily use emojis in your commits using commitizen.
? Select the type of change you are committing: (Use arrow keys)
āÆ feature š A new feature
fix š A bug fix
docs š Documentation change
refactor šØ A code refactoring change
chore š© A chore change
Install
npm install --global cz-emoji-mini
# set as default adapter for your projects
echo '{ "path": "cz-emoji-mini" }' > ~/.czrc
Usage
$ git cz
Customize
By default cz-emoji-mini
comes preconfigured with the Gitmoji types.
But you can customize things on a project basis by adding a configuration section in your package.json
:
{
"config": {
"cz-emoji-mini": {}
}
}
Types
An Inquirer.js choices array:
{
"config": {
"cz-emoji-mini": {
"types": [
{
"emoji": "š",
"code": ":star2:",
"description": "A new feature",
"name": "feature"
}
]
}
}
}
The value property
must be the emoji itself.
Scopes
An Inquirer.js choices array:
{
"config": {
"cz-emoji-mini": {
"scopes": [
"home",
"accounts",
"ci"
]
}
}
}
Commitlint
Commitlint can be set to work with this package by leveraging the package https://github.com/arvinxx/commitlint-config-gitmoji.
npm install --save-dev commitlint-config-gitmoji
commitlint.config.js
module.exports = {
extends: [
'gitmoji'
],
parserPreset: {
parserOpts: {
headerPattern: /^(:\w*:)(?:\s)(?:\((.*?)\))?\s((?:.*(?=\())|.*)(?:\(#(\d*)\))?/,
headerCorrespondence: [
'type',
'scope',
'subject',
'ticket'
],
}
}
};
License
MIT Ā© ZhaoMuwei zhaomuwei@gmail.com
MIT Ā© Nicolas Gryman