1.0.0 ā€¢ Published 4 years ago

cz-gamedev v1.0.0

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

cz-gamedev

Commitizen adapter formatting commit messages for game development.

cz-gamedev allows you to easily use emojis in your commits using commitizen focused on a gamedev scope of project.

? 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

Globally

npm install --global cz-gamedev

# set as default adapter for your projects
echo '{ "path": "cz-gamedev" }' > ~/.czrc

Locally

npm install --save-dev cz-gamedev

Add this to your package.json:

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

Usage

$ git cz

Customization

By default cz-gamedev 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-gamedev 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": {
    "cz-gamedev": {}
  }
}

Configuration Options

Types

By default cz-gamedev comes preconfigured with the Gitmoji types.

An Inquirer.js choices array:

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

Scopes

An Inquirer.js choices array:

{
  "config": {
    "cz-gamedev": {
      "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": {
    "cz-gamedev": {
      "symbol": true
    }
  }
}

Skip Questions

An array of questions you want to skip:

{
  "config": {
    "cz-gamedev": {
      "skipQuestions": ["scope", "issues"]
    }
  }
}

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

Customize Questions

An object that contains overrides of the original questions:

{
  "config": {
    "cz-gamedev": {
      "questions": {
        "body": "This will be displayed instead of original text"
      }
    }
  }
}

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 Ā© Ian Geier