Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
372 views
in Technique[技术] by (71.8m points)

javascript - 语义发布-在自动生成的发布说明中添加更多部分(Semantic Release - Add more sections to auto-generated release notes)

I've just finished setting up semantic-release for my node project and made the first release with it:(我刚刚为节点项目设置了语义发布,并使用它发布了第一个版本:)

发行说明 It seems that only commits with type fix or feat are added to the release notes... I want to be able to show improvement type as well.(似乎只有带有类型fixfeat提交才添加到发行说明中...我也希望能够显示improvement类型。) Is there a way to configure/add it?(有没有办法配置/添加它?) Thanks!(谢谢!)   ask by Gee VB translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The changelog text is generated by conventional-changelog-angular by default and it's over there that the type of commit to include in the change log are determined.(默认情况下,changelog文本由常规的changelog-angular生成,并且在那里确定了要包含在更改日志中的提交类型。)

See https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/writer-opts.js#L45(参见https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/writer-opts.js#L45) If you want to include other type of commit in the changelog you can create your own preset (based on conventional-changelog-angular ) that would include all the commits type.(如果要在更改日志中包括其他类型的提交,则可以创建自己的预设(基于conventional-changelog-angular ),其中将包括所有提交类型。) Alternatively you can use the conventional-changelog-conventionalcommits preset which support the types option to define new types and if they should be included in the release note.(或者,您可以使用常规的-changelog-conventionalcommits预设,该预设支持types选项以定义新类型,以及是否应将它们包含在发行说明中。) You semantic-release config would be:(您的语义发布配置将是:) { "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} ] } }] ] } I added the releaseRules config for @semantic-release/commit-analyzer as I assume you want to create a minor releases for improvement commits.(我为@semantic-release/commit-analyzer添加了releaseRules配置,因为我假设您想为improvement提交创建次要版本。)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...