The tool for automatically generating changelog logs has been upgraded~

Time:2021-9-21

background

I posted an article in 19 yearsChangelog automatic log generation plug-in, which introduces my open source set of [auto changelog, commit lint] standardized code submission tool plug-ins.

However, since it is the first time to release some open source projects, it is inevitable that the development scheme is not very smooth and not very flexible to use.

Therefore, based on these problems, this tool is upgraded with lerna. The general contents are as follows:

Jimi web changelog / CZ -- > nicecode / commit // git format cli submission plug-in
Jimi web changelog / lint -- > nicecode / commit lint // git submits the lint verification plug-in
Jimi web changelog -- > nicecode / changelog // plug-in for automatic log generation

CZ module configuration optimization

Official documents

Original configuration

//1. Installation dependency
cnpm i commitizen jimi-web-changelog --save-dev

//2. Add in package.json
{
  ...
  "config": {
    "commitizen": {
      "path": "./node_modules/jimi-web-changelog/lib/cz"
    }
  },
  ...
}

New configuration

//1. Installation dependency
cnpm i commitizen @nicecode/commit --save-dev

//2. Add in package.json
{
  ...
  "config": {
    "commitizen": {
      "path": "@nicecode/commit"
    }
  },
  ...
}

Lint module configuration optimization

Official documents

Original configuration

1. Installation dependency
cnpm i husky commitlint jimi-web-changelog --save-dev

2. Introduce the following configuration in package.json
{
  ...
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },
  ...
}

3. . commitlint.js under the root directory 
modules.exports = Object.assign({}, require('jimi-web-changelog/lib/lint'), {
  rules: {
    'subject-empty': [2, 'never'],
    'type-empty': [2, 'never'],
    'type-enum': [2, 'always',
      [
        'new features',
        'repair ',
        ...
      ]
    ]
  }
}

New configuration

//1. Installation dependency
cnpm i husky commitlint @nicecode/commit-lint --save-dev

//2. Introduce the following configuration in package.json
{
  ...
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },
  ...
}

//3. Commitlint.js in the root directory 
modules.exports = {
  extends: ["@nicecode/commit-lint"]
}

Changelog module configuration optimization

Official documents

Original configuration

//1. Installation dependency
cnpm i conventional-changelog-cli jimi-web-changelog --save-dev

//2. Add a command in package.json
{
  ...
  "script": {
    "log": "conventional-changelog --config node_modules/jimi-web-changelog/lib/log -i CHANGELOG.md -s -r 0",
  }
  ...
}

New configuration

//1. Installation dependency
cnpm i conventional-changelog-cli @nicecode/changelog --save-dev

//2. Add a command in package.json
{
  ...
  "script": {
    "log": "conventional-changelog --n node_modules/@nicecode/changelog -i CHANGELOG.md -s -r 0",
  }
  ...
}

Postscript

Nicecoder teamAt present, 4 people are committed to integrating a set of tool library to improve work efficiency and code specification. At present, our plans and completed include the following sections:

The tool for automatically generating changelog logs has been upgraded~

Looking forward to your joining:nicecoder

Related links

@Nicecode / tools common function library

Nicecode official website

Nicecode GitHub address

Recommended Today

Seven Python code review tools recommended

althoughPythonLanguage is one of the most flexible development languages at present, but developers often abuse its flexibility and even violate relevant standards. So PythoncodeThe following common quality problems often occur: Some unused modules have been imported Function is missing arguments in various calls The appropriate format indentation is missing Missing appropriate spaces before and after […]