@williamthorsen/release-kit 12.0.0 → 13.0.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 (168) hide show
  1. package/.meta/changelog.json +212 -0
  2. package/.readyup/kits/default.js +18 -17
  3. package/.readyup/kits/npm-auto-publish.js +24 -23
  4. package/.readyup/manifest.json +16 -11
  5. package/CHANGELOG.md +58 -0
  6. package/README.md +55 -48
  7. package/bin/release-kit.js +1 -1
  8. package/dist/esm/assertCleanWorkingTree.d.ts +1 -5
  9. package/dist/esm/assertTaggedBaseline.d.ts +29 -0
  10. package/dist/esm/assertTaggedBaseline.js +41 -0
  11. package/dist/esm/attachChangelogDiagnostics.d.ts +1 -1
  12. package/dist/esm/attachChangelogDiagnostics.js +3 -0
  13. package/dist/esm/bin/release-kit.js +85 -22
  14. package/dist/esm/buildChangelogEntries.d.ts +23 -13
  15. package/dist/esm/buildChangelogEntries.js +36 -17
  16. package/dist/esm/buildDependencyGraph.d.ts +6 -6
  17. package/dist/esm/buildEmptyReleaseEntry.d.ts +1 -8
  18. package/dist/esm/buildReleaseSummary.d.ts +2 -8
  19. package/dist/esm/buildSyntheticChangelogEntry.d.ts +3 -5
  20. package/dist/esm/buildSyntheticChangelogEntry.js +2 -2
  21. package/dist/esm/bumpVersion.d.ts +1 -8
  22. package/dist/esm/changelogJsonFile.d.ts +5 -7
  23. package/dist/esm/changelogJsonFile.js +2 -17
  24. package/dist/esm/changelogJsonUtils.d.ts +7 -10
  25. package/dist/esm/changelogOverrides.d.ts +59 -98
  26. package/dist/esm/classifyChangelogCommit.d.ts +7 -9
  27. package/dist/esm/classifyChangelogCommit.js +3 -2
  28. package/dist/esm/commitCommand.d.ts +2 -4
  29. package/dist/esm/compareVersions.d.ts +10 -4
  30. package/dist/esm/compareVersions.js +16 -0
  31. package/dist/esm/configFlagSchema.d.ts +1 -1
  32. package/dist/esm/createGithubRelease.d.ts +7 -19
  33. package/dist/esm/createGithubReleaseCommand.d.ts +5 -5
  34. package/dist/esm/createGithubReleaseCommand.js +9 -9
  35. package/dist/esm/createTags.d.ts +2 -3
  36. package/dist/esm/decideRelease.d.ts +2 -6
  37. package/dist/esm/defaults.d.ts +5 -24
  38. package/dist/esm/defaults.js +4 -5
  39. package/dist/esm/defineConfig.d.ts +1 -1
  40. package/dist/esm/deleteFileIfExists.d.ts +1 -1
  41. package/dist/esm/deriveReleaseNotesConfig.d.ts +20 -0
  42. package/dist/esm/deriveReleaseNotesConfig.js +21 -0
  43. package/dist/esm/deriveWorkspaceConfig.d.ts +3 -5
  44. package/dist/esm/detectPackageManager.d.ts +2 -4
  45. package/dist/esm/detectUndeclaredTagPrefixes.d.ts +4 -6
  46. package/dist/esm/detectUndeclaredTagPrefixes.js +1 -1
  47. package/dist/esm/determineBumpType.d.ts +1 -1
  48. package/dist/esm/discoverWorkspaces.d.ts +14 -15
  49. package/dist/esm/discoverWorkspaces.js +12 -12
  50. package/dist/esm/enterRepoRoot.d.ts +12 -0
  51. package/dist/esm/enterRepoRoot.js +16 -0
  52. package/dist/esm/enumerateReleaseWindows.d.ts +8 -8
  53. package/dist/esm/extractMigration.d.ts +6 -8
  54. package/dist/esm/findUnroutedEntryScopes.d.ts +16 -0
  55. package/dist/esm/findUnroutedEntryScopes.js +57 -0
  56. package/dist/esm/formatExcludedSkip.d.ts +3 -0
  57. package/dist/esm/formatExcludedSkip.js +3 -0
  58. package/dist/esm/formatPrivateSkip.d.ts +1 -6
  59. package/dist/esm/generateChangelogs.d.ts +10 -5
  60. package/dist/esm/glyphs.d.ts +1 -1
  61. package/dist/esm/help/prepareHelp.d.ts +3 -4
  62. package/dist/esm/help/prepareHelp.js +4 -3
  63. package/dist/esm/init/checks.d.ts +3 -3
  64. package/dist/esm/init/checks.js +4 -1
  65. package/dist/esm/init/detectRepoType.d.ts +2 -3
  66. package/dist/esm/init/hasProvenance.d.ts +2 -0
  67. package/dist/esm/init/hasProvenance.js +3 -0
  68. package/dist/esm/init/initCommand.d.ts +3 -6
  69. package/dist/esm/init/initCommand.js +10 -10
  70. package/dist/esm/init/parseJsonRecord.d.ts +1 -4
  71. package/dist/esm/init/scaffold.d.ts +1 -1
  72. package/dist/esm/init/templates.d.ts +9 -11
  73. package/dist/esm/init/templates.js +12 -11
  74. package/dist/esm/init/updateTemplatesCommand.d.ts +13 -0
  75. package/dist/esm/init/updateTemplatesCommand.js +64 -0
  76. package/dist/esm/injectReleaseNotesIntoReadme.d.ts +12 -17
  77. package/dist/esm/injectSection.d.ts +3 -3
  78. package/dist/esm/loadConfig.d.ts +16 -14
  79. package/dist/esm/loadConfig.js +2 -2
  80. package/dist/esm/loadValidatedConfig.d.ts +16 -19
  81. package/dist/esm/loadValidatedConfig.js +6 -1
  82. package/dist/esm/packsPath.d.ts +9 -9
  83. package/dist/esm/parseChangeRecordBlock.d.ts +2 -2
  84. package/dist/esm/parseCommitMessage.d.ts +17 -32
  85. package/dist/esm/parseCommitMessage.js +28 -37
  86. package/dist/esm/parseRequestedTags.d.ts +3 -3
  87. package/dist/esm/planReleaseNotesPreviews.d.ts +6 -6
  88. package/dist/esm/planVersionBump.d.ts +5 -3
  89. package/dist/esm/planVersionBump.js +3 -0
  90. package/dist/esm/prepareCommand.d.ts +4 -7
  91. package/dist/esm/prepareCommand.js +13 -6
  92. package/dist/esm/previewTagPrefixes.d.ts +8 -10
  93. package/dist/esm/propagateBumps.d.ts +6 -7
  94. package/dist/esm/publish.d.ts +1 -1
  95. package/dist/esm/publishCommand.d.ts +4 -3
  96. package/dist/esm/publishCommand.js +8 -8
  97. package/dist/esm/pushCommand.d.ts +4 -3
  98. package/dist/esm/pushCommand.js +8 -2
  99. package/dist/esm/pushRelease.d.ts +2 -2
  100. package/dist/esm/readChangelogSections.d.ts +33 -0
  101. package/dist/esm/readChangelogSections.js +80 -0
  102. package/dist/esm/releaseFiles.d.ts +5 -7
  103. package/dist/esm/releasePlan.d.ts +11 -13
  104. package/dist/esm/releasePrepare.d.ts +23 -22
  105. package/dist/esm/releasePrepare.js +31 -11
  106. package/dist/esm/releasePrepareMono.d.ts +9 -7
  107. package/dist/esm/releasePrepareMono.js +85 -33
  108. package/dist/esm/releasePrepareProject.d.ts +19 -29
  109. package/dist/esm/releasePrepareProject.js +31 -12
  110. package/dist/esm/renderChangelogMarkdown.d.ts +10 -4
  111. package/dist/esm/renderChangelogMarkdown.js +27 -2
  112. package/dist/esm/renderReleaseNotes.d.ts +3 -11
  113. package/dist/esm/renderReleaseNotes.js +2 -6
  114. package/dist/esm/reportPrepare.d.ts +4 -5
  115. package/dist/esm/reportPrepare.js +33 -19
  116. package/dist/esm/resolveCommandTags.d.ts +15 -11
  117. package/dist/esm/resolveCommandTags.js +35 -5
  118. package/dist/esm/resolveConfigFlag.d.ts +7 -0
  119. package/dist/esm/resolveConfigFlag.js +4 -0
  120. package/dist/esm/resolveReleaseTags.d.ts +6 -8
  121. package/dist/esm/resolveReleaseTags.js +1 -1
  122. package/dist/esm/resolveStylesOrExit.d.ts +2 -2
  123. package/dist/esm/showTagPrefixesCommand.d.ts +7 -10
  124. package/dist/esm/showTagPrefixesCommand.js +4 -4
  125. package/dist/esm/stripEmojiPrefix.d.ts +1 -0
  126. package/dist/esm/stripScope.d.ts +2 -2
  127. package/dist/esm/stripScope.js +3 -3
  128. package/dist/esm/sync-labels/generateCommand.d.ts +11 -10
  129. package/dist/esm/sync-labels/generateCommand.js +11 -8
  130. package/dist/esm/sync-labels/initCommand.d.ts +6 -7
  131. package/dist/esm/sync-labels/initCommand.js +2 -2
  132. package/dist/esm/sync-labels/presets.d.ts +5 -4
  133. package/dist/esm/sync-labels/presets.js +9 -9
  134. package/dist/esm/sync-labels/resolveLabels.d.ts +7 -7
  135. package/dist/esm/sync-labels/resolveLabels.js +1 -1
  136. package/dist/esm/sync-labels/retiredConfig.d.ts +4 -5
  137. package/dist/esm/sync-labels/syncCommand.d.ts +1 -4
  138. package/dist/esm/sync-labels/templates.d.ts +3 -3
  139. package/dist/esm/sync-labels/templates.js +3 -3
  140. package/dist/esm/sync-labels/typeLabels.d.ts +14 -0
  141. package/dist/esm/sync-labels/typeLabels.js +38 -0
  142. package/dist/esm/sync-labels/types.d.ts +1 -1
  143. package/dist/esm/tagCommand.d.ts +1 -1
  144. package/dist/esm/typeGuards.d.ts +2 -2
  145. package/dist/esm/types.d.ts +116 -91
  146. package/dist/esm/types.js +1 -1
  147. package/dist/esm/validateConfig.d.ts +2 -11
  148. package/dist/esm/validateConfig.js +2 -2
  149. package/dist/esm/validateOnlyExcludesStrandedDependents.d.ts +14 -12
  150. package/dist/esm/validateOverridesCommand.d.ts +17 -20
  151. package/dist/esm/validateOverridesCommand.js +1 -1
  152. package/docs/api.md +6 -6
  153. package/docs/changelogs.md +63 -40
  154. package/docs/configuration.md +29 -27
  155. package/docs/editorial-overrides.md +23 -23
  156. package/docs/labels.md +21 -19
  157. package/docs/project-releases.md +13 -13
  158. package/docs/publishing.md +5 -5
  159. package/docs/readiness-checks.md +3 -3
  160. package/docs/releasing.md +50 -25
  161. package/docs/work-types.md +41 -57
  162. package/package.json +7 -6
  163. package/presets/labels/common.yaml +1 -41
  164. package/dist/esm/resolveReleaseNotesConfig.d.ts +0 -26
  165. package/dist/esm/resolveReleaseNotesConfig.js +0 -29
  166. package/dist/esm/workTypesData.d.ts +0 -50
  167. package/dist/esm/workTypesData.js +0 -145
  168. package/schemas/label-map.json +0 -24
package/README.md CHANGED
@@ -7,39 +7,42 @@ Version-bumping and changelog-generation toolkit for release workflows.
7
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 the same commit history that decides each bump (with optional [editorial overrides](docs/editorial-overrides.md)).
8
8
 
9
9
  <!-- section:release-notes -->
10
- ## Release notes — v12.0.0 (2026-09-23)
10
+ ## Release notes — v13.0.0 (2026-10-01)
11
11
 
12
12
  ### 🎉 Features
13
13
 
14
- - Assign changelog sections from the work-type taxonomy (#877)
15
-
16
- - Adds `excludedFromChangelog` to a `workTypes` entry, which keeps commits of that type out of every changelog while they still count toward the version bump.
17
- - Fixes the silent omission of a ticketed commit written as `type(scope):` or with a capitalized type such as `FEAT:`, which counted toward the version bump but reached no changelog.
18
- - Documents that a scaffolded `.config/git-cliff.toml` may vary its enumeration keys alone: a `commit_parsers` entry that skips or narrows drops the commit before classification, with no error.
19
-
20
- - Build changelog items from a merge commit's change-record block (#882)
21
-
22
- Builds `release-kit` changelog items from a commit's `change-record` block, the fenced YAML block at the end of a squash-merge commit that lists the change's outcomes, so that a merge with several outcomes of different types yields one item per outcome, each under its own type's section. Makes `release-kit prepare` warn about a block that cannot be read, an entry whose type is undeclared, and an entry that violates its type's breaking policy. Keeps reading a commit with no usable block from its title, as before.
23
-
24
- - 🚨 **Breaking:** Derive the version bump from the changelog items (#885)
25
-
26
- Derives the version bump in every `release-kit prepare` path (single-package, project, and monorepo) from the changelog items of the unreleased commits, so that the bump and the changelog describe the same release. A commit that yields no changelog item no longer bumps, and a `BREAKING CHANGE:` footer no longer raises a major bump. Single-package mode now follows the monorepo rules for `--bump` and `--force`, and the `prepare` report shows the diagnostics of a skipped target.
27
-
28
- Migration: Mark a breaking change with a `!` on the commit subject or with `breaking: true` on its change-record entry, because a `BREAKING CHANGE:` footer alone now gets the bump of the commit's type. Give each commit that should bump a ticket-ID prefix and a type that the changelog does not exclude. In single-package mode, add `--force` to a release that used `--bump=X` alone, or that relied on the patch floor, when no commit yields a changelog item; without it, `prepare` skips the release.
29
-
30
- - 🚨 **Breaking:** Key an editorial override to one of several items on a commit (#886)
31
-
32
- Adds the `<hash>:<n>` key to `.meta/changelog-overrides.json`. It targets one of the several changelog items that a commit's change-record block yields, while a bare `<hash>` key still targets all of them. Also makes `release-kit prepare` and `release-kit overrides validate` fail when override keys conflict on an item, and publishes a JSON Schema for the override file.
33
-
34
- Migration: Replace a bare key that sets `description` or `body` on a commit with several items with one `<hash>:<n>` key per item, as listed by the error message. Where two keys match the same item, such as `abc1234` beside `abc1234:2`, remove one of them. This includes a root-file key that overlaps a workspace-file key, which now fails even though the two files are separate. In each scope passed to `validateAllChangelogOverrides`, rename `hashes` to `items` and pass `OverrideTargetItem` objects (`{ hash, entry? }`) instead of hash strings.
14
+ - Adds the `--config <path>` flag to `release-kit push`, which now reads the config as `publish` and `create-github-release` do and fails when the file exists but is invalid. (#895)
15
+ - Makes `release-kit` add an item derived from a change-record entry to a workspace's changelog and version bump only when the entry's `scopes`, after `scopeAliases` resolution, name the workspace's `dir`, are empty, or contain `*`, and extends that rule to the sections of earlier releases that `release-kit prepare` rebuilds. (#896)
16
+ - Adds a warning to the `release-kit prepare` report that lists each change-record entry scope matching no workspace in its commit's window, such as a misspelled scope or the old name of a renamed directory that has no `scopeAliases` entry. (#896)
17
+ - Makes `release-kit overrides validate` check a workspace's overrides against only the entries routed to that workspace, so that an override keyed to an entry routed elsewhere is reported as stale. (#896)
18
+ - Adds `release-kit update-templates`, which writes each scaffolded workflow that is missing or differs from the installed template, prints a diff of each updated file, refreshes `sync-labels.yaml` only when it exists, keeps `publish.yaml`'s provenance setting, and never reads or writes the config files. (#952)
19
+ - Changes the readyup kits' fix messages for a workflow that differs from its template, or that references a deprecated tag, to recommend `update-templates` rather than `init --force`. (#952)
35
20
 
36
21
  ### 🪦 Removed
37
22
 
38
- - 🚨 **Breaking:** Build changelogs from release-kit's own enumeration and remove git-cliff (#880)
39
-
40
- Removes git-cliff from `@williamthorsen/release-kit`: `prepare` now builds every changelog from the same commit history that decides each version bump, and no longer fetches a git-cliff binary through `npx`. A config that still sets `cliffConfigPath` now fails validation. Two ways in which the changelog and the bump read different commits are gone, affecting single-package repositories with a tag prefix other than `v` and `paths` entries that name a bare directory.
41
-
42
- Migration: Remove `cliffConfigPath` from `.config/release-kit.config.ts`, and delete `.config/git-cliff.toml` or `cliff.toml` if the repository has one. Any customization in that file, such as `tag_pattern` or its tag-skipping keys, no longer has an effect: `release-kit` now splits the changelog on the configured tag prefixes alone.
23
+ - 🚨 **Breaking:** Removes `required` as a `breakingPolicies` value, making `drop` default to `optional` so that an unmarked `drop:` commit no longer reports a policy violation. (#905)
24
+ - Stops `release-kit` from parsing a commit subject that combines a pipe scope with a parenthesized scope, such as `web|feat(other): ...`, or that lacks a space and a title after the colon, because subjects are now read through `@williamthorsen/change-grammar`. (#905)
25
+ - Stops publishing `schemas/label-map.json` from `release-kit`, whose identical schema `@williamthorsen/change-grammar` now publishes; URLs under existing `release-kit-v*` tags keep resolving. (#905)
26
+
27
+ ### 🐛 Bug fixes
28
+
29
+ - Record a changelog entry for a forced release whose commits yield no item (#887)
30
+
31
+ Makes `release-kit prepare` record the "Forced version bump." changelog entry for any release forced by `--force` or `--set-version` whose commits yield no changelog item, instead of only for a release with no commits at all. It also stops a monorepo's project release from dropping the forced-release entries that earlier releases recorded.
32
+
33
+ - Stops `release-kit prepare` from reporting `commitCount` 0 and dropping the unparseable commits and change-record and policy diagnostics of a workspace released only because a dependency was bumped, and makes `prepare` list that workspace's commits in the release commit summary under its tag. (#888)
34
+ - Stops `release-kit prepare` from labeling a direct release that has no commits as bumped via a dependency, by marking a propagation-only release with the new `propagatedOnly` result field, whose report line now reads `Bumped via dependency: …` in place of `0 commits (bumped via dependency: …)`. (#888)
35
+ - Stops a `release-kit` command run from inside a package from releasing that package as a single-package repo with its own tag and changelog, by running every command from the repo root: the nearest directory that contains `pnpm-workspace.yaml`, or else the working directory when it contains a `package.json`. (#893)
36
+ - Stops `sync-labels generate` from writing the `--config` path into the `.github/labels.yaml` header as typed, which made the header and the result of `generate --check` depend on the directory from which the command ran; the header now names the config by its path relative to the repo root. (#893)
37
+ - Stops `push`, `publish`, and `create-github-release` from pushing, publishing, or creating a GitHub Release for a tag on HEAD whose workspace the config excludes with `shouldExclude: true`, which each command now skips with a warning, including when `--tags` names the tag or when every tag on HEAD is excluded. (#895)
38
+ - Stops `release-kit prepare` from silently deleting a `CHANGELOG.md` section whose version is absent from both the release windows and `changelog.json`, such as history written by hand before release-kit was adopted; `prepare` now keeps that section verbatim in version order, lists the kept versions in its report, and warns about each `##` section that names no version and is dropped. (#897)
39
+ - Stops `release-kit prepare` from folding every earlier commit into the new version, and deriving the bump from all of them, when the current version was released and recorded in the changelog but never tagged; `prepare` now fails before any write, under `--force` and `--set-version` too, and names each target and the tag to create. (#897)
40
+ - Adds the missing `removal` and `formatting` labels to the `common` preset by defining a label for every work type in change-grammar's taxonomy, and keeps the names, colors, and descriptions of the existing type labels. (#906)
41
+ - Fixes the `release.yaml` generated by `release-kit init`, which `actionlint` rejected because its `bump` choice input listed an empty string as the auto-detect option, by offering `auto` as the default option and passing it to the reusable release workflow as an empty `bump`. (#936)
42
+ - Rewords the error messages, `prepare` report lines, command help, and readyup kit fix strings of `release-kit` that addressed the reader as "your", separated a detail from its subject with an em-dash, or stated an absence with "no", such as "No workspaces had release-worthy changes." (#937)
43
+ - Fixes the issue that the `release.yaml` and `sync-labels.yaml` workflows generated by `release-kit init` and `release-kit sync-labels init` contained unclear wording in two comments and in the `force` input description, which the change rewrites without altering any job, trigger, or input; the release-kit kit check reports a copy generated before this change as stale until `release-kit init --force` or `release-kit sync-labels init --force` regenerates it. (#946)
44
+ - Fixes the issue that `release-kit` titled a propagation-only bump's changelog section `Dependency updates` rather than with the resolved `deps` work type's header, `📦 Dependencies` by default or a consumer's `workTypes.deps.header` override, which broke the heading convention and left the section outside the section order. (#950)
45
+ - Fixes the issue that `release-kit init`'s next steps told a public repo to set `provenance: true` in `publish.yaml`, which the template already sets, and now tells a private repo to remove it instead. (#952)
43
46
  <!-- /section:release-notes -->
44
47
 
45
48
  ## Installation
@@ -63,7 +66,7 @@ npx @williamthorsen/release-kit prepare --dry-run
63
66
  Example output from `prepare --dry-run` in a monorepo whose `arrays` workspace has two commits since its last release:
64
67
 
65
68
  ```
66
- 🔍 DRY RUN — no files will be modified
69
+ 🔍 DRY RUN: release-kit will not modify any files
67
70
 
68
71
  ━━━ arrays ━━━
69
72
  Found 2 commits since arrays-v1.2.0
@@ -88,17 +91,21 @@ gh workflow run release.yaml # every workspace with release-wor
88
91
  gh workflow run release.yaml -f only=arrays # the named workspaces alone
89
92
  ```
90
93
 
94
+ After upgrading release-kit, run `release-kit update-templates` to update the scaffolded workflows to its templates; it leaves the config files alone.
95
+
91
96
  The CLI applies defaults to every discovered workspace. [Releasing](docs/releasing.md) covers `prepare`'s flags, release-notes previews, and the workflow's inputs.
92
97
 
93
98
  ## How it works
94
99
 
95
- 1. **Workspace discovery**: reads `pnpm-workspace.yaml` and resolves its `packages` patterns to find workspace directories, applying pnpm's semantics — a `!`-prefixed entry excludes what it matches, wherever it appears in the list. Each directory containing a `package.json` becomes a workspace. The repo is treated as a single-package project when it holds no workspace file, and when the workspace file declares no `packages` list — a file kept for `catalog:` or `overrides:` alone, which pnpm likewise resolves to the root package. A workspace file that declares patterns resolving to no package is an error naming the condition that emptied it.
96
- 2. **Config loading**: loads `.config/release-kit.config.ts` (if present), or the file named by `--config`, and merges it with discovered defaults.
97
- 3. **Commit analysis**: for each workspace, reads the history once, builds the changelog items of the commits since the last version tag, and takes the bump as the highest level that those items call for.
98
- 4. **Version bump + changelog**: bumps `package.json` versions, builds structured `ChangelogEntry[]` from the commits between each pair of release tags, 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, so the two always agree.
99
- 5. **Release tags file**: writes computed tags to `tmp/.release-tags` for the release workflow to read when tagging and pushing.
100
+ Every command other than `--version` and `--help` first locates the repo root and runs from it, so it can be invoked from any directory in the repo. The root is the nearest directory at or above the invocation directory that contains `pnpm-workspace.yaml`, or else the invocation directory itself when it contains a `package.json`; when neither exists, the command fails. Because a `pnpm-workspace.yaml` takes precedence wherever it is, as it does for pnpm, a single-package repo checked out below a pnpm workspace resolves to that outer workspace.
101
+
102
+ 1. **Workspace discovery**: Reads `pnpm-workspace.yaml` and resolves its `packages` patterns to find workspace directories, applying pnpm's semantics: A `!`-prefixed entry excludes what it matches, wherever it appears in the list. Each directory containing a `package.json` becomes a workspace. The repo is treated as a single-package project when it doesn't contain a workspace file, and when the workspace file doesn't declare a `packages` list: a file kept for `catalog:` or `overrides:` alone, which pnpm likewise resolves to the root package. A workspace file that declares patterns that don't resolve to any package is an error naming the condition that emptied it.
103
+ 2. **Config loading**: Loads `.config/release-kit.config.ts` (if present) from the repo root, or the file named by `--config` relative to the invocation directory, and merges it with discovered defaults.
104
+ 3. **Commit analysis**: For each workspace, reads the history once, builds the changelog items of the commits since the last version tag, and takes the bump as the highest level that those items call for.
105
+ 4. **Version bump + changelog**: Bumps `package.json` versions, builds structured `ChangelogEntry[]` from the commits between each pair of release tags, 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, so the two always agree.
106
+ 5. **Release tags file**: Writes computed tags to `tmp/.release-tags` for the release workflow to read when tagging and pushing.
100
107
 
101
- [Changelogs](docs/changelogs.md) covers what reaches a published tarball, the `changelog.json` item schema, and which commits reach a changelog.
108
+ [Changelogs](docs/changelogs.md) covers what a published tarball includes, the `changelog.json` item schema, and which commits appear in a changelog.
102
109
 
103
110
  ## Commit format
104
111
 
@@ -113,15 +120,15 @@ scope|type!: description # scoped breaking change
113
120
  type(scope)!: description # conventional scoped breaking change
114
121
  ```
115
122
 
116
- 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.
123
+ The `scope|type:` format scopes a commit to a specific workspace in a monorepo. Use `scopeAliases` in the config to map shorthand names to canonical scope names.
117
124
 
118
125
  [Work types and tiers](docs/work-types.md) lists the recognized types and how each one affects the bump and the changelog.
119
126
 
120
127
  ## Configuration
121
128
 
122
- 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.
129
+ Configuration is optional. The CLI works out of the box by auto-discovering workspaces and applying defaults. Create `.config/release-kit.config.ts` only to customize behavior.
123
130
 
124
- Every subcommand that reads a config accepts `--config <path>` to read a file elsewhere. An absent default path means "no config"; an absent `--config` path fails the command. See [Config file location](docs/configuration.md#config-file-location).
131
+ Every subcommand that reads a config accepts `--config <path>` to read a file elsewhere. An absent default path means that the repo doesn't declare a config; an absent `--config` path fails the command. See [Config file location](docs/configuration.md#config-file-location).
125
132
 
126
133
  ```typescript
127
134
  import { defineConfig } from '@williamthorsen/release-kit/config';
@@ -141,9 +148,9 @@ export default defineConfig({
141
148
  });
142
149
  ```
143
150
 
144
- `defineConfig` is a type-safe identity function: it gives the config object validation and completion in `.ts` files and full inference in `.js` ones. The loader also accepts a plain `export default config` or `export const config = { ... }`.
151
+ `defineConfig` is a type-safe identity function: It gives the config object validation and completion in `.ts` files and full inference in `.js` ones. The loader also accepts a plain `export default config` or `export const config = { ... }`.
145
152
 
146
- Node loads the file directly, so a relative import inside it needs an explicit file extension — `./work-types.ts`, not `./work-types`.
153
+ Node loads the file directly, so a relative import inside it needs an explicit file extension: `./work-types.ts`, not `./work-types`.
147
154
 
148
155
  [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.
149
156
 
@@ -168,7 +175,7 @@ export default defineRdyConfig({
168
175
  rdy run --packages
169
176
  ```
170
177
 
171
- `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.
178
+ `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.
172
179
 
173
180
  [Readiness checks](docs/readiness-checks.md) covers running each kit alone and what `npm-auto-publish` needs from the npm session.
174
181
 
@@ -178,18 +185,18 @@ rdy run --packages
178
185
  2. Remove `@changesets/cli` from dev dependencies. The [default readyup kit](#readiness-checks) reports a repo that still declares it.
179
186
  3. Delete the `.changeset/` directory.
180
187
  4. Run `npx @williamthorsen/release-kit init` to scaffold the release workflows.
181
- 5. Remove `changeset:*` scripts from `package.json` (no replacement needed — the CLI handles everything).
188
+ 5. Remove `changeset:*` scripts from `package.json` (they don't need a replacement, because the CLI handles everything).
182
189
  6. Create an initial version tag for each package (e.g., `git tag v1.0.0` or `git tag arrays-v1.0.0`).
183
190
 
184
191
  ## Documentation
185
192
 
186
193
  - [Configuration](docs/configuration.md): `ReleaseKitConfig` fields, workspace overrides and legacy identities, retired packages, tag prefixes, and version patterns
187
- - [Project releases](docs/project-releases.md): the `project` block, and how a project release interacts with `prepare`'s flags
188
- - [Releasing](docs/releasing.md): `init`, `prepare`'s flags and release-notes previews, and the release workflow
194
+ - [Project releases](docs/project-releases.md): The `project` block, and how a project release interacts with `prepare`'s flags
195
+ - [Releasing](docs/releasing.md): `init`, `update-templates`, `prepare`'s flags and release-notes previews, and the release workflow
189
196
  - [Publishing](docs/publishing.md): `publish`, the publishability filter, and `create-github-release`
190
- - [Changelogs](docs/changelogs.md): the `changelog.json` item schema, which commits reach a changelog, and release-notes injection
191
- - [Editorial overrides](docs/editorial-overrides.md): correcting generated changelog entries, and `overrides validate`
192
- - [Work types and tiers](docs/work-types.md): tiers, the `!` policy, markers, custom work types, and maintenance of the bundled taxonomy
193
- - [Labels](docs/labels.md): `sync-labels`, label configuration, the workflow's triggers, and the `label-map.json` schema
194
- - [Readiness checks](docs/readiness-checks.md): both readyup kits, and how to run each
197
+ - [Changelogs](docs/changelogs.md): The `changelog.json` item schema, which commits appear in a changelog, and release-notes injection
198
+ - [Editorial overrides](docs/editorial-overrides.md): Correcting generated changelog entries, and `overrides validate`
199
+ - [Work types and tiers](docs/work-types.md): Tiers, the `!` policy, markers, and custom work types
200
+ - [Labels](docs/labels.md): `sync-labels`, label configuration, the workflow's triggers, and where the `label-map.json` schema is published
201
+ - [Readiness checks](docs/readiness-checks.md): Both readyup kits, and how to run each
195
202
  - [Programmatic API](docs/api.md): `deriveWorkspaceConfig()`, the script-based approach, and `resolveReleaseTags`
@@ -3,7 +3,7 @@ try {
3
3
  await import('../dist/esm/bin/release-kit.js');
4
4
  } catch (error) {
5
5
  if (error.code === 'ERR_MODULE_NOT_FOUND') {
6
- process.stderr.write('release-kit: build output not found — run `nmr build` first\n');
6
+ process.stderr.write('release-kit: build output not found; run `nmr build` first\n');
7
7
  } else {
8
8
  process.stderr.write(`release-kit: failed to load: ${error.message}\n`);
9
9
  }
@@ -1,6 +1,2 @@
1
- /**
2
- * Verify that the git working tree has no uncommitted changes.
3
- *
4
- * @throws If `git status --porcelain` reports any changes.
5
- */
1
+ /** Throws if `git status --porcelain` reports any uncommitted change in the working tree. */
6
2
  export declare function assertCleanWorkingTree(): void;
@@ -0,0 +1,29 @@
1
+ import type { ReleaseConfig } from './types.js';
2
+ /** A release target whose history `prepare` has read, as the baseline check sees it. */
3
+ export interface BaselineTarget {
4
+ /** How the error names the target, such as `workspace 'core'`. */
5
+ label: string;
6
+ packageFiles: readonly string[];
7
+ changelogPaths: readonly string[];
8
+ /** The prefixes under which the history was read; a missing tag is named under the first. */
9
+ tagPrefixes: readonly string[];
10
+ previousTag: string | undefined;
11
+ }
12
+ /** A target whose current version is recorded in its changelog but is not its previous reachable tag. */
13
+ export interface UntaggedBaseline {
14
+ label: string;
15
+ version: string;
16
+ /** The tag to create at the commit that released `version`. */
17
+ tag: string;
18
+ }
19
+ /**
20
+ * Throws when any finding is an untagged baseline, naming each one's missing tag. Without that tag, the unreleased
21
+ * window extends back to the start of history, so the new version would include every earlier commit.
22
+ */
23
+ export declare function assertTaggedBaseline(findings: ReadonlyArray<UntaggedBaseline | undefined>): void;
24
+ /**
25
+ * Returns the target's untagged baseline: its current version appears in one of its `CHANGELOG.md` or
26
+ * `changelog.json` files, and its previous tag is not that version under any of its prefixes. A first release has
27
+ * none, because its changelogs do not record its version yet.
28
+ */
29
+ export declare function findUntaggedBaseline(target: BaselineTarget, config: Pick<ReleaseConfig, 'changelogJson'>): UntaggedBaseline | undefined;
@@ -0,0 +1,41 @@
1
+ import { join } from 'node:path';
2
+ import { resolveChangelogJsonPath } from "./changelogJsonFile.js";
3
+ import { readChangelogEntries } from "./changelogJsonUtils.js";
4
+ import { readCurrentVersion } from "./planVersionBump.js";
5
+ import { readChangelogSections } from "./readChangelogSections.js";
6
+ export function assertTaggedBaseline(findings) {
7
+ const untagged = findings.filter((finding) => finding !== undefined);
8
+ if (untagged.length === 0)
9
+ return;
10
+ const lines = untagged.map(({ label, version, tag }) => ` - ${label}: ${version} (create tag ${tag})`);
11
+ throw new Error([
12
+ 'The current version is recorded in the changelog, but its tag is not the previous tag reachable from HEAD:',
13
+ ...lines,
14
+ 'Tag the commit that released each version, then run prepare again.',
15
+ ].join('\n'));
16
+ }
17
+ export function findUntaggedBaseline(target, config) {
18
+ const recordedVersions = readRecordedVersions(target.changelogPaths, config);
19
+ if (recordedVersions.size === 0) {
20
+ return undefined;
21
+ }
22
+ const version = readCurrentVersion(target.packageFiles);
23
+ if (!recordedVersions.has(version)) {
24
+ return undefined;
25
+ }
26
+ if (target.tagPrefixes.some((prefix) => target.previousTag === `${prefix}${version}`)) {
27
+ return undefined;
28
+ }
29
+ return { label: target.label, version, tag: `${target.tagPrefixes[0] ?? ''}${version}` };
30
+ }
31
+ function readRecordedVersions(changelogPaths, config) {
32
+ const versions = new Set();
33
+ for (const changelogPath of changelogPaths) {
34
+ const { versioned } = readChangelogSections(join(changelogPath, 'CHANGELOG.md'));
35
+ const entries = readChangelogEntries(resolveChangelogJsonPath(config, changelogPath)) ?? [];
36
+ for (const { version } of [...versioned, ...entries]) {
37
+ versions.add(version);
38
+ }
39
+ }
40
+ return versions;
41
+ }
@@ -1,4 +1,4 @@
1
1
  import type { ChangelogDiagnostics } from './buildChangelogEntries.js';
2
2
  import type { ReleasedWorkspaceResult } from './types.js';
3
3
  /** Attaches a history's diagnostics to a released or skipped result, omitting each empty list. */
4
- export declare function attachChangelogDiagnostics(result: Pick<ReleasedWorkspaceResult, 'malformedBlocks' | 'policyViolations' | 'undeclaredEntryTypes'>, diagnostics: ChangelogDiagnostics): void;
4
+ export declare function attachChangelogDiagnostics(result: Pick<ReleasedWorkspaceResult, 'malformedBlocks' | 'policyViolations' | 'undeclaredEntryTypes' | 'unroutedEntryScopes'>, diagnostics: ChangelogDiagnostics): void;
@@ -8,4 +8,7 @@ export function attachChangelogDiagnostics(result, diagnostics) {
8
8
  if (diagnostics.policyViolations.length > 0) {
9
9
  result.policyViolations = diagnostics.policyViolations;
10
10
  }
11
+ if (diagnostics.unroutedEntryScopes.length > 0) {
12
+ result.unroutedEntryScopes = diagnostics.unroutedEntryScopes;
13
+ }
11
14
  }
@@ -4,11 +4,14 @@ import { describeError } from '@williamthorsen/toolbelt.errors';
4
4
  import { commitCommand } from "../commitCommand.js";
5
5
  import { configFlagSchema } from "../configFlagSchema.js";
6
6
  import { createGithubReleaseCommand } from "../createGithubReleaseCommand.js";
7
+ import { enterRepoRoot } from "../enterRepoRoot.js";
7
8
  import { showPrepareHelp } from "../help/prepareHelp.js";
8
9
  import { initCommand } from "../init/initCommand.js";
10
+ import { updateTemplatesCommand } from "../init/updateTemplatesCommand.js";
9
11
  import { prepareCommand } from "../prepareCommand.js";
10
12
  import { publishCommand } from "../publishCommand.js";
11
13
  import { pushCommand } from "../pushCommand.js";
14
+ import { resolveConfigFlag } from "../resolveConfigFlag.js";
12
15
  import { OUTPUT_STYLE_ENV_VAR, resolveStylesOrExit } from "../resolveStylesOrExit.js";
13
16
  import { showTagPrefixesCommand } from "../showTagPrefixesCommand.js";
14
17
  import { generateCommand } from "../sync-labels/generateCommand.js";
@@ -30,6 +33,7 @@ Commands:
30
33
  create-github-release Create GitHub Releases from changelog.json for tags on HEAD
31
34
  show-tag-prefixes Show derived and declared legacy tag prefixes per workspace
32
35
  init Initialize release-kit in the current repository
36
+ update-templates Update the scaffolded workflows to the current templates
33
37
  overrides Manage editorial changelog overrides
34
38
  sync-labels Manage GitHub label synchronization
35
39
 
@@ -69,7 +73,8 @@ retired packages, then generate .github/labels.yaml. When the config file alread
69
73
  exists, print the block for manual paste instead of rewriting the file.
70
74
 
71
75
  Options:
72
- --config <path> Path to config file (default: .config/release-kit.config.ts)
76
+ --config <path> Config file, relative to the current directory
77
+ (default: .config/release-kit.config.ts at the repo root)
73
78
  --dry-run Preview changes without writing files
74
79
  --force Overwrite existing files instead of skipping them
75
80
  --help, -h Show this help message
@@ -83,7 +88,8 @@ Regenerate .github/labels.yaml from the repoLabels block of .config/release-kit.
83
88
 
84
89
  Options:
85
90
  --check Report whether .github/labels.yaml is stale instead of writing it
86
- --config <path> Path to config file (default: .config/release-kit.config.ts)
91
+ --config <path> Config file, relative to the current directory
92
+ (default: .config/release-kit.config.ts at the repo root)
87
93
  --help, -h Show this help message
88
94
  `);
89
95
  }
@@ -111,6 +117,20 @@ Options:
111
117
  --help, -h Show this help message
112
118
  `);
113
119
  }
120
+ function showUpdateTemplatesHelp() {
121
+ console.info(`
122
+ Usage: release-kit update-templates [options]
123
+
124
+ Update the GitHub Actions workflows that release-kit scaffolds to the templates
125
+ of the installed version, showing what changed in each file. Creates a missing
126
+ workflow that \`init\` would create, and refreshes sync-labels.yaml only when it
127
+ exists. Keeps publish.yaml's provenance setting. Never touches config files.
128
+
129
+ Options:
130
+ --dry-run Preview changes without writing files
131
+ --help, -h Show this help message
132
+ `);
133
+ }
114
134
  function showCommitHelp() {
115
135
  console.info(`
116
136
  Usage: release-kit commit [options]
@@ -139,10 +159,12 @@ function showPushHelp() {
139
159
  console.info(`
140
160
  Usage: release-kit push [options]
141
161
 
142
- Push the release commit and each tag individually, ensuring GitHub Actions
143
- fires a separate workflow run per tag.
162
+ Push the release commit and each tag individually, so that GitHub Actions
163
+ starts a separate workflow run for each tag.
144
164
 
145
165
  Options:
166
+ --config <path> Config file, relative to the current directory
167
+ (default: .config/release-kit.config.ts at the repo root)
146
168
  --dry-run Preview without pushing
147
169
  --tags=tag1,tag2 Only push the named tags (comma-separated, full tag names)
148
170
  --tags-only Skip the branch push (push tags only)
@@ -154,10 +176,12 @@ function showCreateGithubReleaseHelp() {
154
176
  Usage: release-kit create-github-release [options]
155
177
 
156
178
  Create GitHub Releases from changelog.json for tags on HEAD. Private
157
- (package.json#private) workspaces are skipped with a warning and get no Release.
179
+ (package.json#private) workspaces are skipped with a warning, and the command
180
+ doesn't create a Release for them.
158
181
 
159
182
  Options:
160
- --config <path> Path to config file (default: .config/release-kit.config.ts)
183
+ --config <path> Config file, relative to the current directory
184
+ (default: .config/release-kit.config.ts at the repo root)
161
185
  --dry-run Preview without creating releases
162
186
  --tags=tag1,tag2 Only create releases for the named tags (comma-separated, full tag names)
163
187
  --help, -h Show this help message
@@ -168,12 +192,13 @@ function showShowTagPrefixesHelp() {
168
192
  Usage: release-kit show-tag-prefixes [options]
169
193
 
170
194
  Print a per-workspace table of derived tag prefixes, tag counts, and declared
171
- legacy tag prefixes. Surfaces any release-shaped tags whose prefix is neither a
195
+ legacy tag prefixes. Reports any release-shaped tags whose prefix is neither a
172
196
  derived prefix nor declared in \`legacyIdentities\`, with a copy-pasteable
173
197
  config snippet.
174
198
 
175
199
  Options:
176
- --config <path> Path to config file (default: .config/release-kit.config.ts)
200
+ --config <path> Config file, relative to the current directory
201
+ (default: .config/release-kit.config.ts at the repo root)
177
202
  --help, -h Show this help message
178
203
  `);
179
204
  }
@@ -199,12 +224,13 @@ scopes. Reports schema/parse errors, ambiguous-prefix errors, conflicting-key er
199
224
  stale-key warnings.
200
225
 
201
226
  Exit codes:
202
- 0 Clean — no errors, no stale keys
227
+ 0 Clean: no errors, no stale keys
203
228
  1 Stale-key warnings only (no errors)
204
- 2 Schema/parse, ambiguous-prefix, or conflicting-key errors (errors dominate)
229
+ 2 Schema/parse, ambiguous-prefix, or conflicting-key errors (errors take precedence)
205
230
 
206
231
  Options:
207
- --config <path> Path to config file (default: .config/release-kit.config.ts)
232
+ --config <path> Config file, relative to the current directory
233
+ (default: .config/release-kit.config.ts at the repo root)
208
234
  --help, -h Show this help message
209
235
  `);
210
236
  }
@@ -212,13 +238,14 @@ function showPublishHelp() {
212
238
  console.info(`
213
239
  Usage: release-kit publish [options]
214
240
 
215
- Publish packages that have release tags on HEAD. Operates only on workspaces where
241
+ Publish packages that have release tags on HEAD. Operates only on workspaces whose
216
242
  package.json#private is absent or false. Without --tags, unpublishable workspaces are
217
243
  silently filtered out. With --tags, an unpublishable tag is skipped with a warning while
218
- any publishable tags still publish.
244
+ any publishable tags are still published.
219
245
 
220
246
  Options:
221
- --config <path> Path to config file (default: .config/release-kit.config.ts)
247
+ --config <path> Config file, relative to the current directory
248
+ (default: .config/release-kit.config.ts at the repo root)
222
249
  --dry-run Preview without publishing
223
250
  --no-git-checks Skip the clean-working-tree check
224
251
  --tags=tag1,tag2 Only publish the named tags (comma-separated, full tag names)
@@ -226,6 +253,15 @@ Options:
226
253
  --help, -h Show this help message
227
254
  `);
228
255
  }
256
+ function enterRepoRootOrExit() {
257
+ try {
258
+ return enterRepoRoot();
259
+ }
260
+ catch (error) {
261
+ reportError(describeError(error));
262
+ process.exit(1);
263
+ }
264
+ }
229
265
  const args = process.argv.slice(2);
230
266
  const command = args[0];
231
267
  if (command === '--version' || command === '-V') {
@@ -247,7 +283,8 @@ if (command === 'prepare') {
247
283
  showPrepareHelp();
248
284
  process.exit(0);
249
285
  }
250
- await prepareCommand(flags, styles);
286
+ const { invocationDir } = enterRepoRootOrExit();
287
+ await prepareCommand(flags, styles, invocationDir);
251
288
  process.exit(0);
252
289
  }
253
290
  if (command === 'commit') {
@@ -255,6 +292,7 @@ if (command === 'commit') {
255
292
  showCommitHelp();
256
293
  process.exit(0);
257
294
  }
295
+ enterRepoRootOrExit();
258
296
  try {
259
297
  commitCommand(flags);
260
298
  }
@@ -269,6 +307,7 @@ if (command === 'tag') {
269
307
  showTagHelp();
270
308
  process.exit(0);
271
309
  }
310
+ enterRepoRootOrExit();
272
311
  tagCommand(flags, styles);
273
312
  process.exit(0);
274
313
  }
@@ -277,7 +316,8 @@ if (command === 'push') {
277
316
  showPushHelp();
278
317
  process.exit(0);
279
318
  }
280
- pushCommand(flags);
319
+ const { invocationDir } = enterRepoRootOrExit();
320
+ await pushCommand(flags, styles, invocationDir);
281
321
  process.exit(0);
282
322
  }
283
323
  if (command === 'create-github-release') {
@@ -285,7 +325,8 @@ if (command === 'create-github-release') {
285
325
  showCreateGithubReleaseHelp();
286
326
  process.exit(0);
287
327
  }
288
- await createGithubReleaseCommand(flags, styles);
328
+ const { invocationDir } = enterRepoRootOrExit();
329
+ await createGithubReleaseCommand(flags, styles, invocationDir);
289
330
  process.exit(0);
290
331
  }
291
332
  if (command === 'publish') {
@@ -293,7 +334,8 @@ if (command === 'publish') {
293
334
  showPublishHelp();
294
335
  process.exit(0);
295
336
  }
296
- await publishCommand(flags, styles);
337
+ const { invocationDir } = enterRepoRootOrExit();
338
+ await publishCommand(flags, styles, invocationDir);
297
339
  process.exit(0);
298
340
  }
299
341
  if (command === 'show-tag-prefixes') {
@@ -301,8 +343,9 @@ if (command === 'show-tag-prefixes') {
301
343
  showShowTagPrefixesHelp();
302
344
  process.exit(0);
303
345
  }
346
+ const { invocationDir } = enterRepoRootOrExit();
304
347
  const { config } = parseArgsOrExit(flags, configFlagSchema).flags;
305
- const exitCode = await showTagPrefixesCommand(styles, config);
348
+ const exitCode = await showTagPrefixesCommand(styles, resolveConfigFlag(config, invocationDir));
306
349
  process.exit(exitCode);
307
350
  }
308
351
  if (command === 'init') {
@@ -310,6 +353,7 @@ if (command === 'init') {
310
353
  showInitHelp();
311
354
  process.exit(0);
312
355
  }
356
+ enterRepoRootOrExit();
313
357
  const initFlagSchema = {
314
358
  dryRun: { long: '--dry-run', type: 'boolean' },
315
359
  force: { long: '--force', type: 'boolean' },
@@ -319,6 +363,19 @@ if (command === 'init') {
319
363
  const exitCode = initCommand({ dryRun, force, styles, withConfig });
320
364
  process.exit(exitCode);
321
365
  }
366
+ if (command === 'update-templates') {
367
+ if (flags.some((f) => f === '--help' || f === '-h')) {
368
+ showUpdateTemplatesHelp();
369
+ process.exit(0);
370
+ }
371
+ enterRepoRootOrExit();
372
+ const updateTemplatesFlagSchema = {
373
+ dryRun: { long: '--dry-run', type: 'boolean' },
374
+ };
375
+ const { dryRun } = parseArgsOrExit(flags, updateTemplatesFlagSchema).flags;
376
+ const exitCode = updateTemplatesCommand({ dryRun, styles });
377
+ process.exit(exitCode);
378
+ }
322
379
  if (command === 'sync-labels') {
323
380
  const subcommand = flags[0];
324
381
  if (subcommand === undefined || ['--help', '-h'].includes(subcommand)) {
@@ -331,14 +388,16 @@ if (command === 'sync-labels') {
331
388
  showSyncLabelsInitHelp();
332
389
  process.exit(0);
333
390
  }
391
+ const { invocationDir } = enterRepoRootOrExit();
334
392
  const syncLabelsInitFlagSchema = {
335
393
  ...configFlagSchema,
336
394
  dryRun: { long: '--dry-run', type: 'boolean' },
337
395
  force: { long: '--force', type: 'boolean' },
338
396
  };
339
397
  const { config, dryRun, force } = parseArgsOrExit(subflags, syncLabelsInitFlagSchema).flags;
398
+ const configPath = resolveConfigFlag(config, invocationDir);
340
399
  const exitCode = await syncLabelsInitCommand({
341
- ...(config !== undefined && { configPath: config }),
400
+ ...(configPath !== undefined && { configPath }),
342
401
  dryRun,
343
402
  force,
344
403
  styles,
@@ -350,12 +409,14 @@ if (command === 'sync-labels') {
350
409
  showSyncLabelsGenerateHelp();
351
410
  process.exit(0);
352
411
  }
412
+ const { invocationDir } = enterRepoRootOrExit();
353
413
  const generateFlagSchema = {
354
414
  ...configFlagSchema,
355
415
  check: { long: '--check', type: 'boolean' },
356
416
  };
357
417
  const { check, config } = parseArgsOrExit(subflags, generateFlagSchema).flags;
358
- const exitCode = await generateCommand({ check, ...(config !== undefined && { configPath: config }), styles });
418
+ const configPath = resolveConfigFlag(config, invocationDir);
419
+ const exitCode = await generateCommand({ check, ...(configPath !== undefined && { configPath }), styles });
359
420
  process.exit(exitCode);
360
421
  }
361
422
  if (subcommand === 'sync') {
@@ -367,6 +428,7 @@ if (command === 'sync-labels') {
367
428
  reportError(`Unknown option: ${subflags[0]}`);
368
429
  process.exit(1);
369
430
  }
431
+ enterRepoRootOrExit();
370
432
  const exitCode = syncLabelsCommand();
371
433
  process.exit(exitCode);
372
434
  }
@@ -386,8 +448,9 @@ if (command === 'overrides') {
386
448
  showOverridesValidateHelp();
387
449
  process.exit(0);
388
450
  }
451
+ const { invocationDir } = enterRepoRootOrExit();
389
452
  const { config } = parseArgsOrExit(subflags, configFlagSchema).flags;
390
- const result = await validateOverridesCommand(styles, config);
453
+ const result = await validateOverridesCommand(styles, resolveConfigFlag(config, invocationDir));
391
454
  if (result.exitCode === 0) {
392
455
  console.info(result.message);
393
456
  }