语义发布 - 向自动生成的发行说明添加更多部分

Semantic Release - Add more sections to auto-generated release notes

我刚刚为我的节点项目设置了语义发布并使用它发布了第一个版本:

似乎只有 fixfeat 类型的提交被添加到发行说明中...我希望也能够显示 improvement 类型。

有没有办法configure/add呢? 谢谢!

默认情况下,变更日志文本由 conventional-changelog-angular 生成,在此处确定要包含在变更日志中的提交类型。

https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/writer-opts.js#L45

如果您想在变更日志中包含其他类型的提交,您可以创建自己的预设(基于 conventional-changelog-angular),其中将包含所有提交类型。

或者,您可以使用支持 types 选项的 conventional-changelog-conventionalcommits 预设来定义新类型以及它们是否应包含在发行说明中。

你的语义释放配置是:

{
  "plugins": [
    ["@semantic-release/commit-analyzer", {
      "preset": "conventionalcommits",
      "releaseRules": [
        {"type": "improvement", "release": "minor"}
      ]
    }],
    ["@semantic-release/release-notes-generator", {
      "preset": "conventionalcommits",
      "presetConfig": {
        "types": [
          {"type": "feat", "section": "Features"},
          {"type": "fix", "section": "Bug Fixes"},
          {"type": "perf", "section": "Performance Improvements"},
          {"type": "revert", "section": "Reverts"},
          {"type": "docs", "section": "Documentation", "hidden": true},
          {"type": "style", "section": "Styles", "hidden": true},
          {"type": "chore", "section": "Miscellaneous Chores", "hidden": true},
          {"type": "refactor", "section": "Code Refactoring", "hidden": true},
          {"type": "test", "section": "Tests", "hidden": true},
          {"type": "build", "section": "Build System", "hidden": true},
          {"type": "ci", "section": "Continuous Integration", "hidden": true},
          {"type": "improvement", "section": "Improvement", "hidden": false}
        ]
      }
    }]
  ]
}

我为 @semantic-release/commit-analyzer 添加了 releaseRules 配置,因为我假设您想为 improvement 提交创建次要版本。