Repository navigation
Commit 820cdbb
committed
fix(cli): wire onNotice so migration prose is suppressed under --json, and share the whole-stdout envelope parser
Review feedback on #313:
1. init.ts's comment claimed this diff matches the verify/test convention
of routing --json prose off stdout, but ensureTasklessDirectory(cwd) was
called with no onNotice, so its migration notice always fell back to an
unconditional console.error regardless of --json. verify.ts actually
SUPPRESSES that notice entirely under --json (its info already lives on
the envelope), matching EnsureOptions.onNotice's own doc comment. Wired
the same onNotice here so the code matches what the comment says, added
a regression test asserting stderr carries nothing about the migration
under --json, and mutation-checked it (dropping the !json guard fails
the new test; restoring it passes).
2. no-implicit-migration.test.ts's four JSON.parse(stdout.trim()) call
sites (from a prior commit widening them off the old blind .at(-1) read)
are now a single parseEnvelope<T> helper, documented the same way
migrated-envelope.test.ts's version is, so the reasoning for whole-string
parsing isn't duplicated four times without its rationale attached.
Mutation-checked: reintroducing the original init --json stdout-prose bug
fails both init --json tests in this file through the shared helper.1 parent e130b67 commit 820cdbb
3 files changed
Lines changed: 62 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | | - | |
262 | | - | |
| 260 | + | |
263 | 261 | | |
264 | 262 | | |
265 | 263 | | |
| |||
274 | 272 | | |
275 | 273 | | |
276 | 274 | | |
277 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
278 | 293 | | |
279 | 294 | | |
280 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
132 | 152 | | |
133 | 153 | | |
134 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
60 | 75 | | |
61 | 76 | | |
62 | 77 | | |
| |||
114 | 129 | | |
115 | 130 | | |
116 | 131 | | |
117 | | - | |
| 132 | + | |
118 | 133 | | |
119 | 134 | | |
120 | | - | |
| 135 | + | |
121 | 136 | | |
122 | 137 | | |
123 | 138 | | |
| |||
231 | 246 | | |
232 | 247 | | |
233 | 248 | | |
234 | | - | |
| 249 | + | |
235 | 250 | | |
236 | | - | |
| 251 | + | |
237 | 252 | | |
238 | 253 | | |
239 | 254 | | |
| |||
278 | 293 | | |
279 | 294 | | |
280 | 295 | | |
281 | | - | |
| 296 | + | |
282 | 297 | | |
283 | 298 | | |
284 | 299 | | |
285 | | - | |
| 300 | + | |
286 | 301 | | |
287 | 302 | | |
288 | 303 | | |
| |||
331 | 346 | | |
332 | 347 | | |
333 | 348 | | |
334 | | - | |
| 349 | + | |
335 | 350 | | |
336 | | - | |
| 351 | + | |
337 | 352 | | |
338 | 353 | | |
339 | 354 | | |
| |||
0 commit comments