cz-custom-scope-changelog

1.0.1 • Public • Published

cz-custom-scope-changelog

   

How to add on your project

yarn add cz-custom-scope-changelog --dev

Note: you do not need to add neither commitizen nor standard-version, everything is already pre-installed.

And add following config to your package.json

"config": {
   "commitizen": {
     "path": "cz-custom-scope-changelog"
   }
 }

 

Use global commitizen-cli or local git-cz package on your npm scripts to start using structured commit messages.

Questions

  • Jira Issue ID(s) (required) - ISSUE-ID
  • Select the type of change that you're committing - COMMIT-TYPE
  • What is the scope of this change - SCOPE
  • Write a short, imperative tense description of the change - SHORT-DESCRIPTION
  • Provide a longer description of the change
  • Are there any breaking changes
    • Describe the breaking changes

Commit Output:

COMMIT-TYPE(SCOPE): ISSUE-ID - SHORT-DESCRIPTION  

Custom Config

Name of config should be custom-changelog.config.js

Example:

module.exports = {
  /*
    "getCustomScope" method receives all answers by { [name]: value, ... } scheme and is used
    for final transformation of SCOPE value 
  */  
  getCustomScope({ modules, page }) {
    return `${modules} ${page}`;
  },
  /*
     "scopeList" property type is array
     In this array we could add different questions   
     For more details on how to add new one you could use inquirer.js library documentation
  */
  "scopeList": [
    {
      "type": "checkbox",
      "name": "modules",
      "message": "Select the modules touched",
      "choices": ["config", "react", "backboneApp"],
      filter: (val) => {
        if(val.length > 2) {
          return "modules(*)"
        }

        return `modules(${val.join(", ")})`;
      }
    },
    {
      "type": "list",
      "name": "page",
      "message": "Select the page touched",
      "choices": ["*", "offer", "search"],
      filter: (val) => {
        return `page(${val})`;
      }
    },
  ]
};

Readme

Keywords

none

Package Sidebar

Install

npm i cz-custom-scope-changelog

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

7.41 kB

Total Files

6

Last publish

Collaborators

  • artemkorchunov