Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
5 changes: 4 additions & 1 deletion PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down