@galenjiang/cz-format-extension
TypeScript icon, indicating that this package has built-in type declarations

1.4.7 • Public • Published

cz format extension

cz-format-extension

Extensible Commitizen's format

Usage

npm install -D commitizen cz-format-extension

Make .czrc or add config fields into package.json

.czrc

{
  "path": "cz-format-extension"
}

package.json

{
  "config": {
    "commitizen": {
      "path": "cz-format-extension"
    }
  }
}

Create Config file

Make .czferc.js

module.exports = {
  questions({inquirer, gitInfo}) {
    return [
      {...},
      {...},
    ]
  },
  commitMessage({answers, gitInfo}) {
    return ...
  }
}

We prepare the example.

Tips: Configuration settings with types

If you love to develop with types, you can use that with JSDocs.

/**
 * @typedef {{questionType1: string; questionType2: string}} Answers
 */

/** @type import('cz-format-extension').Config<Answers> */
module.exports = {
  questions({inquirer, gitInfo}) {
    return [
      {
        type: "list",
        name: "questionType1",
        message: "Select answer",
        choices: [
          {...},
          {...}
        ]
      },
    ]
  },
  commitMessage({answers, gitInfo}) {
    return `${answers.questionType1}${answers.questionType2}`
  }
}

Inspired by

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.4.70latest

Version History

VersionDownloads (Last 7 Days)Published
1.4.70
1.4.60
1.4.50
1.4.40
1.4.30
1.4.20

Package Sidebar

Install

npm i @galenjiang/cz-format-extension

Weekly Downloads

0

Version

1.4.7

License

MIT

Unpacked Size

14.4 kB

Total Files

21

Last publish

Collaborators

  • galenjiang