National Patience Month

    @ms918/mrm-task-cz

    0.5.2 • Public • Published

    @ms918/mrm-task-cz

    mrm task,用来创建commitlintcommitizen配置

    创建或更新package.json,如下

    {
      "husky": {
        "hooks": {
          "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
        }
      },
      "devDependencies": {
        "@commitlint/cli": "^11.0.0",
        "@commitlint/config-conventional": "^11.0.0",
        "commitizen": "^4.2.2",
        "cz-conventional-changelog": "^3.3.0",
        "husky": "^4.3.0"
      },
      "config": {
        "commitizen": {
          "path": "cz-conventional-changelog"
        }
      },
      "scripts": {
        "cz": "cz"
      }
    }

    创建的commitlint.config.js如下

    module.exports = { extends: ['@commitlint/config-conventional'] }

    用法

    npm install -g @ms918/mrm-task-cz
    mrm @ms918/mrm-task-cz

    当执行的时候,会走下面步骤:

    1. 执行@ms918/mrm-task-husky操作
    2. 配置commilint
      1. 使用yarn or npm安装@commitlint/config-conventional@commitlint/cli
      2. 创建或覆盖commitlint.config.js文件
      3. 设置package.jsonhusky.hooks.commit-msg字段为commitlint -E HUSKY_GIT_PARAMS
    3. 配置commitizen
      1. 使用yarn or npm安装commitizencz-conventional-changelog
      2. 设置package.jsonconfig.commitizen.pathcz-conventional-changelog
      3. 设置czscript

    Install

    npm i @ms918/mrm-task-cz

    DownloadsWeekly Downloads

    1

    Version

    0.5.2

    License

    MIT

    Unpacked Size

    5.75 kB

    Total Files

    5

    Last publish

    Collaborators

    • mengshang918