1.1.0 โ€ข Published 5 months ago

commit-prettier v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

commit-prettier

commit-prettier is a light-weight CLI that enhances your commit messages by appending an emoji related to the type of commit you make. It seamlessly integrates with commitlint, supporting all standard commit types including: | Type | Emoji | | ------------- | ------------- | | build | ๐Ÿ—๏ธ | | chore | ๐Ÿงน | | ci | ๐Ÿ‘ท | | docs | ๐Ÿ“„ | | feat | โœจ | | fix | ๐Ÿ› | | perf | โšก๏ธ | | refactor | โ™ป๏ธ | | revert | โช๏ธ | | style | ๐ŸŒˆ | | test | ๐Ÿงช |

Features

  • Emoji Prefixes: Automatically adds an emoji as a prefix to your commit messages after they pass commitlint checks, making your commit history more expressive and easier to navigate.
  • Branch Name Prefixes: Automatically adds branch name into commit scope if there is no scope provided (default is off).
  • Commitlint Compatibility: Fully compatible with all commitlint types, ensuring your commit messages are both fun and professional.
  • Easy Integration: Works with existing git hooks and can be integrated smoothly into your workflow.

Getting Started

Installation

Using npm:

npm install --save-dev commit-prettier

or if you prefer using Yarn:

yarn add --dev commit-prettier

Setup

To integrate commit-prettier with Husky (version >= 8.0.0), follow these steps:

  1. First, ensure you have Husky installed. If not, please follow the instructions.
  2. Create a commit-msg file in the .husky directory with the following content:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run commit-prettier $1

NOTE: Make sure to make the script executable by running:

chmod +x .husky/commit-msg

Usage

Once everything is set up, you can start committing with:

git commit -m "feat(homepage): achieve UI revamp 2.0"
// Output: โœจ feat(homepage): achieve UI revamp 2.0

If you need to work with a ticket system and have enough of typing this number, you can enable the --branch option in your package.json file:

{
  "scripts": {
    "commit-prettier": "commit-prettier --branch",
  }
}

Then commit-prettier will do this for you! ๐Ÿ’…

git commit -m "style: add confetti animation on the login page"
// Output: ๐ŸŒˆ style(JA-1234): add confetti animation on the login page
1.1.0

5 months ago

1.0.5

1 year ago

1.0.2

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago