@williamthorsen/release-kit 6.0.0 → 8.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 (134) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +5 -3
  3. package/dist/esm/assertCleanWorkingTree.js +9 -14
  4. package/dist/esm/bin/release-kit.js +200 -199
  5. package/dist/esm/buildChangelogEntries.d.ts +2 -2
  6. package/dist/esm/buildChangelogEntries.js +142 -149
  7. package/dist/esm/buildDependencyGraph.d.ts +1 -1
  8. package/dist/esm/buildDependencyGraph.js +60 -59
  9. package/dist/esm/buildEmptyReleaseEntry.d.ts +1 -1
  10. package/dist/esm/buildEmptyReleaseEntry.js +12 -15
  11. package/dist/esm/buildReleaseSummary.d.ts +1 -1
  12. package/dist/esm/buildReleaseSummary.js +23 -26
  13. package/dist/esm/buildSyntheticChangelogEntry.d.ts +1 -1
  14. package/dist/esm/buildSyntheticChangelogEntry.js +9 -12
  15. package/dist/esm/bumpAllVersions.d.ts +1 -1
  16. package/dist/esm/bumpAllVersions.js +51 -52
  17. package/dist/esm/bumpVersion.d.ts +1 -1
  18. package/dist/esm/bumpVersion.js +25 -28
  19. package/dist/esm/changelogJsonFile.d.ts +1 -1
  20. package/dist/esm/changelogJsonFile.js +59 -62
  21. package/dist/esm/changelogJsonUtils.d.ts +1 -1
  22. package/dist/esm/changelogJsonUtils.js +35 -32
  23. package/dist/esm/changelogOverrides.d.ts +1 -1
  24. package/dist/esm/changelogOverrides.js +374 -377
  25. package/dist/esm/checkWorkTypesDrift.js +104 -102
  26. package/dist/esm/collectPolicyViolations.d.ts +2 -2
  27. package/dist/esm/collectPolicyViolations.js +11 -14
  28. package/dist/esm/commitCommand.js +48 -46
  29. package/dist/esm/compareVersions.js +20 -23
  30. package/dist/esm/createGithubRelease.js +56 -59
  31. package/dist/esm/createGithubReleaseCommand.js +21 -23
  32. package/dist/esm/createTags.js +57 -56
  33. package/dist/esm/decideRelease.d.ts +2 -2
  34. package/dist/esm/decideRelease.js +27 -41
  35. package/dist/esm/defaults.d.ts +3 -3
  36. package/dist/esm/defaults.js +36 -48
  37. package/dist/esm/deleteFileIfExists.js +10 -12
  38. package/dist/esm/deriveWorkspaceConfig.d.ts +1 -1
  39. package/dist/esm/deriveWorkspaceConfig.js +34 -36
  40. package/dist/esm/detectPackageManager.js +35 -37
  41. package/dist/esm/detectUndeclaredTagPrefixes.js +41 -40
  42. package/dist/esm/determineBumpFromCommits.d.ts +2 -2
  43. package/dist/esm/determineBumpFromCommits.js +25 -29
  44. package/dist/esm/determineBumpType.d.ts +1 -1
  45. package/dist/esm/determineBumpType.js +31 -32
  46. package/dist/esm/discoverWorkspaces.js +38 -40
  47. package/dist/esm/format.js +6 -11
  48. package/dist/esm/generateChangelogs.d.ts +1 -1
  49. package/dist/esm/generateChangelogs.js +13 -17
  50. package/dist/esm/getCommitsSinceTarget.d.ts +1 -1
  51. package/dist/esm/getCommitsSinceTarget.js +54 -55
  52. package/dist/esm/hasPrettierConfig.js +33 -35
  53. package/dist/esm/help/prepareHelp.js +4 -8
  54. package/dist/esm/index.d.ts +4 -4
  55. package/dist/esm/index.js +2 -8
  56. package/dist/esm/init/checks.js +28 -32
  57. package/dist/esm/init/detectRepoType.js +12 -15
  58. package/dist/esm/init/initCommand.js +60 -54
  59. package/dist/esm/init/parseJsonRecord.js +9 -11
  60. package/dist/esm/init/scaffold.d.ts +1 -1
  61. package/dist/esm/init/scaffold.js +32 -38
  62. package/dist/esm/init/templates.d.ts +1 -1
  63. package/dist/esm/init/templates.js +16 -22
  64. package/dist/esm/injectReleaseNotesIntoReadme.js +42 -49
  65. package/dist/esm/injectSection.js +17 -27
  66. package/dist/esm/loadConfig.d.ts +1 -1
  67. package/dist/esm/loadConfig.js +206 -225
  68. package/dist/esm/parseCommitMessage.d.ts +1 -1
  69. package/dist/esm/parseCommitMessage.js +72 -76
  70. package/dist/esm/parseRequestedTags.js +6 -9
  71. package/dist/esm/prepareCommand.d.ts +1 -1
  72. package/dist/esm/prepareCommand.js +225 -235
  73. package/dist/esm/previewTagPrefixes.d.ts +1 -1
  74. package/dist/esm/previewTagPrefixes.js +101 -96
  75. package/dist/esm/propagateBumps.d.ts +2 -2
  76. package/dist/esm/propagateBumps.js +48 -50
  77. package/dist/esm/publish.d.ts +2 -2
  78. package/dist/esm/publish.js +22 -28
  79. package/dist/esm/publishCommand.js +75 -80
  80. package/dist/esm/pushCommand.js +33 -34
  81. package/dist/esm/pushRelease.d.ts +1 -1
  82. package/dist/esm/pushRelease.js +21 -24
  83. package/dist/esm/readCurrentVersion.js +13 -17
  84. package/dist/esm/releasePrepare.d.ts +1 -1
  85. package/dist/esm/releasePrepare.js +213 -231
  86. package/dist/esm/releasePrepareMono.d.ts +2 -2
  87. package/dist/esm/releasePrepareMono.js +434 -494
  88. package/dist/esm/releasePrepareProject.d.ts +2 -2
  89. package/dist/esm/releasePrepareProject.js +143 -153
  90. package/dist/esm/renderChangelogMarkdown.d.ts +1 -1
  91. package/dist/esm/renderChangelogMarkdown.js +20 -24
  92. package/dist/esm/renderReleaseNotes.d.ts +1 -1
  93. package/dist/esm/renderReleaseNotes.js +50 -55
  94. package/dist/esm/reportPrepare.d.ts +1 -1
  95. package/dist/esm/reportPrepare.js +230 -231
  96. package/dist/esm/resolveCliffConfigPath.js +18 -23
  97. package/dist/esm/resolveCommandTags.d.ts +1 -1
  98. package/dist/esm/resolveCommandTags.js +47 -45
  99. package/dist/esm/resolveReleaseNotesConfig.d.ts +1 -1
  100. package/dist/esm/resolveReleaseNotesConfig.js +39 -43
  101. package/dist/esm/resolveReleaseTags.d.ts +1 -1
  102. package/dist/esm/resolveReleaseTags.js +39 -40
  103. package/dist/esm/runGitCliff.js +27 -30
  104. package/dist/esm/showTagPrefixesCommand.js +48 -70
  105. package/dist/esm/stripEmojiPrefix.js +2 -5
  106. package/dist/esm/stripScope.js +18 -21
  107. package/dist/esm/sync-labels/generateCommand.d.ts +1 -1
  108. package/dist/esm/sync-labels/generateCommand.js +51 -53
  109. package/dist/esm/sync-labels/initCommand.js +46 -48
  110. package/dist/esm/sync-labels/loadSyncLabelsConfig.d.ts +1 -1
  111. package/dist/esm/sync-labels/loadSyncLabelsConfig.js +46 -52
  112. package/dist/esm/sync-labels/presets.d.ts +1 -1
  113. package/dist/esm/sync-labels/presets.js +40 -43
  114. package/dist/esm/sync-labels/resolveLabels.d.ts +1 -1
  115. package/dist/esm/sync-labels/resolveLabels.js +28 -35
  116. package/dist/esm/sync-labels/syncCommand.js +30 -31
  117. package/dist/esm/sync-labels/templates.d.ts +1 -1
  118. package/dist/esm/sync-labels/templates.js +23 -26
  119. package/dist/esm/sync-labels/types.js +1 -0
  120. package/dist/esm/syncWorkTypes.js +83 -84
  121. package/dist/esm/tagCommand.js +12 -14
  122. package/dist/esm/typeGuards.js +4 -8
  123. package/dist/esm/types.js +66 -60
  124. package/dist/esm/validateConfig.d.ts +1 -1
  125. package/dist/esm/validateConfig.js +109 -115
  126. package/dist/esm/validateOnlyExcludesStrandedDependents.d.ts +2 -2
  127. package/dist/esm/validateOnlyExcludesStrandedDependents.js +97 -91
  128. package/dist/esm/validateOverridesCommand.d.ts +2 -2
  129. package/dist/esm/validateOverridesCommand.js +110 -111
  130. package/dist/esm/workTypesData.js +57 -60
  131. package/dist/esm/workTypesUtils.js +16 -21
  132. package/dist/esm/writeReleaseNotesPreviews.js +55 -57
  133. package/package.json +3 -2
  134. package/dist/esm/.cache +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 8.0.0 — 2026-07-13
6
+
7
+ ### 🎉 Features
8
+
9
+ - 🚨 **Breaking:** Fail a package that declares types but ships none (#467)
10
+
11
+ `nmr attw` now fails a package that claims to ship type declarations but ships none. Such a package used to pass, leaving every TypeScript consumer of it silently typed as `any`.
12
+
13
+ A package that ships working declarations found only by sitting beside its JavaScript entry point escapes the check, since it declares nothing. Add a `types` entry to bring it under the check.
14
+
15
+ ## 7.0.0 — 2026-07-01
16
+
17
+ ### 🎉 Features
18
+
19
+ - 🚨 **Breaking:** Rebuild nmr-compile on a unified tsc emit (#455)
20
+
21
+ `nmr` now compiles a package's JavaScript and type declarations in one step, rewriting every import form — static, re-export, dynamic `import()`, bare side-effect, and tsconfig `paths` aliases — to runnable `.js` in both outputs. It now requires TypeScript 5.7 or newer as a peer dependency.
22
+
5
23
  ## 6.0.0 — 2026-06-30
6
24
 
7
25
  ### 🎉 Features
package/README.md CHANGED
@@ -5,13 +5,15 @@ Version-bumping and changelog-generation toolkit for release workflows.
5
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)).
6
6
 
7
7
  <!-- section:release-notes -->
8
- ## Release notes — v6.0.0 (2026-06-30)
8
+ ## Release notes — v8.0.0 (2026-07-13)
9
9
 
10
10
  ### 🎉 Features
11
11
 
12
- - 🚨 **Breaking:** Auto-activate integration test variant from config presence (#448)
12
+ - 🚨 **Breaking:** Fail a package that declares types but ships none (#467)
13
13
 
14
- A package can now separate its integration tests from its standalone suite simply by including a `vitest.integration.config.ts` (alongside a `vitest.standalone.config.ts`). The `--int-test` flag that previously enabled this is removed — that config-file pairing is now the only way to activate the separation. In such a package, `test` and `test:coverage` run only the standalone suite and skip integration tests, while a new `test:all` runs both suites together. The separation now holds even when tests run across every package at once, so a full-workspace `test` run still keeps integration tests out of the default suite. Packages that previously hand-copied these test scripts no longer need to.
14
+ `nmr attw` now fails a package that claims to ship type declarations but ships none. Such a package used to pass, leaving every TypeScript consumer of it silently typed as `any`.
15
+
16
+ A package that ships working declarations found only by sitting beside its JavaScript entry point escapes the check, since it declares nothing. Add a `types` entry to bring it under the check.
15
17
  <!-- /section:release-notes -->
16
18
 
17
19
  ## Installation
@@ -1,15 +1,10 @@
1
- import { execFileSync } from "node:child_process";
2
- function assertCleanWorkingTree() {
3
- const status = execFileSync("git", ["status", "--porcelain"], {
4
- encoding: "utf8",
5
- stdio: ["pipe", "pipe", "pipe"]
6
- }).trim();
7
- if (status.length > 0) {
8
- throw new Error(
9
- "Working tree has uncommitted changes. Commit or stash them, or use --no-git-checks to bypass this check."
10
- );
11
- }
1
+ import { execFileSync } from 'node:child_process';
2
+ export function assertCleanWorkingTree() {
3
+ const status = execFileSync('git', ['status', '--porcelain'], {
4
+ encoding: 'utf8',
5
+ stdio: ['pipe', 'pipe', 'pipe'],
6
+ }).trim();
7
+ if (status.length > 0) {
8
+ throw new Error('Working tree has uncommitted changes. Commit or stash them, or use --no-git-checks to bypass this check.');
9
+ }
12
10
  }
13
- export {
14
- assertCleanWorkingTree
15
- };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { parseArgsOrExit, readPackageVersion, reportError } from "@williamthorsen/nmr-core";
2
+ import { parseArgsOrExit, readPackageVersion, reportError } from '@williamthorsen/nmr-core';
3
3
  import { checkWorkTypesDrift } from "../checkWorkTypesDrift.js";
4
4
  import { commitCommand } from "../commitCommand.js";
5
5
  import { createGithubReleaseCommand } from "../createGithubReleaseCommand.js";
@@ -17,7 +17,7 @@ import { tagCommand } from "../tagCommand.js";
17
17
  import { validateOverridesCommand } from "../validateOverridesCommand.js";
18
18
  const VERSION = readPackageVersion(import.meta.url);
19
19
  function showUsage() {
20
- console.info(`
20
+ console.info(`
21
21
  Usage: release-kit <command> [options]
22
22
 
23
23
  Commands:
@@ -39,7 +39,7 @@ Options:
39
39
  `);
40
40
  }
41
41
  function showSyncLabelsHelp() {
42
- console.info(`
42
+ console.info(`
43
43
  Usage: release-kit sync-labels <subcommand> [options]
44
44
 
45
45
  Manage GitHub label synchronization via preset and custom label definitions.
@@ -54,7 +54,7 @@ Options:
54
54
  `);
55
55
  }
56
56
  function showSyncLabelsInitHelp() {
57
- console.info(`
57
+ console.info(`
58
58
  Usage: release-kit sync-labels init [options]
59
59
 
60
60
  Scaffold the sync-labels caller workflow and config file, auto-discover workspaces
@@ -67,7 +67,7 @@ Options:
67
67
  `);
68
68
  }
69
69
  function showSyncLabelsGenerateHelp() {
70
- console.info(`
70
+ console.info(`
71
71
  Usage: release-kit sync-labels generate
72
72
 
73
73
  Regenerate .github/labels.yaml from .config/sync-labels.config.ts.
@@ -77,7 +77,7 @@ Options:
77
77
  `);
78
78
  }
79
79
  function showSyncLabelsSyncHelp() {
80
- console.info(`
80
+ console.info(`
81
81
  Usage: release-kit sync-labels sync
82
82
 
83
83
  Trigger the sync-labels GitHub Actions workflow via the gh CLI.
@@ -87,7 +87,7 @@ Options:
87
87
  `);
88
88
  }
89
89
  function showInitHelp() {
90
- console.info(`
90
+ console.info(`
91
91
  Usage: release-kit init [options]
92
92
 
93
93
  Initialize release-kit in the current repository.
@@ -101,7 +101,7 @@ Options:
101
101
  `);
102
102
  }
103
103
  function showCommitHelp() {
104
- console.info(`
104
+ console.info(`
105
105
  Usage: release-kit commit [options]
106
106
 
107
107
  Stage all changes and create the release commit using tags and summary
@@ -113,7 +113,7 @@ Options:
113
113
  `);
114
114
  }
115
115
  function showTagHelp() {
116
- console.info(`
116
+ console.info(`
117
117
  Usage: release-kit tag [options]
118
118
 
119
119
  Create annotated git tags from the tags file produced by \`prepare\`.
@@ -125,7 +125,7 @@ Options:
125
125
  `);
126
126
  }
127
127
  function showPushHelp() {
128
- console.info(`
128
+ console.info(`
129
129
  Usage: release-kit push [options]
130
130
 
131
131
  Push the release commit and each tag individually, ensuring GitHub Actions
@@ -139,7 +139,7 @@ Options:
139
139
  `);
140
140
  }
141
141
  function showCreateGithubReleaseHelp() {
142
- console.info(`
142
+ console.info(`
143
143
  Usage: release-kit create-github-release [options]
144
144
 
145
145
  Create GitHub Releases from changelog.json for tags on HEAD.
@@ -151,7 +151,7 @@ Options:
151
151
  `);
152
152
  }
153
153
  function showShowTagPrefixesHelp() {
154
- console.info(`
154
+ console.info(`
155
155
  Usage: release-kit show-tag-prefixes [options]
156
156
 
157
157
  Print a per-workspace table of derived tag prefixes, tag counts, and declared
@@ -164,7 +164,7 @@ Options:
164
164
  `);
165
165
  }
166
166
  function showOverridesHelp() {
167
- console.info(`
167
+ console.info(`
168
168
  Usage: release-kit overrides <subcommand> [options]
169
169
 
170
170
  Manage editorial changelog overrides.
@@ -177,14 +177,14 @@ Options:
177
177
  `);
178
178
  }
179
179
  function showOverridesValidateHelp() {
180
- console.info(`
180
+ console.info(`
181
181
  Usage: release-kit overrides validate
182
182
 
183
183
  Validate every \`.meta/changelog-overrides.json\` file across the project and per-workspace
184
184
  scopes. Reports schema/parse errors, ambiguous-prefix errors, and stale-key warnings.
185
185
 
186
186
  Exit codes:
187
- 0 Clean \u2014 no errors, no stale keys
187
+ 0 Clean — no errors, no stale keys
188
188
  1 Stale-key warnings only (no errors)
189
189
  2 Schema/parse or ambiguous-prefix errors (errors dominate)
190
190
 
@@ -193,7 +193,7 @@ Options:
193
193
  `);
194
194
  }
195
195
  function showWorkTypesHelp() {
196
- console.info(`
196
+ console.info(`
197
197
  Usage: release-kit work-types <subcommand>
198
198
 
199
199
  Manage the canonical work-types taxonomy used by changelog and release-notes generation.
@@ -203,7 +203,7 @@ Subcommands:
203
203
  sync Overwrite the local work-types.json with the upstream contents
204
204
 
205
205
  Exit codes (check):
206
- 0 Match (or upstream missing \u2014 transitional warning printed)
206
+ 0 Match (or upstream missing — transitional warning printed)
207
207
  1 Drift detected
208
208
  2 Network error
209
209
  3 Schema mismatch
@@ -213,7 +213,7 @@ Options:
213
213
  `);
214
214
  }
215
215
  function showWorkTypesCheckHelp() {
216
- console.info(`
216
+ console.info(`
217
217
  Usage: release-kit work-types check
218
218
 
219
219
  Compare the local work-types.json against the upstream codeassembly canonical and report
@@ -225,7 +225,7 @@ Options:
225
225
  `);
226
226
  }
227
227
  function showWorkTypesSyncHelp() {
228
- console.info(`
228
+ console.info(`
229
229
  Usage: release-kit work-types sync
230
230
 
231
231
  Fetch the upstream work-types.json, validate its top-level shape, and overwrite the local
@@ -236,7 +236,7 @@ Options:
236
236
  `);
237
237
  }
238
238
  function showPublishHelp() {
239
- console.info(`
239
+ console.info(`
240
240
  Usage: release-kit publish [options]
241
241
 
242
242
  Publish packages that have release tags on HEAD. Operates only on workspaces where
@@ -254,216 +254,217 @@ Options:
254
254
  const args = process.argv.slice(2);
255
255
  const command = args[0];
256
256
  const flags = args.slice(1);
257
- if (command === "--version" || command === "-V") {
258
- console.info(VERSION);
259
- process.exit(0);
260
- }
261
- if (command === "--help" || command === "-h" || command === void 0) {
262
- showUsage();
263
- process.exit(0);
264
- }
265
- if (command === "prepare") {
266
- if (flags.some((f) => f === "--help" || f === "-h")) {
267
- showPrepareHelp();
257
+ if (command === '--version' || command === '-V') {
258
+ console.info(VERSION);
268
259
  process.exit(0);
269
- }
270
- await prepareCommand(flags);
271
- process.exit(0);
272
260
  }
273
- if (command === "commit") {
274
- if (flags.some((f) => f === "--help" || f === "-h")) {
275
- showCommitHelp();
261
+ if (command === '--help' || command === '-h' || command === undefined) {
262
+ showUsage();
276
263
  process.exit(0);
277
- }
278
- try {
279
- commitCommand(flags);
280
- } catch (error) {
281
- reportError(error instanceof Error ? error.message : String(error));
282
- process.exit(1);
283
- }
284
- process.exit(0);
285
264
  }
286
- if (command === "tag") {
287
- if (flags.some((f) => f === "--help" || f === "-h")) {
288
- showTagHelp();
265
+ if (command === 'prepare') {
266
+ if (flags.some((f) => f === '--help' || f === '-h')) {
267
+ showPrepareHelp();
268
+ process.exit(0);
269
+ }
270
+ await prepareCommand(flags);
289
271
  process.exit(0);
290
- }
291
- tagCommand(flags);
292
- process.exit(0);
293
272
  }
294
- if (command === "push") {
295
- if (flags.some((f) => f === "--help" || f === "-h")) {
296
- showPushHelp();
273
+ if (command === 'commit') {
274
+ if (flags.some((f) => f === '--help' || f === '-h')) {
275
+ showCommitHelp();
276
+ process.exit(0);
277
+ }
278
+ try {
279
+ commitCommand(flags);
280
+ }
281
+ catch (error) {
282
+ reportError(error instanceof Error ? error.message : String(error));
283
+ process.exit(1);
284
+ }
297
285
  process.exit(0);
298
- }
299
- await pushCommand(flags);
300
- process.exit(0);
301
286
  }
302
- if (command === "create-github-release") {
303
- if (flags.some((f) => f === "--help" || f === "-h")) {
304
- showCreateGithubReleaseHelp();
287
+ if (command === 'tag') {
288
+ if (flags.some((f) => f === '--help' || f === '-h')) {
289
+ showTagHelp();
290
+ process.exit(0);
291
+ }
292
+ tagCommand(flags);
305
293
  process.exit(0);
306
- }
307
- await createGithubReleaseCommand(flags);
308
- process.exit(0);
309
294
  }
310
- if (command === "publish") {
311
- if (flags.some((f) => f === "--help" || f === "-h")) {
312
- showPublishHelp();
295
+ if (command === 'push') {
296
+ if (flags.some((f) => f === '--help' || f === '-h')) {
297
+ showPushHelp();
298
+ process.exit(0);
299
+ }
300
+ await pushCommand(flags);
313
301
  process.exit(0);
314
- }
315
- await publishCommand(flags);
316
- process.exit(0);
317
302
  }
318
- if (command === "show-tag-prefixes") {
319
- if (flags.some((f) => f === "--help" || f === "-h")) {
320
- showShowTagPrefixesHelp();
303
+ if (command === 'create-github-release') {
304
+ if (flags.some((f) => f === '--help' || f === '-h')) {
305
+ showCreateGithubReleaseHelp();
306
+ process.exit(0);
307
+ }
308
+ await createGithubReleaseCommand(flags);
321
309
  process.exit(0);
322
- }
323
- if (flags.length > 0) {
324
- reportError(`Unknown option: ${flags[0]}`);
325
- process.exit(1);
326
- }
327
- const exitCode = await showTagPrefixesCommand();
328
- process.exit(exitCode);
329
310
  }
330
- if (command === "init") {
331
- if (flags.some((f) => f === "--help" || f === "-h")) {
332
- showInitHelp();
311
+ if (command === 'publish') {
312
+ if (flags.some((f) => f === '--help' || f === '-h')) {
313
+ showPublishHelp();
314
+ process.exit(0);
315
+ }
316
+ await publishCommand(flags);
333
317
  process.exit(0);
334
- }
335
- const initFlagSchema = {
336
- dryRun: { long: "--dry-run", type: "boolean" },
337
- force: { long: "--force", type: "boolean" },
338
- withConfig: { long: "--with-config", type: "boolean" }
339
- };
340
- const { dryRun, force, withConfig } = parseArgsOrExit(flags, initFlagSchema).flags;
341
- const exitCode = initCommand({ dryRun, force, withConfig });
342
- process.exit(exitCode);
343
318
  }
344
- if (command === "sync-labels") {
345
- const subcommand = flags[0];
346
- const subflags = flags.slice(1);
347
- if (subcommand === "--help" || subcommand === "-h" || subcommand === void 0) {
348
- showSyncLabelsHelp();
349
- process.exit(0);
350
- }
351
- if (subcommand === "init") {
352
- if (subflags.some((f) => f === "--help" || f === "-h")) {
353
- showSyncLabelsInitHelp();
354
- process.exit(0);
319
+ if (command === 'show-tag-prefixes') {
320
+ if (flags.some((f) => f === '--help' || f === '-h')) {
321
+ showShowTagPrefixesHelp();
322
+ process.exit(0);
355
323
  }
356
- const syncLabelsInitFlagSchema = {
357
- dryRun: { long: "--dry-run", type: "boolean" },
358
- force: { long: "--force", type: "boolean" }
359
- };
360
- const { dryRun, force } = parseArgsOrExit(subflags, syncLabelsInitFlagSchema).flags;
361
- const exitCode = await syncLabelsInitCommand({ dryRun, force });
362
- process.exit(exitCode);
363
- }
364
- if (subcommand === "generate") {
365
- if (subflags.some((f) => f === "--help" || f === "-h")) {
366
- showSyncLabelsGenerateHelp();
367
- process.exit(0);
324
+ if (flags.length > 0) {
325
+ reportError(`Unknown option: ${flags[0]}`);
326
+ process.exit(1);
368
327
  }
369
- if (subflags.length > 0) {
370
- reportError(`Unknown option: ${subflags[0]}`);
371
- process.exit(1);
372
- }
373
- const exitCode = await generateCommand();
328
+ const exitCode = await showTagPrefixesCommand();
374
329
  process.exit(exitCode);
375
- }
376
- if (subcommand === "sync") {
377
- if (subflags.some((f) => f === "--help" || f === "-h")) {
378
- showSyncLabelsSyncHelp();
379
- process.exit(0);
380
- }
381
- if (subflags.length > 0) {
382
- reportError(`Unknown option: ${subflags[0]}`);
383
- process.exit(1);
330
+ }
331
+ if (command === 'init') {
332
+ if (flags.some((f) => f === '--help' || f === '-h')) {
333
+ showInitHelp();
334
+ process.exit(0);
384
335
  }
385
- const exitCode = syncLabelsCommand();
336
+ const initFlagSchema = {
337
+ dryRun: { long: '--dry-run', type: 'boolean' },
338
+ force: { long: '--force', type: 'boolean' },
339
+ withConfig: { long: '--with-config', type: 'boolean' },
340
+ };
341
+ const { dryRun, force, withConfig } = parseArgsOrExit(flags, initFlagSchema).flags;
342
+ const exitCode = initCommand({ dryRun, force, withConfig });
386
343
  process.exit(exitCode);
387
- }
388
- reportError(`Unknown subcommand: ${subcommand}`);
389
- showSyncLabelsHelp();
390
- process.exit(1);
391
344
  }
392
- if (command === "overrides") {
393
- const subcommand = flags[0];
394
- const subflags = flags.slice(1);
395
- if (subcommand === "--help" || subcommand === "-h" || subcommand === void 0) {
396
- showOverridesHelp();
397
- process.exit(0);
398
- }
399
- if (subcommand === "validate") {
400
- if (subflags.some((f) => f === "--help" || f === "-h")) {
401
- showOverridesValidateHelp();
402
- process.exit(0);
345
+ if (command === 'sync-labels') {
346
+ const subcommand = flags[0];
347
+ const subflags = flags.slice(1);
348
+ if (subcommand === '--help' || subcommand === '-h' || subcommand === undefined) {
349
+ showSyncLabelsHelp();
350
+ process.exit(0);
403
351
  }
404
- if (subflags.length > 0) {
405
- reportError(`Unknown option: ${subflags[0]}`);
406
- process.exit(1);
352
+ if (subcommand === 'init') {
353
+ if (subflags.some((f) => f === '--help' || f === '-h')) {
354
+ showSyncLabelsInitHelp();
355
+ process.exit(0);
356
+ }
357
+ const syncLabelsInitFlagSchema = {
358
+ dryRun: { long: '--dry-run', type: 'boolean' },
359
+ force: { long: '--force', type: 'boolean' },
360
+ };
361
+ const { dryRun, force } = parseArgsOrExit(subflags, syncLabelsInitFlagSchema).flags;
362
+ const exitCode = await syncLabelsInitCommand({ dryRun, force });
363
+ process.exit(exitCode);
407
364
  }
408
- const result = await validateOverridesCommand();
409
- if (result.exitCode === 0) {
410
- console.info(result.message);
411
- } else {
412
- process.stderr.write(`${result.message}
413
- `);
365
+ if (subcommand === 'generate') {
366
+ if (subflags.some((f) => f === '--help' || f === '-h')) {
367
+ showSyncLabelsGenerateHelp();
368
+ process.exit(0);
369
+ }
370
+ if (subflags.length > 0) {
371
+ reportError(`Unknown option: ${subflags[0]}`);
372
+ process.exit(1);
373
+ }
374
+ const exitCode = await generateCommand();
375
+ process.exit(exitCode);
414
376
  }
415
- process.exit(result.exitCode);
416
- }
417
- reportError(`Unknown subcommand: ${subcommand}`);
418
- showOverridesHelp();
419
- process.exit(1);
420
- }
421
- if (command === "work-types") {
422
- const subcommand = flags[0];
423
- const subflags = flags.slice(1);
424
- if (subcommand === "--help" || subcommand === "-h" || subcommand === void 0) {
425
- showWorkTypesHelp();
426
- process.exit(0);
427
- }
428
- if (subcommand === "check") {
429
- if (subflags.some((f) => f === "--help" || f === "-h")) {
430
- showWorkTypesCheckHelp();
431
- process.exit(0);
377
+ if (subcommand === 'sync') {
378
+ if (subflags.some((f) => f === '--help' || f === '-h')) {
379
+ showSyncLabelsSyncHelp();
380
+ process.exit(0);
381
+ }
382
+ if (subflags.length > 0) {
383
+ reportError(`Unknown option: ${subflags[0]}`);
384
+ process.exit(1);
385
+ }
386
+ const exitCode = syncLabelsCommand();
387
+ process.exit(exitCode);
432
388
  }
433
- if (subflags.length > 0) {
434
- reportError(`Unknown option: ${subflags[0]}`);
435
- process.exit(1);
389
+ reportError(`Unknown subcommand: ${subcommand}`);
390
+ showSyncLabelsHelp();
391
+ process.exit(1);
392
+ }
393
+ if (command === 'overrides') {
394
+ const subcommand = flags[0];
395
+ const subflags = flags.slice(1);
396
+ if (subcommand === '--help' || subcommand === '-h' || subcommand === undefined) {
397
+ showOverridesHelp();
398
+ process.exit(0);
436
399
  }
437
- const result = await checkWorkTypesDrift();
438
- if (result.exitCode === 0) {
439
- console.info(result.message);
440
- } else {
441
- process.stderr.write(`${result.message}
442
- `);
400
+ if (subcommand === 'validate') {
401
+ if (subflags.some((f) => f === '--help' || f === '-h')) {
402
+ showOverridesValidateHelp();
403
+ process.exit(0);
404
+ }
405
+ if (subflags.length > 0) {
406
+ reportError(`Unknown option: ${subflags[0]}`);
407
+ process.exit(1);
408
+ }
409
+ const result = await validateOverridesCommand();
410
+ if (result.exitCode === 0) {
411
+ console.info(result.message);
412
+ }
413
+ else {
414
+ process.stderr.write(`${result.message}\n`);
415
+ }
416
+ process.exit(result.exitCode);
443
417
  }
444
- process.exit(result.exitCode);
445
- }
446
- if (subcommand === "sync") {
447
- if (subflags.some((f) => f === "--help" || f === "-h")) {
448
- showWorkTypesSyncHelp();
449
- process.exit(0);
418
+ reportError(`Unknown subcommand: ${subcommand}`);
419
+ showOverridesHelp();
420
+ process.exit(1);
421
+ }
422
+ if (command === 'work-types') {
423
+ const subcommand = flags[0];
424
+ const subflags = flags.slice(1);
425
+ if (subcommand === '--help' || subcommand === '-h' || subcommand === undefined) {
426
+ showWorkTypesHelp();
427
+ process.exit(0);
450
428
  }
451
- if (subflags.length > 0) {
452
- reportError(`Unknown option: ${subflags[0]}`);
453
- process.exit(1);
429
+ if (subcommand === 'check') {
430
+ if (subflags.some((f) => f === '--help' || f === '-h')) {
431
+ showWorkTypesCheckHelp();
432
+ process.exit(0);
433
+ }
434
+ if (subflags.length > 0) {
435
+ reportError(`Unknown option: ${subflags[0]}`);
436
+ process.exit(1);
437
+ }
438
+ const result = await checkWorkTypesDrift();
439
+ if (result.exitCode === 0) {
440
+ console.info(result.message);
441
+ }
442
+ else {
443
+ process.stderr.write(`${result.message}\n`);
444
+ }
445
+ process.exit(result.exitCode);
454
446
  }
455
- const result = await syncWorkTypes();
456
- if (result.exitCode === 0) {
457
- console.info(result.message);
458
- } else {
459
- process.stderr.write(`${result.message}
460
- `);
447
+ if (subcommand === 'sync') {
448
+ if (subflags.some((f) => f === '--help' || f === '-h')) {
449
+ showWorkTypesSyncHelp();
450
+ process.exit(0);
451
+ }
452
+ if (subflags.length > 0) {
453
+ reportError(`Unknown option: ${subflags[0]}`);
454
+ process.exit(1);
455
+ }
456
+ const result = await syncWorkTypes();
457
+ if (result.exitCode === 0) {
458
+ console.info(result.message);
459
+ }
460
+ else {
461
+ process.stderr.write(`${result.message}\n`);
462
+ }
463
+ process.exit(result.exitCode);
461
464
  }
462
- process.exit(result.exitCode);
463
- }
464
- reportError(`Unknown subcommand: ${subcommand}`);
465
- showWorkTypesHelp();
466
- process.exit(1);
465
+ reportError(`Unknown subcommand: ${subcommand}`);
466
+ showWorkTypesHelp();
467
+ process.exit(1);
467
468
  }
468
469
  reportError(`Unknown command: ${command}`);
469
470
  showUsage();
@@ -1,4 +1,4 @@
1
- import type { GenerateChangelogOptions } from './generateChangelogs.ts';
2
- import type { ChangelogEntry, ReleaseConfig } from './types.ts';
1
+ import type { GenerateChangelogOptions } from './generateChangelogs.js';
2
+ import type { ChangelogEntry, ReleaseConfig } from './types.js';
3
3
  export declare function stripGroupDecorations(group: string): string;
4
4
  export declare function buildChangelogEntries(config: Pick<ReleaseConfig, 'cliffConfigPath' | 'changelogJson'>, tag: string, options?: GenerateChangelogOptions): ChangelogEntry[];