gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 00:25:18 25 4
gpt4 key购买 nike

我刚刚完成了我的节点项目的语义发布设置,并用它进行了第一个发布:

Release notes

似乎只有类型为 fixfeat 的提交才会添加到发行说明中...我希望能够显示改进 也键入。

有办法配置/添加它吗?谢谢!

最佳答案

变更日志文本由 conventional-changelog-angular 生成默认情况下,更改日志中包含的提交类型就是在那里确定的。

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

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

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

您的语义发布配置将是:

{
"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 配置,因为我假设您想为改进创建一个次要版本提交。

关于javascript - 语义发布 - 向自动生成的发行说明添加更多部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59066245/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com