0

使用@semantic-release我想考虑对两者进行重构更改,触发新版本并在 CHANGELOG.md 文件中写下。

到目前为止,我已经包含了重构提交,"@semantic-release/commit-analyzer"因此它们会触发补丁发布:

[
  "@semantic-release/commit-analyzer",
  {
    "preset": "angular",
    "releaseRules": [
      {
        "type": "refactor",
        "release": "patch"
      }
    ]
  }
],      

但是这些提交消息不包含在 CHANGELOG 文件中,我如何设置"@semantic-release/release-notes-generator"插件以包含重构提交?我发现相关文档令人困惑且缺乏示例


  1. 生成的 CHANGELOG 示例
## [0.6.4](.../compare/v0.6.3...v0.6.4) (date)

## [0.6.3](.../compare/v0.6.2...v0.6.3) (date)
  1. 所需的变更日志
## [0.6.4](.../compare/v0.6.3...v0.6.4) (date)

[[>>INCLUDE HERE COMMIT MSG + LINK<<]]

## [0.6.3](.../compare/v0.6.2...v0.6.3) (date)
4

1 回答 1

1

如果有人觉得这很有用:我们需要进行配置"@semantic-release/release-notes-generator"以考虑除featfix之外的其他关键字,包括这些字典:

{
   "type": "refactor",
   "section": "title to be used in changelog.md",
   "hidden": false
}

对于复制粘贴,此设置将refactorchoreperf都收集到## Internal部分中(注意我需要明确编写默认值,我猜这是因为它覆盖了配置)

[
  "@semantic-release/release-notes-generator",
  {
    "preset": "conventionalCommits",
    "parserOpts": {
      "noteKeywords": [
        "BREAKING CHANGE",
        "BREAKING CHANGES",
        "BREAKING"
      ]
    },
    "presetConfig": {
      "types": [
        {
          "type": "feat",
          "section": "Features"
        },
        {
          "type": "fix",
          "section": "Bug Fixes"
        },
        {
          "type": "chore",
          "section": "Internal",
          "hidden": false
        },
        {
          "type": "refactor",
          "section": "Internal",
          "hidden": false
        },
        {
          "type": "perf",
          "section": "Internal",
          "hidden": false
        }
      ]
    }
  }
]
于 2021-02-25T09:42:51.133 回答