1.0.0 ā€¢ Published 5 years ago

cz-emoji-mini v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

cz-emoji-mini

Commitizen adapter formatting commit messages using emojis.

This is a fork of cz-emoji, with less emoji options.

Build Status npm

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