@williamthorsen/nmr-core 0.10.3 โ 0.11.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.
- package/.meta/changelog.json +535 -0
- package/CHANGELOG.md +295 -0
- package/README.md +9 -1
- package/dist/esm/cache-store.d.ts +39 -0
- package/dist/esm/findPackageRoot.d.ts +7 -0
- package/dist/esm/gitOutputLimit.d.ts +9 -0
- package/dist/esm/hasErrnoCode.d.ts +5 -0
- package/dist/esm/hashWorkingTree.d.ts +23 -0
- package/dist/esm/parseArgs.d.ts +27 -0
- package/dist/esm/readPackageVersion.d.ts +13 -0
- package/dist/esm/terminal.d.ts +15 -0
- package/dist/esm/writeFileWithCheck.d.ts +10 -0
- package/package.json +7 -5
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.11.0",
|
|
4
|
+
"date": "2026-09-08",
|
|
5
|
+
"sections": [
|
|
6
|
+
{
|
|
7
|
+
"title": "๐ Features",
|
|
8
|
+
"audience": "all",
|
|
9
|
+
"items": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Report a package whose tarball would omit its changelog (#768)",
|
|
12
|
+
"body": "Adds ReadyUp checks to verify that every published package bundles its changelog files: the human-readable `CHANGELOG.md` and the machine-readable `changelog.json`.",
|
|
13
|
+
"hash": "25dd5c01b5e5b0ac26b266613fe71f47428e6c5c"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"version": "0.10.4",
|
|
21
|
+
"date": "2026-09-01",
|
|
22
|
+
"sections": [
|
|
23
|
+
{
|
|
24
|
+
"title": "โป๏ธ Refactoring",
|
|
25
|
+
"audience": "dev",
|
|
26
|
+
"items": [
|
|
27
|
+
{
|
|
28
|
+
"description": "Upgrade eslint-config-typescript and mark the discards it now reports (#761)",
|
|
29
|
+
"body": "Upgrades `@williamthorsen/eslint-config-typescript` to v12 and fixes violations surfaced by the newly added rule warning against a disposable that is discarded or that is bound to a declaration that never releases it.",
|
|
30
|
+
"hash": "61f59fe51681c590278f7c969bb3889309396dcc"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"version": "0.10.3",
|
|
38
|
+
"date": "2026-08-24",
|
|
39
|
+
"sections": [
|
|
40
|
+
{
|
|
41
|
+
"title": "๐งช Tests",
|
|
42
|
+
"audience": "dev",
|
|
43
|
+
"items": [
|
|
44
|
+
{
|
|
45
|
+
"description": "Scaffold the nmr-core, root, and v11y-check trees through the write API (#734)",
|
|
46
|
+
"body": "Converts the `node:fs` scaffolding in five test suites across `nmr-core`, the repo root, and `v11y-check` to the temporary tree's own write API, which refuses a path that escapes the tree. Fixture helpers in `hashWorkingTree.tool.test.ts` and `init.unit.test.ts` take the tree itself in place of a captured directory string.",
|
|
47
|
+
"hash": "91afecf0302d84ac8e67607b81a0269b1c410464"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"version": "0.10.2",
|
|
55
|
+
"date": "2026-08-19",
|
|
56
|
+
"sections": [
|
|
57
|
+
{
|
|
58
|
+
"title": "๐งช Tests",
|
|
59
|
+
"audience": "dev",
|
|
60
|
+
"items": [
|
|
61
|
+
{
|
|
62
|
+
"description": "Register fixture-repo cleanup against the test that asks for it (#715)",
|
|
63
|
+
"body": "Routes nmr's `buildRepo` fixture helper through `createTempTree`, registering each fixture directory's removal against the test that requested it. The module-level accumulator and the exported `removeFixtureDirs` have been removed.",
|
|
64
|
+
"hash": "4186900691928b41e56b6f1855ca74b9700c1968"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"description": "Convert the per-test temporary directories to test-scoped fixtures (#719)",
|
|
68
|
+
"body": "Converts the suites that create a temporary directory in `nmr`, `nmr-core`, and `release-kit` to take it as a Vitest fixture built on `createTempTree`, or as a `using` declaration where the directory lives and dies inside one test body. Each suite loses the mutable binding and the `beforeEach`/`afterEach` pair that carried the directory's lifetime, and a directory is created only for the tests that name one.\n\nSeparately, `nmr lint:strict` now fails on a stale `eslint-disable` directive.",
|
|
69
|
+
"hash": "ab09827339799f3849b8968e7e25a9cd80083c30"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"version": "0.10.1",
|
|
77
|
+
"date": "2026-08-17",
|
|
78
|
+
"sections": [
|
|
79
|
+
{
|
|
80
|
+
"title": "โป๏ธ Refactoring",
|
|
81
|
+
"audience": "dev",
|
|
82
|
+
"items": [
|
|
83
|
+
{
|
|
84
|
+
"description": "Adopt silenceConsole across the test suites (#677)",
|
|
85
|
+
"body": "Adopts `silenceConsole` from `@williamthorsen/toolbelt.vitest` to replace all hand-rolled `vi.spyOn(console, โฆ)` spies and reduce boilerplate across the repo's test suites. The function returns a disposable, allowing the caller to use `using` to enable restoration of the console method at the end of the test scope.",
|
|
86
|
+
"hash": "412fd27cfe1324612aa123d1f8166fb6b37a07ff"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"description": "Adopt `isError` and consolidate errno narrowing on a shared helper (#697)",
|
|
90
|
+
"body": "Replaces every hand-rolled `instanceof Error` narrowing with `hasErrnoCode`, a new predicate exported from `@williamthorsen/nmr-core`, or with `isError` from `@williamthorsen/toolbelt.errors`. Previously the errno question was answered by inline copies alongside two private helpers of differing shape; both helpers are removed.\r\n\r\nSeparately, `eslint.config.ts` now bans `instanceof Error` in every position rather than in a ternary alone.",
|
|
91
|
+
"hash": "c5e8e8a5e006b451e8c5aeea75d35772926d503c"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"title": "๐งช Tests",
|
|
97
|
+
"audience": "dev",
|
|
98
|
+
"items": [
|
|
99
|
+
{
|
|
100
|
+
"description": "Replace the stdio spies with captureStdio (#678)",
|
|
101
|
+
"body": "Replaces every `process.stdout` and `process.stderr` spy in the test suites with `captureStdio` from `@williamthorsen/toolbelt.testing` and deletes the obviated local capture helpers. `captureStdio` buffers writes rather than recording calls, so assertions that previously used `toHaveBeenCalledWith` instead check `stderr`/`stdout` strings and their chunk arrays.\n\nSeparately, `unicorn/no-nonstandard-builtin-properties` is off for test files. Its hand-maintained symbol table omits `Symbol.dispose`, which a suite-scoped capture calls to restore the streams, and `schema: []` offers no way to extend the table.",
|
|
102
|
+
"hash": "b59304680cd26864d282ec3b36eac31bc2e0386d"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"description": "Adopt throwOnProcessExit and captureError across the test suites (#690)",
|
|
106
|
+
"body": "Adopts `throwOnProcessExit` from `@williamthorsen/toolbelt.vitest`, replacing every hand-rolled `process.exit` mock in the `release-kit` and `nmr-core` test suites, and `captureError` from `@williamthorsen/toolbelt.testing`, replacing inline try/catch/`instanceof` blocks.\n\nSeparately, `@williamthorsen/toolbelt.vitest` is now listed in the ReadyUp config, so that its kit is run by `rdy run --packages`.",
|
|
107
|
+
"hash": "41a14bbee515d27ccb92058816eec46812a88478"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"version": "0.10.0",
|
|
115
|
+
"date": "2026-08-13",
|
|
116
|
+
"sections": [
|
|
117
|
+
{
|
|
118
|
+
"title": "๐ Features",
|
|
119
|
+
"audience": "all",
|
|
120
|
+
"items": [
|
|
121
|
+
{
|
|
122
|
+
"description": "Print a retained run with nmr --log (#669)",
|
|
123
|
+
"body": "Adds `nmr --log <command>`, which prints what the last recorded pass wrote instead of running the command again. The whole transcript, up to a limit of 256 KiB, is now saved for any passing command that is not writing straight to a terminal; `--log` prints it under a header giving the instant, the duration, and the command chain that succeeded. The log of a composite is the sum of its constituents' excerpts. If a change disqualifies the recording, `--log` instead reports the change.",
|
|
124
|
+
"hash": "ed9ecb24bf0f71b1b34172a73f8bdd8c016f43fa"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"title": "โป๏ธ Refactoring",
|
|
130
|
+
"audience": "dev",
|
|
131
|
+
"items": [
|
|
132
|
+
{
|
|
133
|
+
"description": "Adopt toolbelt.errors for error-message extraction and cause-chaining (#652)",
|
|
134
|
+
"body": "Improves error reporting by adopting standardized ways of capturing and describing errors across the codebase.",
|
|
135
|
+
"hash": "30e6dac440ca7c61b8f44fb2998ff9e933425008"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"title": "โ๏ธ Tooling",
|
|
141
|
+
"audience": "dev",
|
|
142
|
+
"items": [
|
|
143
|
+
{
|
|
144
|
+
"description": "Upgrade the lint config and clear its violations (#671)",
|
|
145
|
+
"body": "Upgrades `@williamthorsen/eslint-config-typescript`, along with other config packages, and clears lint violations surfaced by the newly activated rules.",
|
|
146
|
+
"hash": "17124c0ccd1a101d9fc46743b8e6b05d1e639e19"
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"version": "0.9.3",
|
|
154
|
+
"date": "2026-08-08",
|
|
155
|
+
"sections": [
|
|
156
|
+
{
|
|
157
|
+
"title": "โ๏ธ Tooling",
|
|
158
|
+
"audience": "dev",
|
|
159
|
+
"items": [
|
|
160
|
+
{
|
|
161
|
+
"description": "Migrate to the shared tsconfig baseline (#626)",
|
|
162
|
+
"body": "Adopts `@williamthorsen/tsconfig` as the standard TypeScript configuration for this repo, replacing the previous hand-maintained copy. Reading a property through an index signature now requires bracket notation or a type that declares the property. The `nmr` build now fails on a base TypeScript config it cannot resolve, rather than building without it, and it now resolves a base config named by package name alone.",
|
|
163
|
+
"hash": "890a67c84b99d7efa663f8e64cf0beb89168581b"
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"version": "0.9.1",
|
|
171
|
+
"date": "2026-08-04",
|
|
172
|
+
"sections": [
|
|
173
|
+
{
|
|
174
|
+
"title": "๐ Bug fixes",
|
|
175
|
+
"audience": "all",
|
|
176
|
+
"items": [
|
|
177
|
+
{
|
|
178
|
+
"description": "Remove the 1 MiB ceiling on captured git output (#596)",
|
|
179
|
+
"body": "Fixes an issue where `release-kit prepare` began aborting once a repository's release history grew long enough, leaving that repository unable to cut another release. The fix covers, in addition to `prepare`, every other release-kit command that reads from git.",
|
|
180
|
+
"hash": "07bf786d00c493f7bc4c0fda6932ea9659ca6f95"
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"version": "0.9.0",
|
|
188
|
+
"date": "2026-08-03",
|
|
189
|
+
"sections": [
|
|
190
|
+
{
|
|
191
|
+
"title": "๐ Features",
|
|
192
|
+
"audience": "all",
|
|
193
|
+
"items": [
|
|
194
|
+
{
|
|
195
|
+
"description": "Publish nmr's readyup kit with a test-tier conformance check (#580)",
|
|
196
|
+
"body": "`@williamthorsen/nmr` is now bundled with ReadyUp kits that check a repo's alignment with `nmr` requirements and recommendations.\n\n`rdy run --from npm:@williamthorsen/nmr` checks the repo against the kits without prior configuration. Once the package is added to the ReadyUp config, `rdy run --packages` will run the `nmr` kits along with those of any other registered package. Requires `readyup` v0.23 or greater.",
|
|
197
|
+
"hash": "94bd46acfecf87d6ec0f981ee561c0ebf22d9c09"
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"version": "0.8.0",
|
|
205
|
+
"date": "2026-08-03",
|
|
206
|
+
"sections": [
|
|
207
|
+
{
|
|
208
|
+
"title": "๐ Features",
|
|
209
|
+
"audience": "all",
|
|
210
|
+
"items": [
|
|
211
|
+
{
|
|
212
|
+
"description": "Skip checks that already passed on the current working tree (#568)",
|
|
213
|
+
"body": "`nmr` commands now skip any pure check (types, lint, tests) that has already passed on an unchanged working tree; instead, success is reported immediately. `nmr --no-cache` causes the cache check to be skipped, and `NMR_NO_CACHE=1` does the same for a whole shell. Cached results are cleared by `nmr clean`. Which commands can skip is configurable at the monorepo root, and `NMR_DEBUG=1` reports why a run didn't skip.",
|
|
214
|
+
"hash": "2dd719e04391fabd7b773ba88c072544e73dd2e9"
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"title": "โป๏ธ Refactoring",
|
|
220
|
+
"audience": "dev",
|
|
221
|
+
"items": [
|
|
222
|
+
{
|
|
223
|
+
"description": "Share nmr-core's cache primitives with nmr-compile (#570)",
|
|
224
|
+
"body": "A package's writes to the build cache are now hidden from other packages until the write is complete. A failing build now reports its error in the same form as every other `nmr` command. `tsx` is no longer required to build a package.",
|
|
225
|
+
"hash": "2a67cf1e6181cb8713de485859c3731e16edacf6"
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"version": "0.7.3",
|
|
233
|
+
"date": "2026-07-30",
|
|
234
|
+
"sections": [
|
|
235
|
+
{
|
|
236
|
+
"title": "โ๏ธ Tooling",
|
|
237
|
+
"audience": "dev",
|
|
238
|
+
"items": [
|
|
239
|
+
{
|
|
240
|
+
"description": "Adopt Vitest projects in this repo (#530)",
|
|
241
|
+
"body": "Simplifies test configurations so that every package exposes the same test commands, which select suites by test category: `nmr test` runs everything except integration tests, `nmr test:integration` runs only those, and `nmr test:all` runs both. `nmr test:integration` now succeeds in a package that has no integration tests instead of failing. release-kit's drift checks can now be run on their own, apart from unit and integration tests. A fresh clone now has to run `pnpm run bootstrap` before any test run, not just before `nmr` commands.",
|
|
242
|
+
"hash": "a2fdd9c03c419f8fb70941ff5a3c580a6badcde6"
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"version": "0.7.1",
|
|
250
|
+
"date": "2026-07-22",
|
|
251
|
+
"sections": [
|
|
252
|
+
{
|
|
253
|
+
"title": "๐ฆ Dependencies",
|
|
254
|
+
"audience": "dev",
|
|
255
|
+
"items": [
|
|
256
|
+
{
|
|
257
|
+
"description": "Upgrade dependencies and align the Node support policy (#483)",
|
|
258
|
+
"body": "All four published packages (`nmr`, `nmr-core`, `release-kit`, and `v11y-check`) now require Node.js 24 or later, up from Node 18.17. Separately, `nmr-compile` now rebuilds when the TypeScript version changes.",
|
|
259
|
+
"hash": "3090aa1ec68224f88e0b537ae09282e8e636f711"
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"version": "0.7.0",
|
|
267
|
+
"date": "2026-07-13",
|
|
268
|
+
"sections": [
|
|
269
|
+
{
|
|
270
|
+
"title": "๐ Features",
|
|
271
|
+
"audience": "all",
|
|
272
|
+
"items": [
|
|
273
|
+
{
|
|
274
|
+
"description": "Fail a package that declares types but ships none (#467)",
|
|
275
|
+
"body": "`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`.\n\n 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.",
|
|
276
|
+
"breaking": true,
|
|
277
|
+
"hash": "8ccea9d93cd63a7963a7a7516e20f8d54069bd7b"
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"version": "0.6.0",
|
|
285
|
+
"date": "2026-07-01",
|
|
286
|
+
"sections": [
|
|
287
|
+
{
|
|
288
|
+
"title": "๐ Features",
|
|
289
|
+
"audience": "all",
|
|
290
|
+
"items": [
|
|
291
|
+
{
|
|
292
|
+
"description": "Rebuild nmr-compile on a unified tsc emit (#455)",
|
|
293
|
+
"body": "`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.",
|
|
294
|
+
"breaking": true,
|
|
295
|
+
"hash": "0e55822c88cad341f90b052b15fb9af41e7ae414"
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"version": "0.5.0",
|
|
303
|
+
"date": "2026-06-30",
|
|
304
|
+
"sections": [
|
|
305
|
+
{
|
|
306
|
+
"title": "๐ Features",
|
|
307
|
+
"audience": "all",
|
|
308
|
+
"items": [
|
|
309
|
+
{
|
|
310
|
+
"description": "Rewrite parseArgs on node:util with typed error and exit API (#428)",
|
|
311
|
+
"body": "`@williamthorsen/nmr-core` gains a typed error API for CLI parsing: `parseArgsOrExit` (parse, or print a usage error and exit) and `ParseError` replace the per-command boilerplate, so every bundled CLI reports a flag mistake the same way. Breaking: the `translateParseError` export is removed and `parseArgs` now throws `ParseError`.",
|
|
312
|
+
"breaking": true,
|
|
313
|
+
"hash": "5629bef8f645485b401a04f06ff9153ef5472282"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"description": "Reject unexpected positional arguments by default (#432)",
|
|
317
|
+
"body": "Commands built on nmr-core now reject unexpected positional arguments by default. Commands that take positional arguments can opt back in to accept them.",
|
|
318
|
+
"hash": "196871885cfa671dcab2996101e99cc73553cf6a"
|
|
319
|
+
}
|
|
320
|
+
]
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"title": "โป๏ธ Refactoring",
|
|
324
|
+
"audience": "dev",
|
|
325
|
+
"items": [
|
|
326
|
+
{
|
|
327
|
+
"description": "Route all CLI error reporting through a single stderr helper (#437)",
|
|
328
|
+
"body": "Consolidates error reporting across the CLIs so every command reports errors the same way, and guards against the previous inconsistency returning. The error messages and exit codes users see are unchanged.",
|
|
329
|
+
"hash": "63e36b3f80bd8858e940362ea2914cb9a19fd821"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"description": "Normalize CLI error wording to the canonical Error: format (#439)",
|
|
333
|
+
"body": "Single-line error messages from the `nmr` and `release-kit` commands now print in one uniform shape, so the same class of failure reads the same way no matter which command produced it. Previously the wording varied, which made error output harder to scan and harder for scripts to match against. Richer output, such as multi-line validation reports and the stack trace from an unexpected crash, is unchanged.",
|
|
334
|
+
"hash": "2cbb46523fc7c3f0d8387405cafbd2cc90274b19"
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
]
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"version": "0.4.0",
|
|
342
|
+
"date": "2026-06-27",
|
|
343
|
+
"sections": [
|
|
344
|
+
{
|
|
345
|
+
"title": "๐ Features",
|
|
346
|
+
"audience": "all",
|
|
347
|
+
"items": [
|
|
348
|
+
{
|
|
349
|
+
"description": "Centralize the per-package build as an nmr-compile bin (#419)",
|
|
350
|
+
"body": "Introduces `nmr-compile`, a single command shipped with `@williamthorsen/nmr` that compiles each workspace package and now backs the default build. Consuming repos can delete their own per-package build script and pick up future build fixes just by upgrading nmr. Repeated builds with unchanged source now reliably skip recompiling instead of occasionally rebuilding for no reason, and import aliases now resolve correctly in symlinked checkouts.",
|
|
351
|
+
"hash": "cc20e3130087689c2fe8bf0e6de4b1349646296e"
|
|
352
|
+
}
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
]
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"version": "0.3.2",
|
|
359
|
+
"date": "2026-05-19",
|
|
360
|
+
"sections": [
|
|
361
|
+
{
|
|
362
|
+
"title": "โป๏ธ Refactoring",
|
|
363
|
+
"audience": "dev",
|
|
364
|
+
"items": [
|
|
365
|
+
{
|
|
366
|
+
"description": "Restructure tests and align core package directory with package name (#405)",
|
|
367
|
+
"body": "Tests in every package are now typechecked alongside the code they cover, so type breakage in tests fails the build instead of slipping through. The `core` package's workspace directory is renamed to match its package name, so `nmr -F nmr-core ...` and `pnpm --filter nmr-core ...` now resolve where they previously failed.",
|
|
368
|
+
"hash": "91006ec4281be902d66dfdef3917f603ee56b5c3"
|
|
369
|
+
}
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"version": "0.3.1",
|
|
376
|
+
"date": "2026-05-04",
|
|
377
|
+
"sections": [
|
|
378
|
+
{
|
|
379
|
+
"title": "โป๏ธ Refactoring",
|
|
380
|
+
"audience": "dev",
|
|
381
|
+
"items": [
|
|
382
|
+
{
|
|
383
|
+
"description": "Read package version at runtime via shared helper (#338)",
|
|
384
|
+
"body": "Fixes an issue where running `audit-deps`, `nmr`, or `release-kit` from the locally built `dist/esm/` after a `git pull` could report a stale version. Each CLI now reads its version directly from its `package.json` at startup, so version reads stay in sync with the installed source without requiring a fresh `pnpm install` or rebuild."
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"version": "0.3.0",
|
|
392
|
+
"date": "2026-04-23",
|
|
393
|
+
"sections": [
|
|
394
|
+
{
|
|
395
|
+
"title": "๐ Features",
|
|
396
|
+
"audience": "all",
|
|
397
|
+
"items": [
|
|
398
|
+
{
|
|
399
|
+
"description": "Scaffold audit.yaml workflow from audit-deps init (#277)",
|
|
400
|
+
"body": "Adds GitHub Actions workflow scaffolding to `audit-deps init`. Running the command now writes both `.config/audit-deps.config.json` and `.github/workflows/audit.yaml` in the target repo, so that consumers no longer have to copy the canonical caller workflow by hand from this repo. The workflow content is shipped as a bundled template that ships to npm, and the repo's own workflow is kept byte-identical to that template via a consistency test โ the canonical workflow cannot silently drift from what is published."
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"title": "โป๏ธ Refactoring",
|
|
406
|
+
"audience": "dev",
|
|
407
|
+
"items": [
|
|
408
|
+
{
|
|
409
|
+
"description": "Rename `node-monorepo-core` to `nmr-core` (#304)",
|
|
410
|
+
"body": "Renames the shared-utilities package from `@williamthorsen/node-monorepo-core` to `@williamthorsen/nmr-core`, aligning it with the repository's `nmr-*` naming convention. The package's functionality and version are unchanged; only the published name differs.",
|
|
411
|
+
"breaking": true
|
|
412
|
+
}
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
]
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"version": "0.2.6",
|
|
419
|
+
"date": "2026-04-15",
|
|
420
|
+
"sections": [
|
|
421
|
+
{
|
|
422
|
+
"title": "โ๏ธ Tooling",
|
|
423
|
+
"audience": "dev",
|
|
424
|
+
"items": [
|
|
425
|
+
{
|
|
426
|
+
"description": "Enable automated publication to npm (#187)",
|
|
427
|
+
"body": "Prepares the repository for reliable tag-triggered npm publishing by adding missing package metadata, standardizing licensing, and introducing a readyup kit that validates publish readiness across all packages."
|
|
428
|
+
}
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"version": "0.2.5",
|
|
435
|
+
"date": "2026-04-04",
|
|
436
|
+
"sections": [
|
|
437
|
+
{
|
|
438
|
+
"title": "โป๏ธ Refactoring",
|
|
439
|
+
"audience": "dev",
|
|
440
|
+
"items": [
|
|
441
|
+
{
|
|
442
|
+
"description": "Extract shared CLI argument-parsing utility into core (#151)",
|
|
443
|
+
"body": "Add a schema-driven `parseArgs` function to `@williamthorsen/node-monorepo-core` that handles boolean flags, string flags (both `--flag=value` and `--flag value`), short aliases, positional collection, the `--` delimiter, and unknown-flag errors. Migrate all CLI argument-parsing sites in preflight (3 sites) and release-kit (5 sites) to use it. A companion `translateParseError` helper normalizes internal error messages for consistent user-facing output."
|
|
444
|
+
}
|
|
445
|
+
]
|
|
446
|
+
}
|
|
447
|
+
]
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"version": "0.2.1",
|
|
451
|
+
"date": "2026-03-28",
|
|
452
|
+
"sections": [
|
|
453
|
+
{
|
|
454
|
+
"title": "๐ Features",
|
|
455
|
+
"audience": "all",
|
|
456
|
+
"items": [
|
|
457
|
+
{
|
|
458
|
+
"description": "Add shared writeFileWithCheck utility and overwrite reporting (#66)",
|
|
459
|
+
"body": "Extracts three duplicated `writeIfAbsent` implementations and two duplicated terminal helper sets into shared utilities in `@williamthorsen/node-monorepo-core`, then migrates all consumers (`release-kit init`, `preflight init`, `sync-labels`) to use them. All init commands now report which files were created, overwritten, skipped, or failed โ including when `--force` replaces existing files."
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
}
|
|
463
|
+
]
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"version": "0.2.0",
|
|
467
|
+
"date": "2026-03-27",
|
|
468
|
+
"sections": [
|
|
469
|
+
{
|
|
470
|
+
"title": "๐ Features",
|
|
471
|
+
"audience": "all",
|
|
472
|
+
"items": [
|
|
473
|
+
{
|
|
474
|
+
"description": "Add --quiet flag to nmr CLI (#4)",
|
|
475
|
+
"body": "Adds a `-q`/`--quiet` flag to the `nmr` CLI that suppresses command output on success while preserving full output on failure. When quiet mode is active, `runCommand()` uses `stdio: 'pipe'` to capture child process output, discards it on success, and writes captured stdout and stderr to `process.stderr` on failure. All informational messages on success paths (`console.info` calls for override script notifications) are also suppressed."
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"description": "Enable strict linting of monorepo root (#50)",
|
|
479
|
+
"body": "Replaces the `root:lint:strict` echo fallback with a direct `strict-lint --ignore-pattern 'packages/**' .` invocation, now that the `strict-lint` package supports the full `eslint` CLI API."
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"description": "Extract nmr CLI from core package (#61)",
|
|
483
|
+
"body": "Extracts all nmr CLI code from `packages/core` into a new `packages/nmr` package (`@williamthorsen/nmr`). Core is reduced to an empty shared-library shell ready for cross-cutting utilities. All internal references are rewired and the full build/test pipeline passes.\n\nScopes: core, nmr"
|
|
484
|
+
}
|
|
485
|
+
]
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"title": "โป๏ธ Refactoring",
|
|
489
|
+
"audience": "dev",
|
|
490
|
+
"items": [
|
|
491
|
+
{
|
|
492
|
+
"description": "Replace dist bin targets with thin wrapper scripts (#48)",
|
|
493
|
+
"body": "The `bin` entries in `packages/core` and `packages/release-kit` pointed directly into `dist/esm/`, causing `pnpm install` to emit \"Failed to create bin\" warnings in fresh worktrees where `dist/` does not yet exist. Each bin entry now points to a committed wrapper script in `bin/` that dynamically imports the real entry point. The `files` field in both packages includes `bin` so the wrappers are published."
|
|
494
|
+
}
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"title": "โ๏ธ Tooling",
|
|
499
|
+
"audience": "dev",
|
|
500
|
+
"items": [
|
|
501
|
+
{
|
|
502
|
+
"description": "Adopt nmr to run monorepo and workspace scripts (#38)",
|
|
503
|
+
"body": "Replaces the legacy workspace script runner and ~25 root `package.json` scripts with `nmr`, the monorepo's own context-aware script runner. Root scripts are reduced to 4 (`prepare`, `postinstall`, `ci`, `bootstrap`), packages use direct build commands for bootstrap, and release-kit declares tier-3 test overrides for its integration test configs."
|
|
504
|
+
}
|
|
505
|
+
]
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"title": "๐ฆ Dependencies",
|
|
509
|
+
"audience": "dev",
|
|
510
|
+
"items": [
|
|
511
|
+
{
|
|
512
|
+
"description": "Remove vitest optional peer dependency (#46)",
|
|
513
|
+
"body": "Removes the `peerDependencies` and `peerDependenciesMeta` entries for vitest from `packages/core/package.json` and regenerates the lockfile to eliminate the stale `vitest@4.1.0` resolution.\n\nThe peer dependency caused pnpm to resolve a stale `vitest@4.1.0` in the lockfile, conflicting with the root-pinned `vitest@4.1.1` and breaking coverage runs with a mixed-versions error. Consumers of the `./tests` export already provide vitest as a root devDependency, so the declaration was unnecessary."
|
|
514
|
+
}
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
]
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"version": "0.1.0",
|
|
521
|
+
"date": "2026-03-12",
|
|
522
|
+
"sections": [
|
|
523
|
+
{
|
|
524
|
+
"title": "๐ Features",
|
|
525
|
+
"audience": "all",
|
|
526
|
+
"items": [
|
|
527
|
+
{
|
|
528
|
+
"description": "Implement nmr CLI and core package (#2)",
|
|
529
|
+
"body": "Adds the `@williamthorsen/node-monorepo-core` package, implementing the `nmr` CLI tool for unified script execution across a PNPM monorepo. Removes all example/template packages that were scaffolding from the original template repository."
|
|
530
|
+
}
|
|
531
|
+
]
|
|
532
|
+
}
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
]
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## 0.11.0 โ 2026-09-08
|
|
6
|
+
|
|
7
|
+
### ๐ Features
|
|
8
|
+
|
|
9
|
+
- Report a package whose tarball would omit its changelog (#768)
|
|
10
|
+
|
|
11
|
+
Adds ReadyUp checks to verify that every published package bundles its changelog files: the human-readable `CHANGELOG.md` and the machine-readable `changelog.json`.
|
|
12
|
+
|
|
13
|
+
## 0.10.4 โ 2026-09-01
|
|
14
|
+
|
|
15
|
+
### โป๏ธ Refactoring
|
|
16
|
+
|
|
17
|
+
- Upgrade eslint-config-typescript and mark the discards it now reports (#761)
|
|
18
|
+
|
|
19
|
+
Upgrades `@williamthorsen/eslint-config-typescript` to v12 and fixes violations surfaced by the newly added rule warning against a disposable that is discarded or that is bound to a declaration that never releases it.
|
|
20
|
+
|
|
21
|
+
## 0.10.3 โ 2026-08-24
|
|
22
|
+
|
|
23
|
+
### ๐งช Tests
|
|
24
|
+
|
|
25
|
+
- Scaffold the nmr-core, root, and v11y-check trees through the write API (#734)
|
|
26
|
+
|
|
27
|
+
Converts the `node:fs` scaffolding in five test suites across `nmr-core`, the repo root, and `v11y-check` to the temporary tree's own write API, which refuses a path that escapes the tree. Fixture helpers in `hashWorkingTree.tool.test.ts` and `init.unit.test.ts` take the tree itself in place of a captured directory string.
|
|
28
|
+
|
|
29
|
+
## 0.10.2 โ 2026-08-19
|
|
30
|
+
|
|
31
|
+
### ๐งช Tests
|
|
32
|
+
|
|
33
|
+
- Register fixture-repo cleanup against the test that asks for it (#715)
|
|
34
|
+
|
|
35
|
+
Routes nmr's `buildRepo` fixture helper through `createTempTree`, registering each fixture directory's removal against the test that requested it. The module-level accumulator and the exported `removeFixtureDirs` have been removed.
|
|
36
|
+
|
|
37
|
+
- Convert the per-test temporary directories to test-scoped fixtures (#719)
|
|
38
|
+
|
|
39
|
+
Converts the suites that create a temporary directory in `nmr`, `nmr-core`, and `release-kit` to take it as a Vitest fixture built on `createTempTree`, or as a `using` declaration where the directory lives and dies inside one test body. Each suite loses the mutable binding and the `beforeEach`/`afterEach` pair that carried the directory's lifetime, and a directory is created only for the tests that name one.
|
|
40
|
+
|
|
41
|
+
Separately, `nmr lint:strict` now fails on a stale `eslint-disable` directive.
|
|
42
|
+
|
|
43
|
+
## 0.10.1 โ 2026-08-17
|
|
44
|
+
|
|
45
|
+
### โป๏ธ Refactoring
|
|
46
|
+
|
|
47
|
+
- Adopt silenceConsole across the test suites (#677)
|
|
48
|
+
|
|
49
|
+
Adopts `silenceConsole` from `@williamthorsen/toolbelt.vitest` to replace all hand-rolled `vi.spyOn(console, โฆ)` spies and reduce boilerplate across the repo's test suites. The function returns a disposable, allowing the caller to use `using` to enable restoration of the console method at the end of the test scope.
|
|
50
|
+
|
|
51
|
+
- Adopt `isError` and consolidate errno narrowing on a shared helper (#697)
|
|
52
|
+
|
|
53
|
+
Replaces every hand-rolled `instanceof Error` narrowing with `hasErrnoCode`, a new predicate exported from `@williamthorsen/nmr-core`, or with `isError` from `@williamthorsen/toolbelt.errors`. Previously the errno question was answered by inline copies alongside two private helpers of differing shape; both helpers are removed.
|
|
54
|
+
|
|
55
|
+
Separately, `eslint.config.ts` now bans `instanceof Error` in every position rather than in a ternary alone.
|
|
56
|
+
|
|
57
|
+
### ๐งช Tests
|
|
58
|
+
|
|
59
|
+
- Replace the stdio spies with captureStdio (#678)
|
|
60
|
+
|
|
61
|
+
Replaces every `process.stdout` and `process.stderr` spy in the test suites with `captureStdio` from `@williamthorsen/toolbelt.testing` and deletes the obviated local capture helpers. `captureStdio` buffers writes rather than recording calls, so assertions that previously used `toHaveBeenCalledWith` instead check `stderr`/`stdout` strings and their chunk arrays.
|
|
62
|
+
|
|
63
|
+
Separately, `unicorn/no-nonstandard-builtin-properties` is off for test files. Its hand-maintained symbol table omits `Symbol.dispose`, which a suite-scoped capture calls to restore the streams, and `schema: []` offers no way to extend the table.
|
|
64
|
+
|
|
65
|
+
- Adopt throwOnProcessExit and captureError across the test suites (#690)
|
|
66
|
+
|
|
67
|
+
Adopts `throwOnProcessExit` from `@williamthorsen/toolbelt.vitest`, replacing every hand-rolled `process.exit` mock in the `release-kit` and `nmr-core` test suites, and `captureError` from `@williamthorsen/toolbelt.testing`, replacing inline try/catch/`instanceof` blocks.
|
|
68
|
+
|
|
69
|
+
Separately, `@williamthorsen/toolbelt.vitest` is now listed in the ReadyUp config, so that its kit is run by `rdy run --packages`.
|
|
70
|
+
|
|
71
|
+
## 0.10.0 โ 2026-08-13
|
|
72
|
+
|
|
73
|
+
### ๐ Features
|
|
74
|
+
|
|
75
|
+
- Print a retained run with nmr --log (#669)
|
|
76
|
+
|
|
77
|
+
Adds `nmr --log <command>`, which prints what the last recorded pass wrote instead of running the command again. The whole transcript, up to a limit of 256 KiB, is now saved for any passing command that is not writing straight to a terminal; `--log` prints it under a header giving the instant, the duration, and the command chain that succeeded. The log of a composite is the sum of its constituents' excerpts. If a change disqualifies the recording, `--log` instead reports the change.
|
|
78
|
+
|
|
79
|
+
### โป๏ธ Refactoring
|
|
80
|
+
|
|
81
|
+
- Adopt toolbelt.errors for error-message extraction and cause-chaining (#652)
|
|
82
|
+
|
|
83
|
+
Improves error reporting by adopting standardized ways of capturing and describing errors across the codebase.
|
|
84
|
+
|
|
85
|
+
### โ๏ธ Tooling
|
|
86
|
+
|
|
87
|
+
- Upgrade the lint config and clear its violations (#671)
|
|
88
|
+
|
|
89
|
+
Upgrades `@williamthorsen/eslint-config-typescript`, along with other config packages, and clears lint violations surfaced by the newly activated rules.
|
|
90
|
+
|
|
91
|
+
## 0.9.3 โ 2026-08-08
|
|
92
|
+
|
|
93
|
+
### โ๏ธ Tooling
|
|
94
|
+
|
|
95
|
+
- Migrate to the shared tsconfig baseline (#626)
|
|
96
|
+
|
|
97
|
+
Adopts `@williamthorsen/tsconfig` as the standard TypeScript configuration for this repo, replacing the previous hand-maintained copy. Reading a property through an index signature now requires bracket notation or a type that declares the property. The `nmr` build now fails on a base TypeScript config it cannot resolve, rather than building without it, and it now resolves a base config named by package name alone.
|
|
98
|
+
|
|
99
|
+
## 0.9.1 โ 2026-08-04
|
|
100
|
+
|
|
101
|
+
### ๐ Bug fixes
|
|
102
|
+
|
|
103
|
+
- Remove the 1 MiB ceiling on captured git output (#596)
|
|
104
|
+
|
|
105
|
+
Fixes an issue where `release-kit prepare` began aborting once a repository's release history grew long enough, leaving that repository unable to cut another release. The fix covers, in addition to `prepare`, every other release-kit command that reads from git.
|
|
106
|
+
|
|
107
|
+
## 0.9.0 โ 2026-08-03
|
|
108
|
+
|
|
109
|
+
### ๐ Features
|
|
110
|
+
|
|
111
|
+
- Publish nmr's readyup kit with a test-tier conformance check (#580)
|
|
112
|
+
|
|
113
|
+
`@williamthorsen/nmr` is now bundled with ReadyUp kits that check a repo's alignment with `nmr` requirements and recommendations.
|
|
114
|
+
|
|
115
|
+
`rdy run --from npm:@williamthorsen/nmr` checks the repo against the kits without prior configuration. Once the package is added to the ReadyUp config, `rdy run --packages` will run the `nmr` kits along with those of any other registered package. Requires `readyup` v0.23 or greater.
|
|
116
|
+
|
|
117
|
+
## 0.8.0 โ 2026-08-03
|
|
118
|
+
|
|
119
|
+
### ๐ Features
|
|
120
|
+
|
|
121
|
+
- Skip checks that already passed on the current working tree (#568)
|
|
122
|
+
|
|
123
|
+
`nmr` commands now skip any pure check (types, lint, tests) that has already passed on an unchanged working tree; instead, success is reported immediately. `nmr --no-cache` causes the cache check to be skipped, and `NMR_NO_CACHE=1` does the same for a whole shell. Cached results are cleared by `nmr clean`. Which commands can skip is configurable at the monorepo root, and `NMR_DEBUG=1` reports why a run didn't skip.
|
|
124
|
+
|
|
125
|
+
### โป๏ธ Refactoring
|
|
126
|
+
|
|
127
|
+
- Share nmr-core's cache primitives with nmr-compile (#570)
|
|
128
|
+
|
|
129
|
+
A package's writes to the build cache are now hidden from other packages until the write is complete. A failing build now reports its error in the same form as every other `nmr` command. `tsx` is no longer required to build a package.
|
|
130
|
+
|
|
131
|
+
## 0.7.3 โ 2026-07-30
|
|
132
|
+
|
|
133
|
+
### โ๏ธ Tooling
|
|
134
|
+
|
|
135
|
+
- Adopt Vitest projects in this repo (#530)
|
|
136
|
+
|
|
137
|
+
Simplifies test configurations so that every package exposes the same test commands, which select suites by test category: `nmr test` runs everything except integration tests, `nmr test:integration` runs only those, and `nmr test:all` runs both. `nmr test:integration` now succeeds in a package that has no integration tests instead of failing. release-kit's drift checks can now be run on their own, apart from unit and integration tests. A fresh clone now has to run `pnpm run bootstrap` before any test run, not just before `nmr` commands.
|
|
138
|
+
|
|
139
|
+
## 0.7.1 โ 2026-07-22
|
|
140
|
+
|
|
141
|
+
### ๐ฆ Dependencies
|
|
142
|
+
|
|
143
|
+
- Upgrade dependencies and align the Node support policy (#483)
|
|
144
|
+
|
|
145
|
+
All four published packages (`nmr`, `nmr-core`, `release-kit`, and `v11y-check`) now require Node.js 24 or later, up from Node 18.17. Separately, `nmr-compile` now rebuilds when the TypeScript version changes.
|
|
146
|
+
|
|
147
|
+
## 0.7.0 โ 2026-07-13
|
|
148
|
+
|
|
149
|
+
### ๐ Features
|
|
150
|
+
|
|
151
|
+
- ๐จ **Breaking:** Fail a package that declares types but ships none (#467)
|
|
152
|
+
|
|
153
|
+
`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`.
|
|
154
|
+
|
|
155
|
+
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.
|
|
156
|
+
|
|
157
|
+
## 0.6.0 โ 2026-07-01
|
|
158
|
+
|
|
159
|
+
### ๐ Features
|
|
160
|
+
|
|
161
|
+
- ๐จ **Breaking:** Rebuild nmr-compile on a unified tsc emit (#455)
|
|
162
|
+
|
|
163
|
+
`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.
|
|
164
|
+
|
|
165
|
+
## 0.5.0 โ 2026-06-30
|
|
166
|
+
|
|
167
|
+
### ๐ Features
|
|
168
|
+
|
|
169
|
+
- ๐จ **Breaking:** Rewrite parseArgs on node:util with typed error and exit API (#428)
|
|
170
|
+
|
|
171
|
+
`@williamthorsen/nmr-core` gains a typed error API for CLI parsing: `parseArgsOrExit` (parse, or print a usage error and exit) and `ParseError` replace the per-command boilerplate, so every bundled CLI reports a flag mistake the same way. Breaking: the `translateParseError` export is removed and `parseArgs` now throws `ParseError`.
|
|
172
|
+
|
|
173
|
+
- Reject unexpected positional arguments by default (#432)
|
|
174
|
+
|
|
175
|
+
Commands built on nmr-core now reject unexpected positional arguments by default. Commands that take positional arguments can opt back in to accept them.
|
|
176
|
+
|
|
177
|
+
### โป๏ธ Refactoring
|
|
178
|
+
|
|
179
|
+
- Route all CLI error reporting through a single stderr helper (#437)
|
|
180
|
+
|
|
181
|
+
Consolidates error reporting across the CLIs so every command reports errors the same way, and guards against the previous inconsistency returning. The error messages and exit codes users see are unchanged.
|
|
182
|
+
|
|
183
|
+
- Normalize CLI error wording to the canonical Error: format (#439)
|
|
184
|
+
|
|
185
|
+
Single-line error messages from the `nmr` and `release-kit` commands now print in one uniform shape, so the same class of failure reads the same way no matter which command produced it. Previously the wording varied, which made error output harder to scan and harder for scripts to match against. Richer output, such as multi-line validation reports and the stack trace from an unexpected crash, is unchanged.
|
|
186
|
+
|
|
187
|
+
## 0.4.0 โ 2026-06-27
|
|
188
|
+
|
|
189
|
+
### ๐ Features
|
|
190
|
+
|
|
191
|
+
- Centralize the per-package build as an nmr-compile bin (#419)
|
|
192
|
+
|
|
193
|
+
Introduces `nmr-compile`, a single command shipped with `@williamthorsen/nmr` that compiles each workspace package and now backs the default build. Consuming repos can delete their own per-package build script and pick up future build fixes just by upgrading nmr. Repeated builds with unchanged source now reliably skip recompiling instead of occasionally rebuilding for no reason, and import aliases now resolve correctly in symlinked checkouts.
|
|
194
|
+
|
|
195
|
+
## 0.3.2 โ 2026-05-19
|
|
196
|
+
|
|
197
|
+
### โป๏ธ Refactoring
|
|
198
|
+
|
|
199
|
+
- Restructure tests and align core package directory with package name (#405)
|
|
200
|
+
|
|
201
|
+
Tests in every package are now typechecked alongside the code they cover, so type breakage in tests fails the build instead of slipping through. The `core` package's workspace directory is renamed to match its package name, so `nmr -F nmr-core ...` and `pnpm --filter nmr-core ...` now resolve where they previously failed.
|
|
202
|
+
|
|
203
|
+
## 0.3.1 โ 2026-05-04
|
|
204
|
+
|
|
205
|
+
### โป๏ธ Refactoring
|
|
206
|
+
|
|
207
|
+
- Read package version at runtime via shared helper (#338)
|
|
208
|
+
|
|
209
|
+
Fixes an issue where running `audit-deps`, `nmr`, or `release-kit` from the locally built `dist/esm/` after a `git pull` could report a stale version. Each CLI now reads its version directly from its `package.json` at startup, so version reads stay in sync with the installed source without requiring a fresh `pnpm install` or rebuild.
|
|
210
|
+
|
|
211
|
+
## 0.3.0 โ 2026-04-23
|
|
212
|
+
|
|
213
|
+
### ๐ Features
|
|
214
|
+
|
|
215
|
+
- Scaffold audit.yaml workflow from audit-deps init (#277)
|
|
216
|
+
|
|
217
|
+
Adds GitHub Actions workflow scaffolding to `audit-deps init`. Running the command now writes both `.config/audit-deps.config.json` and `.github/workflows/audit.yaml` in the target repo, so that consumers no longer have to copy the canonical caller workflow by hand from this repo. The workflow content is shipped as a bundled template that ships to npm, and the repo's own workflow is kept byte-identical to that template via a consistency test โ the canonical workflow cannot silently drift from what is published.
|
|
218
|
+
|
|
219
|
+
### โป๏ธ Refactoring
|
|
220
|
+
|
|
221
|
+
- ๐จ **Breaking:** Rename `node-monorepo-core` to `nmr-core` (#304)
|
|
222
|
+
|
|
223
|
+
Renames the shared-utilities package from `@williamthorsen/node-monorepo-core` to `@williamthorsen/nmr-core`, aligning it with the repository's `nmr-*` naming convention. The package's functionality and version are unchanged; only the published name differs.
|
|
224
|
+
|
|
225
|
+
## 0.2.6 โ 2026-04-15
|
|
226
|
+
|
|
227
|
+
### โ๏ธ Tooling
|
|
228
|
+
|
|
229
|
+
- Enable automated publication to npm (#187)
|
|
230
|
+
|
|
231
|
+
Prepares the repository for reliable tag-triggered npm publishing by adding missing package metadata, standardizing licensing, and introducing a readyup kit that validates publish readiness across all packages.
|
|
232
|
+
|
|
233
|
+
## 0.2.5 โ 2026-04-04
|
|
234
|
+
|
|
235
|
+
### โป๏ธ Refactoring
|
|
236
|
+
|
|
237
|
+
- Extract shared CLI argument-parsing utility into core (#151)
|
|
238
|
+
|
|
239
|
+
Add a schema-driven `parseArgs` function to `@williamthorsen/node-monorepo-core` that handles boolean flags, string flags (both `--flag=value` and `--flag value`), short aliases, positional collection, the `--` delimiter, and unknown-flag errors. Migrate all CLI argument-parsing sites in preflight (3 sites) and release-kit (5 sites) to use it. A companion `translateParseError` helper normalizes internal error messages for consistent user-facing output.
|
|
240
|
+
|
|
241
|
+
## 0.2.1 โ 2026-03-28
|
|
242
|
+
|
|
243
|
+
### ๐ Features
|
|
244
|
+
|
|
245
|
+
- Add shared writeFileWithCheck utility and overwrite reporting (#66)
|
|
246
|
+
|
|
247
|
+
Extracts three duplicated `writeIfAbsent` implementations and two duplicated terminal helper sets into shared utilities in `@williamthorsen/node-monorepo-core`, then migrates all consumers (`release-kit init`, `preflight init`, `sync-labels`) to use them. All init commands now report which files were created, overwritten, skipped, or failed โ including when `--force` replaces existing files.
|
|
248
|
+
|
|
249
|
+
## 0.2.0 โ 2026-03-27
|
|
250
|
+
|
|
251
|
+
### ๐ Features
|
|
252
|
+
|
|
253
|
+
- Add --quiet flag to nmr CLI (#4)
|
|
254
|
+
|
|
255
|
+
Adds a `-q`/`--quiet` flag to the `nmr` CLI that suppresses command output on success while preserving full output on failure. When quiet mode is active, `runCommand()` uses `stdio: 'pipe'` to capture child process output, discards it on success, and writes captured stdout and stderr to `process.stderr` on failure. All informational messages on success paths (`console.info` calls for override script notifications) are also suppressed.
|
|
256
|
+
|
|
257
|
+
- Enable strict linting of monorepo root (#50)
|
|
258
|
+
|
|
259
|
+
Replaces the `root:lint:strict` echo fallback with a direct `strict-lint --ignore-pattern 'packages/**' .` invocation, now that the `strict-lint` package supports the full `eslint` CLI API.
|
|
260
|
+
|
|
261
|
+
- Extract nmr CLI from core package (#61)
|
|
262
|
+
|
|
263
|
+
Extracts all nmr CLI code from `packages/core` into a new `packages/nmr` package (`@williamthorsen/nmr`). Core is reduced to an empty shared-library shell ready for cross-cutting utilities. All internal references are rewired and the full build/test pipeline passes.
|
|
264
|
+
|
|
265
|
+
Scopes: core, nmr
|
|
266
|
+
|
|
267
|
+
### โป๏ธ Refactoring
|
|
268
|
+
|
|
269
|
+
- Replace dist bin targets with thin wrapper scripts (#48)
|
|
270
|
+
|
|
271
|
+
The `bin` entries in `packages/core` and `packages/release-kit` pointed directly into `dist/esm/`, causing `pnpm install` to emit "Failed to create bin" warnings in fresh worktrees where `dist/` does not yet exist. Each bin entry now points to a committed wrapper script in `bin/` that dynamically imports the real entry point. The `files` field in both packages includes `bin` so the wrappers are published.
|
|
272
|
+
|
|
273
|
+
### โ๏ธ Tooling
|
|
274
|
+
|
|
275
|
+
- Adopt nmr to run monorepo and workspace scripts (#38)
|
|
276
|
+
|
|
277
|
+
Replaces the legacy workspace script runner and ~25 root `package.json` scripts with `nmr`, the monorepo's own context-aware script runner. Root scripts are reduced to 4 (`prepare`, `postinstall`, `ci`, `bootstrap`), packages use direct build commands for bootstrap, and release-kit declares tier-3 test overrides for its integration test configs.
|
|
278
|
+
|
|
279
|
+
### ๐ฆ Dependencies
|
|
280
|
+
|
|
281
|
+
- Remove vitest optional peer dependency (#46)
|
|
282
|
+
|
|
283
|
+
Removes the `peerDependencies` and `peerDependenciesMeta` entries for vitest from `packages/core/package.json` and regenerates the lockfile to eliminate the stale `vitest@4.1.0` resolution.
|
|
284
|
+
|
|
285
|
+
The peer dependency caused pnpm to resolve a stale `vitest@4.1.0` in the lockfile, conflicting with the root-pinned `vitest@4.1.1` and breaking coverage runs with a mixed-versions error. Consumers of the `./tests` export already provide vitest as a root devDependency, so the declaration was unnecessary.
|
|
286
|
+
|
|
287
|
+
## 0.1.0 โ 2026-03-12
|
|
288
|
+
|
|
289
|
+
### ๐ Features
|
|
290
|
+
|
|
291
|
+
- Implement nmr CLI and core package (#2)
|
|
292
|
+
|
|
293
|
+
Adds the `@williamthorsen/node-monorepo-core` package, implementing the `nmr` CLI tool for unified script execution across a PNPM monorepo. Removes all example/template packages that were scaffolding from the original template repository.
|
|
294
|
+
|
|
295
|
+
<!-- Generated by release-kit. Do not edit this file. Use .meta/changelog-overrides.json to override entries. -->
|
package/README.md
CHANGED
|
@@ -4,7 +4,15 @@ Shared utilities for node-monorepo-tools packages.
|
|
|
4
4
|
|
|
5
5
|
This package serves as the shared library foundation for the monorepo. For the nmr CLI tool, see [`@williamthorsen/nmr`](../nmr).
|
|
6
6
|
|
|
7
|
-
<!-- section:release-notes
|
|
7
|
+
<!-- section:release-notes -->
|
|
8
|
+
## Release notes โ v0.11.0 (2026-09-08)
|
|
9
|
+
|
|
10
|
+
### ๐ Features
|
|
11
|
+
|
|
12
|
+
- Report a package whose tarball would omit its changelog (#768)
|
|
13
|
+
|
|
14
|
+
Adds ReadyUp checks to verify that every published package bundles its changelog files: the human-readable `CHANGELOG.md` and the machine-readable `changelog.json`.
|
|
15
|
+
<!-- /section:release-notes -->
|
|
8
16
|
|
|
9
17
|
## Installation
|
|
10
18
|
|
|
@@ -1,16 +1,55 @@
|
|
|
1
|
+
/** Names the cache directory a tool's entries live in: `{home}/node_modules/.cache/{tool}/`. */
|
|
1
2
|
export interface CacheDirRef {
|
|
3
|
+
/** The tool the cache belongs to, e.g. `nmr-compile`. Becomes the directory name. */
|
|
2
4
|
tool: string;
|
|
5
|
+
/** The directory the cache serves; its nearest `node_modules` ancestor hosts the cache. */
|
|
3
6
|
scopeDir: string;
|
|
4
7
|
}
|
|
8
|
+
/** Locates a single entry within a tool's cache directory. */
|
|
5
9
|
export interface CacheEntryRef extends CacheDirRef {
|
|
10
|
+
/** Readable filename prefix, e.g. the package name. */
|
|
6
11
|
slug: string;
|
|
12
|
+
/** Filename extension, including the leading dot. */
|
|
7
13
|
extension: string;
|
|
14
|
+
/**
|
|
15
|
+
* Strings folded into the filename digest alongside the absolute scope directory, so that one scope can hold
|
|
16
|
+
* several entries. Two refs differing only in `slug` would collide were the slug all that separated them.
|
|
17
|
+
*/
|
|
8
18
|
discriminators?: string[];
|
|
9
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Reads an entry's raw text, or `undefined` when it is absent or unreadable. A cache that cannot be read is a
|
|
22
|
+
* miss, never an error: the caller's fallback is to do the work again, which is always correct.
|
|
23
|
+
*/
|
|
10
24
|
export declare function readCacheEntry(entryPath: string): Promise<string | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Reads a JSON entry and narrows it with `isValidEntry`, returning `undefined` when the entry is missing,
|
|
27
|
+
* unparseable, or of the wrong shape. Content written by an older format therefore reads as a miss rather than
|
|
28
|
+
* reaching the caller as a value it cannot trust.
|
|
29
|
+
*/
|
|
11
30
|
export declare function readJsonCacheEntry<T>(entryPath: string, isValidEntry: (value: unknown) => value is T): Promise<T | undefined>;
|
|
31
|
+
/** Removes a tool's entire cache directory. Idempotent: an absent directory is a silent no-op. */
|
|
12
32
|
export declare function removeCacheDir(ref: CacheDirRef): Promise<void>;
|
|
33
|
+
/** Removes a single entry. Idempotent: an absent entry is a silent no-op, as is an absent cache directory. */
|
|
13
34
|
export declare function removeCacheEntry(entryPath: string): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Resolves the absolute path of a tool's cache directory. The conventional `node_modules/.cache/{tool}/` home is
|
|
37
|
+
* git-ignored and outside any `files` convention, so an entry never reaches a published tarball. The home is the
|
|
38
|
+
* nearest enclosing directory that already has a `node_modules`: the scope's own when it has one, otherwise a
|
|
39
|
+
* hoisted ancestor, such as the workspace root for a zero-dependency package. No `node_modules` is ever
|
|
40
|
+
* materialized solely to hold the cache.
|
|
41
|
+
*/
|
|
14
42
|
export declare function resolveCacheDir(ref: CacheDirRef): string;
|
|
43
|
+
/**
|
|
44
|
+
* Resolves the absolute path of a single cache entry. The file name folds a digest of the absolute scope
|
|
45
|
+
* directory (and any discriminators) into a readable base name, so scopes sharing a hoisted `node_modules`
|
|
46
|
+
* never collide while the path stays stable across runs for the same scope.
|
|
47
|
+
*/
|
|
15
48
|
export declare function resolveCacheEntryPath(ref: CacheEntryRef): string;
|
|
49
|
+
/**
|
|
50
|
+
* Writes an entry, creating the cache directory as needed. The write lands in a uniquely named temporary file
|
|
51
|
+
* and is renamed into place, so a concurrent reader sees either the previous entry or the new one and never a
|
|
52
|
+
* half-written file. Throws when the write cannot be completed; a caller for whom a failed cache write is not
|
|
53
|
+
* worth failing over catches it.
|
|
54
|
+
*/
|
|
16
55
|
export declare function writeCacheEntry(entryPath: string, content: string): Promise<void>;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the nearest ancestor directory containing `package.json`, starting from
|
|
3
|
+
* the directory of the given `import.meta.url`.
|
|
4
|
+
*
|
|
5
|
+
* Useful for resolving bundled assets (presets, templates) relative to the
|
|
6
|
+
* package root, regardless of the calling module's depth in the source or dist tree.
|
|
7
|
+
*/
|
|
1
8
|
export declare function findPackageRoot(fromUrl: string): string;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `maxBuffer` every git invocation that pipes stdout should declare, raised well above Node's 1 MiB default
|
|
3
|
+
* so a tree with thousands of untracked files still reports a status and a long-lived repo still lists its tags.
|
|
4
|
+
*
|
|
5
|
+
* Node enforces the cap on the parent side: it kills the child and reports `ENOBUFS` once the pipe accumulates
|
|
6
|
+
* past the limit, so the child never learns why it died and the error names the spawned program rather than the
|
|
7
|
+
* output that overflowed. A call site that omits the option inherits the default silently and fails only once
|
|
8
|
+
* the repo it runs against has grown enough, which is why the value is shared rather than chosen per site.
|
|
9
|
+
*/
|
|
1
10
|
export declare const GIT_OUTPUT_LIMIT: number;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Narrows a thrown value to an `Error` carrying the given Node errno code.
|
|
3
|
+
*
|
|
4
|
+
* `isError` recognizes an `Error` crossing a realm boundary, which a bare `instanceof` test reports as false.
|
|
5
|
+
*/
|
|
1
6
|
export declare function hasErrnoCode(error: unknown, code: string): error is Error & {
|
|
2
7
|
code: string;
|
|
3
8
|
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A whole-repo content hash, or the reason one could not be produced. Every degraded condition (no repository,
|
|
3
|
+
* no commit, a git failure, a tree this hash cannot describe) reports `ok: false` rather than a hash a caller
|
|
4
|
+
* might act on. A caller that gates work on the hash therefore does the work whenever the hash is unavailable.
|
|
5
|
+
*/
|
|
1
6
|
export type WorkingTreeHashResult = {
|
|
2
7
|
ok: true;
|
|
3
8
|
hash: string;
|
|
@@ -7,5 +12,23 @@ export type WorkingTreeHashResult = {
|
|
|
7
12
|
ok: false;
|
|
8
13
|
reason: string;
|
|
9
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Produces a content hash of the entire working tree at `cwd`: the commit's tree object folded with the current
|
|
17
|
+
* content of every path git reports as changed or untracked. Two trees holding the same content hash alike, so
|
|
18
|
+
* a `touch` that changes no bytes leaves the hash where it was, while any edit, addition, or deletion moves it.
|
|
19
|
+
*
|
|
20
|
+
* The hash is taken from git's own status rather than by walking the filesystem, which keeps it proportional to
|
|
21
|
+
* what has changed rather than to the size of the repository, and inherits git's ignore rules for free. Nothing
|
|
22
|
+
* here writes to the object database or the index: a hash is an observation, and a repository must look exactly
|
|
23
|
+
* the same after taking one.
|
|
24
|
+
*
|
|
25
|
+
* Because the commit's tree object is the base of the fold, committing an already-hashed tree moves the hash
|
|
26
|
+
* even though no content changed. The reverse holds too, and usefully: a rebase or an amended message that
|
|
27
|
+
* preserves content leaves the hash alone, as does checking out a branch whose tree is identical.
|
|
28
|
+
*/
|
|
10
29
|
export declare function hashWorkingTree(cwd: string): WorkingTreeHashResult;
|
|
30
|
+
/**
|
|
31
|
+
* Returns the commit `HEAD` names, or `undefined` when git cannot say. Cheap next to a full hash, so a caller
|
|
32
|
+
* holding an observation of a tree can ask whether the commit still stands where it did without retaking it.
|
|
33
|
+
*/
|
|
11
34
|
export declare function readHeadSha(cwd: string): string | undefined;
|
package/dist/esm/parseArgs.d.ts
CHANGED
|
@@ -1,24 +1,51 @@
|
|
|
1
|
+
/** Schema entry describing a single CLI flag. */
|
|
1
2
|
export interface FlagDefinition {
|
|
2
3
|
long: string;
|
|
3
4
|
type: 'boolean' | 'string';
|
|
4
5
|
short?: string;
|
|
5
6
|
}
|
|
7
|
+
/** Map of camelCase property names to their flag definitions. */
|
|
6
8
|
export type FlagSchema = Record<string, FlagDefinition>;
|
|
9
|
+
/** Infer the result type from a flag schema: booleans become `boolean`, strings become `string | undefined`. */
|
|
7
10
|
export type ParsedFlags<S extends FlagSchema> = {
|
|
8
11
|
[K in keyof S]: S[K]['type'] extends 'boolean' ? boolean : string | undefined;
|
|
9
12
|
};
|
|
13
|
+
/** Return type of `parseArgs`: typed flags plus collected positionals. */
|
|
10
14
|
export interface ParsedArgs<S extends FlagSchema> {
|
|
11
15
|
flags: ParsedFlags<S>;
|
|
12
16
|
positionals: string[];
|
|
13
17
|
}
|
|
18
|
+
/** Options controlling how `parseArgs` handles input beyond the flag schema. */
|
|
14
19
|
export interface ParseArgsOptions {
|
|
20
|
+
/** When true, positionals are collected; otherwise an unexpected positional throws. Defaults to false. */
|
|
15
21
|
allowPositionals?: boolean;
|
|
16
22
|
}
|
|
23
|
+
/** Discriminates the failure modes `parseArgs` reports. */
|
|
17
24
|
export type ParseErrorKind = 'unknown-flag' | 'missing-value' | 'unexpected-value' | 'unexpected-positional';
|
|
25
|
+
/**
|
|
26
|
+
* Error thrown by `parseArgs` on invalid input.
|
|
27
|
+
*
|
|
28
|
+
* Carries the failure `kind` and the offending token in `flag` โ a flag as the user typed it, or the
|
|
29
|
+
* positional value for `'unexpected-positional'`. Its `message` is composed from those fields, so error
|
|
30
|
+
* wording is uniform across every kind.
|
|
31
|
+
*/
|
|
18
32
|
export declare class ParseError extends Error {
|
|
19
33
|
readonly kind: ParseErrorKind;
|
|
20
34
|
readonly flag: string;
|
|
21
35
|
constructor(kind: ParseErrorKind, flag: string);
|
|
22
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Parse a pre-sliced argv array against a flag schema.
|
|
39
|
+
*
|
|
40
|
+
* Delegates tokenizing to `node:util.parseArgs` (non-strict, with tokens) and validates the token
|
|
41
|
+
* stream against the schema. Throws `ParseError` on an unknown flag, a missing string-flag value, a
|
|
42
|
+
* value supplied to a boolean flag, or โ unless `options.allowPositionals` is set โ an unexpected
|
|
43
|
+
* positional argument. Does not write output or exit.
|
|
44
|
+
*/
|
|
23
45
|
export declare function parseArgs<S extends FlagSchema>(argv: string[], schema: S, options?: ParseArgsOptions): ParsedArgs<S>;
|
|
46
|
+
/**
|
|
47
|
+
* Parse argv, or print a usage error to stderr and exit non-zero.
|
|
48
|
+
*
|
|
49
|
+
* The canonical "parse or die" entry point for CLI commands that terminate on invalid input.
|
|
50
|
+
*/
|
|
24
51
|
export declare function parseArgsOrExit<S extends FlagSchema>(argv: string[], schema: S, options?: ParseArgsOptions): ParsedArgs<S>;
|
|
@@ -1 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the `version` field from the nearest ancestor `package.json`, starting
|
|
3
|
+
* from the directory of the given `import.meta.url`.
|
|
4
|
+
*
|
|
5
|
+
* Composes `findPackageRoot` with a `package.json` read so callers get a
|
|
6
|
+
* depth-agnostic version lookup that works in source layouts (`src/...`),
|
|
7
|
+
* compiled layouts (`dist/esm/...`), and consumer layouts (npm-installed,
|
|
8
|
+
* `npx`).
|
|
9
|
+
*
|
|
10
|
+
* Throws if the located `package.json` lacks a string `version` field.
|
|
11
|
+
* Propagates `findPackageRoot`'s own error when no ancestor `package.json`
|
|
12
|
+
* exists.
|
|
13
|
+
*/
|
|
1
14
|
export declare function readPackageVersion(fromUrl: string): string;
|
package/dist/esm/terminal.d.ts
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import type { Writable } from 'node:stream';
|
|
2
2
|
import type { WriteResult } from './writeFileWithCheck.js';
|
|
3
|
+
/**
|
|
4
|
+
* Renders the canonical `Error: <message>` line (without a trailing newline) โ the single
|
|
5
|
+
* definition of this shape. Use it where the line is a value rather than a write target,
|
|
6
|
+
* e.g. a command that returns its message for the caller to print.
|
|
7
|
+
*/
|
|
3
8
|
export declare function formatErrorLine(message: string): string;
|
|
9
|
+
/** Prints an error message to stderr. */
|
|
4
10
|
export declare function printError(message: string): void;
|
|
11
|
+
/** Prints a skip/warning message to stdout. */
|
|
5
12
|
export declare function printSkip(message: string): void;
|
|
13
|
+
/** Prints a step label with a right-arrow prefix. */
|
|
6
14
|
export declare function printStep(message: string): void;
|
|
15
|
+
/** Prints a success message with a checkmark emoji prefix. */
|
|
7
16
|
export declare function printSuccess(message: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Writes the canonical `Error: <message>` line to a stream (stderr by default) โ the single
|
|
19
|
+
* sanctioned door for this output shape. Pass an injected stream for in-process CLIs that
|
|
20
|
+
* route output through a `Writable` rather than touching `process.stderr` directly.
|
|
21
|
+
*/
|
|
8
22
|
export declare function reportError(message: string, stream?: Writable): void;
|
|
23
|
+
/** Prints a terminal message for a write result based on its outcome. */
|
|
9
24
|
export declare function reportWriteResult(result: WriteResult, dryRun: boolean): void;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
/** Outcome of a `writeFileWithCheck` call. */
|
|
1
2
|
export type WriteOutcome = 'created' | 'overwritten' | 'up-to-date' | 'skipped' | 'failed';
|
|
3
|
+
/** Result returned by `writeFileWithCheck`. */
|
|
2
4
|
export interface WriteResult {
|
|
3
5
|
filePath: string;
|
|
4
6
|
outcome: WriteOutcome;
|
|
5
7
|
error?: string;
|
|
6
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Write a file with existence and content checks.
|
|
11
|
+
*
|
|
12
|
+
* Creates parent directories as needed. Compares content using whitespace-normalized comparison
|
|
13
|
+
* to determine whether an existing file is up to date. In dry-run mode, returns the outcome
|
|
14
|
+
* that would happen without performing writes. Filesystem errors are caught and returned as
|
|
15
|
+
* `{ outcome: 'failed' }` rather than thrown.
|
|
16
|
+
*/
|
|
7
17
|
export declare function writeFileWithCheck(filePath: string, content: string, options: {
|
|
8
18
|
dryRun: boolean;
|
|
9
19
|
overwrite: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@williamthorsen/nmr-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared utilities for node-monorepo-tools packages",
|
|
6
6
|
"keywords": [
|
|
@@ -29,15 +29,17 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
|
+
".meta/changelog.json",
|
|
33
|
+
"CHANGELOG.md",
|
|
32
34
|
"dist"
|
|
33
35
|
],
|
|
34
36
|
"dependencies": {
|
|
35
|
-
"@williamthorsen/toolbelt.errors": "0.
|
|
37
|
+
"@williamthorsen/toolbelt.errors": "0.7.0"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|
|
38
|
-
"@williamthorsen/toolbelt.filesystem": "0.8.
|
|
39
|
-
"@williamthorsen/toolbelt.testing": "0.
|
|
40
|
-
"@williamthorsen/toolbelt.vitest": "0.
|
|
40
|
+
"@williamthorsen/toolbelt.filesystem": "0.8.3",
|
|
41
|
+
"@williamthorsen/toolbelt.testing": "0.5.1",
|
|
42
|
+
"@williamthorsen/toolbelt.vitest": "0.9.0"
|
|
41
43
|
},
|
|
42
44
|
"engines": {
|
|
43
45
|
"node": ">=24"
|