# @galenjiang/cz-format-extension

> ``` npm install -D commitizen cz-format-extension ```

Latest version **1.4.7** (published 2021-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @galenjiang/cz-format-extension
pnpm add @galenjiang/cz-format-extension
yarn add @galenjiang/cz-format-extension
bun add @galenjiang/cz-format-extension
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.7 |
| Published | 2021-09-17 |
| First published | 2021-09-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | ^12 \|\| ^14 \|\| ^16 |
| Dependencies | 6 |
| Unpacked size | 14 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 15 |
| Author | tyankatsu |
| Maintainers | galenjiang |
| Keywords | commitizen, git-cz |

## Links

- npm: https://www.npmjs.com/package/@galenjiang/cz-format-extension
- Repository: https://github.com/tyankatsu0105/cz-format-extension
- Homepage: https://github.com/tyankatsu0105/cz-format-extension#readme
- Issues: https://github.com/tyankatsu0105/cz-format-extension/issues
- npm.io page: https://npm.io/package/@galenjiang/cz-format-extension

## Dependencies (6)

- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [inquirer](https://npm.io/package/inquirer.md) ^8.1.2
- [simple-git](https://npm.io/package/simple-git.md) ^2.44.0
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^7.0.1
- [git-repo-info](https://npm.io/package/git-repo-info.md) ^2.1.1
- [@types/inquirer](https://npm.io/package/@types/inquirer.md) ^7.3.3

## Recent versions

- 1.4.7 (latest) — 2021-09-17
- 1.4.6 — 2021-09-17
- 1.4.5 — 2021-09-16
- 1.4.4 — 2021-09-16
- 1.4.3 — 2021-09-16
- 1.4.2 — 2021-09-16

## README

<p align="center"><img width="300px" height="280px" src="https://raw.githubusercontent.com/tyankatsu0105/cz-format-extension/master/assets/logo.png" alt="cz format extension"></p>

<h2 align="center">cz-format-extension</h2>
<p align="center">
  Extensible <a href="https://github.com/commitizen/cz-cli">Commitizen</a>'s format
</p>

<p align="center">
  <a title="Current version" href="https://badge.fury.io/js/cz-format-extension" rel="nofollow">
    <img src="https://badge.fury.io/js/cz-format-extension.svg?style=flat">
  </a>
  <a title="deploy" href="https://github.com/algolia/shipjs" rel="nofollow">
    <img src="https://img.shields.io/badge/deploy-🛳%20Ship.js-blue?style=flat">
  </a>
  <a title="MIT License" href="[LICENSE](https://opensource.org/licenses/MIT)" rel="nofollow">
    <img src="https://img.shields.io/badge/License-MIT-green.svg?style=flat">
  </a>
</p>

## Usage

```
npm install -D commitizen cz-format-extension
```

Make `.czrc` or add `config` fields into package.json

`.czrc`

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

`package.json`

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

### Create Config file

Make `.czferc.js`

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

- questions
  - params
    - [inquirer](https://github.com/SBoudrias/Inquirer.js)
    - [gitInfo](https://github.com/rwjblue/git-repo-info) + `not_added`, `created`, `deleted`, `modified`, `renamed`, `staged` from [StatusResult](https://github.com/steveukx/git-js/blob/master/typings/response.d.ts) of [simple-git](https://github.com/steveukx/git-js)
  - return
    - [Question Object](https://github.com/SBoudrias/Inquirer.js#question)
- commitMessage
  - params
    - [answers](https://github.com/SBoudrias/Inquirer.js#answers)
    - [gitInfo](https://github.com/rwjblue/git-repo-info) + `not_added`, `created`, `deleted`, `modified`, `renamed`, `staged` from [StatusResult](https://github.com/steveukx/git-js/blob/master/typings/response.d.ts) of [simple-git](https://github.com/steveukx/git-js)
  - return
    - string

We prepare [the example](https://github.com/tyankatsu0105/cz-format-extension/tree/master/example).

#### Tips: Configuration settings with types

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

```js
/**
 * @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

- [cz-conventional-changelog](https://github.com/commitizen/cz-conventional-changelog)
- [cz-conventional-changelog-ja](https://github.com/AquiTCD/cz-conventional-changelog-ja)

---
_Source: https://npm.io/package/@galenjiang/cz-format-extension · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
