Code Monkey home page Code Monkey logo

cz-cc's Introduction

cz-cc

build NPM semantic-release Commitizen friendly Conventional Changelog

A commitizen adaptor that follows the Conventional Commits specification.

DEMO

✨ Features

  • Supports semantic emoji in commit subject message
  • Customizable questions (disable any question)
  • Searchable choices for type & scope
  • Customizable type values, descriptions and associated emojis
  • Customizable scope values
  • Better CLI prompts
  • 0 modification required when migrating from cz-conventional-changelog

🎨 Default Commit Types

type emoji description
feat A new feature
fix 🐛 A bug fix
chore 🔧 Changes that do not modify src or test files
refactor 🧹 Changes that neither fix a bug nor add a feature (renaming variable, file structure changes...)
style 💄 Changes that do not affect the meaning of the code (white-space, formatting, semi-colons...)
test Adding missing tests or correcting existing tests
perf ⚡️ Changes that improves performance
docs 📝 Documentation only changes
ci 👷 Changes to CI config files and scripts
build 🔨 Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
revert Reverts a previous commit
break 💥 A breaking change (alias to feat)
init 🎉 Initial commit (alias to feat)

🔨 Usage (globally installed commitizen)

  1. Install commitizen
# npm
npm install -g commitizen
# yarn
yarn global add commitizen
  1. Initialize cz-cc adaptor
# npm
commitizen init cz-cc
# yarn
commitizen init cz-cc --yarn
  1. Start commitizen CLI
cz

🔨 Usage (locally installed commitizen)

  1. Install commitizen & cz-cc
# npm
npm install -D commitizen cz-cc
# yarn
yarn add -D commitizen cz-cc
  1. Add following config to package.json
{
  // ...
  "scripts": {
    // ...
    "commit": "cz"
  },
  // ...
  "config": {
    "commitizen": {
      "path": "cz-cc"
    }
  }
}
  1. Start commitizen CLI
# npm
npm run commit
# yarn
yarn run commit

⚙️ Configuration

cz-cc fully supports the configurations of cz-conventional-changelog.

Additionally, the native configuration options of cz-zz are as follows:

{
  // ... package.json
  "config": {
    // Default configurations:
    "commitizen": {
      // ...
      // Set to `false` to disable emoji.
      "useEmoji": true,
      // If `true`, whenever commit includes a breaking change, an exclamation mark will be inserted before the colon in commit header.
      // @example feat(core)!: replace algorithm entirely
      "useExclamationMark": false,
      // Maximum amount of characters allowed in the commit header.
      // @note Default to 50/72 formatting style.
      "maxHeaderLength": 50,
      // Maximum amount of characters per line in the commit body and commit footer(s).
      // @note Default to 50/72 formatting style.
      "maxLineLength": 72,
      // Minimal amount of characters allowed for the commit subject.
      "minSubjectLength": 4,
      // Questions to be prompted, remove key to disable that question.
      "questions": ["type", "scope", "subject", "body", "breaking", "issues"],
      // Types to be presented in the default selection list (the list before user enters any search input).
      "defaultTypes": ["feat", "fix", "chore", "refactor", "style", "test", "perf", "docs", "ci", "build", "break"],
      // Scopes to be presented in the selection list.
      // @note Empty array will prompts an input, allows user to enter any string as value of the scope.
      "scopes": [],
      // All available types for user selection.
      // @note The entries that are not part of the `defaultTypes` will be presented when user searches for the entry key.
      "types": {
        // ...
        "init": {
          "emoji": "🎉",
          "value": "feat",
          "description": "Initial commit (alias to feat)"
        },
        "fix": {
          "emoji": "🐛",
          "value": "fix",
          "description": "A bug fix"
        }
        // ...
      }
    }
  }
}

📜 License

Apache License 2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.