favoloso / conventional-changelog-emoji

Conventional Changelog with Emojis support 🎉
MIT License
42 stars 8 forks source link
changelog conventional-changelog emoji

@favoloso/conventional-changelog-emoji

Travis CI Coveralls npm

Conventional Changelog with Emojis support 🎉

Installation

yarn add --dev @favoloso/conventional-changelog-emoji

or

npm install --save-dev @favoloso/conventional-changelog-emoji

Usage

conventional-changelog -p @favoloso/emoji -i CHANGELOG.md -s

Usage with release-it

You can use conventional-changelog plugin (v11+) with the @favoloso/emoji preset.

"release-it": {
  "plugins": {
    "@release-it/conventional-changelog": {
      "preset": "@favoloso/emoji",
      "infile": "CHANGELOG.md"
    }
  }
}

Lint (and fix) commit messages

This package provides an additional bin script emoji-commit-lint.

The scripts lints and eventually changes commit messages, from traditional conventional changelog format (i.e. feat: Add a magic feature) to corresponding emoji (i.e. ✨ Add a magic feature), checks and applies correct casing (i.e. lower-case) and many more, as configured by Linter Rules.

To use it, install husky

yarn add --dev husky

Now in your package.json add:

{
  "husky": {
    "hooks": {
      "commit-msg": "emoji-commit-lint"
    }
  }
}

Now linter will check your commits. Any commit like <type>: <msg> will be automatically transformed with related emoji. See Available Emojis to see available types.

Configuration

The package works as-is, but its behaviour may be customized with the following options.

Note: This package supports cosmiconfig to provide configuration options with favolosoEmoji module name.

Example config in package.json

{
  "favolosoEmoji": {
    "showEmojiPerCommit": false
  }
}

Available Emojis

Emoji Aliases Type Type Aliases Version Bump In Changelog? Heading Order
🚨 breaking major 🚨 Breaking Changes 10
🌟, 💫, 🌠 feat minor ✨ Features 20
🔒 security patch 🔒 Security 25
🛠 improvement imp patch 🛠 Improvements 30
⚡️ perf performance patch ⚡️ Performance 35
🐛 🐞 fix patch 🐛 Bug Fixes 40
📚 📖 docs doc patch 📚 Documentation 50
🏗 ⚙️ chore chores patch 🏗 Chore 60
♻️ refactor patch ♻️ Refactoring 90
🚦 test patch 🚦 Test 90
🎨 💄 style cleanup patch 🎨 Style 90
📦 build deps patch 📦 Build 90
🔖 release patch 🔖 Release 90
🚧 wip patch 🚧 Wip 90