outfitter 0.3.4 → 0.4.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 (197) hide show
  1. package/dist/actions/add.d.ts +1 -1
  2. package/dist/actions/add.js +6 -5
  3. package/dist/actions/check-automation.d.ts +4 -2
  4. package/dist/actions/check-automation.js +13 -9
  5. package/dist/actions/check.d.ts +2 -2
  6. package/dist/actions/check.js +6 -6
  7. package/dist/actions/demo.d.ts +1 -1
  8. package/dist/actions/demo.js +3 -4
  9. package/dist/actions/docs.d.ts +7 -7
  10. package/dist/actions/docs.js +12 -13
  11. package/dist/actions/doctor.d.ts +1 -1
  12. package/dist/actions/doctor.js +8 -7
  13. package/dist/actions/init.d.ts +9 -7
  14. package/dist/actions/init.js +12 -10
  15. package/dist/actions/scaffold.d.ts +1 -1
  16. package/dist/actions/scaffold.js +14 -12
  17. package/dist/actions/shared.d.ts +1 -20
  18. package/dist/actions/shared.js +1 -5
  19. package/dist/actions/upgrade.d.ts +10 -2
  20. package/dist/actions/upgrade.js +15 -8
  21. package/dist/actions.js +51 -48
  22. package/dist/cli.js +51 -48
  23. package/dist/commands/add.js +4 -3
  24. package/dist/commands/check-action-ceremony.d.ts +1 -1
  25. package/dist/commands/check-action-ceremony.js +2 -2
  26. package/dist/commands/check-action-registry.d.ts +52 -0
  27. package/dist/commands/check-action-registry.js +13 -0
  28. package/dist/commands/check-docs-sentinel.d.ts +1 -1
  29. package/dist/commands/check-docs-sentinel.js +2 -2
  30. package/dist/commands/check-orchestrator.d.ts +1 -1
  31. package/dist/commands/check-orchestrator.js +2 -2
  32. package/dist/commands/check-preset-versions.d.ts +4 -2
  33. package/dist/commands/check-preset-versions.js +8 -3
  34. package/dist/commands/check-publish-guardrails.d.ts +1 -1
  35. package/dist/commands/check-publish-guardrails.js +2 -2
  36. package/dist/commands/check-surface-map-format.d.ts +1 -1
  37. package/dist/commands/check-surface-map-format.js +2 -2
  38. package/dist/commands/check-surface-map.d.ts +1 -1
  39. package/dist/commands/check-surface-map.js +2 -2
  40. package/dist/commands/check-tsdoc.d.ts +2 -2
  41. package/dist/commands/check.js +3 -3
  42. package/dist/commands/demo.d.ts +1 -1
  43. package/dist/commands/demo.js +1 -1
  44. package/dist/commands/docs-api.d.ts +3 -3
  45. package/dist/commands/docs-api.js +2 -2
  46. package/dist/commands/docs-export.d.ts +2 -2
  47. package/dist/commands/docs-export.js +2 -2
  48. package/dist/commands/docs-list.d.ts +2 -2
  49. package/dist/commands/docs-list.js +2 -2
  50. package/dist/commands/docs-search.d.ts +2 -2
  51. package/dist/commands/docs-search.js +2 -2
  52. package/dist/commands/docs-show.d.ts +2 -2
  53. package/dist/commands/docs-show.js +2 -2
  54. package/dist/commands/doctor.js +6 -5
  55. package/dist/commands/init-execution.d.ts +5 -5
  56. package/dist/commands/init-execution.js +6 -4
  57. package/dist/commands/init-option-resolution.d.ts +3 -3
  58. package/dist/commands/init-option-resolution.js +1 -1
  59. package/dist/commands/init-output.d.ts +5 -5
  60. package/dist/commands/init-output.js +3 -3
  61. package/dist/commands/init.d.ts +5 -5
  62. package/dist/commands/init.js +9 -9
  63. package/dist/commands/scaffold-output.js +3 -3
  64. package/dist/commands/scaffold-planning.d.ts +9 -10
  65. package/dist/commands/scaffold-planning.js +6 -4
  66. package/dist/commands/scaffold.js +12 -10
  67. package/dist/commands/shared-deps.js +2 -2
  68. package/dist/commands/upgrade-codemod-builder.d.ts +45 -0
  69. package/dist/commands/upgrade-codemod-builder.js +14 -0
  70. package/dist/commands/upgrade-output.js +2 -2
  71. package/dist/commands/upgrade-workspace.js +5 -1
  72. package/dist/commands/upgrade.js +9 -5
  73. package/dist/create/index.d.ts +1 -1
  74. package/dist/create/planner.js +1 -1
  75. package/dist/engine/blocks.d.ts +2 -2
  76. package/dist/engine/blocks.js +5 -4
  77. package/dist/engine/config.d.ts +2 -2
  78. package/dist/engine/config.js +6 -5
  79. package/dist/engine/dependency-versions.d.ts +11 -3
  80. package/dist/engine/dependency-versions.js +6 -2
  81. package/dist/engine/executor.d.ts +2 -2
  82. package/dist/engine/executor.js +23 -10
  83. package/dist/engine/index.d.ts +8 -9
  84. package/dist/engine/index.js +1 -5
  85. package/dist/engine/package-json.d.ts +3 -0
  86. package/dist/engine/package-json.js +10 -0
  87. package/dist/engine/post-scaffold.js +1 -1
  88. package/dist/engine/preset.d.ts +3 -3
  89. package/dist/engine/preset.js +4 -2
  90. package/dist/engine/render-plan.js +2 -2
  91. package/dist/engine/types.d.ts +1 -1
  92. package/dist/engine/workspace.d.ts +2 -2
  93. package/dist/engine/workspace.js +3 -2
  94. package/dist/index.d.ts +7 -7
  95. package/dist/manifest.js +1 -1
  96. package/dist/output-mode.d.ts +2 -2
  97. package/dist/output-mode.js +2 -4
  98. package/dist/scaffold-e2e/cli.d.ts +19 -0
  99. package/dist/scaffold-e2e/cli.js +14 -0
  100. package/dist/scaffold-e2e/config.d.ts +6 -0
  101. package/dist/scaffold-e2e/config.js +14 -0
  102. package/dist/scaffold-e2e/runner.d.ts +29 -0
  103. package/dist/scaffold-e2e/runner.js +17 -0
  104. package/dist/scaffold-e2e/template-guardrails.d.ts +25 -0
  105. package/dist/scaffold-e2e/template-guardrails.js +183 -0
  106. package/dist/scaffold-e2e/workspace.d.ts +27 -0
  107. package/dist/scaffold-e2e/workspace.js +18 -0
  108. package/dist/scripts/scaffold-e2e.js +78 -0
  109. package/dist/shared/{outfitter-qsrx7m4w.js → outfitter-00wxeg2g.js} +8 -8
  110. package/dist/shared/{outfitter-ex8gn945.js → outfitter-0cspz333.js} +4 -6
  111. package/dist/shared/{outfitter-rp89dafm.js → outfitter-0xp447gf.js} +55 -8
  112. package/dist/shared/outfitter-0zs8makw.js +94 -0
  113. package/dist/shared/{outfitter-5d9wbzhh.d.ts → outfitter-11r5ny73.d.ts} +2 -2
  114. package/dist/shared/{outfitter-gyayfx5r.js → outfitter-18s82np1.js} +1 -1
  115. package/dist/shared/{outfitter-954y4mzx.d.ts → outfitter-1dekqnaw.d.ts} +1 -1
  116. package/dist/shared/{outfitter-6t7xeyg1.js → outfitter-1t8gjzw6.js} +91 -3
  117. package/dist/shared/{outfitter-tqznjgbm.js → outfitter-23159bef.js} +6 -3
  118. package/dist/shared/{outfitter-y6ee0k45.d.ts → outfitter-232ean4v.d.ts} +1 -1
  119. package/dist/shared/{outfitter-3rcrvva8.js → outfitter-247et71q.js} +8 -8
  120. package/dist/shared/{outfitter-xs94pkfe.js → outfitter-3f261xh0.js} +5 -7
  121. package/dist/shared/outfitter-4bs5a2n4.js +31 -0
  122. package/dist/shared/{outfitter-76k25svs.js → outfitter-4c4q091c.js} +6 -28
  123. package/dist/shared/{outfitter-738z4c37.js → outfitter-4t818mq5.js} +21 -9
  124. package/dist/shared/{outfitter-4s9meh3j.js → outfitter-4w9sc6bw.js} +24 -0
  125. package/dist/shared/outfitter-5gaptj9b.js +83 -0
  126. package/dist/shared/{outfitter-2ysjerp6.d.ts → outfitter-5rc4hxdn.d.ts} +2 -2
  127. package/dist/shared/{outfitter-ttjr95y9.js → outfitter-7krhbg3b.js} +3 -3
  128. package/dist/shared/{outfitter-7n7vsz95.js → outfitter-7t7ces1x.js} +1 -42
  129. package/dist/shared/{outfitter-gdc7b7de.d.ts → outfitter-8231g70k.d.ts} +1 -1
  130. package/dist/shared/{outfitter-yhb23pjc.js → outfitter-8jd1sak0.js} +4 -4
  131. package/dist/shared/{outfitter-wkt0a0ra.js → outfitter-93e1shd4.js} +4 -6
  132. package/dist/shared/{outfitter-wyg1tpp5.d.ts → outfitter-a93yanw6.d.ts} +1 -1
  133. package/dist/shared/{outfitter-mstr60zz.js → outfitter-aa5nzw14.js} +47 -22
  134. package/dist/shared/{outfitter-fxry5n58.js → outfitter-b05mvbmx.js} +4 -4
  135. package/dist/shared/{outfitter-1fy7byz5.js → outfitter-bsjq8gkk.js} +6 -4
  136. package/dist/shared/{outfitter-ssrtakh3.js → outfitter-c50y6yr3.js} +4 -4
  137. package/dist/shared/{outfitter-cyvr4r8d.d.ts → outfitter-crxe5gth.d.ts} +4 -0
  138. package/dist/shared/{outfitter-fj2v5ffz.js → outfitter-d5kz9x7g.js} +1 -1
  139. package/dist/shared/{outfitter-dmfac1w9.js → outfitter-dna8exj2.js} +19 -10
  140. package/dist/shared/{outfitter-940h0x7b.js → outfitter-e44qcs0w.js} +3 -3
  141. package/dist/shared/{outfitter-r2awqszh.d.ts → outfitter-e5x0ybqt.d.ts} +12 -3
  142. package/dist/shared/{outfitter-3tx3adgj.js → outfitter-ez7qffv5.js} +8 -6
  143. package/dist/shared/outfitter-fgrqt6aq.js +179 -0
  144. package/dist/shared/outfitter-fhahf9f3.d.ts +14 -0
  145. package/dist/shared/{outfitter-c7sbs7es.js → outfitter-g6r9avgz.js} +3 -3
  146. package/dist/shared/{outfitter-ssynegbs.js → outfitter-ga59fa45.js} +1 -1
  147. package/dist/shared/{outfitter-tavatb5p.js → outfitter-gna739c3.js} +86 -31
  148. package/dist/shared/{outfitter-nxvjxrmw.d.ts → outfitter-grt5ngqq.d.ts} +1 -1
  149. package/dist/shared/{outfitter-58rn1sj1.d.ts → outfitter-gsjbcta2.d.ts} +1 -1
  150. package/dist/shared/{outfitter-q1g58t85.js → outfitter-gvpwpqnc.js} +0 -1
  151. package/dist/shared/{outfitter-x39awx8g.js → outfitter-hr4cvmjy.js} +47 -25
  152. package/dist/shared/{outfitter-xwzjgswj.js → outfitter-hw9f0zq9.js} +57 -21
  153. package/dist/shared/{outfitter-ksyvwmb5.js → outfitter-jhpcjeg1.js} +5 -5
  154. package/dist/shared/outfitter-kc46jq69.d.ts +12 -0
  155. package/dist/shared/{outfitter-px5sv5gn.js → outfitter-ksg34wka.js} +5 -5
  156. package/dist/shared/{outfitter-wrcqq29p.js → outfitter-n63ygpv3.js} +30 -23
  157. package/dist/shared/{outfitter-qsd5638j.js → outfitter-n9jp1abt.js} +16 -40
  158. package/dist/shared/{outfitter-d0kqashd.d.ts → outfitter-nhft74pe.d.ts} +4 -2
  159. package/dist/shared/{outfitter-8kmak0wc.d.ts → outfitter-nx1sywpb.d.ts} +1 -1
  160. package/dist/shared/{outfitter-5r6q2749.d.ts → outfitter-pw74st5t.d.ts} +1 -1
  161. package/dist/shared/{outfitter-h0wmtxw8.d.ts → outfitter-qka1skyw.d.ts} +1 -1
  162. package/dist/shared/{outfitter-6mpkh3zn.js → outfitter-qps83547.js} +30 -23
  163. package/dist/shared/outfitter-qzd5djgx.js +88 -0
  164. package/dist/shared/{outfitter-hf5bj2gq.js → outfitter-sh015v8k.js} +4 -4
  165. package/dist/shared/{outfitter-ypcvwg1s.js → outfitter-srznx3hj.js} +1 -1
  166. package/dist/shared/{outfitter-n0ed012k.js → outfitter-ssq33ym3.js} +8 -8
  167. package/dist/shared/outfitter-sxf8jjjn.js +7 -0
  168. package/dist/shared/{outfitter-p2wn07b7.js → outfitter-t535h0mw.js} +1 -1
  169. package/dist/shared/{outfitter-znbqe5zy.d.ts → outfitter-t8dg4tg5.d.ts} +1 -1
  170. package/dist/shared/{outfitter-ydw7x6bh.js → outfitter-t8mvabed.js} +1 -1
  171. package/dist/shared/{outfitter-6ddf91vh.js → outfitter-t9xkn37g.js} +11 -12
  172. package/dist/shared/{outfitter-x4cc5xsq.js → outfitter-wmgzyymq.js} +4 -4
  173. package/dist/shared/outfitter-wna6gp2t.js +56 -0
  174. package/dist/shared/outfitter-x0r7mfvy.js +142 -0
  175. package/dist/shared/{outfitter-b9cpnr7e.js → outfitter-x4f8v5vf.js} +1 -1
  176. package/dist/shared/{outfitter-x8w5sjnd.d.ts → outfitter-x6322tjp.d.ts} +1 -1
  177. package/dist/shared/{outfitter-6rtcemk7.d.ts → outfitter-xa4915yp.d.ts} +3 -2
  178. package/dist/shared/{outfitter-2z61gp5w.js → outfitter-xg5yryp2.js} +1 -1
  179. package/dist/shared/{outfitter-rdpw2sbp.d.ts → outfitter-xn5km042.d.ts} +6 -0
  180. package/dist/shared/{outfitter-cyhzstz0.js → outfitter-xqr4fp1n.js} +4 -4
  181. package/dist/shared/outfitter-z6tg0swx.js +87 -0
  182. package/dist/shared/{outfitter-1gmrtapz.js → outfitter-zmzrsvcn.js} +17 -21
  183. package/dist/shared/{outfitter-8ggmja91.js → outfitter-zqj1nte1.js} +66 -67
  184. package/dist/targets/index.d.ts +2 -2
  185. package/dist/targets/registry.d.ts +2 -2
  186. package/dist/targets/registry.js +13 -1
  187. package/dist/targets/types.d.ts +1 -1
  188. package/package.json +85 -39
  189. package/dist/actions/docs-output-mode.d.ts +0 -4
  190. package/dist/actions/docs-output-mode.js +0 -8
  191. package/dist/engine/template.d.ts +0 -4
  192. package/dist/engine/template.js +0 -34
  193. package/dist/shared/outfitter-7r12fj7f.js +0 -30
  194. package/dist/shared/outfitter-a79xrm12.d.ts +0 -17
  195. package/dist/shared/outfitter-ec83h4v2.js +0 -17
  196. package/dist/shared/outfitter-fbvfd5zq.d.ts +0 -13
  197. package/dist/shared/outfitter-yywcypw8.js +0 -53
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  resolveStructuredOutputMode
4
- } from "./outfitter-7r12fj7f.js";
4
+ } from "./outfitter-sxf8jjjn.js";
5
5
 
6
6
  // apps/outfitter/src/commands/check-orchestrator.ts
7
7
  import { resolve } from "path";
@@ -27,12 +27,12 @@ function normalizePaths(paths) {
27
27
  }
28
28
  return paths.map((path) => path.trim()).filter((path) => path.length > 0).toSorted();
29
29
  }
30
- function shouldSyncAgentScaffolding(paths) {
31
- return paths.some((path) => path === ".claude/settings.json" || path.startsWith(".claude/hooks/"));
32
- }
33
30
  function buildCheckOrchestratorPlan(options) {
34
31
  const stagedFiles = normalizePaths(options.stagedFiles);
32
+ const commandProfile = options.commandProfile ?? "default";
35
33
  if (options.mode === "all" || options.mode === "ci") {
34
+ const typecheckCommand = commandProfile === "hook" ? ["bun", "run", "typecheck:hook"] : ["bun", "run", "typecheck", "--", "--only"];
35
+ const lintAndFormatCommand = commandProfile === "hook" ? ["bun", "run", "check:hook"] : ["bun", "run", "check"];
36
36
  const steps = [
37
37
  {
38
38
  id: "block-drift",
@@ -50,12 +50,12 @@ function buildCheckOrchestratorPlan(options) {
50
50
  {
51
51
  id: "typecheck",
52
52
  label: "Typecheck",
53
- command: ["bun", "run", "typecheck", "--", "--only"]
53
+ command: typecheckCommand
54
54
  },
55
55
  {
56
56
  id: "lint-and-format",
57
57
  label: "Lint/Format checks",
58
- command: ["bun", "run", "check"]
58
+ command: lintAndFormatCommand
59
59
  },
60
60
  {
61
61
  id: "publish-guardrails",
@@ -313,13 +313,6 @@ function buildCheckOrchestratorPlan(options) {
313
313
  command: ["bun", "run", "typecheck", "--", "--only"]
314
314
  });
315
315
  }
316
- if (shouldSyncAgentScaffolding(stagedFiles)) {
317
- preCommitSteps.push({
318
- id: "sync-agent-scaffolding",
319
- label: "Sync agent scaffolding",
320
- command: ["./scripts/sync-agent-scaffolding.sh"]
321
- });
322
- }
323
316
  return preCommitSteps;
324
317
  }
325
318
  function parseTreePaths(statusOutput) {
@@ -344,17 +337,19 @@ function diffTreePaths(before, after) {
344
337
  const beforeSet = new Set(before);
345
338
  return after.filter((path) => !beforeSet.has(path));
346
339
  }
347
- async function runStep(cwd, step) {
340
+ async function runStep(cwd, step, options = {}) {
348
341
  const startedAt = Date.now();
349
342
  const processHandle = Bun.spawn([...step.command], {
350
343
  cwd,
351
344
  stdout: "pipe",
352
345
  stderr: "pipe"
353
346
  });
347
+ const stdoutTarget = options.streamOutput ? process.stdout : undefined;
348
+ const stderrTarget = options.streamOutput ? process.stderr : undefined;
354
349
  const [exitCode, stdout, stderr] = await Promise.all([
355
350
  processHandle.exited,
356
- new Response(processHandle.stdout).text(),
357
- new Response(processHandle.stderr).text()
351
+ readOutputStream(processHandle.stdout, stdoutTarget),
352
+ readOutputStream(processHandle.stderr, stderrTarget)
358
353
  ]);
359
354
  return {
360
355
  id: step.id,
@@ -366,6 +361,36 @@ async function runStep(cwd, step) {
366
361
  durationMs: Date.now() - startedAt
367
362
  };
368
363
  }
364
+ async function readOutputStream(stream, target) {
365
+ if (!stream) {
366
+ return "";
367
+ }
368
+ const reader = stream.getReader();
369
+ const decoder = new TextDecoder;
370
+ const chunks = [];
371
+ try {
372
+ while (true) {
373
+ const { done, value } = await reader.read();
374
+ if (done) {
375
+ break;
376
+ }
377
+ const chunk = decoder.decode(value, { stream: true });
378
+ if (chunk.length === 0) {
379
+ continue;
380
+ }
381
+ chunks.push(chunk);
382
+ target?.write(chunk);
383
+ }
384
+ const trailingChunk = decoder.decode();
385
+ if (trailingChunk.length > 0) {
386
+ chunks.push(trailingChunk);
387
+ target?.write(trailingChunk);
388
+ }
389
+ return chunks.join("");
390
+ } finally {
391
+ reader.releaseLock();
392
+ }
393
+ }
369
394
  function extractSuccessAdvisory(stderr) {
370
395
  const lines = stderr.split(`
371
396
  `).map((line) => line.trim()).filter((line) => line.length > 0);
@@ -393,8 +418,14 @@ async function runCheckOrchestrator(options) {
393
418
  }
394
419
  const treeBefore = readTreePaths(cwd);
395
420
  const stepResults = [];
396
- for (const step of plan) {
397
- const result = await runStep(cwd, step);
421
+ for (const [index, step] of plan.entries()) {
422
+ if (options.streamOutput) {
423
+ process.stdout.write(`[check ${index + 1}/${plan.length}] ${step.label}
424
+ `);
425
+ }
426
+ const result = await runStep(cwd, step, {
427
+ streamOutput: options.streamOutput
428
+ });
398
429
  stepResults.push(result);
399
430
  if (result.exitCode !== 0) {
400
431
  break;
@@ -451,11 +482,16 @@ async function printCheckOrchestratorResults(result, options = {}) {
451
482
  process.stdout.write(` ${icon} ${step.label} ${theme.muted(`(${duration})`)}
452
483
  `);
453
484
  if (step.exitCode !== 0) {
454
- const snippet = `${step.stdout}
485
+ if (options.liveOutput) {
486
+ process.stdout.write(` ${theme.muted("Live step output shown above.")}
487
+ `);
488
+ } else {
489
+ const snippet = `${step.stdout}
455
490
  ${step.stderr}`.trim();
456
- if (snippet.length > 0) {
457
- process.stdout.write(`${theme.muted(snippet)}
491
+ if (snippet.length > 0) {
492
+ process.stdout.write(`${theme.muted(snippet)}
458
493
  `);
494
+ }
459
495
  }
460
496
  } else {
461
497
  const advisory = extractSuccessAdvisory(step.stderr);
@@ -127,22 +127,22 @@ function parseEmbeddedOptions(argv) {
127
127
  async function runEmbeddedDemo(options) {
128
128
  const mode = toOutputMode(options.outputMode);
129
129
  if (options.list) {
130
- await output(renderListSections(), { mode });
130
+ await output(renderListSections(), mode);
131
131
  return 0;
132
132
  }
133
133
  if (options.animate) {
134
- await output(renderDemo("spinner"), { mode });
134
+ await output(renderDemo("spinner"), mode);
135
135
  return 0;
136
136
  }
137
137
  if (options.section === undefined || options.section === "all") {
138
- await output(renderAllDemos(), { mode });
138
+ await output(renderAllDemos(), mode);
139
139
  return 0;
140
140
  }
141
141
  if (!isPrimitiveId(options.section)) {
142
- await output(renderUnknownSection(options.section), { mode });
142
+ await output(renderUnknownSection(options.section), mode);
143
143
  return 1;
144
144
  }
145
- await output(renderDemo(options.section), { mode });
145
+ await output(renderDemo(options.section), mode);
146
146
  return 0;
147
147
  }
148
148
  async function runEmbeddedFromArgv() {
@@ -0,0 +1,12 @@
1
+ import { InitPresetId } from "./outfitter-11r5ny73.js";
2
+ type ScaffoldE2EProfileId = "default" | "ci";
3
+ interface ScaffoldE2EProfile {
4
+ readonly commandTimeoutMs: number;
5
+ readonly id: ScaffoldE2EProfileId;
6
+ readonly presets: readonly InitPresetId[];
7
+ }
8
+ declare const DEFAULT_SCAFFOLD_E2E_PRESETS: readonly InitPresetId[];
9
+ declare const SCAFFOLD_E2E_STEPS_PER_PRESET = 3;
10
+ declare function resolveScaffoldE2EProfile(id?: ScaffoldE2EProfileId): ScaffoldE2EProfile;
11
+ declare function getScaffoldE2ESuiteTimeoutBudgetMs(profile: ScaffoldE2EProfile): number;
12
+ export { ScaffoldE2EProfileId, ScaffoldE2EProfile, DEFAULT_SCAFFOLD_E2E_PRESETS, SCAFFOLD_E2E_STEPS_PER_PRESET, resolveScaffoldE2EProfile, getScaffoldE2ESuiteTimeoutBudgetMs };
@@ -1,14 +1,14 @@
1
1
  // @bun
2
2
  import {
3
3
  validatePackageName
4
- } from "./outfitter-q1g58t85.js";
4
+ } from "./outfitter-gvpwpqnc.js";
5
5
  import {
6
6
  resolveStructuredOutputMode
7
- } from "./outfitter-7r12fj7f.js";
7
+ } from "./outfitter-sxf8jjjn.js";
8
8
  import {
9
9
  getWorkspacePatterns,
10
10
  hasWorkspacesField
11
- } from "./outfitter-1fy7byz5.js";
11
+ } from "./outfitter-bsjq8gkk.js";
12
12
 
13
13
  // apps/outfitter/src/commands/doctor.ts
14
14
  import { existsSync, readFileSync } from "fs";
@@ -255,7 +255,7 @@ function runDoctor(options) {
255
255
  async function printDoctorResults(result, options) {
256
256
  const structuredMode = resolveStructuredOutputMode(options?.mode);
257
257
  if (structuredMode) {
258
- await output(result, { mode: structuredMode });
258
+ await output(result, structuredMode);
259
259
  return;
260
260
  }
261
261
  const theme = createTheme();
@@ -306,7 +306,7 @@ async function printDoctorResults(result, options) {
306
306
  if (result.exitCode !== 0) {
307
307
  lines.push("", theme.muted("Run 'outfitter doctor' after fixing issues to verify."));
308
308
  }
309
- await output(lines, { mode: "human" });
309
+ await output(lines, "human");
310
310
  }
311
311
  function doctorCommand(program) {
312
312
  program.command("doctor").description("Validate environment and dependencies").action(async (_flags, command) => {
@@ -2,28 +2,29 @@
2
2
  import {
3
3
  SHARED_DEV_DEPS,
4
4
  SHARED_SCRIPTS
5
- } from "./outfitter-tqznjgbm.js";
6
- import {
7
- applyResolvedDependencyVersions,
8
- resolvePresetDependencyVersions
9
- } from "./outfitter-x39awx8g.js";
5
+ } from "./outfitter-23159bef.js";
10
6
  import {
11
7
  getWorkspacePatterns
12
- } from "./outfitter-1fy7byz5.js";
8
+ } from "./outfitter-bsjq8gkk.js";
9
+ import {
10
+ serializePackageJson
11
+ } from "./outfitter-5gaptj9b.js";
13
12
  import {
14
13
  ScaffoldError
15
14
  } from "./outfitter-8y2dfx6n.js";
15
+ import {
16
+ DEPENDENCY_SECTIONS,
17
+ applyResolvedDependencyVersions,
18
+ resolvePresetDependencyVersions
19
+ } from "./outfitter-hr4cvmjy.js";
16
20
 
17
21
  // apps/outfitter/src/engine/config.ts
18
22
  import { existsSync, readdirSync, readFileSync, writeFileSync } from "fs";
19
23
  import { join } from "path";
20
24
  import { Result } from "@outfitter/contracts";
21
- var DEPENDENCY_SECTIONS = [
22
- "dependencies",
23
- "devDependencies",
24
- "peerDependencies",
25
- "optionalDependencies"
26
- ];
25
+ function formatUnresolvedCatalogMessage(packageJsonPath, unresolvedNames) {
26
+ return `Unresolved catalog placeholder(s) in ${packageJsonPath}: ` + unresolvedNames.join(", ");
27
+ }
27
28
  function getWorkspaceMemberPackageJsonPaths(rootDir, rootPackageJson) {
28
29
  const patterns = getWorkspacePatterns(rootPackageJson["workspaces"]);
29
30
  const packageJsonPaths = new Set;
@@ -76,23 +77,31 @@ function injectSharedConfig(targetDir) {
76
77
  try {
77
78
  const content = readFileSync(packageJsonPath, "utf-8");
78
79
  const parsed = JSON.parse(content);
79
- const dependencyVersions = resolvePresetDependencyVersions();
80
- applyResolvedDependencyVersions(parsed, dependencyVersions);
80
+ const versionsResult = resolvePresetDependencyVersions();
81
+ if (versionsResult.isErr()) {
82
+ return Result.err(new ScaffoldError(`Failed to resolve dependency versions: ${versionsResult.error.message}`));
83
+ }
84
+ const dependencyVersions = versionsResult.value;
85
+ const unresolvedRootDeps = applyResolvedDependencyVersions(parsed, dependencyVersions);
86
+ if (unresolvedRootDeps.length > 0) {
87
+ return Result.err(new ScaffoldError(formatUnresolvedCatalogMessage(packageJsonPath, unresolvedRootDeps)));
88
+ }
81
89
  const existingDevDeps = parsed["devDependencies"] ?? {};
82
90
  parsed["devDependencies"] = { ...SHARED_DEV_DEPS, ...existingDevDeps };
83
91
  const existingScripts = parsed["scripts"] ?? {};
84
92
  parsed["scripts"] = { ...SHARED_SCRIPTS, ...existingScripts };
85
- writeFileSync(packageJsonPath, `${JSON.stringify(parsed, null, 2)}
86
- `, "utf-8");
93
+ writeFileSync(packageJsonPath, serializePackageJson(parsed), "utf-8");
87
94
  const workspaceMembers = getWorkspaceMemberPackageJsonPaths(targetDir, parsed);
88
95
  for (const memberPackageJsonPath of workspaceMembers) {
89
96
  const memberContent = readFileSync(memberPackageJsonPath, "utf-8");
90
97
  const memberParsed = JSON.parse(memberContent);
91
98
  const before = JSON.stringify(memberParsed);
92
- applyResolvedDependencyVersions(memberParsed, dependencyVersions);
99
+ const unresolvedMemberDeps = applyResolvedDependencyVersions(memberParsed, dependencyVersions);
100
+ if (unresolvedMemberDeps.length > 0) {
101
+ return Result.err(new ScaffoldError(formatUnresolvedCatalogMessage(memberPackageJsonPath, unresolvedMemberDeps)));
102
+ }
93
103
  if (JSON.stringify(memberParsed) !== before) {
94
- writeFileSync(memberPackageJsonPath, `${JSON.stringify(memberParsed, null, 2)}
95
- `, "utf-8");
104
+ writeFileSync(memberPackageJsonPath, serializePackageJson(memberParsed), "utf-8");
96
105
  }
97
106
  }
98
107
  return Result.ok(undefined);
@@ -110,16 +119,14 @@ function rewriteLocalDependencies(targetDir) {
110
119
  const content = readFileSync(packageJsonPath, "utf-8");
111
120
  const parsed = JSON.parse(content);
112
121
  if (rewriteOutfitterDepsToWorkspace(parsed)) {
113
- writeFileSync(packageJsonPath, `${JSON.stringify(parsed, null, 2)}
114
- `, "utf-8");
122
+ writeFileSync(packageJsonPath, serializePackageJson(parsed), "utf-8");
115
123
  }
116
124
  const workspaceMembers = getWorkspaceMemberPackageJsonPaths(targetDir, parsed);
117
125
  for (const memberPackageJsonPath of workspaceMembers) {
118
126
  const memberContent = readFileSync(memberPackageJsonPath, "utf-8");
119
127
  const memberParsed = JSON.parse(memberContent);
120
128
  if (rewriteOutfitterDepsToWorkspace(memberParsed)) {
121
- writeFileSync(memberPackageJsonPath, `${JSON.stringify(memberParsed, null, 2)}
122
- `, "utf-8");
129
+ writeFileSync(memberPackageJsonPath, serializePackageJson(memberParsed), "utf-8");
123
130
  }
124
131
  }
125
132
  return Result.ok(undefined);
@@ -9,10 +9,18 @@ import {
9
9
  sanitizePackageName,
10
10
  validatePackageName,
11
11
  validateProjectDirectoryName
12
- } from "./outfitter-q1g58t85.js";
12
+ } from "./outfitter-gvpwpqnc.js";
13
13
  import {
14
- detectWorkspaceRoot
15
- } from "./outfitter-1fy7byz5.js";
14
+ parseBlocks
15
+ } from "./outfitter-xg5yryp2.js";
16
+ import {
17
+ detectWorkspaceRoot,
18
+ getWorkspacePatterns,
19
+ hasWorkspacesField
20
+ } from "./outfitter-bsjq8gkk.js";
21
+ import {
22
+ serializePackageJson
23
+ } from "./outfitter-5gaptj9b.js";
16
24
 
17
25
  // apps/outfitter/src/commands/scaffold-planning.ts
18
26
  import {
@@ -38,30 +46,6 @@ function readPackageJson(path) {
38
46
  return null;
39
47
  }
40
48
  }
41
- function hasWorkspacesField(pkg) {
42
- const workspaces = pkg.workspaces;
43
- if (Array.isArray(workspaces) && workspaces.length > 0) {
44
- return true;
45
- }
46
- if (workspaces && typeof workspaces === "object" && !Array.isArray(workspaces)) {
47
- const packages = workspaces.packages;
48
- return Array.isArray(packages) && packages.length > 0;
49
- }
50
- return false;
51
- }
52
- function extractWorkspacePatterns(pkg) {
53
- const workspaces = pkg.workspaces;
54
- if (Array.isArray(workspaces)) {
55
- return workspaces.filter((entry) => typeof entry === "string");
56
- }
57
- if (workspaces && typeof workspaces === "object" && !Array.isArray(workspaces)) {
58
- const packages = workspaces.packages;
59
- if (Array.isArray(packages)) {
60
- return packages.filter((entry) => typeof entry === "string");
61
- }
62
- }
63
- return [];
64
- }
65
49
  function detectProjectStructure(cwd) {
66
50
  const resolvedCwd = resolve(cwd);
67
51
  const cwdPackageJsonPath = join(resolvedCwd, "package.json");
@@ -71,7 +55,7 @@ function detectProjectStructure(cwd) {
71
55
  return Result.ok({
72
56
  kind: "workspace",
73
57
  rootDir: resolvedCwd,
74
- workspacePatterns: extractWorkspacePatterns(cwdPkg)
58
+ workspacePatterns: getWorkspacePatterns(cwdPkg.workspaces)
75
59
  });
76
60
  }
77
61
  const wsResult2 = detectWorkspaceRoot(resolvedCwd);
@@ -84,7 +68,7 @@ function detectProjectStructure(cwd) {
84
68
  return Result.ok({
85
69
  kind: "workspace",
86
70
  rootDir: wsResult2.value,
87
- workspacePatterns: extractWorkspacePatterns(rootPkg)
71
+ workspacePatterns: getWorkspacePatterns(rootPkg.workspaces)
88
72
  });
89
73
  }
90
74
  }
@@ -104,7 +88,7 @@ function detectProjectStructure(cwd) {
104
88
  return Result.ok({
105
89
  kind: "workspace",
106
90
  rootDir: wsResult.value,
107
- workspacePatterns: extractWorkspacePatterns(rootPkg)
91
+ workspacePatterns: getWorkspacePatterns(rootPkg.workspaces)
108
92
  });
109
93
  }
110
94
  }
@@ -186,7 +170,7 @@ function ensureWorkspacePattern(rootDir, placement, dryRun, collector) {
186
170
  return Result.err("Failed to read workspace package.json");
187
171
  }
188
172
  const pattern = `${placement}/*`;
189
- const patterns = [...extractWorkspacePatterns(pkg)];
173
+ const patterns = [...getWorkspacePatterns(pkg.workspaces)];
190
174
  if (patterns.includes(pattern)) {
191
175
  return Result.ok(false);
192
176
  }
@@ -211,8 +195,7 @@ function ensureWorkspacePattern(rootDir, placement, dryRun, collector) {
211
195
  } else {
212
196
  nextPkg["workspaces"] = nextPatterns;
213
197
  }
214
- writeFileSync(packageJsonPath, `${JSON.stringify(nextPkg, null, 2)}
215
- `, "utf-8");
198
+ writeFileSync(packageJsonPath, serializePackageJson(nextPkg), "utf-8");
216
199
  return Result.ok(true);
217
200
  }
218
201
  function movePath(source, destination) {
@@ -324,13 +307,6 @@ function convertToWorkspace(rootDir, existingPkg, dryRun, collector) {
324
307
  }
325
308
  });
326
309
  }
327
- function parseBlocks(withFlag) {
328
- if (!withFlag) {
329
- return;
330
- }
331
- const blocks = withFlag.split(",").map((value) => value.trim()).filter((value) => value.length > 0);
332
- return blocks.length > 0 ? blocks : undefined;
333
- }
334
310
  function buildScaffoldPlan(target, rootDir, targetName, options) {
335
311
  const targetDir = join(rootDir, target.placement, targetName);
336
312
  const packageName = targetName;
@@ -1,5 +1,5 @@
1
- import { InitStructure } from "./outfitter-r2awqszh.js";
2
- import { InitPresetId } from "./outfitter-5d9wbzhh.js";
1
+ import { InitStructure } from "./outfitter-e5x0ybqt.js";
2
+ import { InitPresetId } from "./outfitter-11r5ny73.js";
3
3
  import { PostScaffoldResult } from "./outfitter-hcexcvxe.js";
4
4
  import { OutputMode } from "@outfitter/cli/types";
5
5
  import { Result } from "@outfitter/contracts";
@@ -13,6 +13,8 @@ interface InitOptions {
13
13
  readonly bin?: string | undefined;
14
14
  /** Preview changes without writing to disk. */
15
15
  readonly dryRun?: boolean | undefined;
16
+ /** Example name to overlay pattern-rich scaffold files (e.g., "todo" for cli, "files" for mcp). */
17
+ readonly example?: string | undefined;
16
18
  /** Overwrite existing files without prompting. */
17
19
  readonly force: boolean;
18
20
  /** Timeout in milliseconds for `bun install`. */
@@ -1,4 +1,4 @@
1
- import { EngineOptions, ScaffoldError, ScaffoldPlan, ScaffoldResult } from "./outfitter-cyvr4r8d.js";
1
+ import { EngineOptions, ScaffoldError, ScaffoldPlan, ScaffoldResult } from "./outfitter-crxe5gth.js";
2
2
  import { Result } from "@outfitter/contracts";
3
3
  declare function executePlan(plan: ScaffoldPlan, options: EngineOptions): Promise<Result<ScaffoldResult, ScaffoldError>>;
4
4
  export { executePlan };
@@ -1,4 +1,4 @@
1
- import { TargetCategory, TargetDefinition, TargetId, TargetScope, TargetStatus } from "./outfitter-58rn1sj1.js";
1
+ import { TargetCategory, TargetDefinition, TargetId, TargetScope, TargetStatus } from "./outfitter-gsjbcta2.js";
2
2
  import { NotFoundError, Result, ValidationError } from "@outfitter/contracts";
3
3
  declare const TARGET_REGISTRY: ReadonlyMap<TargetId, TargetDefinition>;
4
4
  declare const TARGET_IDS: readonly TargetId[];
@@ -1,4 +1,4 @@
1
- import { CliOutputMode } from "./outfitter-a79xrm12.js";
1
+ import { CliOutputMode } from "./outfitter-fhahf9f3.js";
2
2
  import { Result } from "@outfitter/contracts";
3
3
  import { CoverageLevel, TsDocCheckResult } from "@outfitter/tooling";
4
4
  /** Validated input for the check-tsdoc action handler. */
@@ -1,27 +1,27 @@
1
1
  // @bun
2
- import {
3
- printInitResults
4
- } from "./outfitter-n0ed012k.js";
5
- import {
6
- isBinaryPreset,
7
- parseBlocks,
8
- resolvePresetFromFlags
9
- } from "./outfitter-2z61gp5w.js";
10
2
  import {
11
3
  executeInitPipeline
12
- } from "./outfitter-tavatb5p.js";
4
+ } from "./outfitter-gna739c3.js";
13
5
  import {
14
6
  INIT_TARGET_IDS,
15
7
  TARGET_REGISTRY,
16
8
  getInitTarget
17
9
  } from "./outfitter-g3hvjshg.js";
10
+ import {
11
+ printInitResults
12
+ } from "./outfitter-ssq33ym3.js";
18
13
  import {
19
14
  deriveBinName,
20
15
  deriveProjectName,
21
16
  resolvePackageName,
22
17
  sanitizePackageName,
23
18
  validatePackageName
24
- } from "./outfitter-q1g58t85.js";
19
+ } from "./outfitter-gvpwpqnc.js";
20
+ import {
21
+ isBinaryPreset,
22
+ parseBlocks,
23
+ resolvePresetFromFlags
24
+ } from "./outfitter-xg5yryp2.js";
25
25
 
26
26
  // apps/outfitter/src/commands/init.ts
27
27
  import { basename, resolve } from "path";
@@ -35,6 +35,7 @@ import {
35
35
  text
36
36
  } from "@clack/prompts";
37
37
  import { exitWithError } from "@outfitter/cli";
38
+ import { resolveOutputMode as resolveOutputModeFromFlags } from "@outfitter/cli/query";
38
39
  import { Result } from "@outfitter/contracts";
39
40
  class InitError extends Error {
40
41
  _tag = "InitError";
@@ -83,7 +84,8 @@ async function resolveInitInput(options, presetOverride) {
83
84
  local: Boolean(options.local),
84
85
  ...blocksOverride2 ? { blocksOverride: blocksOverride2 } : {},
85
86
  ...workspaceName2 ? { workspaceName: workspaceName2 } : {},
86
- ...options.bin ? { binName: options.bin } : {}
87
+ ...options.bin ? { binName: options.bin } : {},
88
+ ...options.example ? { example: options.example } : {}
87
89
  });
88
90
  }
89
91
  intro("Outfitter init");
@@ -211,7 +213,8 @@ async function resolveInitInput(options, presetOverride) {
211
213
  local: Boolean(localValue),
212
214
  ...blocksOverride ? { blocksOverride } : {},
213
215
  ...workspaceName ? { workspaceName } : {},
214
- ...binName ? { binName } : {}
216
+ ...binName ? { binName } : {},
217
+ ...options.example ? { example: options.example } : {}
215
218
  });
216
219
  }
217
220
  async function runInit(options, presetOverride) {
@@ -244,12 +247,10 @@ var resolveLocal = (flags) => {
244
247
  return;
245
248
  };
246
249
  var resolveOutputMode = (flags) => {
247
- if (flags.json) {
248
- return "json";
249
- }
250
- return;
250
+ const { mode } = resolveOutputModeFromFlags(flags);
251
+ return mode === "human" ? undefined : mode;
251
252
  };
252
- var withCommonOptions = (command) => command.option("-n, --name <name>", "Package name (defaults to directory name)").option("-b, --bin <name>", "Binary name (defaults to project name)").option("-p, --preset <preset>", "Preset to use (minimal|cli|mcp|daemon|library|full-stack)").option("-s, --structure <mode>", "Project structure (single|workspace)").option("--workspace-name <name>", "Workspace root package name").option("-f, --force", "Overwrite existing files", false).option("--local", "Use workspace:* for @outfitter dependencies").option("--workspace", "Alias for --local").option("--with <blocks>", "Comma-separated tooling blocks to add").option("--no-tooling", "Skip default tooling blocks").option("-y, --yes", "Skip prompts and use defaults", false).option("--dry-run", "Preview changes without writing files", false).option("--skip-install", "Skip bun install", false).option("--skip-git", "Skip git init and initial commit", false).option("--skip-commit", "Skip initial commit only", false).option("--install-timeout <ms>", "bun install timeout in ms");
253
+ var withCommonOptions = (command) => command.option("-n, --name <name>", "Package name (defaults to directory name)").option("-b, --bin <name>", "Binary name (defaults to project name)").option("-e, --example <name>", "Scaffold with a pattern-rich example (cli: todo; mcp: files)").option("-p, --preset <preset>", "Preset to use (basic|minimal|cli|mcp|daemon|library|full-stack)").option("-s, --structure <mode>", "Project structure (single|workspace)").option("--workspace-name <name>", "Workspace root package name").option("-f, --force", "Overwrite existing files", false).option("--local", "Use workspace:* for @outfitter dependencies").option("--workspace", "Alias for --local").option("--with <blocks>", "Comma-separated tooling blocks to add").option("--no-tooling", "Skip default tooling blocks").option("-y, --yes", "Skip prompts and use defaults", false).option("--dry-run", "Preview changes without writing files", false).option("--skip-install", "Skip bun install", false).option("--skip-git", "Skip git init and initial commit", false).option("--skip-commit", "Skip initial commit only", false).option("--install-timeout <ms>", "bun install timeout in ms");
253
254
  function initCommand(program) {
254
255
  const init = program.command("init").description("Create a new Outfitter project");
255
256
  const resolveFlags = (flags, command) => {
@@ -274,6 +275,7 @@ function initCommand(program) {
274
275
  force: resolvedFlags.force ?? false,
275
276
  with: resolvedFlags.with,
276
277
  noTooling: resolvedFlags.noTooling,
278
+ example: resolvedFlags.example,
277
279
  yes: resolvedFlags.yes,
278
280
  dryRun: Boolean(resolvedFlags.dryRun),
279
281
  skipInstall: Boolean(resolvedFlags.skipInstall),
@@ -282,7 +284,7 @@ function initCommand(program) {
282
284
  ...resolvedFlags.installTimeout !== undefined ? { installTimeout: resolvedFlags.installTimeout } : {}
283
285
  });
284
286
  if (result.isErr()) {
285
- exitWithError(result.error, outputOptions);
287
+ exitWithError(result.error, mode);
286
288
  return;
287
289
  }
288
290
  await printInitResults(result.value, outputOptions);
@@ -302,6 +304,7 @@ function initCommand(program) {
302
304
  force: resolvedFlags.force ?? false,
303
305
  with: resolvedFlags.with,
304
306
  noTooling: resolvedFlags.noTooling,
307
+ example: resolvedFlags.example,
305
308
  yes: resolvedFlags.yes,
306
309
  dryRun: Boolean(resolvedFlags.dryRun),
307
310
  skipInstall: Boolean(resolvedFlags.skipInstall),
@@ -310,7 +313,7 @@ function initCommand(program) {
310
313
  ...resolvedFlags.installTimeout !== undefined ? { installTimeout: resolvedFlags.installTimeout } : {}
311
314
  }, "cli");
312
315
  if (result.isErr()) {
313
- exitWithError(result.error, outputOptions);
316
+ exitWithError(result.error, mode);
314
317
  return;
315
318
  }
316
319
  await printInitResults(result.value, outputOptions);
@@ -330,6 +333,7 @@ function initCommand(program) {
330
333
  force: resolvedFlags.force ?? false,
331
334
  with: resolvedFlags.with,
332
335
  noTooling: resolvedFlags.noTooling,
336
+ example: resolvedFlags.example,
333
337
  yes: resolvedFlags.yes,
334
338
  dryRun: Boolean(resolvedFlags.dryRun),
335
339
  skipInstall: Boolean(resolvedFlags.skipInstall),
@@ -338,7 +342,7 @@ function initCommand(program) {
338
342
  ...resolvedFlags.installTimeout !== undefined ? { installTimeout: resolvedFlags.installTimeout } : {}
339
343
  }, "mcp");
340
344
  if (result.isErr()) {
341
- exitWithError(result.error, outputOptions);
345
+ exitWithError(result.error, mode);
342
346
  return;
343
347
  }
344
348
  await printInitResults(result.value, outputOptions);
@@ -358,6 +362,7 @@ function initCommand(program) {
358
362
  force: resolvedFlags.force ?? false,
359
363
  with: resolvedFlags.with,
360
364
  noTooling: resolvedFlags.noTooling,
365
+ example: resolvedFlags.example,
361
366
  yes: resolvedFlags.yes,
362
367
  dryRun: Boolean(resolvedFlags.dryRun),
363
368
  skipInstall: Boolean(resolvedFlags.skipInstall),
@@ -366,7 +371,7 @@ function initCommand(program) {
366
371
  ...resolvedFlags.installTimeout !== undefined ? { installTimeout: resolvedFlags.installTimeout } : {}
367
372
  }, "daemon");
368
373
  if (result.isErr()) {
369
- exitWithError(result.error, outputOptions);
374
+ exitWithError(result.error, mode);
370
375
  return;
371
376
  }
372
377
  await printInitResults(result.value, outputOptions);
@@ -386,6 +391,7 @@ function initCommand(program) {
386
391
  force: resolvedFlags.force ?? false,
387
392
  with: resolvedFlags.with,
388
393
  noTooling: resolvedFlags.noTooling,
394
+ example: resolvedFlags.example,
389
395
  yes: resolvedFlags.yes,
390
396
  dryRun: Boolean(resolvedFlags.dryRun),
391
397
  skipInstall: Boolean(resolvedFlags.skipInstall),
@@ -394,7 +400,7 @@ function initCommand(program) {
394
400
  ...resolvedFlags.installTimeout !== undefined ? { installTimeout: resolvedFlags.installTimeout } : {}
395
401
  }, "library");
396
402
  if (result.isErr()) {
397
- exitWithError(result.error, outputOptions);
403
+ exitWithError(result.error, mode);
398
404
  return;
399
405
  }
400
406
  await printInitResults(result.value, outputOptions);
@@ -414,6 +420,7 @@ function initCommand(program) {
414
420
  force: resolvedFlags.force ?? false,
415
421
  with: resolvedFlags.with,
416
422
  noTooling: resolvedFlags.noTooling,
423
+ example: resolvedFlags.example,
417
424
  yes: resolvedFlags.yes,
418
425
  dryRun: Boolean(resolvedFlags.dryRun),
419
426
  skipInstall: Boolean(resolvedFlags.skipInstall),
@@ -422,7 +429,7 @@ function initCommand(program) {
422
429
  ...resolvedFlags.installTimeout !== undefined ? { installTimeout: resolvedFlags.installTimeout } : {}
423
430
  }, "full-stack");
424
431
  if (result.isErr()) {
425
- exitWithError(result.error, outputOptions);
432
+ exitWithError(result.error, mode);
426
433
  return;
427
434
  }
428
435
  await printInitResults(result.value, outputOptions);