1.0.3 ā€¢ Published 2 years ago

@seanix/cz-emoji-lerna-changelog v1.0.3

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

@seanix/cz-emoji-lerna-changelog

A commitizen adapter developed by cz-lerna-changelog and cz-emoji.

@seanix/cz-emoji-lerna-changelog allows you to easily use emojis in your commits using commitizen in lerna project.

? Please enter or select the commit type you are submitted: (Use arrow keys or type to search)
āÆ feat      āœØ  A new feature (note: this may require a new version number to be released).
  fix       šŸ›  Bug fixes (note: this may require a new version number to be released).
  ui        šŸ’„  Update UI and style files.
  style     šŸŽØ  Improving structure / format of the code(does not affect code modifications, whitespace, formatting, missing semicolons, etc).
  refactor  ā™»ļø  A code refactoring change.
  perf      āš”ļø  Improving performance.
  docs      šŸ“  Writing docs.
  merge     šŸ”€  Merging branches.
  chore     šŸ”§  Other changes that don't modify src or test files.
  prune     šŸ”„  Removing code or files.
  revert    āŖ  Reverting changes.
  release   šŸ”–  Releasing / Version tags.
  test      āœ…  Adding tests.
  ci        šŸ‘·  CI/CD build system.
  init      šŸŽ‰  Initial commit.

Install

Globally

npm install --global @seanix/cz-emoji-lerna-changelog

# set as default adapter for your projects
echo '{ "path": "@seanix/cz-emoji-lerna-changelog" }' > ~/.czrc

Locally

npm install --save-dev @seanix/cz-emoji-lerna-changelog

Add this to your package.json:

"config": {
  "commitizen": {
    "path": "@seanix/cz-emoji-lerna-changelog"
  }
}

Usage

$ git cz

Customization

By default @seanix/cz-emoji-lerna-changelog comes ready to run out of the box. Uses may vary, so there are a few configuration options to allow fine tuning for project needs.

How to

Configuring cz-emoji can be handled in the users home directory (~/.czrc) for changes to impact all projects or on a per project basis (package.json). Simply add the config property as shown below to the existing object in either of the locations with your settings for override.

{
  "config": {
    "@seanix/cz-emoji": {}
  }
}

Configuration Options

Lang

You can configure the language displayed by inquiar, support "zh-CN" and "en-US".

{
  "config": {
    "@seanix/cz-emoji": {
      "lang": "zh-CN"
    }
  }
}

Types

An Inquirer.js choices array:

{
  "config": {
    "@seanix/cz-emoji": {
      "types": [
        {
          "emoji": "šŸŒŸ",
          "code": ":star2:",
          "description": "A new feature",
          "name": "feature"
        }
      ]
    }
  }
}

Scopes

An Inquirer.js choices array:

{
  "config": {
    "@seanix/cz-emoji": {
      "scopes": ["home", "accounts", "ci"]
    }
  }
}

Symbol

A boolean value that allows for an using a unicode value rather than the default of Gitmoji markup in a commit message. The default for symbol is false.

{
  "config": {
    "@seanix/cz-emoji": {
      "symbol": true
    }
  }
}

Skip Questions

An array of questions you want to skip:

{
  "config": {
    "@seanix/cz-emoji": {
      "skipQuestions": ["scope", "issues"]
    }
  }
}

You can skip the following questions: scope, body, footer, and breaking. The type and subject questions are mandatory.

Customize Questions

An object that contains overrides of the original questions:

{
  "config": {
    "@seanix/cz-emoji": {
      "questions": {
        "body": "This will be displayed instead of original text"
      }
    }
  }
}

Customize the subject max length

The maximum length you want your subject has

{
  "config": {
    "@seanix/cz-emoji": {
      "subjectMaxLength": 200
    }
  }
}

Examples

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 Ā© RainyLiao