diff --git a/.releaserc.js b/.releaserc.js index e982d49..2b53492 100644 --- a/.releaserc.js +++ b/.releaserc.js @@ -3,7 +3,21 @@ export default { tagFormat: 'v${version}', pkgRoot: 'packages/sdk', plugins: [ - '@semantic-release/commit-analyzer', + [ + '@semantic-release/commit-analyzer', + { + preset: 'angular', + // Non-default. The Angular preset ships rules for feat, fix, perf and + // breaking changes only, so a refactor-only release cut nothing while + // the notes below still advertised a "Code Refactoring" section — one + // that could never appear on its own. These are additive: the preset's + // own rules still apply as the fallback. + releaseRules: [ + { type: 'refactor', release: 'patch' }, + { type: 'revert', release: 'patch' }, + ], + }, + ], [ '@semantic-release/release-notes-generator', { diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8fe9d2e..6519c3d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -149,6 +149,8 @@ Must be one of the following. The right-hand column is the version bump the type Only `feat`, `fix`, `perf` and `refactor` appear in the release notes. The rest are still part of the history; they just do not produce a release on their own. +`refactor` bumps because `.releaserc.js` adds it (along with `revert`) through `releaseRules`. The Angular preset on its own releases for `feat`, `fix`, `perf` and breaking changes only — see [PUBLISHING.md](./PUBLISHING.md#version-bumps). + ### Scope The scope could be anything specifying the place of the commit change. For example `core`, `api`, or `contracts`. diff --git a/PUBLISHING.md b/PUBLISHING.md index 9ae65a4..4725a2f 100644 --- a/PUBLISHING.md +++ b/PUBLISHING.md @@ -37,12 +37,15 @@ The bump comes from the commit types since the last tag, following the [Angular | Commit | Bump | | ------------------------------------------- | ----- | | `feat:` | minor | -| `fix:`, `perf:`, `refactor:` | patch | +| `fix:`, `perf:` | patch | +| `refactor:`, `revert:` | patch | | `BREAKING CHANGE:` in the footer | major | | `docs:`, `style:`, `test:`, `chore:`, `ci:` | none | A push containing only no-bump types publishes nothing — the workflow succeeds and semantic-release logs that there is no release to make. +`refactor` and `revert` are **not** stock behaviour. The Angular preset ships rules for `feat`, `fix`, `perf` and breaking changes only, so `.releaserc.js` adds them through `releaseRules` on the commit-analyzer. Without that, a refactor-only release cut nothing while the notes config still advertised a "Code Refactoring" section that could never appear on its own — which is exactly how the 2.0.1 client regeneration came to sit on `main`, merged and unpublished. + ### A major needs the `BREAKING CHANGE:` footer The `!` shorthand does **not** work on its own here, and it is worse than a no-op. The Angular preset's header pattern is `/^(\w*)(?:\((.*)\))?: (.*)$/` — it has no `breakingHeaderPattern` — so `feat(core)!: …` fails to parse as a `feat` at all. Without a footer, such a commit contributes no bump and never reaches the Features section.