@williamthorsen/release-kit 16.1.1 → 17.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 (116) hide show
  1. package/.meta/changelog.json +79 -0
  2. package/.readyup/kits/default.js +2 -2
  3. package/.readyup/kits/npm-auto-publish.js +1 -1
  4. package/.readyup/manifest.json +204 -16
  5. package/CHANGELOG.md +28 -0
  6. package/README.md +7 -2
  7. package/bin/release-kit.js +1 -1
  8. package/dist/esm/assertCleanWorkingTree.js +14 -7
  9. package/dist/esm/assertReleasesOnNpm.js +11 -3
  10. package/dist/esm/assertTaggedBaseline.js +2 -1
  11. package/dist/esm/assertTarballsComplete.js +16 -5
  12. package/dist/esm/bin.d.ts +2 -0
  13. package/dist/esm/bin.js +1 -0
  14. package/dist/esm/buildChangelogEntries.js +2 -2
  15. package/dist/esm/buildDependencyGraph.js +5 -4
  16. package/dist/esm/bumpVersion.js +3 -2
  17. package/dist/esm/changelogJsonUtils.js +2 -1
  18. package/dist/esm/changelogOverrides.js +3 -2
  19. package/dist/esm/cli/commandKit.d.ts +18 -0
  20. package/dist/esm/cli/commandKit.js +27 -0
  21. package/dist/esm/cli/maintenanceCommands.d.ts +6 -0
  22. package/dist/esm/cli/maintenanceCommands.js +129 -0
  23. package/dist/esm/cli/releaseCommands.d.ts +7 -0
  24. package/dist/esm/cli/releaseCommands.js +156 -0
  25. package/dist/esm/cli.js +9 -237
  26. package/dist/esm/commitCommand.d.ts +4 -1
  27. package/dist/esm/commitCommand.js +12 -10
  28. package/dist/esm/compareVersions.js +2 -1
  29. package/dist/esm/createGithubRelease.js +7 -1
  30. package/dist/esm/createGithubReleaseCommand.d.ts +10 -4
  31. package/dist/esm/createGithubReleaseCommand.js +4 -18
  32. package/dist/esm/createTags.js +6 -4
  33. package/dist/esm/deleteFileIfExists.js +2 -1
  34. package/dist/esm/deriveDirectoryConfig.js +7 -7
  35. package/dist/esm/deriveWorkspaceConfig.js +4 -4
  36. package/dist/esm/detectPackageManager.js +1 -1
  37. package/dist/esm/enterRepoRoot.js +2 -1
  38. package/dist/esm/enumerateReleaseWindows.js +2 -2
  39. package/dist/esm/findMissingManifestPaths.js +1 -1
  40. package/dist/esm/hasPrettierConfig.js +1 -1
  41. package/dist/esm/init/initCommand.js +10 -1
  42. package/dist/esm/init/parseJsonRecord.js +1 -1
  43. package/dist/esm/init/updateTemplatesCommand.js +10 -1
  44. package/dist/esm/isPublishableManifest.js +1 -1
  45. package/dist/esm/loadChangelogOverrides.js +1 -1
  46. package/dist/esm/loadConfig.js +6 -6
  47. package/dist/esm/loadValidatedConfig.d.ts +6 -1
  48. package/dist/esm/loadValidatedConfig.js +11 -3
  49. package/dist/esm/mergeConfig.js +5 -4
  50. package/dist/esm/monorepoConfigAssertions.js +6 -5
  51. package/dist/esm/npmRegistry.js +1 -1
  52. package/dist/esm/packFromCleanCheckout.js +12 -4
  53. package/dist/esm/parseChangeRecordBlock.js +1 -1
  54. package/dist/esm/planVersionBump.js +6 -5
  55. package/dist/esm/prepareArgs.d.ts +1 -49
  56. package/dist/esm/prepareArgs.js +4 -51
  57. package/dist/esm/prepareCommand.d.ts +15 -3
  58. package/dist/esm/prepareCommand.js +26 -44
  59. package/dist/esm/prepareComposite.js +2 -1
  60. package/dist/esm/prepareRunContext.js +2 -2
  61. package/dist/esm/previewTagPrefixes.js +2 -2
  62. package/dist/esm/publish.js +7 -1
  63. package/dist/esm/publishCommand.d.ts +12 -3
  64. package/dist/esm/publishCommand.js +4 -33
  65. package/dist/esm/pushCommand.d.ts +12 -4
  66. package/dist/esm/pushCommand.js +6 -27
  67. package/dist/esm/pushRelease.js +18 -6
  68. package/dist/esm/releaseFiles.js +2 -2
  69. package/dist/esm/releasePlan.js +2 -2
  70. package/dist/esm/resolveCommandTags.d.ts +4 -4
  71. package/dist/esm/resolveCommandTags.js +8 -12
  72. package/dist/esm/resolveReleaseDeclaration.js +9 -8
  73. package/dist/esm/resolveReleaseTags.js +11 -4
  74. package/dist/esm/resolveReleaseTargets.js +2 -1
  75. package/dist/esm/{resolveStylesOrExit.d.ts → resolveStyles.d.ts} +2 -2
  76. package/dist/esm/resolveStyles.js +10 -0
  77. package/dist/esm/route.d.ts +2 -0
  78. package/dist/esm/route.js +39 -0
  79. package/dist/esm/showTagPrefixesCommand.js +6 -3
  80. package/dist/esm/sync-labels/generateCommand.js +11 -7
  81. package/dist/esm/sync-labels/initCommand.js +7 -1
  82. package/dist/esm/sync-labels/presets.js +7 -8
  83. package/dist/esm/sync-labels/resolveLabels.js +4 -3
  84. package/dist/esm/sync-labels/retiredConfig.js +2 -1
  85. package/dist/esm/sync-labels/syncCommand.js +4 -3
  86. package/dist/esm/sync-labels/templates.js +2 -2
  87. package/dist/esm/tagCommand.d.ts +8 -3
  88. package/dist/esm/tagCommand.js +2 -15
  89. package/dist/esm/typeGuards.d.ts +0 -2
  90. package/dist/esm/typeGuards.js +0 -3
  91. package/dist/esm/user-error-chaining.d.ts +13 -0
  92. package/dist/esm/user-error-chaining.js +11 -0
  93. package/dist/esm/validateConfig.js +1 -1
  94. package/dist/esm/validateOverridesCommand.js +12 -5
  95. package/docs/configuration.md +1 -1
  96. package/docs/editorial-overrides.md +2 -0
  97. package/docs/labels.md +2 -0
  98. package/docs/releasing.md +1 -1
  99. package/package.json +3 -3
  100. package/dist/esm/configFlagSchema.d.ts +0 -12
  101. package/dist/esm/configFlagSchema.js +0 -3
  102. package/dist/esm/help/initHelp.d.ts +0 -4
  103. package/dist/esm/help/initHelp.js +0 -31
  104. package/dist/esm/help/overridesHelp.d.ts +0 -4
  105. package/dist/esm/help/overridesHelp.js +0 -32
  106. package/dist/esm/help/prepareHelp.d.ts +0 -7
  107. package/dist/esm/help/prepareHelp.js +0 -30
  108. package/dist/esm/help/releaseStepsHelp.d.ts +0 -12
  109. package/dist/esm/help/releaseStepsHelp.js +0 -91
  110. package/dist/esm/help/syncLabelsHelp.d.ts +0 -8
  111. package/dist/esm/help/syncLabelsHelp.js +0 -55
  112. package/dist/esm/help/usage.d.ts +0 -2
  113. package/dist/esm/help/usage.js +0 -29
  114. package/dist/esm/resolveConfigFlag.d.ts +0 -7
  115. package/dist/esm/resolveConfigFlag.js +0 -4
  116. package/dist/esm/resolveStylesOrExit.js +0 -10
@@ -1,4 +1,83 @@
1
1
  [
2
+ {
3
+ "version": "17.0.0",
4
+ "date": "2026-11-08",
5
+ "sections": [
6
+ {
7
+ "title": "🎉 Features",
8
+ "audience": "all",
9
+ "items": [
10
+ {
11
+ "description": "Routes `release-kit` commands through the `toolbelt.cli` command parser, which renders help from each command's options and makes a usage error, such as an invalid `RELEASE_KIT_OUTPUT_STYLE` or a stray argument to `sync-labels sync`, exit 2 with a `Try` line instead of exit 1, and makes a bare `release-kit`, `release-kit overrides`, or `release-kit sync-labels` exit 2 instead of printing help and exiting 0. (#1186)",
12
+ "breaking": true,
13
+ "migration": "Update any script that checks for exit code 1 from a `release-kit` usage error to check for 2, and replace a bare `release-kit`, `release-kit overrides`, or `release-kit sync-labels` with the same command followed by `--help`; note that `release-kit overrides validate` already exits 2 for a schema or parse error, so a script cannot tell that error from a usage error by its exit code alone.",
14
+ "hash": "343c0f97b212aa710c49baf61fce118256da6db7",
15
+ "entry": 1
16
+ },
17
+ {
18
+ "description": "Prefixes each handled error line written by `nmr` and its other bins, `release-kit`, and `v11y-check` with the name of the program that wrote it, as `<bin>: <message>` in place of `Error: <message>`, for usage errors such as an unknown command or option as well, and names `v11y` for both of the bins in `v11y-check`. (#1190)",
19
+ "hash": "b7634734032c508e45388b7752b7b6905071273e",
20
+ "entry": 1
21
+ }
22
+ ]
23
+ },
24
+ {
25
+ "title": "🐛 Bug fixes",
26
+ "audience": "all",
27
+ "items": [
28
+ {
29
+ "description": "Fixes the issue that the tarball refusal from `release-kit prepare` and `release-kit publish` pointed to a `prepack` script, even though the check builds the package through its `prepublishOnly` script, and makes the refusal and `docs/releasing.md` name `\"prepublishOnly\": \"nmr build\"` instead. (#1193)",
30
+ "hash": "916c4dcf90766d43721feaad4d6d443f89533902",
31
+ "entry": 1
32
+ }
33
+ ]
34
+ },
35
+ {
36
+ "title": "♻️ Refactoring",
37
+ "audience": "dev",
38
+ "items": [
39
+ {
40
+ "description": "Replaces nmr's `isObject`, release-kit's `isRecord`, and the private copies in nmr-core's `workspace.ts` and an nmr test with one `isRecord` guard exported from the root entry of `@williamthorsen/nmr-core`. (#1194)",
41
+ "hash": "6c66148170145ccf5628c95d27e7783ef26d97e9",
42
+ "entry": 1
43
+ },
44
+ {
45
+ "description": "Group nmr-core's source by role (#1196)",
46
+ "body": "Groups `nmr-core`'s source modules into `cache`, `errors`, `files`, `git`, `portable`, and `workspace` directories by role, retiring `helpers/`, and moves the write-outcome reporters out of `terminal.ts` into `files/report-write-outcomes.ts`. The package's exports, including the `./workspace` subpath, resolve to the same modules at their new paths.",
47
+ "hash": "bddeaf8cdad251c681808688be3d459c60fc2bdb"
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ "title": "📚 Documentation",
53
+ "audience": "dev",
54
+ "items": [
55
+ {
56
+ "description": "Documents for each shipped JSON Schema the `node_modules` path, such as `../node_modules/v11y-check/schemas/config.json`, that a project listing the package as a direct dependency can use as `$schema`, and states that the path does not resolve when the package is installed through another package or run through `pnpm dlx` or `npx`. (#1206)",
57
+ "hash": "cf19a9037ab15a24548ecc9cebe27c06f262ad6a",
58
+ "entry": 3
59
+ }
60
+ ]
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "version": "16.1.2",
66
+ "date": "2026-11-06",
67
+ "sections": [
68
+ {
69
+ "title": "🐛 Bug fixes",
70
+ "audience": "all",
71
+ "items": [
72
+ {
73
+ "description": "Fixes the issue that `release-kit` printed a bug in its own code as an ordinary `Error: <message>`, which it now prints as `release-kit: internal error: <message>` followed by the stack, while a failure in the user's input, config, or environment, including a failed `git`, `gh`, or `npm` call, keeps the `Error: <message>` form. (#1158)",
74
+ "hash": "3a62cc768b23f37156c846f32fd4acaa70f7f931",
75
+ "entry": 1
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ },
2
81
  {
3
82
  "version": "16.1.1",
4
83
  "date": "2026-11-05",
@@ -18,7 +18,7 @@ import {
18
18
  // src/init/detectRepoType.ts
19
19
  import { existsSync, readFileSync } from "node:fs";
20
20
 
21
- // src/typeGuards.ts
21
+ // ../nmr-core/dist/esm/portable/isRecord.js
22
22
  function isRecord(value) {
23
23
  return typeof value === "object" && value !== null && !Array.isArray(value);
24
24
  }
@@ -234,7 +234,7 @@ var CREATE_GITHUB_RELEASE_WORKFLOW_HASH_SINGLE = "d6de961de913c67b08dfa7e07f7349
234
234
 
235
235
  // .readyup/kits/default.ts
236
236
  function getMinVersion() {
237
- const picked = { "version": "16.1.1" };
237
+ const picked = { "version": "17.0.0" };
238
238
  if (typeof picked["version"] !== "string") {
239
239
  throw new TypeError("release-kit/package.json: 'version' must be a string");
240
240
  }
@@ -20,7 +20,7 @@ import {
20
20
  // src/npmRegistry.ts
21
21
  import { execFileSync } from "node:child_process";
22
22
 
23
- // src/typeGuards.ts
23
+ // ../nmr-core/dist/esm/portable/isRecord.js
24
24
  function isRecord(value) {
25
25
  return typeof value === "object" && value !== null && !Array.isArray(value);
26
26
  }
@@ -2,12 +2,31 @@
2
2
  "version": 1,
3
3
  "kits": [
4
4
  {
5
+ "bundledDependencies": {
6
+ "@williamthorsen/toolbelt.datetime": "4.1.0",
7
+ "@williamthorsen/toolbelt.errors": "0.9.0",
8
+ "@williamthorsen/toolbelt.filesystem": "0.10.0",
9
+ "@williamthorsen/toolbelt.numbers": "7.3.0",
10
+ "@williamthorsen/toolbelt.objects": "4.4.0",
11
+ "@williamthorsen/toolbelt.packaging": "0.7.0",
12
+ "@williamthorsen/toolbelt.terminal": "0.3.0",
13
+ "ansi-regex": "6.5.0",
14
+ "ansi-styles": "6.2.3",
15
+ "cli-truncate": "6.1.1",
16
+ "diff": "9.0.0",
17
+ "get-east-asian-width": "1.7.0",
18
+ "is-fullwidth-code-point": "5.1.0",
19
+ "slice-ansi": "9.0.1",
20
+ "string-width": "8.3.0",
21
+ "strip-ansi": "7.2.0",
22
+ "wrap-ansi": "10.0.2"
23
+ },
5
24
  "checklistChecks": [
6
25
  {
7
26
  "checklist": "release-kit",
8
27
  "checks": [
9
28
  "@williamthorsen/release-kit in devDependencies",
10
- "@williamthorsen/release-kit >= 16.1.1",
29
+ "@williamthorsen/release-kit >= 17.0.0",
11
30
  "release.yaml workflow exists",
12
31
  "release.yaml matches template",
13
32
  "release.yaml does not reference deprecated tag ref",
@@ -42,6 +61,86 @@
42
61
  ],
43
62
  "esbuildVersion": "0.28.2",
44
63
  "inputs": [
64
+ {
65
+ "hash": "bf29a9a3",
66
+ "kind": "module",
67
+ "path": "../../nmr-core/dist/esm/cache/cache-store.js"
68
+ },
69
+ {
70
+ "hash": "6b7d0243",
71
+ "kind": "module",
72
+ "path": "../../nmr-core/dist/esm/errors/hasErrnoCode.js"
73
+ },
74
+ {
75
+ "hash": "85d76864",
76
+ "kind": "module",
77
+ "path": "../../nmr-core/dist/esm/errors/isAnticipatedFailure.js"
78
+ },
79
+ {
80
+ "hash": "e02e0a74",
81
+ "kind": "module",
82
+ "path": "../../nmr-core/dist/esm/errors/UserError.js"
83
+ },
84
+ {
85
+ "hash": "77aa59f7",
86
+ "kind": "module",
87
+ "path": "../../nmr-core/dist/esm/files/report-write-outcomes.js"
88
+ },
89
+ {
90
+ "hash": "5ae3e980",
91
+ "kind": "module",
92
+ "path": "../../nmr-core/dist/esm/files/updateManagedFile.js"
93
+ },
94
+ {
95
+ "hash": "d377c37c",
96
+ "kind": "module",
97
+ "path": "../../nmr-core/dist/esm/files/writeFileWithCheck.js"
98
+ },
99
+ {
100
+ "hash": "bc0baa4a",
101
+ "kind": "module",
102
+ "path": "../../nmr-core/dist/esm/git/collectChangedPaths.js"
103
+ },
104
+ {
105
+ "hash": "70d519e7",
106
+ "kind": "module",
107
+ "path": "../../nmr-core/dist/esm/git/gitObjects.js"
108
+ },
109
+ {
110
+ "hash": "d5a89448",
111
+ "kind": "module",
112
+ "path": "../../nmr-core/dist/esm/git/gitOutputLimit.js"
113
+ },
114
+ {
115
+ "hash": "62be92c4",
116
+ "kind": "module",
117
+ "path": "../../nmr-core/dist/esm/git/hashWorkingTree.js"
118
+ },
119
+ {
120
+ "hash": "6734717f",
121
+ "kind": "module",
122
+ "path": "../../nmr-core/dist/esm/git/runGit.js"
123
+ },
124
+ {
125
+ "hash": "fe9fd44c",
126
+ "kind": "module",
127
+ "path": "../../nmr-core/dist/esm/index.js"
128
+ },
129
+ {
130
+ "hash": "1d74f646",
131
+ "kind": "module",
132
+ "path": "../../nmr-core/dist/esm/portable/isRecord.js"
133
+ },
134
+ {
135
+ "hash": "b88a9126",
136
+ "kind": "module",
137
+ "path": "../../nmr-core/dist/esm/terminal.js"
138
+ },
139
+ {
140
+ "hash": "85afaf3e",
141
+ "kind": "module",
142
+ "path": "../../nmr-core/dist/esm/timer.js"
143
+ },
45
144
  {
46
145
  "hash": "56566d0b",
47
146
  "kind": "module",
@@ -63,7 +162,7 @@
63
162
  "path": "lib/workflow-hashes.ts"
64
163
  },
65
164
  {
66
- "hash": "1c9904c3",
165
+ "hash": "8df94cba",
67
166
  "kind": "inline",
68
167
  "path": "../package.json",
69
168
  "paths": [
@@ -81,7 +180,7 @@
81
180
  "path": "../src/init/detectRepoType.ts"
82
181
  },
83
182
  {
84
- "hash": "9ca0f6bf",
183
+ "hash": "133be525",
85
184
  "kind": "module",
86
185
  "path": "../src/init/parseJsonRecord.ts"
87
186
  },
@@ -89,11 +188,6 @@
89
188
  "hash": "2210df36",
90
189
  "kind": "module",
91
190
  "path": "../src/packsPath.ts"
92
- },
93
- {
94
- "hash": "1424b343",
95
- "kind": "module",
96
- "path": "../src/typeGuards.ts"
97
191
  }
98
192
  ],
99
193
  "name": "default",
@@ -101,9 +195,28 @@
101
195
  "readyupVersion": "0.45.0",
102
196
  "source": "kits/default.ts",
103
197
  "sourceHash": "56566d0b",
104
- "targetHash": "070a29f8"
198
+ "targetHash": "060f7720"
105
199
  },
106
200
  {
201
+ "bundledDependencies": {
202
+ "@williamthorsen/toolbelt.datetime": "4.1.0",
203
+ "@williamthorsen/toolbelt.errors": "0.9.0",
204
+ "@williamthorsen/toolbelt.filesystem": "0.10.0",
205
+ "@williamthorsen/toolbelt.numbers": "7.3.0",
206
+ "@williamthorsen/toolbelt.objects": "4.4.0",
207
+ "@williamthorsen/toolbelt.packaging": "0.7.0",
208
+ "@williamthorsen/toolbelt.terminal": "0.3.0",
209
+ "ansi-regex": "6.5.0",
210
+ "ansi-styles": "6.2.3",
211
+ "cli-truncate": "6.1.1",
212
+ "diff": "9.0.0",
213
+ "get-east-asian-width": "1.7.0",
214
+ "is-fullwidth-code-point": "5.1.0",
215
+ "slice-ansi": "9.0.1",
216
+ "string-width": "8.3.0",
217
+ "strip-ansi": "7.2.0",
218
+ "wrap-ansi": "10.0.2"
219
+ },
107
220
  "checklistChecks": [
108
221
  {
109
222
  "checklist": "repo",
@@ -129,6 +242,86 @@
129
242
  ],
130
243
  "esbuildVersion": "0.28.2",
131
244
  "inputs": [
245
+ {
246
+ "hash": "bf29a9a3",
247
+ "kind": "module",
248
+ "path": "../../nmr-core/dist/esm/cache/cache-store.js"
249
+ },
250
+ {
251
+ "hash": "6b7d0243",
252
+ "kind": "module",
253
+ "path": "../../nmr-core/dist/esm/errors/hasErrnoCode.js"
254
+ },
255
+ {
256
+ "hash": "85d76864",
257
+ "kind": "module",
258
+ "path": "../../nmr-core/dist/esm/errors/isAnticipatedFailure.js"
259
+ },
260
+ {
261
+ "hash": "e02e0a74",
262
+ "kind": "module",
263
+ "path": "../../nmr-core/dist/esm/errors/UserError.js"
264
+ },
265
+ {
266
+ "hash": "77aa59f7",
267
+ "kind": "module",
268
+ "path": "../../nmr-core/dist/esm/files/report-write-outcomes.js"
269
+ },
270
+ {
271
+ "hash": "5ae3e980",
272
+ "kind": "module",
273
+ "path": "../../nmr-core/dist/esm/files/updateManagedFile.js"
274
+ },
275
+ {
276
+ "hash": "d377c37c",
277
+ "kind": "module",
278
+ "path": "../../nmr-core/dist/esm/files/writeFileWithCheck.js"
279
+ },
280
+ {
281
+ "hash": "bc0baa4a",
282
+ "kind": "module",
283
+ "path": "../../nmr-core/dist/esm/git/collectChangedPaths.js"
284
+ },
285
+ {
286
+ "hash": "70d519e7",
287
+ "kind": "module",
288
+ "path": "../../nmr-core/dist/esm/git/gitObjects.js"
289
+ },
290
+ {
291
+ "hash": "d5a89448",
292
+ "kind": "module",
293
+ "path": "../../nmr-core/dist/esm/git/gitOutputLimit.js"
294
+ },
295
+ {
296
+ "hash": "62be92c4",
297
+ "kind": "module",
298
+ "path": "../../nmr-core/dist/esm/git/hashWorkingTree.js"
299
+ },
300
+ {
301
+ "hash": "6734717f",
302
+ "kind": "module",
303
+ "path": "../../nmr-core/dist/esm/git/runGit.js"
304
+ },
305
+ {
306
+ "hash": "fe9fd44c",
307
+ "kind": "module",
308
+ "path": "../../nmr-core/dist/esm/index.js"
309
+ },
310
+ {
311
+ "hash": "1d74f646",
312
+ "kind": "module",
313
+ "path": "../../nmr-core/dist/esm/portable/isRecord.js"
314
+ },
315
+ {
316
+ "hash": "b88a9126",
317
+ "kind": "module",
318
+ "path": "../../nmr-core/dist/esm/terminal.js"
319
+ },
320
+ {
321
+ "hash": "85afaf3e",
322
+ "kind": "module",
323
+ "path": "../../nmr-core/dist/esm/timer.js"
324
+ },
132
325
  {
133
326
  "hash": "682fdd4a",
134
327
  "kind": "module",
@@ -145,14 +338,9 @@
145
338
  "path": "../src/init/hasProvenance.ts"
146
339
  },
147
340
  {
148
- "hash": "bb8746b3",
341
+ "hash": "4f6456ae",
149
342
  "kind": "module",
150
343
  "path": "../src/npmRegistry.ts"
151
- },
152
- {
153
- "hash": "1424b343",
154
- "kind": "module",
155
- "path": "../src/typeGuards.ts"
156
344
  }
157
345
  ],
158
346
  "name": "npm-auto-publish",
@@ -160,7 +348,7 @@
160
348
  "readyupVersion": "0.45.0",
161
349
  "source": "kits/npm-auto-publish.ts",
162
350
  "sourceHash": "682fdd4a",
163
- "targetHash": "52d15648"
351
+ "targetHash": "bdd314ac"
164
352
  }
165
353
  ]
166
354
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,34 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 17.0.0 — 2026-11-08
6
+
7
+ ### 🎉 Features
8
+
9
+ - 🚨 **Breaking:** Routes `release-kit` commands through the `toolbelt.cli` command parser, which renders help from each command's options and makes a usage error, such as an invalid `RELEASE_KIT_OUTPUT_STYLE` or a stray argument to `sync-labels sync`, exit 2 with a `Try` line instead of exit 1, and makes a bare `release-kit`, `release-kit overrides`, or `release-kit sync-labels` exit 2 instead of printing help and exiting 0. (#1186)
10
+ - Prefixes each handled error line written by `nmr` and its other bins, `release-kit`, and `v11y-check` with the name of the program that wrote it, as `<bin>: <message>` in place of `Error: <message>`, for usage errors such as an unknown command or option as well, and names `v11y` for both of the bins in `v11y-check`. (#1190)
11
+
12
+ ### 🐛 Bug fixes
13
+
14
+ - Fixes the issue that the tarball refusal from `release-kit prepare` and `release-kit publish` pointed to a `prepack` script, even though the check builds the package through its `prepublishOnly` script, and makes the refusal and `docs/releasing.md` name `"prepublishOnly": "nmr build"` instead. (#1193)
15
+
16
+ ### ♻️ Refactoring
17
+
18
+ - Replaces nmr's `isObject`, release-kit's `isRecord`, and the private copies in nmr-core's `workspace.ts` and an nmr test with one `isRecord` guard exported from the root entry of `@williamthorsen/nmr-core`. (#1194)
19
+ - Group nmr-core's source by role (#1196)
20
+
21
+ Groups `nmr-core`'s source modules into `cache`, `errors`, `files`, `git`, `portable`, and `workspace` directories by role, retiring `helpers/`, and moves the write-outcome reporters out of `terminal.ts` into `files/report-write-outcomes.ts`. The package's exports, including the `./workspace` subpath, resolve to the same modules at their new paths.
22
+
23
+ ### 📚 Documentation
24
+
25
+ - Documents for each shipped JSON Schema the `node_modules` path, such as `../node_modules/v11y-check/schemas/config.json`, that a project listing the package as a direct dependency can use as `$schema`, and states that the path does not resolve when the package is installed through another package or run through `pnpm dlx` or `npx`. (#1206)
26
+
27
+ ## 16.1.2 — 2026-11-06
28
+
29
+ ### 🐛 Bug fixes
30
+
31
+ - Fixes the issue that `release-kit` printed a bug in its own code as an ordinary `Error: <message>`, which it now prints as `release-kit: internal error: <message>` followed by the stack, while a failure in the user's input, config, or environment, including a failed `git`, `gh`, or `npm` call, keeps the `Error: <message>` form. (#1158)
32
+
5
33
  ## 16.1.1 — 2026-11-05
6
34
 
7
35
  ### 🐛 Bug fixes
package/README.md CHANGED
@@ -7,11 +7,16 @@ 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 — v16.1.1 (2026-11-05)
10
+ ## Release notes — v17.0.0 (2026-11-08)
11
+
12
+ ### 🎉 Features
13
+
14
+ - 🚨 **Breaking:** Routes `release-kit` commands through the `toolbelt.cli` command parser, which renders help from each command's options and makes a usage error, such as an invalid `RELEASE_KIT_OUTPUT_STYLE` or a stray argument to `sync-labels sync`, exit 2 with a `Try` line instead of exit 1, and makes a bare `release-kit`, `release-kit overrides`, or `release-kit sync-labels` exit 2 instead of printing help and exiting 0. (#1186)
15
+ - Prefixes each handled error line written by `nmr` and its other bins, `release-kit`, and `v11y-check` with the name of the program that wrote it, as `<bin>: <message>` in place of `Error: <message>`, for usage errors such as an unknown command or option as well, and names `v11y` for both of the bins in `v11y-check`. (#1190)
11
16
 
12
17
  ### 🐛 Bug fixes
13
18
 
14
- - Fixes the issue that the bin scripts of `nmr`, `release-kit`, and `v11y-check` reported every error other than missing build output as `<bin>: failed to load: <message>` without a stack, which hid where the fault occurred. (#1157)
19
+ - Fixes the issue that the tarball refusal from `release-kit prepare` and `release-kit publish` pointed to a `prepack` script, even though the check builds the package through its `prepublishOnly` script, and makes the refusal and `docs/releasing.md` name `"prepublishOnly": "nmr build"` instead. (#1193)
15
20
  <!-- /section:release-notes -->
16
21
 
17
22
  ## Installation
@@ -11,5 +11,5 @@ try {
11
11
  const frames = firstFrame === -1 ? '' : `${lines.slice(firstFrame).join('\n')}\n`;
12
12
  process.stderr.write(`release-kit: internal error: ${message}\n${frames}`);
13
13
  }
14
- process.exit(1);
14
+ process.exitCode = 1;
15
15
  }
@@ -1,12 +1,19 @@
1
1
  import { execFileSync } from 'node:child_process';
2
- import { GIT_OUTPUT_LIMIT_BYTES } from '@williamthorsen/nmr-core';
2
+ import { GIT_OUTPUT_LIMIT_BYTES, UserError } from '@williamthorsen/nmr-core';
3
+ import { asUserError } from "./user-error-chaining.js";
3
4
  export function assertCleanWorkingTree() {
4
- const status = execFileSync('git', ['status', '--porcelain'], {
5
- encoding: 'utf8',
6
- maxBuffer: GIT_OUTPUT_LIMIT_BYTES,
7
- stdio: ['pipe', 'pipe', 'pipe'],
8
- }).trim();
5
+ let status;
6
+ try {
7
+ status = execFileSync('git', ['status', '--porcelain'], {
8
+ encoding: 'utf8',
9
+ maxBuffer: GIT_OUTPUT_LIMIT_BYTES,
10
+ stdio: ['pipe', 'pipe', 'pipe'],
11
+ }).trim();
12
+ }
13
+ catch (error) {
14
+ throw asUserError(error);
15
+ }
9
16
  if (status.length > 0) {
10
- throw new Error('Working tree has uncommitted changes. Commit or stash them, or use --no-git-checks to bypass this check.');
17
+ throw new UserError('Working tree has uncommitted changes. Commit or stash them, or use --no-git-checks to bypass this check.');
11
18
  }
12
19
  }
@@ -1,8 +1,9 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
+ import { isRecord, UserError } from '@williamthorsen/nmr-core';
3
4
  import { isPublishableManifest } from "./isPublishableManifest.js";
4
5
  import { lookUpNpmPackage } from "./npmRegistry.js";
5
- import { isRecord } from "./typeGuards.js";
6
+ import { chainUserError } from "./user-error-chaining.js";
6
7
  export function assertReleasesOnNpm(workspacePaths) {
7
8
  const unpublishedCandidates = [];
8
9
  const unverifiableCandidates = [];
@@ -22,10 +23,17 @@ export function assertReleasesOnNpm(workspacePaths) {
22
23
  if (unpublishedCandidates.length === 0 && unverifiableCandidates.length === 0) {
23
24
  return;
24
25
  }
25
- throw new Error(describeRefusal(unpublishedCandidates, unverifiableCandidates));
26
+ throw new UserError(describeRefusal(unpublishedCandidates, unverifiableCandidates));
26
27
  }
27
28
  function buildNpmCandidate(workspacePath) {
28
- const manifest = JSON.parse(readFileSync(join(workspacePath, 'package.json'), 'utf8'));
29
+ const manifestPath = join(workspacePath, 'package.json');
30
+ let manifest;
31
+ try {
32
+ manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
33
+ }
34
+ catch (error) {
35
+ throw chainUserError(`Failed to parse ${manifestPath}`, error);
36
+ }
29
37
  if (!isRecord(manifest) || !isPublishableManifest(manifest) || typeof manifest['name'] !== 'string') {
30
38
  return undefined;
31
39
  }
@@ -1,4 +1,5 @@
1
1
  import { join } from 'node:path';
2
+ import { UserError } from '@williamthorsen/nmr-core';
2
3
  import { resolveChangelogJsonPath } from "./changelogJsonFile.js";
3
4
  import { readChangelogEntries } from "./changelogJsonUtils.js";
4
5
  import { readCurrentVersion } from "./planVersionBump.js";
@@ -8,7 +9,7 @@ export function assertTaggedBaseline(findings) {
8
9
  if (untaggedFindings.length === 0)
9
10
  return;
10
11
  const lines = untaggedFindings.map(({ label, version, tag }) => ` - ${label}: ${version} (create tag ${tag})`);
11
- throw new Error([
12
+ throw new UserError([
12
13
  'The current version is recorded in the changelog, but its tag is not the previous tag reachable from HEAD:',
13
14
  ...lines,
14
15
  'Tag the commit that released each version, then run prepare again.',
@@ -1,11 +1,12 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
+ import { isAnticipatedFailure, isRecord, UserError } from '@williamthorsen/nmr-core';
3
4
  import { describeError } from '@williamthorsen/toolbelt.errors';
4
5
  import { detectPackageManager } from "./detectPackageManager.js";
5
6
  import { findMissingManifestPaths } from "./findMissingManifestPaths.js";
6
7
  import { isPublishableManifest } from "./isPublishableManifest.js";
7
8
  import { packFromCleanCheckout } from "./packFromCleanCheckout.js";
8
- import { isRecord } from "./typeGuards.js";
9
+ import { chainUserError } from "./user-error-chaining.js";
9
10
  export function assertTarballsComplete(workspacePaths, devExportConditions, pack = packFromCleanCheckout) {
10
11
  const candidates = workspacePaths
11
12
  .map((workspacePath) => ({ workspacePath, manifest: readManifest(workspacePath) }))
@@ -19,7 +20,10 @@ export function assertTarballsComplete(workspacePaths, devExportConditions, pack
19
20
  filesByWorkspace = pack(candidates.map(({ workspacePath }) => workspacePath), detectPackageManager());
20
21
  }
21
22
  catch (error) {
22
- throw new Error(`Cannot release: The packages could not be packed from a clean checkout of HEAD.\n${describeError(error)}`, { cause: error });
23
+ if (!isAnticipatedFailure(error)) {
24
+ throw error;
25
+ }
26
+ throw new UserError(`Cannot release: The packages could not be packed from a clean checkout of HEAD.\n${describeError(error)}`, { cause: error });
23
27
  }
24
28
  const incompletePackages = candidates
25
29
  .map(({ workspacePath, manifest }) => ({
@@ -31,7 +35,7 @@ export function assertTarballsComplete(workspacePaths, devExportConditions, pack
31
35
  if (incompletePackages.length === 0) {
32
36
  return;
33
37
  }
34
- throw new Error(describeRefusal(incompletePackages));
38
+ throw new UserError(describeRefusal(incompletePackages));
35
39
  }
36
40
  function describeRefusal(incompletePackages) {
37
41
  const sections = ['Cannot release: The tarball of every package must contain each file that its manifest names.'];
@@ -42,11 +46,18 @@ function describeRefusal(incompletePackages) {
42
46
  ...missingPaths.map(({ location, path }) => ` - ${path} (${location})`),
43
47
  ].join('\n'));
44
48
  }
45
- sections.push('Build these files in the package\'s publish lifecycle, such as in a "prepack" script. ' +
49
+ sections.push('Build these files in the package\'s prepublishOnly script, usually "prepublishOnly": "nmr build". ' +
46
50
  'If an export condition is for development only, list it in the "devExportConditions" config key.');
47
51
  return sections.join('\n\n');
48
52
  }
49
53
  function readManifest(workspacePath) {
50
- const manifest = JSON.parse(readFileSync(join(workspacePath, 'package.json'), 'utf8'));
54
+ const manifestPath = join(workspacePath, 'package.json');
55
+ let manifest;
56
+ try {
57
+ manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
58
+ }
59
+ catch (error) {
60
+ throw chainUserError(`Failed to parse ${manifestPath}`, error);
61
+ }
51
62
  return isRecord(manifest) ? manifest : {};
52
63
  }
@@ -0,0 +1,2 @@
1
+ /** The program name that release-kit's errors and help name. */
2
+ export declare const BIN = "release-kit";
@@ -0,0 +1 @@
1
+ export const BIN = 'release-kit';
@@ -1,4 +1,3 @@
1
- import { chainError } from '@williamthorsen/toolbelt.errors/candidate';
2
1
  import { buildEntryItem, buildTitleItem, hasRoutedEntry, } from "./buildChangelogItem.js";
3
2
  import { buildEmptyReleaseEntry } from "./buildEmptyReleaseEntry.js";
4
3
  import { extractVersion } from "./changelogJsonUtils.js";
@@ -8,6 +7,7 @@ import { determineBumpType } from "./determineBumpType.js";
8
7
  import { enumerateReleaseWindows } from "./enumerateReleaseWindows.js";
9
8
  import { parseChangeRecordBlock } from "./parseChangeRecordBlock.js";
10
9
  import { stripEmojiPrefix } from "./stripEmojiPrefix.js";
10
+ import { prefixUserError } from "./user-error-chaining.js";
11
11
  const UNRELEASED_TAG = 'unreleased';
12
12
  const CANONICAL_SECTION_ORDER = new Map(Object.values(DEFAULT_WORK_TYPES).map((config, index) => [stripGroupDecorations(config.header), index]));
13
13
  export function buildChangelogEntries(config, tag, options) {
@@ -49,7 +49,7 @@ export function readReleaseHistory(config, options) {
49
49
  return transformReleases(windows, context);
50
50
  }
51
51
  catch (error) {
52
- throw chainError(`Failed to read the release history for ${options.tagPrefixes.join(', ')}`, error);
52
+ throw prefixUserError(`Failed to read the release history for ${options.tagPrefixes.join(', ')}`, error);
53
53
  }
54
54
  }
55
55
  export function stripGroupDecorations(group) {
@@ -1,5 +1,6 @@
1
1
  import { readFileSync } from 'node:fs';
2
- import { chainError } from '@williamthorsen/toolbelt.errors/candidate';
2
+ import { UserError } from '@williamthorsen/nmr-core';
3
+ import { chainUserError } from "./user-error-chaining.js";
3
4
  function isPackageJsonSubset(value) {
4
5
  return typeof value === 'object' && value !== null;
5
6
  }
@@ -56,17 +57,17 @@ function readPackageJsonSubset(filePath) {
56
57
  content = readFileSync(filePath, 'utf8');
57
58
  }
58
59
  catch (error) {
59
- throw chainError(`Failed to read ${filePath}`, error);
60
+ throw chainUserError(`Failed to read ${filePath}`, error);
60
61
  }
61
62
  let parsedJson;
62
63
  try {
63
64
  parsedJson = JSON.parse(content);
64
65
  }
65
66
  catch (error) {
66
- throw chainError(`Failed to parse JSON in ${filePath}`, error);
67
+ throw chainUserError(`Failed to parse JSON in ${filePath}`, error);
67
68
  }
68
69
  if (!isPackageJsonSubset(parsedJson)) {
69
- throw new Error(`Invalid package.json at ${filePath}`);
70
+ throw new UserError(`Invalid package.json at ${filePath}`);
70
71
  }
71
72
  return parsedJson;
72
73
  }