cz-emoji-mini
v1.0.0
Published
Commitizen adapter formatting commit messages using emojis(mini version).
Downloads
15
Readme
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 [email protected]
MIT © Nicolas Gryman