Skip to content

Sharable conventional changelog configuration for cz-emoji style commit.

License

Notifications You must be signed in to change notification settings

epoweripione/conventional-changelog-cz-emoji-config

Repository files navigation

conventional-changelog-cz-emoji-config

NPM version NPM downloads

Sharable conventional changelog configuration for cz-emoji style commit.

Inspired by @Arvin Xu's gitmoji-commit-workflow.

The code refers to conventional-changelog-angular and conventional-changelog-gitmoji-config.

cz-emoji configuration file (package.json)

{
  "config": {
    "commitizen": {
      "path": "cz-emoji"
    },
    "cz-emoji": {
      "symbol": true,
      "conventional": true,
      "types": [
        {
          "emoji": "โœจ",
          "code": ":sparkles:",
          "description": "Introduce new features",
          "name": "feat"
        },
        {
          "emoji": "๐Ÿ›",
          "code": ":bug:",
          "description": "Fix bug",
          "name": "fix"
        },
        {
          "emoji": "๐Ÿš‘",
          "code": ":ambulance:",
          "description": "Critical hotfix",
          "name": "hotfix"
        },
        {
          "emoji": "๐Ÿฉน",
          "code": ":adhesive_bandage:",
          "description": "Simple fix for a non-critical issue",
          "name": "patch"
        },
        {
          "emoji": "๐ŸŽจ",
          "code": ":art:",
          "description": "Improve structure / format of the code",
          "name": "style"
        },
        {
          "emoji": "๐Ÿ“",
          "code": ":memo:",
          "description": "Add or update documentation",
          "name": "docs"
        },
        {
          "emoji": "๐ŸŒ ๏ธ",
          "code": ":shooting_star:",
          "description": "Improve performance",
          "name": "perf"
        },
        {
          "emoji": "๐ŸŽซ",
          "code": ":file_cabinet:",
          "description": "Chores",
          "name": "chore"
        },
        {
          "emoji": "๐Ÿญ",
          "code": ":factory:",
          "description": "Add or update build system",
          "name": "build"
        },
        {
          "emoji": "๐Ÿ’„",
          "code": ":lipstick:",
          "description": "Add or update UI and style files",
          "name": "ui"
        },
        {
          "emoji": "๐ŸŒ€",
          "code": ":cyclone:",
          "description": "Refactor code",
          "name": "refactor"
        },
        {
          "emoji": "๐Ÿ”ง",
          "code": ":wrench:",
          "description": "Add or update configuration files",
          "name": "config"
        },
        {
          "emoji": "๐ŸŒ",
          "code": ":globe_with_meridians:",
          "description": "Internationalization and localization",
          "name": "i18n"
        },
        {
          "emoji": "โœŽ",
          "code": ":lower_right_pencil:",
          "description": "Fix typos",
          "name": "typo"
        },
        {
          "emoji": "โช",
          "code": ":rewind:",
          "description": "Revert changes",
          "name": "revert"
        },
        {
          "emoji": "๐Ÿ”€",
          "code": ":twisted_rightwards_arrows:",
          "description": "Merge branches",
          "name": "merge"
        },
        {
          "emoji": "๐Ÿ’ฅ",
          "code": ":boom:",
          "description": "Introduce breaking changes",
          "name": "break"
        },
        {
          "emoji": "๐Ÿ‘ฝ",
          "code": ":alien:",
          "description": "Update code due to external API changes",
          "name": "api"
        },
        {
          "emoji": "๐Ÿšจ",
          "code": ":rotating_light:",
          "description": "Fix compiler / linter warnings",
          "name": "lint"
        },
        {
          "emoji": "โœ…",
          "code": ":white_check_mark:",
          "description": "Add, update, or pass tests",
          "name": "test"
        },
        {
          "emoji": "๐Ÿ”ฅ",
          "code": ":fire:",
          "description": "Remove code or files",
          "name": "prune"
        },
        {
          "emoji": "๐Ÿšš",
          "code": ":truck:",
          "description": "Move or rename resources (e.g.: files, paths, routes)",
          "name": "move"
        },
        {
          "emoji": "๐Ÿ“ก",
          "code": ":satellite:",
          "description": "Data exploration / inspection",
          "name": "data"
        },
        {
          "emoji": "๐Ÿ’ฝ",
          "code": ":computer_disk:",
          "description": "Perform database related changes",
          "name": "db"
        },
        {
          "emoji": "๐Ÿšธ",
          "code": ":children_crossing:",
          "description": "Improve user experience / usability",
          "name": "ux"
        },
        {
          "emoji": "๐Ÿ‘”",
          "code": ":necktie:",
          "description": "Add or update business logic",
          "name": "business"
        },
        {
          "emoji": "๐Ÿ ",
          "code": ":house:",
          "description": "Make architectural changes",
          "name": "arch"
        },
        {
          "emoji": "๐Ÿ’ฌ",
          "code": ":speech_balloon:",
          "description": "Add or update text and literals",
          "name": "texts"
        },
        {
          "emoji": "๐Ÿฑ",
          "code": ":bento:",
          "description": "Add or update assets",
          "name": "assets"
        },
        {
          "emoji": "๐Ÿ›‚",
          "code": ":passport_control:",
          "description": "Work on code related to authorization, roles and permissions",
          "name": "auth"
        },
        {
          "emoji": "โ™ฟ",
          "code": ":wheelchair:",
          "description": "Improve accessibility",
          "name": "access"
        },
        {
          "emoji": "๐Ÿ‘Œ",
          "code": ":ok_hand:",
          "description": "Update code due to code review changes",
          "name": "review"
        },
        {
          "emoji": "๐Ÿงช",
          "code": ":test_tube:",
          "description": "Perform experiments",
          "name": "experiment"
        },
        {
          "emoji": "๐Ÿšฉ",
          "code": ":triangular_flag_on_post:",
          "description": "Add, update, or remove feature flags",
          "name": "flags"
        },
        {
          "emoji": "๐Ÿ’ซ",
          "code": ":dizzy:",
          "description": "Add or update animations and transitions",
          "name": "animation"
        },
        {
          "emoji": "๐Ÿ“ฑ",
          "code": ":iphone:",
          "description": "Work on responsive design",
          "name": "responsive"
        },
        {
          "emoji": "๐Ÿ“”",
          "code": ":notebook_with_decorative_cover:",
          "description": "Add or update types",
          "name": "types"
        },
        {
          "emoji": "๐Ÿคก",
          "code": ":clown_face:",
          "description": "Mock things",
          "name": "mock"
        },
        {
          "emoji": "๐Ÿ”จ",
          "code": ":hammer:",
          "description": "Add or update development scripts",
          "name": "script"
        },
        {
          "emoji": "๐Ÿฅ…",
          "code": ":goal_net:",
          "description": "Catch errors",
          "name": "error"
        },
        {
          "emoji": "๐Ÿฉบ",
          "code": ":stethoscope:",
          "description": "Add or update healthcheck",
          "name": "healthcheck"
        },
        {
          "emoji": "๐Ÿ“ฆ",
          "code": ":package:",
          "description": "Add or update compiled files or packages",
          "name": "package"
        },
        {
          "emoji": "โž•",
          "code": ":heavy_plus_sign:",
          "description": "Add dependencies",
          "name": "dep-add"
        },
        {
          "emoji": "โž–",
          "code": ":heavy_minus_sign:",
          "description": "Remove dependencies",
          "name": "dep-rm"
        },
        {
          "emoji": "โฌ‡",
          "code": ":arrow_down:",
          "description": "Downgrade dependencies",
          "name": "dep-down"
        },
        {
          "emoji": "โฌ†",
          "code": ":arrow_up:",
          "description": "Upgrade dependencies",
          "name": "dep-up"
        },
        {
          "emoji": "๐Ÿ“Œ",
          "code": ":pushpin:",
          "description": "Pin dependencies to specific versions",
          "name": "pushpin"
        },
        {
          "emoji": "๐ŸŽ‰",
          "code": ":tada:",
          "description": "Begin a project",
          "name": "init"
        },
        {
          "emoji": "๐Ÿšง",
          "code": ":construction:",
          "description": "Work in progress",
          "name": "wip"
        },
        {
          "emoji": "๐Ÿš€",
          "code": ":rocket:",
          "description": "Deploy stuff",
          "name": "deploy"
        },
        {
          "emoji": "๐Ÿ”–",
          "code": ":bookmark:",
          "description": "Release / Version tags",
          "name": "release"
        },
        {
          "emoji": "๐Ÿ“ˆ",
          "code": ":chart_with_upwards_trend:",
          "description": "Add or update analytics or track code",
          "name": "analytics"
        },
        {
          "emoji": "๐Ÿ”’",
          "code": ":lock:",
          "description": "Fix security issues",
          "name": "security"
        },
        {
          "emoji": "๐Ÿ‘ท",
          "code": ":construction_worker:",
          "description": "Add or update CI build system",
          "name": "ci"
        },
        {
          "emoji": "๐Ÿ’š",
          "code": ":green_heart:",
          "description": "Fix CI Build",
          "name": "fixci"
        },
        {
          "emoji": "๐Ÿงน",
          "code": ":broom:",
          "description": "Deprecate code that needs to be cleaned up",
          "name": "clean"
        },
        {
          "emoji": "๐Ÿšฎ",
          "code": ":trash:",
          "description": "Remove dead code",
          "name": "deadcode"
        },
        {
          "emoji": "๐Ÿณ",
          "code": ":whale:",
          "description": "Work about Docker",
          "name": "docker"
        },
        {
          "emoji": "๐ŸŽก",
          "code": ":ferris_wheel:",
          "description": "Work about Kubernetes",
          "name": "k8s"
        },
        {
          "emoji": "๐ŸŽ",
          "code": ":apple:",
          "description": "Fix something on macOS",
          "name": "osx"
        },
        {
          "emoji": "๐Ÿง",
          "code": ":penguin:",
          "description": "Fix something on Linux",
          "name": "linux"
        },
        {
          "emoji": "๐Ÿ",
          "code": ":checkered_flag:",
          "description": "Fix something on Windows",
          "name": "windows"
        },
        {
          "emoji": "๐Ÿค–",
          "code": ":robot:",
          "description": "Fix something on Android",
          "name": "android"
        },
        {
          "emoji": "๐Ÿ",
          "code": ":green_apple:",
          "description": "Fix something on iOS",
          "name": "ios"
        },
        {
          "emoji": "๐Ÿ™ˆ",
          "code": ":see_no_evil:",
          "description": "Add or update .gitignore file",
          "name": "ignore"
        },
        {
          "emoji": "๐Ÿ’ก",
          "code": ":bulb:",
          "description": "Add or update comments in source code",
          "name": "comment"
        },
        {
          "emoji": "๐Ÿ“ธ",
          "code": ":camera_flash:",
          "description": "Add or update snapshots",
          "name": "snapshot"
        },
        {
          "emoji": "๐Ÿ”Š",
          "code": ":loud_sound:",
          "description": "Add or update logs",
          "name": "addlog"
        },
        {
          "emoji": "๐Ÿ”‡",
          "code": ":mute:",
          "description": "Remove logs",
          "name": "rmlog"
        },
        {
          "emoji": "๐ŸŒฑ",
          "code": ":seedling:",
          "description": "Add or update seed files",
          "name": "seed"
        },
        {
          "emoji": "๐Ÿ”",
          "code": ":mag:",
          "description": "Improve SEO",
          "name": "seo"
        },
        {
          "emoji": "๐Ÿ‘ฅ",
          "code": ":busts_in_silhouette:",
          "description": "Add or update contributor(s)",
          "name": "contrib"
        },
        {
          "emoji": "๐Ÿ“„",
          "code": ":page_facing_up:",
          "description": "Add or update license",
          "name": "license"
        },
        {
          "emoji": "๐Ÿฅš",
          "code": ":egg:",
          "description": "Add or update an easter egg",
          "name": "egg"
        },
        {
          "emoji": "๐Ÿป",
          "code": ":beers:",
          "description": "Write code drunkenly",
          "name": "beer"
        },
        {
          "emoji": "๐Ÿ’ฉ",
          "code": ":poop:",
          "description": "Write bad code that needs to be improved",
          "name": "poo"
        }
      ]
    }
  },
}

Conventional changelog configuration File (.changelogrc.js)

conventional-changelog-cz-emoji-config uses cosmiconfig to find and load your configuration object. Starting from the current working directory, it looks for the following possible sources:

  • a changelog property in package.json
  • a .changelogrc file
  • a changelog.config.js file exporting a JS object

The .changelogrc file (without extension) can be in JSON or YAML format. You can add a filename extension to help your text editor provide syntax checking and highlighting:

  • .changelogrc.json
  • .changelogrc.yaml / .changelogrc.yml
  • .changelogrc.js
module.exports = {
    headerPattern: /^([\w\-]*)(?:\(([\w\-\*]*)\))?:\s+((?:.*(?=\())|.*)(?:\(#(\d*)\))?$/,
    headerCorrespondence: ['type', 'scope', 'subject', 'ticket'],
    displayTypes: ['*'],
    displayScopes: ['*'],
    displayTitles: {
        'feat': 'Features',
        'fix': 'Bug Fixes',
        'hotfix': 'Bug Fixes',
        'patch': 'Bug Fixes',
        'style': 'Styles',
        'docs': 'Documentation',
        'perf': 'Performance Improvements',
        'chore': 'Chores',
        'build': 'Build System',
        'prune': 'Prune & Move & Rename',
        'ui': 'UI',
        'test': 'Tests',
        'lint': 'Lint',
        'refactor': 'Code Refactoring',
        'config': 'Configuration',
        'i18n': 'Internationalization & Localization',
        'typo': 'Typos',
        'revert': 'Reverts',
        'merge': 'Merge',
        'break': 'BREAKING CHANGES',
        'api': 'API',
        'move': 'Move & Rename',
        'data': 'Data',
        'db': 'Database',
        'ux': 'User experience & Usability',
        'business': 'Business Logic',
        'arch': 'Architecture',
        'texts': 'Text & Literals',
        'assets': 'Assets',
        'auth': 'Authorization',
        'access': 'Accessibility',
        'review': 'Review Changes',
        'experiment': 'Experiments',
        'flags': 'Feature Flags',
        'animation': 'Animations',
        'responsive': 'Responsive Design',
        'types': 'Types',
        'mock': 'Mock',
        'script': 'Scripts',
        'error': 'Errors',
        'healthcheck': 'Healthcheck',
        'package': 'Packages',
        'dep-add': 'Dependencies',
        'dep-rm': 'Dependencies',
        'dep-down': 'Dependencies',
        'pushpin': 'Dependencies',
        'dep-up': 'Dependencies',
        'init': 'Init Project',
        'wip': 'Work in Progress',
        'deploy': 'Deploy',
        'release': 'Release & Version tags',
        'analytics': 'Analytics',
        'security': 'Security',
        'ci': 'Continuous Integration',
        'fixci': 'Continuous Integration',
        'clean': 'Clean',
        'deadcode': 'Clean',
        'docker': 'Docker',
        'k8s': 'Kubernetes',
        'osx': 'macOS',
        'linux': 'Linux',
        'windows': 'Windows',
        'android': 'Android',
        'ios': 'iOS',
        'ignore': 'Git',
        'comment': 'Comments',
        'snapshot': 'Snapshots',
        'addlog': 'Logs',
        'rmlog': 'Logs',
        'seed': 'Seed files',
        'seo': 'SEO',
        'contrib': 'Contributors',
        'license': 'License',
        'egg': 'Easter Egg',
        'beer': 'Bad Code',
        'poo': 'Bad Code',
    },
    displayTitleEmojis: {
        'Features': 'โœจ',
        'Bug Fixes': '๐Ÿ›',
        'Styles': '๐ŸŽจ',
        'Documentation': '๐Ÿ“',
        'Performance Improvements': '๐ŸŒ ๏ธ',
        'Chores': '๐ŸŽซ',
        'Build System': '๐Ÿญ',
        'Prune & Move & Rename': '๐Ÿ”ฅ',
        'UI': '๐Ÿ’„',
        'Tests': 'โœ…',
        'Lint': '๐Ÿšจ',
        'Code Refactoring': '๐ŸŒ€',
        'Configuration': '๐Ÿ”ง',
        'Internationalization & Localization': '๐ŸŒ',
        'Typos': 'โœŽ',
        'Reverts': 'โช',
        'Merge': '๐Ÿ”€',
        'BREAKING CHANGES': '๐Ÿ’ฅ',
        'API': '๐Ÿ‘ฝ',
        'Move & Rename': '๐Ÿšš',
        'Data': '๐Ÿ“ก',
        'Database': '๐Ÿ’ฝ',
        'User experience & Usability': '๐Ÿšธ',
        'Business Logic': '๐Ÿ‘”',
        'Architecture': '๐Ÿ ',
        'Text & Literals': '๐Ÿ’ฌ',
        'Assets': '๐Ÿฑ',
        'Authorization': '๐Ÿ›‚',
        'Accessibility': 'โ™ฟ',
        'Review Changes': '๐Ÿ‘Œ',
        'Experiments': '๐Ÿงช',
        'Feature Flags': '๐Ÿšฉ',
        'Animations': '๐Ÿ’ซ',
        'Responsive Design': '๐Ÿ“ฑ',
        'Types': '๐Ÿ“”',
        'Mock': '๐Ÿคก',
        'Scripts': '๐Ÿ”จ',
        'Errors': '๐Ÿฅ…',
        'Healthcheck': '๐Ÿฉบ',
        'Packages': '๐Ÿ“ฆ',
        'Dependencies': '๐Ÿ“Œ',
        'Init Project': '๐ŸŽ‰',
        'Work in Progress': '๐Ÿšง',
        'Deploy': '๐Ÿš€',
        'Release & Version tags': '๐Ÿ”–',
        'Analytics': '๐Ÿ“ˆ',
        'Security': '๐Ÿ”’',
        'Continuous Integration': '๐Ÿ‘ท',
        'Clean': '๐Ÿงน',
        'Docker': '๐Ÿณ',
        'Kubernetes': '๐ŸŽก',
        'macOS': '๐ŸŽ',
        'Linux': '๐Ÿง',
        'Windows': '๐Ÿ',
        'Android': '๐Ÿค–',
        'iOS': '๐Ÿ',
        'Git': '๐Ÿ™ˆ',
        'Comments': '๐Ÿ’ก',
        'Snapshots': '๐Ÿ“ธ',
        'Logs': '๐Ÿ”Š',
        'Seed files': '๐ŸŒฑ',
        'SEO': '๐Ÿ”',
        'Contributors': '๐Ÿ‘ฅ',
        'License': '๐Ÿ“„',
        'Easter Egg': '๐Ÿฅš',
        'Bad Code': '๐Ÿ’ฉ',
    },
    scopeDisplayName: {},
    withEmoji: true,
    showAuthor: false,
}

About

Sharable conventional changelog configuration for cz-emoji style commit.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published