パッケージの詳細

git-cz

streamich313.6kUnlicense4.9.0

Semantic emojified git commit, git-cz.

readme

Commitizen friendly

git-cz

image

Without installation

npx git-cz
# or
npx git-cz -e

Install globally standalone

npm install -g git-cz
git-cz
# or
git-cz -e

Install locally with Commitizen

npm install -g commitizen
npm install --save-dev git-cz

package.json:

{
  "config": {
    "commitizen": {
      "path": "git-cz"
    }
  }
}

run:

git cz

Install globally with Commitizen

npm install -g commitizen git-cz
commitizen init git-cz --save-dev --save-exact

run:

git cz

Custom config

You can provide a custom configuration in a changelog.config.js file in your repo, or in any parent folder. git-cz will search for the closest config file. Below is default config:

module.exports = {
  disableEmoji: false,
  format: '{type}{scope}: {emoji}{subject}',
  list: ['test', 'feat', 'fix', 'chore', 'docs', 'refactor', 'style', 'ci', 'perf'],
  maxMessageLength: 64,
  minMessageLength: 3,
  questions: ['type', 'scope', 'subject', 'body', 'breaking', 'issues', 'lerna'],
  scopes: [],
  types: {
    chore: {
      description: 'Build process or auxiliary tool changes',
      emoji: '🤖',
      value: 'chore'
    },
    ci: {
      description: 'CI related changes',
      emoji: '🎡',
      value: 'ci'
    },
    docs: {
      description: 'Documentation only changes',
      emoji: '✏️',
      value: 'docs'
    },
    feat: {
      description: 'A new feature',
      emoji: '🎸',
      value: 'feat'
    },
    fix: {
      description: 'A bug fix',
      emoji: '🐛',
      value: 'fix'
    },
    perf: {
      description: 'A code change that improves performance',
      emoji: '⚡️',
      value: 'perf'
    },
    refactor: {
      description: 'A code change that neither fixes a bug or adds a feature',
      emoji: '💡',
      value: 'refactor'
    },
    release: {
      description: 'Create a release commit',
      emoji: '🏹',
      value: 'release'
    },
    style: {
      description: 'Markup, white-space, formatting, missing semi-colons...',
      emoji: '💄',
      value: 'style'
    },
    test: {
      description: 'Adding missing tests',
      emoji: '💍',
      value: 'test'
    },
    messages: {
      type: 'Select the type of change that you\'re committing:',
      customScope: 'Select the scope this component affects:',
      subject: 'Write a short, imperative mood description of the change:\n',
      body: 'Provide a longer description of the change:\n ',
      breaking: 'List any breaking changes:\n',
      footer: 'Issues this commit closes, e.g #123:',
      confirmCommit: 'The packages that this commit has affected\n',
    },
  }
};

Non-interactive mode

Using --non-interactive flag you can run git-cz non-interactive mode.

For example:

git-cz --non-interactive --type=feat --subject="add onClick prop to component"

CLI parameters:

  • --type
  • --subject
  • --scope
  • --body
  • --breaking
  • --issues
  • --lerna

Disable Emoji

Using --disable-emoji flag will disable emoji.

For example:

git-cz --disable-emoji

Commit message format

  • A commit message consists of a header, body and footer.
  • The header has a type and a subject:
<type>[(<scope>)]: <emoji> <subject>
[BLANK LINE]
[body]
[BLANK LINE]
[breaking changes]
[BLANK LINE]
[footer]

The header is the only mandatory part of the commit message.

The first line (type + subject) is limited to 50 characters [enforced]

Any other line should be limited to 72 character [automatic wrapping]

This allows the message to be easier to read on GitHub as well as in various git tools.

Format

By default the subject format is: {type}{scope}: {subject}

Configuring the format field in .git-cz.json you can customize your own:

  • {type}{scope}: {emoji}{subject}
  • {emoji}{scope} {subject}

Type

Must be one of the following:

  • test — Adding missing tests
  • feat — A new feature
  • fix — A bug fix
  • chore — Build process or auxiliary tool changes
  • docs — Documentation only changes
  • refactor — A code change that neither fixes a bug or adds a feature
  • style — Markup, white-space, formatting, missing semi-colons...
  • ci — CI related changes
  • perf — A code change that improves performance

Subject

The subject contains succinct description of the change:

  • Use the imperative, present tense: "change" not "changed" nor "changes"
  • No dot (.) at the end.

Body

Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

Affects [only on lerna environments]

Select the packages the commit affected.

Breaking Changes

Breaking Changes must start with the words BREAKING CHANGE:.

Footer

The footer is the place to reference any tasks related to this commit.

Why this Fork?

npm i -g git-cz
added 1 package in 0.612s

Installs in 0.6s vs 31.1s.

npm i -g mol-conventional-changelog
added 345 packages in 31.076s

更新履歴

4.9.0 (2022-05-14)

Bug Fixes

  • 🐛 Read git-cz config from package.json (c72cfac)

Features

  • 🎸 support cjs config files (4f2ebc5)

4.8.1 (2022-05-14)

Bug Fixes

  • 🐛 Fix COMMIT_EDITMSG in bare repositories (008ee31)

4.8.0 (2021-10-13)

Bug Fixes

  • 🐛 give default value to prevent convert error (c16df5d), closes #227
  • better support for workspaces (215b6c3)

Features

  • 🎸 add "format" field to customize subject in commit msg #81 (5e998cf)
  • 🎸️ format (custom message) (6f0c828)

4.7.6 (2020-12-07)

Bug Fixes

  • 🐛 move check for git folder to top (cdf142c)

4.7.5 (2020-11-30)

Bug Fixes

4.7.4 (2020-11-18)

Bug Fixes

  • 🐛 add config option to change closed issue message (#218) (dd88ce9), closes #215

4.7.3 (2020-11-11)

Bug Fixes

4.7.2 (2020-11-11)

Bug Fixes

  • 🐛 disable-emoji config being overwritten by default (#211) (eb9eb06), closes #207

4.7.1 (2020-08-26)

Bug Fixes

  • 🐛 ignore "staged files check" when -a or --amend is passed (206274f), closes #189

4.7.0 (2020-06-18)

Features

  • 🎸 exit process when no files staged (9fb4844)

4.6.2 (2020-05-28)

Bug Fixes

  • 🐛 check for staged files (78dec95)
  • 🐛 failing test (execSync not defined) (b9b6969)

4.6.1 (2020-05-27)

Bug Fixes

  • release revert of checking for staged files (8a6ac6e)

4.6.0 (2020-05-25)

Bug Fixes

  • 🐛 test when in --dry-run mode (1697c56)

Features

  • 🎸 check for staged files (c283ad3)

4.5.0 (2020-05-16)

Features

  • 🎸 manually bump version (fb05bfb)
  • 🎸 recursively search parent folders for config file (ce04676), closes #60

4.4.1 (2020-05-16)

Bug Fixes

  • manually update version (811025c)

4.4.0 (2020-05-16)

Features

  • 🎸 add --disable-emoji to --help and parse from CLI (82dd0c9)
  • 🎸 add disable emoji flag (52a43d9)

4.3.1 (2020-02-03)

Bug Fixes

  • 🐛 fix git commit error (b116ba0)

4.3.0 (2020-02-02)

Features

  • 🎸 add help & version flags (799fff2)
  • 🎸 improve help screen (1838c1c)

4.2.0 (2020-01-20)

Bug Fixes

  • 🐛 do not format body as undefined (28d6e77)

Features

  • 🎸 Allow emojis in non-interactive and set defaults (08cf19c)
  • 🎸 can set answers through CLI in default mode (99238c2)
  • 🎸 non-interactive mode (61b40db)

4.1.0 (2020-01-18)

Features

  • use fuzzy search for scopes and types (e6d615f)

4.0.0 (2020-01-16)

Bug Fixes

  • 🐛 Adhere to lerna settings for workspaces directory (4151235), closes #85
  • 🐛 fixes autocomplete prompt import (91226ba)
  • 🐛 fixes scope's empty string answer issue (53dd466)
  • 🐛 make semantic-release publish to NPM (6f5c836)
  • 🐛 simplify semantic-release config (3872978)
  • remove emojis when disableEmoji is true (62915be)

Continuous Integration

  • 🎡 remove NPM semantic-release plugin for on release (a9f23eb)

Features

  • 🎸 adds a feature to search for types (f8c3452)
  • 🎸 adds git hooks support (80176cd), closes #79
  • 🎸 adds scope search in scopes question (70bf18b)

BREAKING CHANGES

  • 🧨 Release new major

3.2.1 (2019-07-01)

Bug Fixes

3.2.0 (2019-07-01)

Bug Fixes

  • 🐛 don't add emoji to head only when "disableEmoji" is true (45489c8)

Features

  • 🎸 added disableEmojis on config (448873e)

3.1.1 (2019-04-26)

Bug Fixes

  • build binaries on Travis (10194a8)

3.1.0 (2019-04-26)

Features