@williamthorsen/release-kit 10.5.0 → 10.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.meta/changelog.json +1570 -0
  2. package/.readyup/kits/default.js +127 -4
  3. package/.readyup/kits/npm-auto-publish.js +87 -23
  4. package/.readyup/manifest.json +14 -9
  5. package/CHANGELOG.md +83 -0
  6. package/README.md +68 -963
  7. package/dist/esm/bin/release-kit.js +4 -3
  8. package/dist/esm/buildChangelogEntries.js +5 -0
  9. package/dist/esm/buildDependencyGraph.d.ts +6 -5
  10. package/dist/esm/buildDependencyGraph.js +5 -1
  11. package/dist/esm/changelogJsonUtils.d.ts +5 -7
  12. package/dist/esm/changelogJsonUtils.js +0 -13
  13. package/dist/esm/changelogOverrides.js +8 -0
  14. package/dist/esm/extractMigration.d.ts +14 -0
  15. package/dist/esm/extractMigration.js +18 -0
  16. package/dist/esm/init/scaffold.js +14 -6
  17. package/dist/esm/packsPath.d.ts +15 -0
  18. package/dist/esm/packsPath.js +47 -0
  19. package/dist/esm/planVersionBump.d.ts +2 -1
  20. package/dist/esm/planVersionBump.js +4 -0
  21. package/dist/esm/propagateBumps.d.ts +1 -3
  22. package/dist/esm/propagateBumps.js +2 -2
  23. package/dist/esm/releasePrepare.js +0 -16
  24. package/dist/esm/releasePrepareMono.js +3 -24
  25. package/dist/esm/reportPrepare.js +4 -2
  26. package/dist/esm/runGitCliff.d.ts +16 -23
  27. package/dist/esm/runGitCliff.js +4 -10
  28. package/dist/esm/sync-labels/resolveLabels.d.ts +5 -3
  29. package/dist/esm/sync-labels/resolveLabels.js +21 -6
  30. package/dist/esm/types.d.ts +13 -2
  31. package/dist/esm/validateConfig.js +1 -1
  32. package/docs/api.md +73 -0
  33. package/docs/changelogs.md +70 -0
  34. package/docs/configuration.md +105 -0
  35. package/docs/editorial-overrides.md +144 -0
  36. package/docs/labels.md +83 -0
  37. package/docs/project-releases.md +74 -0
  38. package/docs/publishing.md +30 -0
  39. package/docs/readiness-checks.md +18 -0
  40. package/docs/releasing.md +108 -0
  41. package/docs/work-types.md +121 -0
  42. package/package.json +16 -12
  43. package/dist/esm/readCurrentVersion.d.ts +0 -2
  44. package/dist/esm/readCurrentVersion.js +0 -18
package/README.md CHANGED
@@ -1,17 +1,36 @@
1
+ <!-- readme-type: cli -->
2
+
1
3
  # @williamthorsen/release-kit
2
4
 
3
5
  Version-bumping and changelog-generation toolkit for release workflows.
4
6
 
5
- Provides a self-contained CLI that auto-discovers workspaces from `pnpm-workspace.yaml`, parses conventional commits, determines version bumps, updates `package.json` files, and generates changelogs from `git-cliff --context` output rendered in-process (with optional [editorial overrides](#editorial-overrides)).
7
+ Provides a self-contained CLI that auto-discovers workspaces from `pnpm-workspace.yaml`, parses conventional commits, determines version bumps, updates `package.json` files, and generates changelogs from `git-cliff --context` output rendered in-process (with optional [editorial overrides](docs/editorial-overrides.md)).
6
8
 
7
9
  <!-- section:release-notes -->
8
- ## Release notes — v10.5.0 (2026-09-01)
10
+ ## Release notes — v10.7.0 (2026-09-15)
9
11
 
10
12
  ### 🎉 Features
11
13
 
12
- - Report a consuming repo that still declares @changesets/cli (#764)
14
+ - Fix scaffold error handling and cover every scaffolded workflow (#806)
15
+
16
+ - Adds a `create-github-release.yaml matches template` check to release-kit's ReadyUp kit, which warns when `.github/workflows/create-github-release.yaml` differs from the template for the detected repo type and skips in a repo that has not installed that workflow.
17
+ - Stops `v11y init --force` from replacing an existing `.config/v11y-check.config.json` with the defaults, which discarded the repo's thresholds and the allowlist maintained by `v11y sync`.
18
+
19
+ Migration: To reset `.config/v11y-check.config.json` to its defaults, delete the file and run `v11y init`, because `v11y init --force` now overwrites only `.github/workflows/audit.yaml`.
20
+
21
+ ### 🐛 Bug fixes
22
+
23
+ - Gate the trusted-publisher checks on trust-query capability (#786)
24
+
25
+ - Fixes the issue that the `npm-auto-publish` kit advised `npm trust github …` for every package when the npm session lacked the two-factor authentication that trust queries need.
13
26
 
14
- Adds a check to the default ReadyUp kit in `@williamthorsen/release-kit` that reports a repo still declaring `@changesets/cli`, the release tool superseded by release-kit. The check reports at `recommend` severity; its fix directs the consumer to remove the dependency together with the `.changeset/` directory and any `changeset:*` scripts.
27
+ - Treat label names that differ only in case as one label (#808)
28
+
29
+ - Fixes the issue that `sync-labels generate` wrote a preset's `bug` and a local `Bug` to `.github/labels.yaml` as two labels, which made the first sync fail to create the second and every later sync rename the existing label back and forth.
30
+ - Lets a `labels` entry change a preset label's casing: `Bug` replaces a preset's `bug` and appears in the output as `Bug`, and `Bug: null` removes it.
31
+ - Makes `labels` keys that differ only in case a config error that names each group, such as `'bug' and 'Bug'`, since folding them would discard all but one without any sign in the output.
32
+
33
+ Migration: Keep one of any keys in the `labels` record that differ only in case, and delete the others.
15
34
  <!-- /section:release-notes -->
16
35
 
17
36
  ## Installation
@@ -25,53 +44,53 @@ pnpm add -D @williamthorsen/release-kit
25
44
  ## Quick start
26
45
 
27
46
  ```bash
28
- # 1. Set up release-kit in your repo (scaffolds the release workflow)
47
+ # 1. Scaffold the release workflows
29
48
  npx @williamthorsen/release-kit init
30
49
 
31
50
  # 2. Preview what a release would do
32
51
  npx @williamthorsen/release-kit prepare --dry-run
33
52
  ```
34
53
 
35
- Example output from `prepare --dry-run` in a monorepo:
54
+ Example output from `prepare --dry-run` in a monorepo whose `arrays` workspace has two commits since its last release:
36
55
 
37
56
  ```
38
57
  🔍 DRY RUN — no files will be modified
39
58
 
40
- ── arrays ──────────────────────────────────────
41
- Found 4 commits since arrays-v1.2.0
42
- Parsed 3 typed commits
59
+ ━━━ arrays ━━━
60
+ Found 2 commits since arrays-v1.2.0
61
+ Parsed 2 typed commits
43
62
  Bumping versions (minor)...
44
63
  📦 1.2.0 → 1.3.0 (minor)
45
- [dry-run] Would bump packages/arrays/package.json
64
+ [dry-run] Would bump packages/arrays/package.json
46
65
  Generating changelogs...
47
- [dry-run] Would write packages/arrays/CHANGELOG.md
66
+ [dry-run] Would run: npx --prefer-offline --yes git-cliff@<version> ... --output packages/arrays/CHANGELOG.md
48
67
  🏷️ arrays-v1.3.0
49
68
 
50
- ── strings ─────────────────────────────────────
51
- Found 2 commits since strings-v0.5.1
52
- Parsed 2 typed commits
53
- Bumping versions (patch)...
54
- 📦 0.5.1 → 0.5.2 (patch)
55
- [dry-run] Would bump packages/strings/package.json
56
- Generating changelogs...
57
- [dry-run] Would write packages/strings/CHANGELOG.md
58
- 🏷️ strings-v0.5.2
59
-
60
69
  ✅ Release preparation complete.
61
70
  🏷️ arrays-v1.3.0
62
- 🏷️ strings-v0.5.2
71
+ [dry-run] Would write tmp/.release-tags: arrays-v1.3.0
72
+ [dry-run] Would write tmp/.release-summary
63
73
  ```
64
74
 
65
- That's it for most repos. The CLI auto-discovers workspaces and applies sensible defaults. The bundled `cliff.toml.template` is used automatically — no need to copy it. Customize only what you need via `.config/release-kit.config.ts`.
75
+ Commit the scaffolded workflows, then start a release from the `release` workflow. It runs `prepare` in CI, then commits, tags, and pushes the result:
76
+
77
+ ```sh
78
+ gh workflow run release.yaml # every workspace with release-worthy changes
79
+ gh workflow run release.yaml -f only=arrays # the named workspaces alone
80
+ ```
81
+
82
+ The CLI applies defaults to every discovered workspace and uses the bundled `cliff.toml.template` unless the repository provides a git-cliff config of its own. [Releasing](docs/releasing.md) covers `prepare`'s flags, release-notes previews, and the workflow's inputs.
66
83
 
67
84
  ## How it works
68
85
 
69
86
  1. **Workspace discovery**: reads `pnpm-workspace.yaml` and resolves its `packages` globs to find workspace directories. Each directory containing a `package.json` becomes a workspace. If no workspace file is found, the repo is treated as a single-package project.
70
87
  2. **Config loading**: loads `.config/release-kit.config.ts` (if present) and merges it with discovered defaults.
71
88
  3. **Commit analysis**: for each workspace, finds commits since the last version tag, parses them for type and scope, and determines the appropriate version bump.
72
- 4. **Version bump + changelog**: bumps `package.json` versions, builds structured `ChangelogEntry[]` from `git-cliff --context`, applies any [editorial overrides](#editorial-overrides) from per-scope `.meta/changelog-overrides.json` files, and renders both `CHANGELOG.md` and `.meta/changelog.json` from that single source. `git-cliff` is invoked only for its `--context` JSON; markdown rendering happens in-process so `.meta/changelog.json` and `CHANGELOG.md` always agree.
89
+ 4. **Version bump + changelog**: bumps `package.json` versions, builds structured `ChangelogEntry[]` from `git-cliff --context`, applies any [editorial overrides](docs/editorial-overrides.md) from per-scope `.meta/changelog-overrides.json` files, and renders both `CHANGELOG.md` and `.meta/changelog.json` from that single source. `git-cliff` is invoked only for its `--context` JSON; markdown rendering happens in-process so `.meta/changelog.json` and `CHANGELOG.md` always agree.
73
90
  5. **Release tags file**: writes computed tags to `tmp/.release-tags` for the release workflow to read when tagging and pushing.
74
91
 
92
+ [Changelogs](docs/changelogs.md) covers what reaches a published tarball, the `changelog.json` item schema, and the git-cliff config.
93
+
75
94
  ## Commit format
76
95
 
77
96
  release-kit parses commits in these formats:
@@ -87,12 +106,12 @@ type(scope)!: description # conventional scoped breaking change
87
106
 
88
107
  The `scope|type:` format scopes a commit to a specific workspace in a monorepo. Use `scopeAliases` in your config to map shorthand names to canonical scope names.
89
108
 
109
+ [Work types and tiers](docs/work-types.md) lists the recognized types and how each one affects the bump and the changelog.
110
+
90
111
  ## Configuration
91
112
 
92
113
  Configuration is optional. The CLI works out of the box by auto-discovering workspaces and applying defaults. Create `.config/release-kit.config.ts` only when you need to customize behavior.
93
114
 
94
- ### Config file
95
-
96
115
  ```typescript
97
116
  import { defineConfig } from '@williamthorsen/release-kit/config';
98
117
 
@@ -115,779 +134,18 @@ export default defineConfig({
115
134
 
116
135
  Node loads the file directly, so a relative import inside it needs an explicit file extension — `./work-types.ts`, not `./work-types`.
117
136
 
118
- ### `ReleaseKitConfig` reference
119
-
120
- | Field | Type | Description |
121
- | ------------------ | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
122
- | `cliffConfigPath` | `string` | Explicit path to cliff config. If omitted, resolved automatically: `.config/git-cliff.toml` → `cliff.toml` → bundled template |
123
- | `workspaces` | `WorkspaceOverride[]` | Override or exclude discovered workspaces (matched by `dir`) |
124
- | `formatCommand` | `string` | Shell command to run after changelog generation; modified file paths are appended as arguments |
125
- | `versionPatterns` | `VersionPatterns` | Rules for which commit types trigger major/minor bumps |
126
- | `scopeAliases` | `Record<string, string>` | Maps shorthand scope names to canonical names in commits |
127
- | `workTypes` | `Record<string, WorkTypeConfig>` | Work type definitions, merged with defaults by key |
128
- | `breakingPolicies` | `Record<string, 'forbidden' \| 'optional' \| 'required'>` | Per-type `!`-policy lookup. Defaults to `DEFAULT_BREAKING_POLICIES`. Replaces the default entirely when provided. Set to `{}` to disable enforcement |
129
- | `retiredPackages` | `RetiredPackage[]` | Packages that once lived in this repo but have been extracted or removed; suppresses undeclared-tag-prefix warnings |
130
- | `project` | `ProjectConfig` | Opt-in project-level release block. Declaring `project: {}` (even empty) enables a project-release stage in `prepare` |
131
- | `repoLabels` | `RepoLabelsConfig` | Declares the repository's label registry for `sync-labels`; see [Label configuration](#label-configuration) |
132
-
133
- All fields are optional.
134
-
135
- ### `WorkspaceOverride`
136
-
137
- ```typescript
138
- interface WorkspaceOverride {
139
- dir: string; // Package directory name (e.g., 'arrays')
140
- shouldExclude?: boolean; // If true, exclude from release processing
141
- legacyIdentities?: LegacyIdentity[]; // Prior `(name, tagPrefix)` identities for this workspace
142
- }
143
-
144
- interface LegacyIdentity {
145
- name: string; // Full scoped npm name at the time (e.g., '@scope/pkg')
146
- tagPrefix: string; // Tag prefix under which historical tags were published (e.g., 'core-v')
147
- }
148
- ```
149
-
150
- `legacyIdentities` captures prior identities of a workspace as complete `(name, tagPrefix)` snapshots. The union of the current `tagPrefix` and each identity's `tagPrefix` is consulted when release-kit searches for the most recent baseline tag and when generating changelogs. Use it when a workspace's historical tags were published under a different npm name, a different tag prefix, or both — typically across a package rename. Both fields are required per identity: each entry must be a complete historical snapshot that stays valid regardless of subsequent renames. Run `release-kit show-tag-prefixes` to detect undeclared candidates and produce a paste-ready config snippet. Listing the current identity (full `(name, tagPrefix)` match) is rejected as a no-op duplicate; an identity whose `tagPrefix` matches the current but whose `name` differs is valid and documents a prior rename that reused the same tag shape. If the workspace no longer exists in this repo at all (the package was extracted or removed), use [`retiredPackages`](#retiredpackage) instead.
151
-
152
- ### `RetiredPackage`
153
-
154
- ```typescript
155
- interface RetiredPackage {
156
- name: string; // Final scoped npm name while the package lived in this repo
157
- tagPrefix: string; // Tag prefix under which the package's historical tags were published
158
- successor?: string; // Optional successor package name (e.g., 'readyup')
159
- }
160
- ```
161
-
162
- `retiredPackages` is the repo-level complement to `legacyIdentities`. Use `legacyIdentities` when the workspace still exists in this repo under a new identity; use `retiredPackages` when no workspace for this package exists in this repo anymore — the package was extracted to another repo or removed outright. Retired entries are inert: release-kit never consults them for baseline lookup or changelog attribution. Their declared `tagPrefix` values are recognized as historical, so `show-tag-prefixes` stops flagging them under "Undeclared tag prefixes."
163
-
164
- Worked example — `preflight` was extracted from this monorepo and continues as the standalone `readyup` project. Its tags stay in this repo as historical anchors:
165
-
166
- ```typescript
167
- import { defineConfig } from '@williamthorsen/release-kit/config';
168
-
169
- export default defineConfig({
170
- retiredPackages: [{ name: '@scope/preflight', tagPrefix: 'preflight-v', successor: 'readyup' }],
171
- });
172
- ```
173
-
174
- Validation rules:
175
-
176
- - `name` and `tagPrefix` are required per entry and must be non-empty strings.
177
- - `successor` is optional; if present, it must be a non-empty string.
178
- - Full-tuple `(name, tagPrefix)` duplicates within `retiredPackages` are rejected.
179
- - Two entries sharing the same `tagPrefix` but different `name`s are accepted — this documents a package renamed within the repo before being retired.
180
-
181
- `show-tag-prefixes` currently does not render a dedicated "Retired packages" section (deferred). Declaring a retired entry is verifiable by confirming that its `tagPrefix` stops appearing under "Undeclared tag prefixes" in the `show-tag-prefixes` output.
182
-
183
- ### Tag prefix collisions
184
-
185
- Tag prefixes from distinct owners must not be identical or be a strict prefix of one another. An owner is one of:
186
-
187
- - An active workspace, comprising its derived `tagPrefix` plus any declared `legacyIdentities[].tagPrefix`. Identities of the same workspace are one owner, so their prefixes are allowed to overlap (this represents the same package across renames).
188
- - A `retiredPackages[]` entry (one owner per entry).
189
- - The `project` block, when configured.
190
-
191
- release-kit resolves baseline tags via `git describe --match=<prefix>*`, so a strict-prefix overlap between distinct owners would cause that glob to return cross-matches against the wrong owner's history. For example, a project prefix of `v` collides with a workspace prefix of `vue-helpers-v`, since `git describe --match=v*` would return both project tags and `vue-helpers` tags.
192
-
193
- The rule is enforced at config load; the resulting error identifies both colliding declarations.
194
-
195
- ### Project releases
196
-
197
- Some monorepos ship a single combined deliverable — a Chrome extension, a CLI binary, a packaged desktop app — for which the per-workspace tags and changelogs alone do not describe what the user actually receives. Declare the optional `project` block to add a project-level release stage that runs alongside the per-workspace pipeline.
198
-
199
- ```typescript
200
- import type { ReleaseKitConfig } from '@williamthorsen/release-kit/config';
201
-
202
- const config: ReleaseKitConfig = {
203
- // Empty object is enough to opt in. Every non-excluded workspace contributes.
204
- project: {},
205
- };
206
-
207
- export default config;
208
- ```
209
-
210
- When configured, each `release-kit prepare` run additionally:
211
-
212
- - Computes commits since the last project tag (`<tagPrefix><version>`), filtered to `paths` (by default, the union of every contributing workspace's paths).
213
- - Bumps the root `package.json`'s `version` field using the same bump-derivation rules as workspaces (or the `--bump=...` override).
214
- - Regenerates the root `./CHANGELOG.md` from the structured `ChangelogEntry[]` produced by `git-cliff --context` (scoped to the project's `tagPrefix` and the same `paths`) and any matching editorial overrides.
215
- - Emits `./.meta/changelog.json` (when `changelogJson.enabled`).
216
- - With `--with-release-notes`, additionally emits `./docs/RELEASE_NOTES.v<version>.md`.
217
- - Appends the project tag to `tmp/.release-tags` so `release-kit commit` and `release-kit tag` pick it up alongside per-workspace tags.
218
-
219
- If no commit under `paths` has landed since the last project tag, the project release is silently skipped — same behavior as a per-workspace skip.
220
-
221
- #### `ProjectConfig`
222
-
223
- ```typescript
224
- interface ProjectConfig {
225
- paths?: string[]; // Defaults to the union of every contributing workspace's paths
226
- tagPrefix?: string; // Defaults to 'v'
227
- }
228
- ```
229
-
230
- | Field | Default | Description |
231
- | ----------- | ----------------------- | -------------------------------------------------------------------- |
232
- | `paths` | Contributing-path union | Patterns selecting the commits the project release considers |
233
- | `tagPrefix` | `'v'` | Prefix for project tags. The full tag is `${tagPrefix}${newVersion}` |
234
-
235
- By default the contributing workspaces are implicit: every non-excluded discovered workspace contributes its `<dir>/**` glob, and the project release considers commits under their union.
236
-
237
- Declare `paths` to choose the window yourself. Each entry reaches two matchers: `git log` as a pathspec, and `git-cliff --include-path` as a glob. A declared value **replaces** the workspace union rather than extending it: `paths: ['docs/**']` drops every workspace commit from the project release.
238
-
239
- A repo whose content lives at the root — where no commit matches any `<dir>/**` glob, so the project release would skip every run — declares the whole tree:
240
-
241
- ```typescript
242
- const config: ReleaseKitConfig = {
243
- project: { paths: ['**'] },
244
- };
245
- ```
246
-
247
- `'**'` is the whole-tree pattern, matching root-level files, dotfiles, and nested paths alike.
248
-
249
- Terminate a directory scope with `/**`. The two matchers agree on `'aws/**'` but diverge on a bare `'aws'`, which git reads as the whole subtree and git-cliff matches against nothing; `'.'` is the same trap for the repo root. A release under such an entry finds commits, bumps the version, and writes the tag, while its changelog gains no entry for them — and nothing reports an error.
250
-
251
- Validation rules:
252
-
253
- - The root `package.json` must exist and declare a `version` field. release-kit reports an error at config-load time if either is missing.
254
- - The `project` block is rejected in single-package mode (the package's own release already covers the whole repo, so a project tier would only duplicate it).
255
- - `paths`, when declared, must hold at least one non-empty string. An empty array is rejected: it reaches git and git-cliff as no filter at all, which is the inverse of how it reads.
256
- - Unknown fields inside `project` are rejected.
257
-
258
- CLI flag interactions:
259
-
260
- - `--dry-run` previews project artifacts alongside workspace artifacts; no files are written.
261
- - `--bump=major|minor|patch` propagates to the project release as a level chooser. It does not trigger a release on its own when there are no commits or no bump-worthy commits.
262
- - `--force` runs the project release even when no commits or no bump-worthy commits exist since the last project tag. Defaults to patch when `--bump` is not given; combine with `--bump=X` to release at a different level.
263
- - `--only` narrows the run to the named workspaces and skips the project release, which is reported as a warning. The project release rolls up every contributing workspace, and `--only` changes which workspaces those are, so rolling up a narrowed set would release a project version covering work the run excluded. Run a full `prepare` (no `--only`) to include the project release.
264
- - `--set-version` is rejected with an error when `project` is configured. `--set-version` operates on a single workspace, but a project release rolls up every contributing workspace; the two semantics don't compose. To use `--set-version`, run on a config without a `project` block.
265
-
266
- `--bump` and `--force` are orthogonal: `--bump` is purely a level chooser; `--force` is purely a release trigger. Examples:
267
-
268
- ```sh
269
- # Release every target at its natural bump level (no flags).
270
- release-kit prepare
271
-
272
- # Force a release even when no bump-worthy commits exist; defaults to patch
273
- # per target, with each target keeping its natural bump if one is derivable.
274
- release-kit prepare --force
275
-
276
- # Force a release at a uniform level across every releasing target.
277
- release-kit prepare --force --bump=minor
278
-
279
- # --bump=X alone is a level chooser, NOT a trigger. If a target has no
280
- # bump-worthy commits, it skips with a "Pass --force..." reason. If it has
281
- # bump-worthy commits, the override applies. (Behavioral change from earlier
282
- # release-kit versions, where --bump=X alone would force a release.)
283
- release-kit prepare --bump=minor
284
- ```
285
-
286
- ### `VersionPatterns`
287
-
288
- Defines which commit types trigger major or minor bumps. Any recognized type not listed defaults to a patch bump.
289
-
290
- ```typescript
291
- interface VersionPatterns {
292
- major: string[]; // Patterns triggering a major bump ('!' = any breaking change)
293
- minor: string[]; // Commit types triggering a minor bump
294
- }
295
- ```
296
-
297
- Default: `{ major: ['!'], minor: ['feat'] }`
298
-
299
- ### Work types and tiers
300
-
301
- The canonical taxonomy lives in `packages/release-kit/src/work-types.json` and is split into three tiers that drive section rendering and audience classification.
302
-
303
- | Tier | Key | Header | Aliases | `!` policy |
304
- | -------- | ----------- | ------------------------- | ------------- | ------------ |
305
- | public | `feat` | 🎉 Features | `feature` | optional |
306
- | public | `drop` | 🪦 Removed | | **required** |
307
- | public | `deprecate` | 🗑️ Deprecated | | forbidden |
308
- | public | `fix` | 🐛 Bug fixes | `bugfix` | forbidden |
309
- | public | `sec` | 🔒 Security | `security` | optional |
310
- | public | `perf` | ⚡ Performance | `performance` | forbidden |
311
- | internal | `internal` | 🏗️ Internal features | `utility` | forbidden |
312
- | internal | `refactor` | ♻️ Refactoring | | forbidden |
313
- | internal | `tests` | 🧪 Tests | `test` | forbidden |
314
- | process | `tooling` | ⚙️ Tooling | | forbidden |
315
- | process | `ci` | 👷 CI | | forbidden |
316
- | process | `deps` | 📦 Dependencies | `dep` | forbidden |
317
- | process | `ai` | 🤖 Agentic support | | forbidden |
318
- | process | `docs` | 📚 Documentation | `doc` | forbidden |
319
- | process | `fmt` | (excluded from changelog) | | forbidden |
320
-
321
- #### Tier semantics
322
-
323
- - **`public`** — visible to all audiences. `public`-tier sections appear in both public release notes and dev changelogs.
324
- - **`internal`** — dev-only. `internal`-tier sections appear in dev changelogs but not in public-facing release notes.
325
- - **`process`** — dev-only. Same audience treatment as `internal`.
326
-
327
- Section render order is **tier order (`public` → `internal` → `process`), then row order within tier**. The bundled `cliff.toml.template` encodes this order via hidden `<!-- NN -->` HTML-comment prefixes on each parser's `group` value; tera's `group_by` filter sorts groups lexicographically (now monotonic by row number), and the body template's `striptags` filter erases the prefix from rendered headings.
328
-
329
- #### `docs` reclassification
330
-
331
- `docs`/Documentation has moved from the all-audience tier (where it lived before this taxonomy was formalised) to the dev-only `process` tier. **Documentation commits no longer appear in public-facing release notes.** They still appear in `CHANGELOG.md` and `changelog.json` under the `audience: 'dev'` classification.
332
-
333
- #### `utility` alias
334
-
335
- `utility:` is a backward-compat alias for `internal:`. Both forms parse to the same canonical type, route to the same `🏗️ Internal features` section, and are subject to the same `!` policy.
336
-
337
- #### `!` (breaking change) policy
338
-
339
- Each work-type carries a `breakingPolicy` value:
340
-
341
- - `optional` (`feat`, `sec`) — `!` is allowed; both `type:` and `type!:` parse cleanly.
342
- - `forbidden` (most types) — `!` is a policy violation. The premise: types like `internal!`, `perf!`, `fix!` are contradictory; an internal change cannot break a consumer contract, a pure perf change preserves the contract, and a bug-fix is by definition not a contract change.
343
- - `required` (`drop`) — bare `drop:` is a policy violation; only `drop!:` is accepted. The premise: removing a feature always breaks consumers; the `!` form makes that explicit.
344
-
345
- ##### Two-tier policy enforcement
346
-
347
- The `!` policy operates at two distinct levels with different semantics:
348
-
349
- - **Write-time** (commit-msg hook) — strict rejection. Policy violations are blocked at the gate where the author can act on them immediately. _Hook-based enforcement is tracked separately and is not yet shipped._
350
- - **Release-time** (`parseCommitMessage`) — tolerant warn-and-continue. Commits already in the log cannot be rewritten, so a policy-violating commit is parsed using its canonical type with `breaking: false` (the `!` is dropped from the parse) and a `onPolicyViolation` callback fires. Callers (`decideRelease` etc.) can collect these warnings and surface them in the release report. A single legacy `internal!` in a year-old log does not block releases.
351
-
352
- A `BREAKING CHANGE:` body footer on a `forbidden`-policy type triggers the same warning path as the prefix `!` does — the spirit of the policy is "internal/perf/etc. cannot be breaking", which must apply to both surfaces.
353
-
354
- The release-prepare orchestrators (`releasePrepare`, `releasePrepareMono`, `releasePrepareProject`) apply `DEFAULT_BREAKING_POLICIES` automatically. Violations encountered while parsing each workspace's or project's commit window are collected onto the corresponding result's `policyViolations` field and rendered under the section in the prepare report:
355
-
356
- ```
357
- arrays
358
- Found 1 commits since arrays-v1.0.0
359
- ⚠️ 1 policy violation:
360
- · def5678 'internal!: refactor cache' — type 'internal' at prefix surface
361
- Bumping versions (patch)...
362
- 📦 1.0.0 → 1.0.1 (patch)
363
- ```
364
-
365
- To customize, set `breakingPolicies` in `release-kit.config.ts` — provide a partial map to override individual types, or `{}` to disable enforcement entirely (the parser falls back to `'optional'` for any missing type). Violations remain warnings, never failures.
366
-
367
- #### `🚨 **Breaking:**` bullet marker
368
-
369
- Items whose commit subject carries the `!` prefix (e.g. `feat!`, `drop!`, `feat(api)!`) are rendered with a `🚨 **Breaking:** ` prefix on the bullet:
370
-
371
- ```markdown
372
- - 🚨 **Breaking:** Drop legacy /v1 endpoint
373
- ```
374
-
375
- Only the prefix `!` triggers this marker. A `BREAKING CHANGE:` body footer on its own does **not** retroactively mark a changelog item as breaking — the changelog signal is tied to the commit-prefix policy. This avoids surprise breaking-marker appearances for older commits written under earlier conventions.
376
-
377
- The emoji and label of this marker are sourced from the `markers.breaking` entry in `work-types.json` (see [Section markers](#section-markers)) so consumers that render their own breaking-changes section draw from the same SSOT.
378
-
379
- ### Section markers
380
-
381
- Alongside `tiers` and `types`, `work-types.json` exposes a top-level `markers` object for cross-cutting section markers — visual indicators that aren't tied to a specific work type. Today the canonical entry is `breaking`; additional keys (e.g., security advisories, migration notices) can be added without a schema change.
382
-
383
- ```jsonc
384
- {
385
- "markers": {
386
- "breaking": { "emoji": "🚨", "label": "Breaking" },
387
- },
388
- }
389
- ```
390
-
391
- Entries store plain text only — the SSOT is format-agnostic, so consumers apply their own emphasis (Markdown bold, ANSI escape, HTML `<strong>`) when constructing the rendered form. release-kit's own renderer constructs the per-bullet prefix as `${emoji} **${label}:** ` from this entry.
392
-
393
- #### `fmt`
394
-
395
- `fmt:` commits are recognized by `parseCommitMessage` (they contribute to a patch bump) but `fmt` carries `excludedFromChangelog: true`. The bundled `cliff.toml.template` skips `fmt:` commits at the parser level, so they never appear in `CHANGELOG.md`, `changelog.json`, or release notes. The label and emoji are present in `work-types.json` for schema parity with the codeassembly upstream but never render.
396
-
397
- #### Custom work types
398
-
399
- Work types from your config are merged with these defaults by key — your entries override or extend, they don't replace the full set. Release-notes sections are rendered in the declaration order of the merged work-types record, with any unknown titles trailing the known ones.
400
-
401
- The default `devOnlySections` (excluded from public release notes but still written to `CHANGELOG.md`) are derived from the `internal` and `process` tiers (excluding `fmt`). Override via `changelogJson.devOnlySections` in your config; matching is decorator-tolerant, so a bare-name override like `['Internal features']` keeps working against the emoji-prefixed and prefix-decorated default titles.
402
-
403
- ## Editorial overrides
404
-
405
- Generated changelogs occasionally need editorial correction — typos, redacted scope, reworded entries, or historical commits whose bodies carry verbatim PR-template scaffolding (`## What`, `## Why`, etc.) that renders as literal text in user-facing release notes. Rewriting git history is not viable, and any in-place edit to `CHANGELOG.md` or `.meta/changelog.json` is overwritten on the next release because release-kit regenerates both artifacts from scratch.
406
-
407
- Override files are the supported escape hatch. Drop a checked-in JSON file at the conventional path for the scope you want to influence, keyed by commit hash, and `release-kit prepare` applies the overrides between `buildChangelogEntries` and serialization. Both `CHANGELOG.md` and `.meta/changelog.json` reflect the post-override view, so downstream consumers (the GitHub Release body, the in-app release-notes page, etc.) see the same content.
408
-
409
- ### File-location convention
410
-
411
- | Scope | Path | Applies to |
412
- | ------------------- | ---------------------------------------------- | ------------------------------------------------------- |
413
- | Project (root) | `.meta/changelog-overrides.json` | The project changelog and every workspace's changelog |
414
- | Workspace | `packages/<ws>/.meta/changelog-overrides.json` | Only that workspace's changelog |
415
- | Single-package mode | `.meta/changelog-overrides.json` | The package's changelog (collapses to the project case) |
416
-
417
- Filenames have no leading dot — the `.meta/` directory already provides the visibility property and parallels its sibling artifacts (`changelog.json`, `label-map.json`).
418
-
419
- ### Composition: per-key shadowing
420
-
421
- When a workspace's changelog is rendered, both files are consulted:
422
-
423
- - The root file's overrides apply globally.
424
- - The workspace file's overrides apply only to that workspace.
425
- - When the **same hash key** (string-equal, byte-for-byte) appears in both files, the **workspace entry wins entirely** for that workspace's changelog — no field-level merge, the workspace entry replaces the root entry.
426
- - Different prefix strings that happen to resolve to the same commit do **not** shadow; they fall through to the existing ambiguous-prefix error so you can correct your override file.
427
- - Other keys in the root file still apply for that workspace.
428
-
429
- The project-level changelog applies only the root file. Per-workspace files describe per-workspace editorial intent and have no meaning at the aggregated project tier.
430
-
431
- ### Stale-key warnings
432
-
433
- A key that doesn't match any commit gets a stale-reference warning. The warning's scope mirrors the file's scope:
434
-
435
- - **Per-workspace files** are warned against their own apply context. A key in `packages/foo/.meta/changelog-overrides.json` that doesn't match any commit in foo's changelog is unambiguously stale and is warned immediately.
436
- - **Root file** keys are aggregated globally — a root key that matches in any workspace or in the project changelog is non-stale; a root key matched nowhere is warned exactly once after all batches complete.
437
-
438
- ### File shape
439
-
440
- ```json
441
- {
442
- "82962311": {
443
- "audience": "skip"
444
- },
445
- "abc1234d": {
446
- "body": "Cleaned-up prose without the original PR-template scaffolding."
447
- },
448
- "ef567890": {
449
- "description": "Rewritten headline that fixes the typo",
450
- "body": "Optional replacement body."
451
- }
452
- }
453
- ```
454
-
455
- Per-entry fields are all optional, but at least one must be present per entry:
456
-
457
- | Field | Type | Effect |
458
- | ------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
459
- | `audience` | `'all' \| 'dev' \| 'skip'` | `'skip'` removes the entry entirely. `'all'` and `'dev'` are reserved for a future audience-reclassification feature (see below). |
460
- | `description` | `string` | Replaces the entry's bullet headline. Other fields are preserved. |
461
- | `body` | `string` | Replaces the entry's body (the prose that renders below the bullet). Other fields are preserved. |
462
- | `breaking` | `boolean` | Toggles the `🚨 **Breaking:** ` marker on the bullet. |
463
-
464
- ### Hash-prefix matching
465
-
466
- Keys can be either the full 40-character commit SHA or a non-ambiguous prefix. The matcher walks every `ChangelogItem.hash` value present in the entry tree and resolves each override key to its set of matching hashes:
467
-
468
- - **Exact prefix match (1 hit)** — the override applies. A 7-character prefix is usually unambiguous within a single repo's history; longer prefixes are always safe.
469
- - **No matches (0 hits)** — the override is treated as a stale reference (probably from a rebase or branch deletion) and prepare reports a warning. The release continues.
470
- - **Ambiguous prefix (2+ hits)** — the release aborts with an error naming the key and the matching hashes. Lengthen the prefix or use the full SHA.
471
-
472
- Override application errors abort the run with a non-zero exit; warnings (zero-match keys) are non-fatal and surface on `PrepareResult.warnings`.
473
-
474
- ### Validation
475
-
476
- The override file is validated when `release-kit prepare` loads it. Each error names the offending key so you can locate it in your file:
477
-
478
- - Missing file → empty map, no error (the no-op default — projects that do not need overrides skip the file entirely).
479
- - Malformed JSON → error.
480
- - Wrong top-level shape (e.g., array, primitive) → error.
481
- - Unknown fields on an entry → error.
482
- - Wrong field types (e.g., `description` as a number) → error.
483
- - An entry with no fields set → error (a copy-paste mistake more often than not).
484
- - `audience: 'all'` or `audience: 'dev'` → error in the current release: only `'skip'` is supported (see below).
485
-
486
- #### Standalone validation: `release-kit overrides validate`
487
-
488
- For a focused overrides-only health check (locally or as a CI gate), run:
489
-
490
- ```sh
491
- pnpm exec release-kit overrides validate
492
- ```
493
-
494
- This walks every `.meta/changelog-overrides.json` file across the project tier and per-workspace tier, reporting three classes of finding:
495
-
496
- | Class | Examples | Exit code |
497
- | ------------------- | ------------------------------------------------------------------------------------------- | --------- |
498
- | Schema/parse errors | malformed JSON, unknown fields, wrong field types, no-field entries, unsupported `audience` | `2` |
499
- | Ambiguous-prefix | an override key resolves to 2+ commit hashes | `2` |
500
- | Stale-key warnings | an override key resolves to no commit in its applicable scope | `1` |
501
-
502
- Exit code semantics:
503
-
504
- - `0` — clean (no errors, no stale keys).
505
- - `1` — only stale-key warnings.
506
- - `2` — schema/parse or ambiguous-prefix errors (errors dominate when both classes are present).
507
-
508
- Tier-aware stale-key semantics match `release-kit prepare`'s match-set exactly: a workspace-tier key is stale if it does not match in its own workspace's history; a root-tier key is stale only if it matches in **no** scope (no workspace AND not the project release window).
509
-
510
- The same logic is also exposed programmatically via the `validateAllChangelogOverrides` function exported from `@williamthorsen/release-kit`, for callers that want to integrate the check into their own tooling.
511
-
512
- ### Audience semantics: v1 supports `'skip'` only
513
-
514
- The on-disk format declares the full `'all' | 'dev' | 'skip'` audience vocabulary so the file format will not need to change when the v2 reclassification feature ships. In the current release, only `'skip'` is supported at runtime; `'all'` and `'dev'` are rejected with an explicit "not yet supported" error.
515
-
516
- The eventual v2 behavior will let an override move a single item to a different audience section (e.g., reclassifying a `Documentation` entry as `Internal features` to keep it out of public-facing release notes). v1 deliberately leaves that as a separate change so the override mechanism can ship now and the section-split logic can land additively later.
517
-
518
- ### Worked example 1: cleaning up scaffolded historical commits (root file)
519
-
520
- Suppose a year-old commit `82962311` was authored from a PR template that left `## What` / `## Why` headings in the body, and that commit now appears in your in-app release notes as literal Markdown headings. Add an override at the project tier:
521
-
522
- ```json
523
- // .meta/changelog-overrides.json
524
- {
525
- "82962311": {
526
- "body": "Add the in-app release-notes page with version-aware navigation."
527
- }
528
- }
529
- ```
530
-
531
- On the next `release-kit prepare` run, the matched item's body is replaced before the JSON and Markdown artifacts are written. The original git history is untouched.
532
-
533
- ### Worked example 2: suppressing a cross-attribution spillover (workspace file)
534
-
535
- Release-kit attributes commits to workspaces by file path, so a commit that primarily belongs to one workspace can land in another's changelog if it touched files there. Suppose commit `1ce3d2f` renamed the `audit-deps` package to `v11y-check` (scope `v11y-check`) but also edited `packages/nmr/src/default-scripts.ts` and `packages/nmr/README.md`. The commit correctly appears in `packages/v11y-check/CHANGELOG.md`, but it also spills into `packages/nmr/CHANGELOG.md` where it isn't the right editorial framing.
536
-
537
- Drop a workspace-tier override at `packages/nmr/.meta/changelog-overrides.json`:
538
-
539
- ```json
540
- // packages/nmr/.meta/changelog-overrides.json
541
- {
542
- "1ce3d2f": {
543
- "audience": "skip"
544
- }
545
- }
546
- ```
547
-
548
- The commit is now suppressed in nmr's changelog only — it still appears in v11y-check's, where it belongs. A root-tier `'skip'` would have removed it from both, which is the wrong outcome.
549
-
550
- ### Rendering pipeline change
551
-
552
- Prior versions of release-kit shelled out to `git-cliff` for both structured `--context` JSON and rendered Markdown (cliff's body template). After this change, `git-cliff` is invoked only for `--context` JSON; release-kit's in-process `renderChangelogMarkdown` produces `CHANGELOG.md` from the same `ChangelogEntry[]` that drives `.meta/changelog.json`. The two artifacts can no longer disagree.
553
-
554
- The bundled `cliff.toml.template`'s body template has been emptied (the `[git].commit_parsers` section is still load-bearing for `--context` group assignment); custom `.config/git-cliff.toml` files no longer need a body template.
555
-
556
- Observable output differences from the prior cliff-rendered format:
557
-
558
- - Trailers (`Signed-off-by:`, `Co-authored-by:`, `Closes #N`, GitHub PR URLs) are stripped from rendered bodies.
559
- - Items whose commit subject carries the `!` breaking marker render with a `🚨 **Breaking:** ` prefix.
560
- - Empty version entries (releases with no commits routed to a section) are omitted; the prior cliff template rendered them as bare headings.
561
- - The footer comment is now `<!-- Generated by release-kit. Do not edit this file. Use .meta/changelog-overrides.json to override entries. -->`.
562
-
563
- The first release that ships under the new renderer will produce a one-time noisy diff in `CHANGELOG.md` (whitespace, trailers, breaking markers). Subsequent releases stabilize.
564
-
565
- ## CLI reference
566
-
567
- ### Global options
568
-
569
- | Flag | Description |
570
- | ----------------- | ------------------- |
571
- | `--help`, `-h` | Show help message |
572
- | `--version`, `-V` | Show version number |
573
-
574
- ### `release-kit prepare`
575
-
576
- Run release preparation with automatic workspace discovery.
577
-
578
- | Flag | Description |
579
- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
580
- | `--dry-run` | Preview changes without writing files |
581
- | `--bump=major\|minor\|patch` | Override the bump type for all workspaces |
582
- | `--set-version=X.Y.Z` | Set an explicit canonical semver version; bypasses commit-derived bumps. In monorepo mode it requires `--only`, and is rejected when a `project` block is configured. |
583
- | `--force` | Release even when no commits or no bump-worthy commits exist since the last tag. In monorepo/project mode, defaults to patch (combine with `--bump=X` for a different level); in single-package mode, a bare `--force` is rejected — pass `--bump=major\|minor\|patch`. |
584
- | `--only=name1,name2` | Only process the named workspaces (monorepo only). When a `project` block is configured, the project release is skipped. |
585
- | `--with-release-notes` | Write per-workspace release-notes previews under `<workspacePath>/docs/` |
586
- | `--help`, `-h` | Show help |
587
-
588
- Workspace names for `--only` match the package directory name (e.g., `arrays`, `release-kit`).
589
-
590
- #### Previewing release notes with `--with-release-notes`
137
+ [Configuration](docs/configuration.md) lists every field and covers legacy identities, retired packages, and tag prefixes. [Project releases](docs/project-releases.md) covers releasing a monorepo as one combined deliverable.
591
138
 
592
- `--with-release-notes` writes two versioned files per workspace after each workspace's `changelog.json` is produced:
593
-
594
- - `<workspacePath>/docs/README.v<version>.md` — the workspace `README.md` with release notes injected at the `<!-- section:release-notes -->` marker.
595
- - `<workspacePath>/docs/RELEASE_NOTES.v<version>.md` — the standalone release notes for this version.
596
-
597
- The publish-time inject-and-revert lifecycle is unchanged; previews are additive, deterministic, and safe to regenerate. When `changelogJson.enabled` is `false`, prepare reports a warning and skips preview generation. In dry-run mode, planned writes are logged and no files are created.
598
-
599
- Because preview filenames are versioned, committing them will accumulate files over time. The recommended `.gitignore` entry for monorepos is:
600
-
601
- ```gitignore
602
- packages/*/docs/*.v*.md
603
- ```
604
-
605
- For single-package repos:
606
-
607
- ```gitignore
608
- docs/*.v*.md
609
- ```
610
-
611
- #### Setting an explicit version with `--set-version`
612
-
613
- The `--set-version` flag is a first-class escape hatch for the cases where commit-derived bump logic produces the wrong version — most notably, promoting a pre-1.0 package to 1.0.0. Pre-1.0 packages collapse a `feat!` breaking change to a minor bump (matching semantic-release's `initialMajor: false` and release-please's `bump-minor-pre-major`), so a deliberate promotion to 1.0.0 must be requested explicitly.
614
-
615
- The flag validates that:
616
-
617
- - The value is canonical `N.N.N` semver (pre-release suffixes are rejected).
618
- - The target is strictly greater than the current version (numeric comparison on each component).
619
- - In monorepo mode, `--only` is set and resolves to exactly one workspace.
620
-
621
- `--set-version` is mutually exclusive with `--bump` and `--force`. The rest of the pipeline (changelog generation, tag creation, commit summary, propagation to dependents) runs unchanged, so dependents receive a propagated patch bump triggered by the overridden version.
622
-
623
- Promoting a pre-1.0 package to 1.0.0 in a monorepo:
624
-
625
- ```sh
626
- release-kit prepare --only arrays --set-version 1.0.0
627
- ```
628
-
629
- An empty changelog section is expected for a bare promotion, because the changelog is generated from commits since the last tag. To include a narrative entry, land a descriptive release commit (e.g., a `feat!` describing the stable API) before running `prepare`.
630
-
631
- ### `release-kit publish`
632
-
633
- Publish packages that have release tags on HEAD. The publish workflow's reusable workflow `publish.reusable.yaml` invokes this command in CI.
634
-
635
- | Flag | Description |
636
- | ---------------------- | ---------------------------------------------------------------------------- |
637
- | `--dry-run` | Preview without publishing |
638
- | `--no-git-checks` | Skip the clean-working-tree check |
639
- | `--tags=tag1,tag2,...` | Only publish the named tags (comma-separated, full tag names) |
640
- | `--provenance` | Generate provenance statement (requires OIDC, not supported by classic yarn) |
641
- | `--help`, `-h` | Show help |
642
-
643
- #### Publishability filter
644
-
645
- `publish` and `create-github-release` operate only on workspaces where `package.json#private` is absent or `false`. A workspace marked `private: true` is "versioned but not published": it can still be tagged by `release-kit tag` and get a `CHANGELOG.md` entry, but it is skipped by both `release-kit publish` (no registry publish) and `release-kit create-github-release` (no GitHub Release). `private: true` alone routes a workspace out of publish and announce — no extra release config is required. Other commands ignore this filter and operate on private workspaces unchanged.
646
-
647
- An unpublishable tag is always skipped cleanly, never fatal. For `release-kit publish`, whether the skip is announced depends on how the tag was resolved:
648
-
649
- - **Without `--tags`** (implicit resolution): unpublishable tags on HEAD are silently filtered. The pre-publish listing shows only the publishable subset. If the filter empties the set, `release-kit publish` prints `Nothing to publish.` and exits 0.
650
- - **With `--tags`** (explicit naming): each named tag pointing at an unpublishable workspace is skipped with a warning, and any publishable tags named in the same command still publish.
651
-
652
- `release-kit create-github-release` skips unpublishable workspaces with a warning regardless of `--tags`; an all-private tag set is a clean no-op.
653
-
654
- Example warning when an explicit tag is unpublishable:
655
-
656
- ```
657
- Skipping basic-v1.0.0 (packages/basic): package.json#private is true.
658
- ```
659
-
660
- ### `release-kit create-github-release`
661
-
662
- Create GitHub Releases from `changelog.json` for tags on HEAD. Independent of `npm publish`: invoking this command creates Releases for publishable packages whether or not they were published to a registry. Private workspaces are skipped (see [Publishability filter](#publishability-filter)).
663
-
664
- | Flag | Description |
665
- | ---------------------- | ------------------------------------------------------------------------- |
666
- | `--dry-run` | Preview without creating releases |
667
- | `--tags=tag1,tag2,...` | Only create releases for the named tags (comma-separated, full tag names) |
668
- | `--help`, `-h` | Show help |
669
-
670
- When `--tags` is omitted, every release tag pointing at HEAD is processed. The CLI requires the `gh` CLI on `PATH` and `contents: write` permission. The bundled `create-github-release.reusable.yaml` GitHub Actions workflow runs this command in CI.
671
-
672
- ### `release-kit show-tag-prefixes`
673
-
674
- Print a per-workspace table of derived tag prefixes, tag counts, and declared legacy prefixes. Also surfaces any release-shaped tag prefix in the repo that is neither a derived prefix nor declared via `legacyIdentities`, along with a copy-pasteable `workspaces: [...]` config snippet. The snippet uses a `TODO-fill-in-legacy-npm-name` placeholder for each identity's `name`; replace it with the package's prior npm name before pasting.
675
-
676
- | Flag | Description |
677
- | -------------- | ----------- |
678
- | `--help`, `-h` | Show help |
679
-
680
- Exits `0` when every workspace derives a prefix and there are no cross-workspace collisions; exits `1` on any derivation failure or collision. Undeclared candidates do not affect the exit code — they surface as a warning via the `legacy tag prefixes are declared` readyup check.
681
-
682
- In single-package mode, prints a single row with `workspacePath = .` and `derivedPrefix = v`; legacy entries and undeclared-candidate scanning are not applicable.
683
-
684
- ### `release-kit init`
685
-
686
- Initialize release-kit in the current repository. By default, scaffolds only the GitHub Actions workflow file. Use `--with-config` to also scaffold configuration files.
687
-
688
- | Flag | Description |
689
- | --------------- | -------------------------------------------------------------------------- |
690
- | `--with-config` | Also scaffold `.config/release-kit.config.ts` and `.config/git-cliff.toml` |
691
- | `--force` | Overwrite existing files instead of skipping them |
692
- | `--dry-run` | Preview changes without writing files |
693
- | `--help`, `-h` | Show help |
694
-
695
- Scaffolded files:
696
-
697
- - `.github/workflows/create-github-release.yaml` — workflow that creates a GitHub Release on tag push, independent of npm publish
698
- - `.github/workflows/publish.yaml` — workflow that delegates to a reusable publish workflow
699
- - `.github/workflows/release.yaml` — workflow that delegates to a reusable release workflow
700
- - `.config/release-kit.config.ts` — starter config with commented-out customization examples (with `--with-config`)
701
- - `.config/git-cliff.toml` — copied from the bundled template (with `--with-config`)
702
-
703
- ### `release-kit work-types`
704
-
705
- Manage the canonical work-types taxonomy used by changelog and release-notes generation.
706
-
707
- | Subcommand | Description |
708
- | ---------- | ----------------------------------------------------------------------------------- |
709
- | `check` | Compare the local `work-types.json` against the upstream codeassembly canonical |
710
- | `sync` | Overwrite the local `work-types.json` with the upstream contents (after validation) |
711
-
712
- `check` exit codes:
713
-
714
- | Code | Meaning |
715
- | ---- | --------------------------------------------------------------------------------- |
716
- | `0` | Match (or upstream missing — transitional warning printed) |
717
- | `1` | Drift detected |
718
- | `2` | Network error or non-OK HTTP response |
719
- | `3` | Schema mismatch (upstream JSON does not parse or fails the top-level shape check) |
720
-
721
- The check is non-blocking initially: until codeassembly publishes its `work-types.json`, the upstream URL returns 404 and `check` exits 0 with a warning. CI flip to a blocking check is tracked as a follow-up once the upstream ships.
722
-
723
- These commands are also exposed as `nmr work-types:check` / `nmr work-types:sync` from any package directory.
724
-
725
- #### Authenticated fetches
726
-
727
- When the upstream codeassembly repo is private, both `check` and `sync` need a GitHub token to fetch the canonical `work-types.json`. Set `GITHUB_TOKEN` in the environment and the commands send `Authorization: Bearer <token>` automatically; without it, requests are unauthenticated and a private upstream will return 404.
728
-
729
- ```sh
730
- # Source from `gh auth` for local runs:
731
- export GITHUB_TOKEN=$(gh auth token)
732
- pnpm exec release-kit work-types check
733
- ```
734
-
735
- The token needs `contents: read` on the codeassembly repo (fine-grained PAT scope) or the equivalent classic-PAT scope. A token without sufficient scope still produces a 404 — same response as a missing upstream — so a misconfigured token degrades to the transitional-warning path rather than failing loudly. CI wiring against private upstream is deferred until either codeassembly is publicly readable or a cross-repo PAT is provisioned as a workflow secret.
736
-
737
- ### `release-kit sync-labels`
738
-
739
- Manage GitHub label definitions via the `repoLabels` block of `.config/release-kit.config.ts`.
740
-
741
- | Subcommand | Description | Flags |
742
- | ---------- | -------------------------------------------------------------- | ---------------------- |
743
- | `init` | Scaffold the caller workflow, seed config, and generate labels | `--dry-run`, `--force` |
744
- | `generate` | Regenerate `.github/labels.yaml` from config | `--check` |
745
- | `sync` | Trigger the `sync-labels` GitHub Actions workflow via `gh` CLI | — |
746
-
747
- `init` scaffolds the `.github/workflows/sync-labels.yaml` caller workflow and seeds a `repoLabels` block with scope labels discovered from workspaces and declared `retiredPackages`. When `.config/release-kit.config.ts` does not exist, `init` writes it; when it does, `init` prints the block for manual paste — a hand-authored config is never rewritten. `generate` resolves the block and writes `.github/labels.yaml`; with `--check` it regenerates in memory and exits non-zero if the committed file is stale or missing, writing nothing. `sync` triggers the workflow remotely — it requires the `gh` CLI and an existing workflow file.
748
-
749
- Every `sync-labels` subcommand refuses to run while the retired `.config/sync-labels.config.ts` is present, so custom labels cannot be silently dropped mid-migration; see [Migrating from `.config/sync-labels.config.ts`](#migrating-from-configsync-labelsconfigts).
750
-
751
- #### Label configuration
752
-
753
- ```typescript
754
- import { defineConfig } from '@williamthorsen/release-kit/config';
755
-
756
- export default defineConfig({
757
- repoLabels: {
758
- extends: ['common'],
759
- labels: {
760
- 'scope:my-package': { color: '00ff96' }, // add, with no description
761
- bug: { color: 'b60205', description: 'Something broken' }, // replace the preset's `bug`
762
- wontfix: null, // remove the preset's `wontfix`
763
- },
764
- },
765
- });
766
- ```
767
-
768
- The block declares the repository's label registry — the set of labels defined on the GitHub repo, distinct from labels applied to PRs and issues. Resolution is an ordered fold with last-writer-wins:
769
-
770
- 1. Presets, in `extends` order — a later preset wins on a shared name.
771
- 2. The `labels` record — an entry adds a label, replaces one an earlier layer defined, or removes it (`null`). Replacement is wholesale: an entry omitting `description` resolves to no description rather than inheriting the one an earlier layer supplied.
772
-
773
- `description` is optional throughout, in a preset as in the `labels` record, and `sync-labels init` generates none for a scope label. The generated file spells an absent description `''` because `github-label-sync` reads an omitted description as "leave the label's current one alone"; the empty form clears it.
774
-
775
- Overlaps are never errors; order resolves them, and the committed `.github/labels.yaml` diff is where an unexpected change surfaces at review. The one config error is a dangling `null` — removing a name no preset defines — because that misstatement is invisible in the output diff.
776
-
777
- #### Migrating from `.config/sync-labels.config.ts`
778
-
779
- Label configuration formerly lived in a standalone `.config/sync-labels.config.ts` (`presets` + a `labels` array). To migrate:
780
-
781
- 1. Move the preset list to `repoLabels.extends` in `.config/release-kit.config.ts`.
782
- 2. Convert each `labels` array entry to a `'name': { color }` record entry under `repoLabels.labels`, adding `description` where the label carries one.
783
- 3. Delete `.config/sync-labels.config.ts` and run `release-kit sync-labels generate`.
784
-
785
- The regenerated `.github/labels.yaml` differs only in its `# Source:` header line. Name collisions with preset labels, which the old format rejected, now mean your entry replaces the preset label.
786
-
787
- #### When labels are applied
788
-
789
- The scaffolded workflow carries three triggers:
790
-
791
- | Trigger | Job | Token | Effect |
792
- | --------------------------------------------------------- | ------- | --------------- | --------------------------------- |
793
- | Push to the default branch touching `.github/labels.yaml` | `sync` | `issues: write` | Applies the labels |
794
- | Manual dispatch (`release-kit sync-labels sync`) | `sync` | `issues: write` | Applies the labels |
795
- | Pull request touching `.github/labels.yaml` | `check` | `issues: read` | Logs the diff without applying it |
796
-
797
- Applying on merge closes the window in which a regenerated `.github/labels.yaml` sits unapplied — a window in which a later manual dispatch would apply a label set nobody reviewed.
798
-
799
- The `check` job runs the same sync in dry-run. Its **Label diff** log group lists every create, edit, rename, and deletion the sync would perform, including deletions of labels the file does not declare — the destructive edits a diff of `.github/labels.yaml` alone cannot show, because a label created by hand or by another workflow is absent from the file both before and after. Read that log; the check reports success whether or not the diff is destructive, so a green check is not evidence that nothing will be deleted.
800
-
801
- The two jobs are split because a job's permissions are fixed when the run is created and cannot vary by trigger. The split is what keeps a write-scoped token out of pull-request runs.
802
-
803
- The push trigger filters on the path alone; the `sync` job compares `github.ref_name` against the repository's default branch. The workflow therefore needs no per-repo edit whatever that branch is named — and a push touching `.github/labels.yaml` on any other branch produces a run whose jobs all skip.
804
-
805
- Manual dispatch is not a preview. It matches the `sync` job, so it applies the labels, deletions included; only the pull-request path runs in dry-run.
806
-
807
- #### Dry-run checks on fork pull requests
808
-
809
- GitHub issues a read-only `GITHUB_TOKEN` to pull requests from forks, and by default holds runs from first-time contributors until a maintainer approves them. The dry-run reads labels and writes nothing, so the check normally runs once approved. A repo that disables workflows on fork pull requests gets no check at all; to preview such a change, push the branch to the base repo and open the pull request from there.
810
-
811
- #### Migrating an existing repo
812
-
813
- The caller workflow gained the `push` and `pull_request` triggers after its first release. A repo scaffolded before that keeps working on manual dispatch alone — nothing breaks — but it applies labels only when someone remembers to. To adopt the new shape:
814
-
815
- ```sh
816
- pnpm exec release-kit sync-labels init --force
817
- ```
818
-
819
- `readyup` prompts for this: its `sync-labels.yaml matches template` check fails once the scaffolded workflow no longer matches the current template.
820
-
821
- #### Published JSON Schema for `.meta/label-map.json`
822
-
823
- release-kit publishes a JSON Schema for `.meta/label-map.json` — a separate, generic data file that maps commit-prefix scopes and types to GitHub label names. The schema lives at `packages/release-kit/schemas/label-map.json` in this repo and is reachable via the stable raw URL:
824
-
825
- ```
826
- https://github.com/williamthorsen/node-monorepo-tools/raw/release-kit-v<version>/packages/release-kit/schemas/label-map.json
827
- ```
828
-
829
- Consumers reference it from the top of their `.meta/label-map.json`:
830
-
831
- ```json
832
- {
833
- "$schema": "https://github.com/williamthorsen/node-monorepo-tools/raw/release-kit-v<version>/packages/release-kit/schemas/label-map.json",
834
- "types": { "feat": "feature", "fix": "fix" },
835
- "scopes": { "audit": "scope:audit" }
836
- }
837
- ```
838
-
839
- release-kit publishes the schema only; it does not generate `.meta/label-map.json`. Generation requires commit-prefix knowledge that lives outside release-kit (in agent-conventions tooling), and is owned by those consumers.
840
-
841
- ## GitHub Actions workflow
842
-
843
- The `init` command scaffolds a release workflow at `.github/workflows/release.yaml` that delegates to a reusable release workflow. The scaffolded workflow accepts these inputs:
844
-
845
- | Input | Type | Description |
846
- | ------ | ------ | ------------------------------------------------------------------- |
847
- | `only` | string | Workspaces to release (comma-separated, leave empty for all) |
848
- | `bump` | choice | Override bump type: `patch`, `minor`, `major` (empty = auto-detect) |
849
-
850
- For repos that need a self-contained workflow instead of the reusable one, the scaffolded file can be expanded. The key steps are: checkout with full history (`fetch-depth: 0`), run `release-kit prepare` with optional `--only` and `--bump` flags, check for changes, read tags from `tmp/.release-tags`, then commit, tag, and push.
851
-
852
- ### Triggering a release
853
-
854
- ```sh
855
- # All workspaces
856
- gh workflow run release.yaml
857
-
858
- # Specific workspace(s)
859
- gh workflow run release.yaml -f only=arrays
860
- gh workflow run release.yaml -f only=arrays,strings -f bump=minor
861
- ```
862
-
863
- Or use the GitHub UI: Actions > Release > Run workflow.
864
-
865
- ## cliff.toml setup
866
-
867
- The package includes a bundled `cliff.toml.template` that is used automatically when no custom config is found. The resolution order:
868
-
869
- | Priority | Path | Notes |
870
- | -------- | ----------------------------- | ----------------------------------------------- |
871
- | 1 | `cliffConfigPath` in config | Explicit path, returned without existence check |
872
- | 2 | `.config/git-cliff.toml` | Project-level override |
873
- | 3 | `cliff.toml` | Repo root fallback |
874
- | 4 | Bundled `cliff.toml.template` | Automatic fallback |
875
-
876
- The bundled template provides a generic git-cliff configuration that:
877
-
878
- - Strips issue-ticket prefixes matching `^[A-Z]+-\d+\s+` (e.g., `TOOL-123 `, `AFG-456 `)
879
- - Handles both `type: description` and `workspace|type: description` commit formats
880
- - Groups commits by work type via `[git].commit_parsers`
139
+ ## External dependencies
881
140
 
882
- The body template is intentionally empty: release-kit reads cliff's `--context` JSON output and renders `CHANGELOG.md` in-process via `renderChangelogMarkdown` (see [Editorial overrides](#editorial-overrides) for the rationale). The `[git].commit_parsers` section remains load-bearing for `--context` group assignment.
141
+ This package shells out to two external tools:
883
142
 
884
- To customize, scaffold a local copy with `release-kit init --with-config` and edit `.config/git-cliff.toml`. Edit only the `[git]` section — body-template changes have no effect.
143
+ - **`git`** — must be available on `PATH`. Used to find tags and retrieve commit history.
144
+ - **`git-cliff`** — pinned to an exact version and fetched via `npx` on first invocation, then served from npx's cache. No need to install it as a dev dependency. The pin moves only when a new release-kit version names a newer git-cliff, so two releases cut months apart run the same changelog generator.
885
145
 
886
146
  ## Readiness checks
887
147
 
888
- release-kit publishes two [readyup](https://www.npmjs.com/package/readyup) kits that check a consuming repo against the release it has installed: the `default` kit covers release-kit's own setup — workflows matching the current templates, config free of removed fields, sync-labels wiring — and `npm-auto-publish` covers a repo's OIDC-based npm publishing setup. Both ship inside the package, so they check against the version you installed rather than whatever a repository ref happens to point at, and a check added in a release reaches your repo on upgrade.
889
-
890
- Add `readyup` as a devDependency, then name release-kit in its config:
148
+ release-kit publishes two [readyup](https://www.npmjs.com/package/readyup) kits: `default` checks release-kit's own setup, and `npm-auto-publish` checks OIDC-based npm publishing. Add `readyup` as a devDependency, then name release-kit in its config:
891
149
 
892
150
  ```ts
893
151
  // .config/readyup.config.ts
@@ -899,186 +157,33 @@ export default defineRdyConfig({
899
157
  ```
900
158
 
901
159
  ```bash
902
- rdy run --packages # every kit each listed package publishes
903
- rdy run --from npm:@williamthorsen/release-kit # the default kit alone
904
- rdy run --from npm:@williamthorsen/release-kit npm-auto-publish # the npm-auto-publish kit
905
- rdy list --from npm:@williamthorsen/release-kit # what release-kit publishes
906
- ```
907
-
908
- `--packages` is the form that survives release-kit publishing further kits. Every form needs `readyup` 0.23 or later, and `@williamthorsen/release-kit` as a _direct_ devDependency: a strict pnpm layout links nothing else into the project, so a transitive copy is unreachable.
909
-
910
- `npm-auto-publish` queries the npm registry for each package's trusted publisher, so it needs an authenticated npm session and is meant to be invoked deliberately rather than swept up by an unattended run. Without a login it reports one error naming the missing login and blocks the rest of the `packages` checklist, rather than reporting a trusted-publisher failure for every package.
911
-
912
- These kits are no longer reachable through `rdy run --from github:williamthorsen/node-monorepo-tools`. Repos still using that form should switch to one of the invocations above.
913
-
914
- ## External dependencies
915
-
916
- This package shells out to two external tools:
917
-
918
- - **`git`** — must be available on `PATH`. Used to find tags and retrieve commit history.
919
- - **`git-cliff`** — automatically downloaded and cached via `npx` on first invocation. No need to install it as a dev dependency.
920
-
921
- ## Upgrading from v4 to v5
922
-
923
- Release-kit v5 derives each workspace's tag prefix from its unscoped `package.json` `name`, so a package at `packages/core` with `"name": "@scope/nmr-core"` uses tags like `nmr-core-v1.3.0`. Repos that previously tagged under the directory basename (e.g., `core-v1.3.0`) do not need to rewrite history — declare the prior identity in `legacyIdentities` so release-kit recognizes historical tags under both the new and old prefixes.
924
-
925
- Minimal worked example for a repo whose pre-v5 tags were `core-v0.2.7` and whose npm name has not changed:
926
-
927
- ```typescript
928
- // .config/release-kit.config.ts
929
- import type { ReleaseKitConfig } from '@williamthorsen/release-kit/config';
930
-
931
- const config: ReleaseKitConfig = {
932
- workspaces: [
933
- {
934
- dir: 'core',
935
- legacyIdentities: [{ name: '@scope/nmr-core', tagPrefix: 'core-v' }],
936
- },
937
- ],
938
- };
939
-
940
- export default config;
941
- ```
942
-
943
- Each `legacyIdentity` is a complete `(name, tagPrefix)` snapshot of the workspace at an earlier point. In the common case — the tag-derivation rule changed but the npm name did not — the identity's `name` equals the current `name`. If an earlier publish used a different npm name, use that prior name here.
944
-
945
- Verify with `release-kit show-tag-prefixes` — it prints the derived prefix per workspace, tag counts under each declared legacy prefix, and any undeclared release-shaped prefixes it finds in the repo (with a copy-pasteable config snippet that includes a `TODO-fill-in-legacy-npm-name` placeholder to replace with the prior npm name). After declaring, `release-kit prepare` consults the union of the current and legacy tag prefixes when searching for the most recent baseline tag, and changelog generation matches tags under either prefix.
946
-
947
- See the `legacyIdentities` entry in the [`WorkspaceOverride`](#workspaceoverride) section for the config shape.
948
-
949
- ## Using `deriveWorkspaceConfig()` for manual configuration
950
-
951
- If you need to build a `MonorepoReleaseConfig` manually (e.g., for the legacy script-based approach), the exported `deriveWorkspaceConfig()` helper creates a `WorkspaceConfig` from a workspace-relative path. It reads the workspace's `package.json` to derive the tag prefix from the package name:
952
-
953
- ```typescript
954
- import { deriveWorkspaceConfig } from '@williamthorsen/release-kit';
955
-
956
- // packages/arrays/package.json contains `"name": "@scope/arrays"`
957
- deriveWorkspaceConfig('packages/arrays');
958
- // => {
959
- // dir: 'arrays',
960
- // name: '@scope/arrays',
961
- // tagPrefix: 'arrays-v',
962
- // workspacePath: 'packages/arrays',
963
- // packageFiles: ['packages/arrays/package.json'],
964
- // changelogPaths: ['packages/arrays'],
965
- // paths: ['packages/arrays/**'],
966
- // }
967
- ```
968
-
969
- `dir` is the basename of the workspace path and is the stable internal identifier used by `--only`, `WorkspaceOverride.dir`, and the dependency graph. `tagPrefix` is derived from the unscoped `package.json` `name` — any leading `@scope/` is stripped — so tags reflect the package identity rather than the directory layout. For example, a workspace at `packages/core` with `"name": "@williamthorsen/nmr-core"` produces `tagPrefix: 'nmr-core-v'`, yielding tags like `nmr-core-v1.3.0`.
970
-
971
- The workspace's `package.json` must declare a non-empty `name` field; `deriveWorkspaceConfig()` throws otherwise. If two workspaces produce the same `tagPrefix` (because their unscoped names collide), `mergeMonorepoConfig()` throws and names the colliding workspaces so you can rename one.
972
-
973
- ## Legacy script-based approach
974
-
975
- The CLI-driven approach is recommended for new setups. The script-based approach (using `runReleasePrepare` with a manually maintained config) is still supported for backward compatibility.
976
-
977
- ```typescript
978
- // .github/scripts/release.config.ts
979
- import type { MonorepoReleaseConfig } from '@williamthorsen/release-kit';
980
- import { deriveWorkspaceConfig } from '@williamthorsen/release-kit';
981
-
982
- export const config: MonorepoReleaseConfig = {
983
- workspaces: [deriveWorkspaceConfig('packages/arrays'), deriveWorkspaceConfig('packages/strings')],
984
- formatCommand: 'npx prettier --write',
985
- };
986
- ```
987
-
988
- ```typescript
989
- // .github/scripts/release-prepare.ts
990
- import { runReleasePrepare } from '@williamthorsen/release-kit';
991
- import { config } from './release.config.ts';
992
-
993
- runReleasePrepare(config);
160
+ rdy run --packages
994
161
  ```
995
162
 
996
- The key difference: the script-based approach requires manually listing every workspace, while the CLI auto-discovers them from `pnpm-workspace.yaml`.
997
-
998
- ## Breaking changes
999
-
1000
- ### `resolveReleaseTags` takes workspaces; `WorkspaceConfig` requires `workspacePath`
163
+ `rdy run` needs `readyup` 0.23 or later, and `@williamthorsen/release-kit` as a _direct_ devDependency: a strict pnpm layout links nothing else into the project; therefore, a transitive copy is unreachable.
1001
164
 
1002
- Tag resolution is now driven by workspace records rather than a caller-supplied directory map, so `resolveReleaseTags` can report both the workspace `dir` and its `workspacePath` for every resolved tag.
1003
-
1004
- - `resolveReleaseTags` signature changed from `(workspaceMap?: Map<string, string>)` to `(workspaces?: readonly WorkspaceConfig[])`.
1005
- - `WorkspaceConfig` gained a required `workspacePath: string` field.
1006
-
1007
- Replace direct `Map`-based calls with `deriveWorkspaceConfig()`, which now populates `workspacePath` for you:
1008
-
1009
- ```diff
1010
- -import { resolveReleaseTags } from '@williamthorsen/release-kit';
1011
- -
1012
- -const workspaceMap = new Map([['core', 'packages/core']]);
1013
- -resolveReleaseTags(workspaceMap);
1014
- +import { deriveWorkspaceConfig, resolveReleaseTags } from '@williamthorsen/release-kit';
1015
- +
1016
- +resolveReleaseTags([deriveWorkspaceConfig('packages/core')]);
1017
- ```
1018
-
1019
- If you construct `WorkspaceConfig` objects directly, add `workspacePath` alongside the other required fields.
1020
-
1021
- ### `release-kit publish` and `release-kit push` replace `--only` with `--tags`
1022
-
1023
- The `--only=<dir>` flag on `release-kit publish` and `release-kit push` has been removed. Both commands now filter by full tag name via `--tags=<tag1>[,<tag2>...]`, matching `release-kit create-github-release`. Passing `--only=...` after upgrading produces an `Unknown option: --only` error.
1024
-
1025
- Local usage mapping:
1026
-
1027
- ```diff
1028
- -release-kit publish --only=core
1029
- +release-kit publish --tags=core-v1.3.0
1030
-
1031
- -release-kit push --only=core,cli
1032
- +release-kit push --tags=core-v1.3.0,cli-v0.5.0
1033
- ```
1034
-
1035
- Omitting `--tags` preserves the previous behavior of operating on every release tag at HEAD. The reusable workflow `publish.reusable.yaml` also accepts an optional `tags:` input, and the scaffolded `publish.yaml` now passes `tags: ${{ github.ref_name }}` so the publish scope is explicit rather than relying on `actions/checkout@v6`'s fetch default. Existing callers that do not set `tags:` continue to work unchanged.
1036
-
1037
- ### GitHub Release creation moved to its own command and workflow
1038
-
1039
- `release-kit publish` no longer creates GitHub Releases as a side effect, and the `releaseNotes.shouldCreateGithubRelease` config field has been removed. Adoption is now signaled by installing the dedicated `create-github-release.reusable.yaml` workflow.
1040
-
1041
- If you previously set the field, remove it from `.config/release-kit.config.ts`. The new caller template (scaffolded by `release-kit init`) looks like this:
1042
-
1043
- ```yaml
1044
- name: Create GitHub Release
1045
- on:
1046
- push:
1047
- tags:
1048
- - '*-v[0-9]*.[0-9]*.[0-9]*'
1049
- permissions:
1050
- contents: write
1051
- jobs:
1052
- create-github-release:
1053
- uses: williamthorsen/node-monorepo-tools/.github/workflows/create-github-release.reusable.yaml@workflow/create-github-release-v1
1054
- with:
1055
- tag: ${{ github.ref_name }}
1056
- ```
1057
-
1058
- The CLI command was renamed from `release-kit github-release` to `release-kit create-github-release`, and its filter flag changed from `--only=<package-name>` to `--tags=<full-tag-name>[,...]`.
1059
-
1060
- ### v1.1.0: `formatCommand` receives file paths as trailing arguments
1061
-
1062
- Previously, `formatCommand` was executed as-is (e.g., `pnpm run fmt` would run without arguments). Now, the paths of all modified files (package.json files and changelogs) are appended as trailing arguments.
1063
-
1064
- If your format command does not accept file arguments, update it to one that does:
1065
-
1066
- ```diff
1067
- -formatCommand: 'pnpm run fmt',
1068
- +formatCommand: 'npx prettier --write',
1069
- ```
1070
-
1071
- ### v1.1.0: `git-cliff` is no longer a required dev dependency
1072
-
1073
- `git-cliff` is now invoked via `npx --yes git-cliff` instead of requiring it as a dev dependency. You can remove it from your `devDependencies`. The version is not pinned, so `npx` downloads and caches the latest version on first invocation. To pin a specific version, use `npx --yes git-cliff@2.12.0` by wrapping the call in a custom script.
165
+ [Readiness checks](docs/readiness-checks.md) covers running each kit alone and what `npm-auto-publish` needs from the npm session.
1074
166
 
1075
167
  ## Migration from changesets
1076
168
 
1077
169
  1. Add `@williamthorsen/release-kit` as a dev dependency.
1078
170
  2. Remove `@changesets/cli` from dev dependencies. The [default readyup kit](#readiness-checks) reports a repo that still declares it.
1079
171
  3. Delete the `.changeset/` directory.
1080
- 4. Run `npx @williamthorsen/release-kit init` to scaffold workflow and config files.
172
+ 4. Run `npx @williamthorsen/release-kit init` to scaffold the release workflows.
1081
173
  5. Remove `changeset:*` scripts from `package.json` (no replacement needed — the CLI handles everything).
1082
174
  6. Create an initial version tag for each package (e.g., `git tag v1.0.0` or `git tag arrays-v1.0.0`).
1083
175
 
1084
176
  No cliff config copy is needed — the bundled template is used automatically. To customize, run `release-kit init --with-config`.
177
+
178
+ ## Documentation
179
+
180
+ - [Configuration](docs/configuration.md): `ReleaseKitConfig` fields, workspace overrides and legacy identities, retired packages, tag prefixes, and version patterns
181
+ - [Project releases](docs/project-releases.md): the `project` block, and how a project release interacts with `prepare`'s flags
182
+ - [Releasing](docs/releasing.md): `init`, `prepare`'s flags and release-notes previews, and the release workflow
183
+ - [Publishing](docs/publishing.md): `publish`, the publishability filter, and `create-github-release`
184
+ - [Changelogs](docs/changelogs.md): the `changelog.json` item schema, the git-cliff config, and release-notes injection
185
+ - [Editorial overrides](docs/editorial-overrides.md): correcting generated changelog entries, and `overrides validate`
186
+ - [Work types and tiers](docs/work-types.md): tiers, the `!` policy, markers, custom work types, and `work-types check` and `sync`
187
+ - [Labels](docs/labels.md): `sync-labels`, label configuration, the workflow's triggers, and the `label-map.json` schema
188
+ - [Readiness checks](docs/readiness-checks.md): both readyup kits, and how to run each
189
+ - [Programmatic API](docs/api.md): `deriveWorkspaceConfig()`, the script-based approach, and `resolveReleaseTags`