|
3 | 3 | * release workflow can't push the version bump straight to it. release-it |
4 | 4 | * commits and tags locally, pushes only the tag (tags aren't covered by a |
5 | 5 | * branch ruleset), and the workflow lands the bump commit through a PR. |
| 6 | + * |
| 7 | + * ESM rather than `.release-it.cjs` so the type list can live in |
| 8 | + * tools/changelog-preset.mjs and be shared with tools/changelog-check.mjs. |
| 9 | + * conventional-changelog-conventionalcommits is ESM-only, so a CJS config |
| 10 | + * could only reach it through a dynamic import. |
6 | 11 | */ |
7 | | -module.exports = { |
| 12 | +import { TYPES } from "./tools/changelog-preset.mjs"; |
| 13 | + |
| 14 | +const config = { |
8 | 15 | git: { |
9 | 16 | requireBranch: "master", |
10 | 17 | commitMessage: "chore(release): v${version}", |
@@ -39,26 +46,21 @@ module.exports = { |
39 | 46 | "@release-it/conventional-changelog": { |
40 | 47 | infile: "CHANGELOG.md", |
41 | 48 | header: "# Changelog", |
42 | | - // Each release leaves a `chore(release)` bump commit and the merge commit |
43 | | - // that lands it. Neither is worth a changelog line. |
44 | | - commitFilter: (commit) => |
45 | | - !(commit.header ?? "").startsWith("chore(release)"), |
| 49 | + // There used to be a `commitFilter` here, meant to keep the |
| 50 | + // `chore(release)` bump commits out of the notes. The plugin never read |
| 51 | + // it: it destructures `preset`, `context`, `gitRawCommitsOpts`, |
| 52 | + // `parserOpts`, `writerOpts` and `whatBump`, and `commitFilter` appears |
| 53 | + // nowhere in its source. Nothing was lost by it doing nothing, because |
| 54 | + // the bump commits reach master as merge commits (both v1.0.12's and |
| 55 | + // v1.0.13's have two parents) and conventional-changelog skips those |
| 56 | + // anyway. Removing the key so the config stops claiming a behaviour it |
| 57 | + // never had. |
46 | 58 | preset: { |
47 | 59 | name: "conventionalcommits", |
48 | | - types: [ |
49 | | - { type: "feat", section: "Features" }, |
50 | | - { type: "fix", section: "Bug Fixes" }, |
51 | | - { type: "perf", section: "Performance" }, |
52 | | - { type: "refactor", section: "Code Refactoring" }, |
53 | | - { type: "docs", section: "Documentation" }, |
54 | | - { type: "build", section: "Build System" }, |
55 | | - { type: "ci", section: "Continuous Integration" }, |
56 | | - { type: "chore", section: "Chores" }, |
57 | | - { type: "revert", section: "Reverts" }, |
58 | | - { type: "test", hidden: true }, |
59 | | - { type: "style", hidden: true }, |
60 | | - ], |
| 60 | + types: TYPES, |
61 | 61 | }, |
62 | 62 | }, |
63 | 63 | }, |
64 | 64 | }; |
| 65 | + |
| 66 | +export default config; |
0 commit comments