outfitter 0.3.2 → 0.3.3

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 (256) hide show
  1. package/README.md +33 -5
  2. package/dist/actions/add.d.ts +18 -0
  3. package/dist/actions/add.js +14 -0
  4. package/dist/actions/check-automation.d.ts +20 -0
  5. package/dist/actions/check-automation.js +27 -0
  6. package/dist/actions/check.d.ts +34 -0
  7. package/dist/actions/check.js +19 -0
  8. package/dist/actions/demo.d.ts +12 -0
  9. package/dist/actions/demo.js +11 -0
  10. package/dist/actions/docs-output-mode.d.ts +4 -0
  11. package/dist/actions/docs-output-mode.js +8 -0
  12. package/dist/actions/docs.d.ts +25 -0
  13. package/dist/actions/docs.js +31 -0
  14. package/dist/actions/doctor.d.ts +10 -0
  15. package/dist/actions/doctor.js +15 -0
  16. package/dist/actions/init.d.ts +28 -0
  17. package/dist/actions/init.js +31 -0
  18. package/dist/actions/scaffold.d.ts +19 -0
  19. package/dist/actions/scaffold.js +21 -0
  20. package/dist/actions/shared.d.ts +61 -0
  21. package/dist/actions/shared.js +30 -0
  22. package/dist/actions/upgrade.d.ts +17 -0
  23. package/dist/actions/upgrade.js +21 -0
  24. package/dist/actions.d.ts +2 -0
  25. package/dist/actions.js +66 -0
  26. package/dist/cli.js +66 -4
  27. package/dist/commands/add.d.ts +54 -0
  28. package/dist/commands/add.js +16 -0
  29. package/dist/commands/check-action-ceremony.d.ts +55 -0
  30. package/dist/commands/check-action-ceremony.js +15 -0
  31. package/dist/commands/check-docs-sentinel.d.ts +27 -0
  32. package/dist/commands/check-docs-sentinel.js +18 -0
  33. package/dist/commands/check-orchestrator.d.ts +2 -0
  34. package/dist/commands/check-orchestrator.js +17 -0
  35. package/dist/commands/check-preset-versions.d.ts +20 -0
  36. package/dist/commands/check-preset-versions.js +15 -0
  37. package/dist/commands/check-publish-guardrails.d.ts +38 -0
  38. package/dist/commands/check-publish-guardrails.js +19 -0
  39. package/dist/commands/check-surface-map-format.d.ts +29 -0
  40. package/dist/commands/check-surface-map-format.js +19 -0
  41. package/dist/commands/check-surface-map.d.ts +20 -0
  42. package/dist/commands/check-surface-map.js +15 -0
  43. package/dist/commands/check-tsdoc.d.ts +3 -0
  44. package/dist/commands/check-tsdoc.js +9 -0
  45. package/dist/commands/check.d.ts +93 -0
  46. package/dist/commands/check.js +14 -0
  47. package/dist/commands/demo.d.ts +21 -0
  48. package/dist/commands/demo.js +8 -0
  49. package/dist/commands/docs-api.d.ts +4 -0
  50. package/dist/commands/docs-api.js +13 -0
  51. package/dist/commands/docs-export.d.ts +4 -0
  52. package/dist/commands/docs-export.js +12 -0
  53. package/dist/commands/docs-list.d.ts +3 -0
  54. package/dist/commands/docs-list.js +13 -0
  55. package/dist/commands/docs-module-loader.d.ts +2 -0
  56. package/dist/commands/docs-module-loader.js +8 -0
  57. package/dist/commands/docs-search.d.ts +3 -0
  58. package/dist/commands/docs-search.js +13 -0
  59. package/dist/commands/docs-show.d.ts +3 -0
  60. package/dist/commands/docs-show.js +13 -0
  61. package/dist/commands/docs-types.d.ts +21 -0
  62. package/dist/commands/docs-types.js +1 -0
  63. package/dist/commands/doctor.d.ts +2 -0
  64. package/dist/commands/doctor.js +17 -0
  65. package/dist/commands/init-execution.d.ts +8 -0
  66. package/dist/commands/init-execution.js +11 -0
  67. package/dist/commands/init-option-resolution.d.ts +5 -0
  68. package/dist/commands/init-option-resolution.js +14 -0
  69. package/dist/commands/init-output.d.ts +9 -0
  70. package/dist/commands/init-output.js +11 -0
  71. package/dist/commands/init.d.ts +9 -0
  72. package/dist/commands/init.js +24 -0
  73. package/dist/commands/jq-utils.d.ts +17 -0
  74. package/dist/commands/jq-utils.js +8 -0
  75. package/dist/commands/repo.d.ts +3 -0
  76. package/dist/commands/repo.js +13 -0
  77. package/dist/commands/scaffold-output.d.ts +4 -0
  78. package/dist/commands/scaffold-output.js +11 -0
  79. package/dist/commands/scaffold-planning.d.ts +65 -0
  80. package/dist/commands/scaffold-planning.js +20 -0
  81. package/dist/commands/scaffold.d.ts +4 -0
  82. package/dist/commands/scaffold.js +26 -0
  83. package/dist/commands/shared-deps.d.ts +22 -0
  84. package/dist/commands/shared-deps.js +11 -0
  85. package/dist/commands/upgrade-apply.d.ts +14 -0
  86. package/dist/commands/upgrade-apply.js +8 -0
  87. package/dist/commands/upgrade-codemods.d.ts +47 -0
  88. package/dist/commands/upgrade-codemods.js +14 -0
  89. package/dist/commands/upgrade-latest-version.d.ts +8 -0
  90. package/dist/commands/upgrade-latest-version.js +8 -0
  91. package/dist/commands/upgrade-migration-docs.d.ts +3 -0
  92. package/dist/commands/upgrade-migration-docs.js +15 -0
  93. package/dist/commands/upgrade-migration-frontmatter.d.ts +2 -0
  94. package/dist/commands/upgrade-migration-frontmatter.js +10 -0
  95. package/dist/commands/upgrade-migration-guides.d.ts +5 -0
  96. package/dist/commands/upgrade-migration-guides.js +10 -0
  97. package/dist/commands/upgrade-output.d.ts +5 -0
  98. package/dist/commands/upgrade-output.js +11 -0
  99. package/dist/commands/upgrade-planner.d.ts +58 -0
  100. package/dist/commands/upgrade-planner.js +8 -0
  101. package/dist/commands/upgrade-report.d.ts +5 -0
  102. package/dist/commands/upgrade-report.js +8 -0
  103. package/dist/commands/upgrade-workspace.d.ts +2 -0
  104. package/dist/commands/upgrade-workspace.js +16 -0
  105. package/dist/commands/upgrade.d.ts +5 -0
  106. package/dist/commands/upgrade.js +37 -0
  107. package/dist/create/index.d.ts +5 -0
  108. package/dist/create/index.js +2 -0
  109. package/dist/create/planner.d.ts +3 -0
  110. package/dist/create/planner.js +85 -0
  111. package/dist/create/presets.d.ts +3 -0
  112. package/dist/create/presets.js +12 -0
  113. package/dist/create/types.d.ts +2 -0
  114. package/dist/create/types.js +1 -0
  115. package/dist/engine/blocks.d.ts +3 -0
  116. package/dist/engine/blocks.js +12 -0
  117. package/dist/engine/collector.d.ts +2 -0
  118. package/dist/engine/collector.js +8 -0
  119. package/dist/engine/config.d.ts +3 -0
  120. package/dist/engine/config.js +15 -0
  121. package/dist/engine/dependency-versions.d.ts +17 -0
  122. package/dist/engine/dependency-versions.js +12 -0
  123. package/dist/engine/executor.d.ts +3 -0
  124. package/dist/engine/executor.js +156 -0
  125. package/dist/engine/index.d.ts +10 -0
  126. package/dist/engine/index.js +54 -0
  127. package/dist/engine/names.d.ts +2 -0
  128. package/dist/engine/names.js +24 -0
  129. package/dist/engine/post-scaffold.d.ts +3 -0
  130. package/dist/engine/post-scaffold.js +8 -0
  131. package/dist/engine/preset.d.ts +3 -0
  132. package/dist/engine/preset.js +17 -0
  133. package/dist/engine/render-plan.d.ts +7 -0
  134. package/dist/engine/render-plan.js +9 -0
  135. package/dist/engine/template.d.ts +4 -0
  136. package/dist/engine/template.js +34 -0
  137. package/dist/engine/types.d.ts +2 -0
  138. package/dist/engine/types.js +8 -0
  139. package/dist/engine/workspace.d.ts +3 -0
  140. package/dist/engine/workspace.js +20 -0
  141. package/dist/index.d.ts +17 -397
  142. package/dist/index.js +7 -165
  143. package/dist/manifest.d.ts +71 -0
  144. package/dist/manifest.js +16 -0
  145. package/dist/output-mode.d.ts +2 -0
  146. package/dist/output-mode.js +10 -0
  147. package/dist/shared/outfitter-109s75x0.d.ts +76 -0
  148. package/dist/shared/outfitter-1fy7byz5.js +170 -0
  149. package/dist/shared/outfitter-1h7k8xxt.js +29 -0
  150. package/dist/shared/outfitter-1tfa9hke.d.ts +55 -0
  151. package/dist/shared/outfitter-2nx0k4b3.d.ts +4 -0
  152. package/dist/shared/outfitter-2ysjerp6.d.ts +44 -0
  153. package/dist/shared/outfitter-2z61gp5w.js +29 -0
  154. package/dist/shared/outfitter-34vg353f.d.ts +82 -0
  155. package/dist/shared/outfitter-3dq4r10s.d.ts +24 -0
  156. package/dist/shared/outfitter-3rcrvva8.js +103 -0
  157. package/dist/shared/outfitter-3tx3adgj.js +278 -0
  158. package/dist/shared/outfitter-4q1zfmvc.js +154 -0
  159. package/dist/shared/outfitter-4s9meh3j.js +221 -0
  160. package/dist/shared/outfitter-507ra35w.js +285 -0
  161. package/dist/shared/outfitter-56jq0rh2.d.ts +42 -0
  162. package/dist/shared/outfitter-58rn1sj1.d.ts +30 -0
  163. package/dist/shared/outfitter-5d9wbzhh.d.ts +19 -0
  164. package/dist/shared/outfitter-5j7zee11.d.ts +180 -0
  165. package/dist/shared/outfitter-5r6q2749.d.ts +18 -0
  166. package/dist/shared/outfitter-5vx1bp7h.js +41 -0
  167. package/dist/shared/outfitter-6ddf91vh.js +190 -0
  168. package/dist/shared/outfitter-6mpkh3zn.js +432 -0
  169. package/dist/shared/outfitter-6rtcemk7.d.ts +18 -0
  170. package/dist/shared/outfitter-6t7xeyg1.js +159 -0
  171. package/dist/shared/outfitter-738z4c37.js +262 -0
  172. package/dist/shared/outfitter-76k25svs.js +322 -0
  173. package/dist/shared/outfitter-7n7vsz95.js +101 -0
  174. package/dist/shared/outfitter-7q9fnbwa.js +60 -0
  175. package/dist/shared/outfitter-7r12fj7f.js +30 -0
  176. package/dist/shared/outfitter-84chvazx.js +480 -0
  177. package/dist/shared/outfitter-8ggmja91.js +301 -0
  178. package/dist/shared/outfitter-8kmak0wc.d.ts +4 -0
  179. package/dist/shared/outfitter-8y2dfx6n.js +11 -0
  180. package/dist/shared/outfitter-940h0x7b.js +71 -0
  181. package/dist/shared/outfitter-954y4mzx.d.ts +5 -0
  182. package/dist/shared/outfitter-a79xrm12.d.ts +17 -0
  183. package/dist/shared/outfitter-b9cpnr7e.js +110 -0
  184. package/dist/shared/outfitter-bpr28y54.js +70 -0
  185. package/dist/shared/outfitter-c7sbs7es.js +92 -0
  186. package/dist/shared/outfitter-cyhzstz0.js +93 -0
  187. package/dist/shared/outfitter-cyvr4r8d.d.ts +67 -0
  188. package/dist/shared/outfitter-d0kqashd.d.ts +98 -0
  189. package/dist/shared/outfitter-dx4hn4ta.js +325 -0
  190. package/dist/shared/outfitter-e84cr97g.js +232 -0
  191. package/dist/shared/outfitter-ec83h4v2.js +17 -0
  192. package/dist/shared/outfitter-eepj7rf7.js +4 -0
  193. package/dist/shared/outfitter-ekb6t1zz.js +35 -0
  194. package/dist/shared/outfitter-ex8gn945.js +51 -0
  195. package/dist/shared/outfitter-f3a70135.js +75 -0
  196. package/dist/shared/outfitter-fbvfd5zq.d.ts +13 -0
  197. package/dist/shared/outfitter-fj2v5ffz.js +165 -0
  198. package/dist/shared/outfitter-fx1m251y.js +122 -0
  199. package/dist/shared/outfitter-fxry5n58.js +254 -0
  200. package/dist/shared/outfitter-g3hvjshg.js +1 -0
  201. package/dist/shared/outfitter-gdc7b7de.d.ts +5 -0
  202. package/dist/shared/outfitter-gyayfx5r.js +156 -0
  203. package/dist/shared/outfitter-h0wmtxw8.d.ts +23 -0
  204. package/dist/shared/outfitter-hcexcvxe.d.ts +25 -0
  205. package/dist/shared/outfitter-hf5bj2gq.js +117 -0
  206. package/dist/shared/outfitter-hsp8vy5m.d.ts +146 -0
  207. package/dist/shared/outfitter-htx4asgr.d.ts +52 -0
  208. package/dist/shared/outfitter-jkct38dh.js +53 -0
  209. package/dist/shared/outfitter-jwxggvz4.js +42 -0
  210. package/dist/shared/outfitter-k6zyvg2n.js +306 -0
  211. package/dist/shared/outfitter-ksyvwmb5.js +191 -0
  212. package/dist/shared/outfitter-m3ehh37q.d.ts +22 -0
  213. package/dist/shared/outfitter-mstr60zz.js +215 -0
  214. package/dist/shared/outfitter-n0ed012k.js +101 -0
  215. package/dist/shared/outfitter-n13pqaft.js +19 -0
  216. package/dist/shared/outfitter-nxvjxrmw.d.ts +48 -0
  217. package/dist/shared/outfitter-p2wn07b7.js +160 -0
  218. package/dist/shared/outfitter-px5sv5gn.js +321 -0
  219. package/dist/shared/outfitter-q1g58t85.js +8 -0
  220. package/dist/shared/outfitter-qsd5638j.js +378 -0
  221. package/dist/shared/outfitter-qsrx7m4w.js +72 -0
  222. package/dist/shared/outfitter-r2awqszh.d.ts +52 -0
  223. package/dist/shared/outfitter-rdpw2sbp.d.ts +77 -0
  224. package/dist/shared/outfitter-rp89dafm.js +109 -0
  225. package/dist/shared/outfitter-s1c0whzj.js +121 -0
  226. package/dist/shared/outfitter-ssrtakh3.js +342 -0
  227. package/dist/shared/outfitter-ssynegbs.js +167 -0
  228. package/dist/shared/outfitter-svts4wk2.js +36 -0
  229. package/dist/shared/outfitter-tavatb5p.js +166 -0
  230. package/dist/shared/outfitter-tqznjgbm.js +44 -0
  231. package/dist/shared/outfitter-ttjr95y9.js +98 -0
  232. package/dist/shared/outfitter-wcrp7d7m.d.ts +5 -0
  233. package/dist/shared/outfitter-wkt0a0ra.js +67 -0
  234. package/dist/shared/outfitter-wrcqq29p.js +132 -0
  235. package/dist/shared/outfitter-wyg1tpp5.d.ts +43 -0
  236. package/dist/shared/outfitter-x0vpb7tj.js +126 -0
  237. package/dist/shared/outfitter-x39awx8g.js +146 -0
  238. package/dist/shared/outfitter-x4cc5xsq.js +168 -0
  239. package/dist/shared/outfitter-x8w5sjnd.d.ts +39 -0
  240. package/dist/shared/outfitter-xr6g13nz.d.ts +50 -0
  241. package/dist/shared/outfitter-xs94pkfe.js +106 -0
  242. package/dist/shared/outfitter-y37yfehn.d.ts +37 -0
  243. package/dist/shared/outfitter-y6ee0k45.d.ts +18 -0
  244. package/dist/shared/outfitter-ydw7x6bh.js +61 -0
  245. package/dist/shared/outfitter-yhb23pjc.js +89 -0
  246. package/dist/shared/outfitter-ypcvwg1s.js +91 -0
  247. package/dist/shared/outfitter-znbqe5zy.d.ts +45 -0
  248. package/dist/shared/outfitter-zng6w0t9.d.ts +4 -0
  249. package/dist/targets/index.d.ts +4 -0
  250. package/dist/targets/index.js +28 -0
  251. package/dist/targets/registry.d.ts +3 -0
  252. package/dist/targets/registry.js +221 -0
  253. package/dist/targets/types.d.ts +2 -0
  254. package/dist/targets/types.js +1 -0
  255. package/package.json +194 -35
  256. package/dist/shared/chunk-3pwh8ys4.js +0 -6461
@@ -0,0 +1,72 @@
1
+ // @bun
2
+ import {
3
+ renderOperationPlan
4
+ } from "./outfitter-ttjr95y9.js";
5
+ import {
6
+ resolveStructuredOutputMode
7
+ } from "./outfitter-7r12fj7f.js";
8
+ import {
9
+ OperationCollector
10
+ } from "./outfitter-1h7k8xxt.js";
11
+
12
+ // apps/outfitter/src/commands/scaffold-output.ts
13
+ import { output } from "@outfitter/cli";
14
+ async function printScaffoldResults(result, options) {
15
+ const structuredMode = resolveStructuredOutputMode(options?.mode);
16
+ if (result.dryRunPlan) {
17
+ if (structuredMode) {
18
+ await output({
19
+ target: result.target,
20
+ rootDir: result.rootDir,
21
+ targetDir: result.targetDir,
22
+ converted: result.converted,
23
+ movedExisting: result.movedExisting ?? null,
24
+ ...result.dryRunPlan
25
+ }, { mode: structuredMode });
26
+ return;
27
+ }
28
+ const collector = new OperationCollector;
29
+ for (const op of result.dryRunPlan.operations) {
30
+ collector.add(op);
31
+ }
32
+ await renderOperationPlan(collector, { rootDir: result.rootDir });
33
+ return;
34
+ }
35
+ if (structuredMode) {
36
+ await output({
37
+ target: result.target,
38
+ rootDir: result.rootDir,
39
+ targetDir: result.targetDir,
40
+ converted: result.converted,
41
+ movedExisting: result.movedExisting ?? null,
42
+ workspacePatternsUpdated: result.workspacePatternsUpdated,
43
+ blocksAdded: result.blocksAdded ?? null,
44
+ postScaffold: result.postScaffold,
45
+ nextSteps: result.postScaffold.nextSteps
46
+ }, { mode: structuredMode });
47
+ return;
48
+ }
49
+ const lines = [];
50
+ if (result.converted) {
51
+ lines.push("Converted to workspace structure:");
52
+ if (result.movedExisting) {
53
+ lines.push(` Moved existing package -> ${result.movedExisting.to}`);
54
+ }
55
+ lines.push(" Created workspace root package.json");
56
+ lines.push("");
57
+ }
58
+ lines.push(`Scaffolded ${result.targetDir}`);
59
+ if (result.blocksAdded && result.blocksAdded.created.length > 0) {
60
+ lines.push(`Added ${result.blocksAdded.created.length} tooling file(s):`);
61
+ for (const created of result.blocksAdded.created) {
62
+ lines.push(` + ${created}`);
63
+ }
64
+ }
65
+ lines.push("", "Next steps:");
66
+ for (const step of result.postScaffold.nextSteps) {
67
+ lines.push(` ${step}`);
68
+ }
69
+ await output(lines, { mode: "human" });
70
+ }
71
+
72
+ export { printScaffoldResults };
@@ -0,0 +1,52 @@
1
+ import { InitPresetId } from "./outfitter-5d9wbzhh.js";
2
+ import { TargetDefinition } from "./outfitter-58rn1sj1.js";
3
+ import { PostScaffoldResult } from "./outfitter-hcexcvxe.js";
4
+ import { Result } from "@outfitter/contracts";
5
+ import { AddBlockResult } from "@outfitter/tooling";
6
+ /** Whether the project is a standalone package or a workspace with nested packages. */
7
+ type InitStructure = "single" | "workspace";
8
+ /** Fully resolved inputs for the init execution pipeline, after interactive/non-interactive resolution. */
9
+ interface ResolvedInitExecutionInput {
10
+ readonly binName?: string | undefined;
11
+ readonly blocksOverride?: readonly string[];
12
+ readonly includeTooling: boolean;
13
+ readonly local: boolean;
14
+ readonly packageName: string;
15
+ readonly preset: InitPresetId;
16
+ readonly rootDir: string;
17
+ readonly structure: InitStructure;
18
+ readonly workspaceName?: string | undefined;
19
+ }
20
+ /** Behavioral flags controlling how the init pipeline executes (dry-run, force, skip steps). */
21
+ interface InitExecutionOptions {
22
+ readonly dryRun: boolean;
23
+ readonly force: boolean;
24
+ readonly installTimeout: number;
25
+ readonly skipCommit: boolean;
26
+ readonly skipGit: boolean;
27
+ readonly skipInstall: boolean;
28
+ }
29
+ /** Output of a successful init pipeline run, including scaffold results and post-scaffold status. */
30
+ interface InitExecutionResult {
31
+ readonly blocksAdded?: AddBlockResult | undefined;
32
+ readonly dryRunPlan?: {
33
+ readonly operations: readonly unknown[];
34
+ readonly summary: Record<string, number>;
35
+ } | undefined;
36
+ readonly packageName: string;
37
+ readonly postScaffold: PostScaffoldResult;
38
+ readonly preset: InitPresetId;
39
+ readonly projectDir: string;
40
+ readonly rootDir: string;
41
+ readonly structure: InitStructure;
42
+ }
43
+ /**
44
+ * Runs the full init pipeline: validates inputs, scaffolds the project structure,
45
+ * executes the preset plan, and performs post-scaffold steps (install, git init).
46
+ * @param input - Resolved user inputs (preset, structure, package name, etc.)
47
+ * @param target - Target definition from the preset registry
48
+ * @param options - Execution flags (dry-run, force, skip steps)
49
+ * @returns The init result on success, or an error message string on failure
50
+ */
51
+ declare function executeInitPipeline(input: ResolvedInitExecutionInput, target: TargetDefinition, options: InitExecutionOptions): Promise<Result<InitExecutionResult, string>>;
52
+ export { InitStructure, ResolvedInitExecutionInput, InitExecutionOptions, InitExecutionResult, executeInitPipeline };
@@ -0,0 +1,77 @@
1
+ import { OutputMode } from "@outfitter/cli/types";
2
+ import { Result } from "@outfitter/contracts";
3
+ /** Check bundle mode controlling which steps are included and whether a clean tree is enforced. */
4
+ type CheckOrchestratorMode = "all" | "ci" | "pre-commit" | "pre-push";
5
+ interface CheckOrchestratorStep {
6
+ readonly command: readonly string[];
7
+ readonly id: string;
8
+ readonly label: string;
9
+ }
10
+ /** Options controlling which checks the orchestrator runs. */
11
+ interface CheckOrchestratorOptions {
12
+ /** Workspace root for resolving commands and tree-clean detection. */
13
+ readonly cwd: string;
14
+ readonly mode: CheckOrchestratorMode;
15
+ /** Staged file paths for pre-commit scoping. Ignored by other modes. */
16
+ readonly stagedFiles?: readonly string[];
17
+ }
18
+ interface CheckOrchestratorStepResult {
19
+ readonly command: readonly string[];
20
+ readonly durationMs: number;
21
+ readonly exitCode: number;
22
+ readonly id: string;
23
+ readonly label: string;
24
+ readonly stderr: string;
25
+ readonly stdout: string;
26
+ }
27
+ /** Aggregate outcome of an orchestrator run including tree-clean status. */
28
+ interface CheckOrchestratorResult {
29
+ /** Step IDs that exited non-zero. */
30
+ readonly failedStepIds: readonly string[];
31
+ readonly mode: CheckOrchestratorMode;
32
+ /** Paths added or modified in the working tree during the run. */
33
+ readonly mutatedPaths: readonly string[];
34
+ /** True when all steps passed and tree-clean enforcement (if applicable) succeeded. */
35
+ readonly ok: boolean;
36
+ readonly steps: readonly CheckOrchestratorStepResult[];
37
+ /** Whether the working tree was unchanged after the run completed. */
38
+ readonly treeClean: boolean;
39
+ }
40
+ /** Error raised when the check orchestrator cannot complete its run. */
41
+ declare class CheckOrchestratorError extends Error {
42
+ readonly _tag: "CheckOrchestratorError";
43
+ constructor(message: string);
44
+ }
45
+ /**
46
+ * Build the ordered list of check steps for the given mode.
47
+ *
48
+ * Pre-commit mode scopes lint/typecheck to staged files and conditionally
49
+ * includes agent-scaffolding sync. All other modes run the full suite.
50
+ */
51
+ declare function buildCheckOrchestratorPlan(options: CheckOrchestratorOptions): readonly CheckOrchestratorStep[];
52
+ /**
53
+ * Parse `git status --porcelain` output into sorted file paths.
54
+ *
55
+ * Handles rename entries by extracting the destination path.
56
+ */
57
+ declare function parseTreePaths(statusOutput: string): string[];
58
+ /**
59
+ * Execute the check plan sequentially, stopping on the first failure.
60
+ *
61
+ * Captures working-tree state before and after to detect mutations.
62
+ * For modes other than pre-commit, a dirty tree causes an overall failure.
63
+ */
64
+ declare function runCheckOrchestrator(options: CheckOrchestratorOptions): Promise<Result<CheckOrchestratorResult, CheckOrchestratorError>>;
65
+ interface PrintCheckOrchestratorResultsOptions {
66
+ readonly compact?: boolean;
67
+ readonly mode?: OutputMode;
68
+ }
69
+ /**
70
+ * Render orchestrator results to stdout.
71
+ *
72
+ * Structured modes emit JSON/JSONL (optionally compact). Human mode
73
+ * prints a step-by-step summary with pass/fail icons, timing, advisory
74
+ * warnings, and mutation traceability.
75
+ */
76
+ declare function printCheckOrchestratorResults(result: CheckOrchestratorResult, options?: PrintCheckOrchestratorResultsOptions): Promise<void>;
77
+ export { CheckOrchestratorMode, CheckOrchestratorOptions, CheckOrchestratorResult, CheckOrchestratorError, buildCheckOrchestratorPlan, parseTreePaths, runCheckOrchestrator, printCheckOrchestratorResults };
@@ -0,0 +1,109 @@
1
+ // @bun
2
+ import {
3
+ actionInternalErr,
4
+ outputModeSchema,
5
+ resolveCwdFromPreset
6
+ } from "./outfitter-7n7vsz95.js";
7
+ import {
8
+ runUpgrade
9
+ } from "./outfitter-fxry5n58.js";
10
+ import {
11
+ printUpgradeResults
12
+ } from "./outfitter-x4cc5xsq.js";
13
+ import {
14
+ resolveOutputModeFromContext
15
+ } from "./outfitter-7r12fj7f.js";
16
+
17
+ // apps/outfitter/src/actions/upgrade.ts
18
+ import { actionCliPresets } from "@outfitter/cli/actions";
19
+ import {
20
+ booleanFlagPreset,
21
+ cwdPreset,
22
+ dryRunPreset,
23
+ interactionPreset
24
+ } from "@outfitter/cli/flags";
25
+ import { defineAction, Result } from "@outfitter/contracts";
26
+ import { z } from "zod";
27
+ var upgradeInputSchema = z.object({
28
+ cwd: z.string(),
29
+ guide: z.boolean(),
30
+ guidePackages: z.array(z.string()).optional(),
31
+ dryRun: z.boolean(),
32
+ yes: z.boolean(),
33
+ interactive: z.boolean(),
34
+ all: z.boolean(),
35
+ noCodemods: z.boolean(),
36
+ outputMode: outputModeSchema
37
+ });
38
+ var upgradeCwd = cwdPreset();
39
+ var upgradeDryRun = dryRunPreset();
40
+ var upgradeInteraction = interactionPreset();
41
+ var upgradeAll = booleanFlagPreset({
42
+ id: "upgradeAll",
43
+ key: "all",
44
+ flags: "--all",
45
+ description: "Include breaking changes in the upgrade"
46
+ });
47
+ var upgradeNoCodemods = booleanFlagPreset({
48
+ id: "upgradeNoCodemods",
49
+ key: "noCodemods",
50
+ flags: "--no-codemods",
51
+ description: "Skip automatic codemod execution during upgrade",
52
+ sources: ["noCodemods", "no-codemods"],
53
+ negatedSources: ["codemods"]
54
+ });
55
+ var upgradeGuide = booleanFlagPreset({
56
+ id: "upgradeGuide",
57
+ key: "guide",
58
+ flags: "--guide",
59
+ description: "Show migration instructions for available updates. Pass package names to filter."
60
+ });
61
+ var upgradeFlags = actionCliPresets(upgradeCwd, upgradeDryRun, upgradeInteraction, upgradeAll, upgradeNoCodemods, upgradeGuide);
62
+ var upgradeAction = defineAction({
63
+ id: "upgrade",
64
+ description: "Check for @outfitter/* package updates and migration guidance",
65
+ surfaces: ["cli"],
66
+ input: upgradeInputSchema,
67
+ cli: {
68
+ command: "upgrade [packages...]",
69
+ description: "Check for @outfitter/* package updates and migration guidance",
70
+ options: [...upgradeFlags.options],
71
+ mapInput: (context) => {
72
+ const outputMode = resolveOutputModeFromContext(context.flags);
73
+ const { dryRun, interactive, yes, all, noCodemods, guide } = upgradeFlags.resolve(context);
74
+ const guidePackages = context.args.length > 0 ? context.args : undefined;
75
+ return {
76
+ cwd: resolveCwdFromPreset(context.flags, upgradeCwd),
77
+ guide,
78
+ ...guidePackages !== undefined ? { guidePackages } : {},
79
+ dryRun,
80
+ yes,
81
+ interactive,
82
+ all,
83
+ noCodemods,
84
+ outputMode
85
+ };
86
+ }
87
+ },
88
+ handler: async (input) => {
89
+ const { outputMode, guidePackages, ...upgradeInput } = input;
90
+ const result = await runUpgrade({
91
+ ...upgradeInput,
92
+ outputMode,
93
+ ...guidePackages !== undefined ? { guidePackages } : {}
94
+ });
95
+ if (result.isErr()) {
96
+ return actionInternalErr("upgrade", result.error);
97
+ }
98
+ await printUpgradeResults(result.value, {
99
+ mode: outputMode,
100
+ guide: upgradeInput.guide,
101
+ cwd: upgradeInput.cwd,
102
+ dryRun: upgradeInput.dryRun,
103
+ all: upgradeInput.all
104
+ });
105
+ return Result.ok(result.value);
106
+ }
107
+ });
108
+
109
+ export { upgradeAction };
@@ -0,0 +1,121 @@
1
+ // @bun
2
+ // apps/outfitter/src/commands/upgrade-migration-frontmatter.ts
3
+ var FRONTMATTER_BLOCK_REGEX = /^---\r?\n[\s\S]*?\r?\n---\r?\n*/;
4
+ var VALID_CHANGE_TYPES = new Set([
5
+ "renamed",
6
+ "removed",
7
+ "signature-changed",
8
+ "moved",
9
+ "deprecated",
10
+ "added"
11
+ ]);
12
+ function stripMigrationFrontmatter(content) {
13
+ return content.replace(FRONTMATTER_BLOCK_REGEX, "").trim();
14
+ }
15
+ function parseYamlValue(raw) {
16
+ const trimmed = raw.trim();
17
+ if (trimmed.startsWith('"') && trimmed.endsWith('"') || trimmed.startsWith("'") && trimmed.endsWith("'")) {
18
+ return trimmed.slice(1, -1);
19
+ }
20
+ return trimmed;
21
+ }
22
+ function parseMigrationFrontmatter(content) {
23
+ const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
24
+ if (!fmMatch?.[1])
25
+ return null;
26
+ const fmBlock = fmMatch[1];
27
+ const lines = fmBlock.split(/\r?\n/);
28
+ let pkg;
29
+ let version;
30
+ let breaking;
31
+ let changesStartIdx = -1;
32
+ for (let i = 0;i < lines.length; i++) {
33
+ const line = lines[i];
34
+ if (line === undefined)
35
+ continue;
36
+ const trimmed = line.trimStart();
37
+ if (trimmed.startsWith("package:")) {
38
+ pkg = parseYamlValue(trimmed.slice("package:".length));
39
+ } else if (trimmed.startsWith("version:")) {
40
+ version = parseYamlValue(trimmed.slice("version:".length));
41
+ } else if (trimmed.startsWith("breaking:")) {
42
+ const val = parseYamlValue(trimmed.slice("breaking:".length));
43
+ if (val === "true")
44
+ breaking = true;
45
+ else if (val === "false")
46
+ breaking = false;
47
+ } else if (trimmed.startsWith("changes:")) {
48
+ changesStartIdx = i + 1;
49
+ }
50
+ }
51
+ if (pkg === undefined || version === undefined || breaking === undefined) {
52
+ return null;
53
+ }
54
+ let changes;
55
+ if (changesStartIdx >= 0) {
56
+ changes = parseChangesArray(lines, changesStartIdx);
57
+ }
58
+ return {
59
+ package: pkg,
60
+ version,
61
+ breaking,
62
+ ...changes !== undefined ? { changes } : {}
63
+ };
64
+ }
65
+ function parseChangesArray(lines, startIdx) {
66
+ const changes = [];
67
+ let current = null;
68
+ for (let i = startIdx;i < lines.length; i++) {
69
+ const line = lines[i];
70
+ if (line === undefined)
71
+ continue;
72
+ if (/^\s+-\s+/.test(line)) {
73
+ if (current !== null) {
74
+ const change = buildChange(current);
75
+ if (change)
76
+ changes.push(change);
77
+ }
78
+ current = {};
79
+ const afterDash = line.replace(/^\s+-\s+/, "");
80
+ const colonIdx = afterDash.indexOf(":");
81
+ if (colonIdx >= 0) {
82
+ const key = afterDash.slice(0, colonIdx).trim();
83
+ const val = parseYamlValue(afterDash.slice(colonIdx + 1));
84
+ current[key] = val;
85
+ }
86
+ } else if (current !== null && /^\s{4,}\S/.test(line)) {
87
+ const trimmed = line.trim();
88
+ const colonIdx = trimmed.indexOf(":");
89
+ if (colonIdx >= 0) {
90
+ const key = trimmed.slice(0, colonIdx).trim();
91
+ const val = parseYamlValue(trimmed.slice(colonIdx + 1));
92
+ current[key] = val;
93
+ }
94
+ } else if (/^\S/.test(line)) {
95
+ break;
96
+ }
97
+ }
98
+ if (current !== null) {
99
+ const change = buildChange(current);
100
+ if (change)
101
+ changes.push(change);
102
+ }
103
+ return changes;
104
+ }
105
+ function buildChange(raw) {
106
+ const type = raw["type"];
107
+ if (!(type && VALID_CHANGE_TYPES.has(type))) {
108
+ return null;
109
+ }
110
+ return {
111
+ type,
112
+ ...raw["from"] ? { from: raw["from"] } : {},
113
+ ...raw["to"] ? { to: raw["to"] } : {},
114
+ ...raw["path"] ? { path: raw["path"] } : {},
115
+ ...raw["export"] ? { export: raw["export"] } : {},
116
+ ...raw["detail"] ? { detail: raw["detail"] } : {},
117
+ ...raw["codemod"] ? { codemod: raw["codemod"] } : {}
118
+ };
119
+ }
120
+
121
+ export { stripMigrationFrontmatter, parseMigrationFrontmatter };