最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Semantic Release - Add more sections to auto-generated release notes - Stack Overflow

programmeradmin4浏览0评论

I've just finished setting up semantic-release for my node project and made the first release with it:

It seems that only mits with type fix or feat are added to the release notes... I want to be able to show improvement type as well.

Is there a way to configure/add it? Thanks!

I've just finished setting up semantic-release for my node project and made the first release with it:

It seems that only mits with type fix or feat are added to the release notes... I want to be able to show improvement type as well.

Is there a way to configure/add it? Thanks!

Share Improve this question edited Nov 27, 2019 at 9:44 Gee VB asked Nov 27, 2019 at 8:44 Gee VBGee VB 2234 silver badges8 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

The changelog text is generated by conventional-changelog-angular by default and it's over there that the type of mit to include in the change log are determined.

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

If you want to include other type of mit in the changelog you can create your own preset (based on conventional-changelog-angular) that would include all the mits type.

Alternatively you can use the conventional-changelog-conventionalmits preset which support the types option to define new types and if they should be included in the release note.

You semantic-release config would be:

{
  "plugins": [
    ["@semantic-release/mit-analyzer", {
      "preset": "conventionalmits",
      "releaseRules": [
        {"type": "improvement", "release": "minor"}
      ]
    }],
    ["@semantic-release/release-notes-generator", {
      "preset": "conventionalmits",
      "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/mit-analyzer as I assume you want to create a minor releases for improvement mits.

发布评论

评论列表(0)

  1. 暂无评论