1.0.0 • Published 4 years ago

cz-smava-changelog v1.0.0

Weekly downloads
3
License
MIT
Repository
bitbucket
Last release
4 years ago

cz-smava-changelog

Common commitizen config for smava which is forked from cz-conventional-changelog.

   

How to add on your project

Add cz-smava-changelog to your projects devDependencies like;

"cz-smava-changelog": "https://bitbucket.smava.de/scm/fe-c/cz-smava-changelog.git"

 

And add following config to your package.json

"config": {
   "commitizen": {
     "path": "./node_modules/cz-smava-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

 

You can add new questions by modifying questions.js

   

Commit Output:

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

Custom Config

Name of config should be smava-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})`;
      }
    },
  ]
};

The result of this config would be Ex: COMMIT-TYPE(modules(config), page(*)): ISSUE-ID - SHORT-DESCRIPTION

You can edit commit output by modifying engine.js