outfitter 0.2.7 → 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 (312) hide show
  1. package/README.md +34 -7
  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 +1 -1
  25. package/dist/actions.js +53 -22
  26. package/dist/cli.js +66 -4
  27. package/dist/commands/add.js +3 -3
  28. package/dist/commands/check-action-ceremony.d.ts +55 -0
  29. package/dist/commands/check-action-ceremony.js +15 -0
  30. package/dist/commands/check-docs-sentinel.d.ts +27 -0
  31. package/dist/commands/check-docs-sentinel.js +18 -0
  32. package/dist/commands/check-orchestrator.d.ts +2 -0
  33. package/dist/commands/check-orchestrator.js +17 -0
  34. package/dist/commands/check-preset-versions.d.ts +20 -0
  35. package/dist/commands/check-preset-versions.js +15 -0
  36. package/dist/commands/check-publish-guardrails.d.ts +38 -0
  37. package/dist/commands/check-publish-guardrails.js +19 -0
  38. package/dist/commands/check-surface-map-format.d.ts +29 -0
  39. package/dist/commands/check-surface-map-format.js +19 -0
  40. package/dist/commands/check-surface-map.d.ts +20 -0
  41. package/dist/commands/check-surface-map.js +15 -0
  42. package/dist/commands/check-tsdoc.d.ts +2 -21
  43. package/dist/commands/check-tsdoc.js +3 -2
  44. package/dist/commands/check.d.ts +2 -0
  45. package/dist/commands/check.js +3 -3
  46. package/dist/commands/demo.js +1 -1
  47. package/dist/commands/docs-api.d.ts +4 -0
  48. package/dist/commands/docs-api.js +13 -0
  49. package/dist/commands/docs-export.d.ts +4 -0
  50. package/dist/commands/docs-export.js +12 -0
  51. package/dist/commands/docs-list.d.ts +3 -0
  52. package/dist/commands/docs-list.js +13 -0
  53. package/dist/commands/docs-module-loader.d.ts +2 -2
  54. package/dist/commands/docs-module-loader.js +2 -2
  55. package/dist/commands/docs-search.d.ts +3 -0
  56. package/dist/commands/docs-search.js +13 -0
  57. package/dist/commands/docs-show.d.ts +3 -0
  58. package/dist/commands/docs-show.js +13 -0
  59. package/dist/commands/docs-types.d.ts +21 -0
  60. package/dist/commands/doctor.js +4 -12
  61. package/dist/commands/init-execution.d.ts +8 -0
  62. package/dist/commands/init-execution.js +11 -0
  63. package/dist/commands/init-option-resolution.d.ts +5 -0
  64. package/dist/commands/init-option-resolution.js +14 -0
  65. package/dist/commands/init-output.d.ts +9 -0
  66. package/dist/commands/init-output.js +11 -0
  67. package/dist/commands/init.d.ts +7 -5
  68. package/dist/commands/init.js +10 -18
  69. package/dist/commands/jq-utils.d.ts +17 -0
  70. package/dist/commands/jq-utils.js +8 -0
  71. package/dist/commands/repo.d.ts +3 -3
  72. package/dist/commands/repo.js +8 -4
  73. package/dist/commands/scaffold-output.d.ts +4 -0
  74. package/dist/commands/scaffold-output.js +11 -0
  75. package/dist/commands/scaffold-planning.d.ts +65 -0
  76. package/dist/commands/scaffold-planning.js +20 -0
  77. package/dist/commands/scaffold.d.ts +3 -3
  78. package/dist/commands/scaffold.js +10 -16
  79. package/dist/commands/shared-deps.d.ts +5 -4
  80. package/dist/commands/shared-deps.js +3 -3
  81. package/dist/commands/upgrade-apply.d.ts +14 -0
  82. package/dist/commands/upgrade-apply.js +8 -0
  83. package/dist/commands/upgrade-codemods.d.ts +5 -0
  84. package/dist/commands/upgrade-codemods.js +4 -5
  85. package/dist/commands/upgrade-latest-version.d.ts +8 -0
  86. package/dist/commands/upgrade-latest-version.js +8 -0
  87. package/dist/commands/upgrade-migration-docs.d.ts +3 -0
  88. package/dist/commands/upgrade-migration-docs.js +15 -0
  89. package/dist/commands/upgrade-migration-frontmatter.d.ts +2 -0
  90. package/dist/commands/upgrade-migration-frontmatter.js +10 -0
  91. package/dist/commands/upgrade-migration-guides.d.ts +5 -0
  92. package/dist/commands/upgrade-migration-guides.js +10 -0
  93. package/dist/commands/upgrade-output.d.ts +5 -0
  94. package/dist/commands/upgrade-output.js +11 -0
  95. package/dist/commands/upgrade-planner.js +1 -1
  96. package/dist/commands/upgrade-report.d.ts +5 -0
  97. package/dist/commands/upgrade-report.js +8 -0
  98. package/dist/commands/upgrade-workspace.js +2 -2
  99. package/dist/commands/upgrade.d.ts +4 -220
  100. package/dist/commands/upgrade.js +21 -9
  101. package/dist/create/index.d.ts +3 -3
  102. package/dist/create/index.js +2 -30
  103. package/dist/create/planner.d.ts +2 -2
  104. package/dist/create/planner.js +80 -17
  105. package/dist/create/presets.d.ts +2 -2
  106. package/dist/create/presets.js +2 -2
  107. package/dist/create/types.d.ts +1 -1
  108. package/dist/engine/blocks.d.ts +2 -2
  109. package/dist/engine/blocks.js +5 -5
  110. package/dist/engine/collector.d.ts +1 -1
  111. package/dist/engine/collector.js +1 -1
  112. package/dist/engine/config.d.ts +2 -2
  113. package/dist/engine/config.js +4 -4
  114. package/dist/engine/dependency-versions.d.ts +13 -8
  115. package/dist/engine/dependency-versions.js +4 -4
  116. package/dist/engine/executor.d.ts +2 -2
  117. package/dist/engine/executor.js +149 -12
  118. package/dist/engine/index.d.ts +9 -7
  119. package/dist/engine/index.js +17 -31
  120. package/dist/engine/names.js +1 -1
  121. package/dist/engine/post-scaffold.d.ts +2 -2
  122. package/dist/engine/post-scaffold.js +1 -1
  123. package/dist/engine/preset.d.ts +3 -0
  124. package/dist/engine/preset.js +17 -0
  125. package/dist/engine/render-plan.d.ts +1 -1
  126. package/dist/engine/render-plan.js +1 -1
  127. package/dist/engine/template.d.ts +3 -2
  128. package/dist/engine/template.js +24 -7
  129. package/dist/engine/types.d.ts +1 -1
  130. package/dist/engine/types.js +1 -1
  131. package/dist/engine/workspace.d.ts +2 -2
  132. package/dist/engine/workspace.js +1 -1
  133. package/dist/index.d.ts +17 -398
  134. package/dist/index.js +7 -164
  135. package/dist/manifest.js +2 -2
  136. package/dist/output-mode.js +1 -1
  137. package/dist/shared/{outfitter-6fgk6adm.d.ts → outfitter-1tfa9hke.d.ts} +16 -1
  138. package/dist/shared/{outfitter-6bkqjk86.d.ts → outfitter-2nx0k4b3.d.ts} +1 -0
  139. package/dist/shared/outfitter-2ysjerp6.d.ts +44 -0
  140. package/dist/shared/outfitter-2z61gp5w.js +29 -0
  141. package/dist/shared/outfitter-34vg353f.d.ts +82 -0
  142. package/dist/shared/{outfitter-5yjr404v.d.ts → outfitter-3dq4r10s.d.ts} +5 -3
  143. package/dist/shared/outfitter-3rcrvva8.js +103 -0
  144. package/dist/shared/{outfitter-79vfxt6y.js → outfitter-3tx3adgj.js} +12 -3
  145. package/dist/shared/{outfitter-63gse8fv.js → outfitter-507ra35w.js} +33 -64
  146. package/dist/shared/outfitter-56jq0rh2.d.ts +42 -0
  147. package/dist/shared/{outfitter-r419zfgs.d.ts → outfitter-58rn1sj1.d.ts} +1 -1
  148. package/dist/shared/outfitter-5d9wbzhh.d.ts +19 -0
  149. package/dist/shared/outfitter-5j7zee11.d.ts +180 -0
  150. package/dist/shared/{outfitter-s7jetkge.d.ts → outfitter-5r6q2749.d.ts} +1 -1
  151. package/dist/shared/outfitter-5vx1bp7h.js +41 -0
  152. package/dist/shared/outfitter-6ddf91vh.js +190 -0
  153. package/dist/shared/{outfitter-mt7d1ek2.js → outfitter-6mpkh3zn.js} +39 -305
  154. package/dist/shared/{outfitter-ybbazsxq.d.ts → outfitter-6rtcemk7.d.ts} +8 -4
  155. package/dist/shared/{outfitter-9x1brcmq.js → outfitter-6t7xeyg1.js} +13 -38
  156. package/dist/shared/outfitter-738z4c37.js +262 -0
  157. package/dist/shared/{outfitter-yvksv5qb.js → outfitter-76k25svs.js} +4 -4
  158. package/dist/shared/outfitter-7n7vsz95.js +101 -0
  159. package/dist/shared/outfitter-7q9fnbwa.js +60 -0
  160. package/dist/shared/outfitter-84chvazx.js +480 -0
  161. package/dist/shared/outfitter-8ggmja91.js +301 -0
  162. package/dist/shared/{outfitter-qakwgrrh.d.ts → outfitter-8kmak0wc.d.ts} +1 -1
  163. package/dist/shared/outfitter-940h0x7b.js +71 -0
  164. package/dist/shared/{outfitter-fn20r49x.d.ts → outfitter-954y4mzx.d.ts} +1 -1
  165. package/dist/shared/outfitter-b9cpnr7e.js +110 -0
  166. package/dist/shared/outfitter-c7sbs7es.js +92 -0
  167. package/dist/shared/outfitter-cyhzstz0.js +93 -0
  168. package/dist/shared/{outfitter-n9g1zk4x.d.ts → outfitter-cyvr4r8d.d.ts} +3 -2
  169. package/dist/shared/outfitter-d0kqashd.d.ts +98 -0
  170. package/dist/shared/outfitter-dx4hn4ta.js +325 -0
  171. package/dist/shared/{outfitter-bn9c8p2e.js → outfitter-e84cr97g.js} +37 -9
  172. package/dist/shared/outfitter-ec83h4v2.js +17 -0
  173. package/dist/shared/{outfitter-vh4xgb93.js → outfitter-ekb6t1zz.js} +4 -4
  174. package/dist/shared/outfitter-ex8gn945.js +51 -0
  175. package/dist/shared/outfitter-f3a70135.js +75 -0
  176. package/dist/shared/outfitter-fbvfd5zq.d.ts +13 -0
  177. package/dist/shared/outfitter-fj2v5ffz.js +165 -0
  178. package/dist/shared/outfitter-fx1m251y.js +122 -0
  179. package/dist/shared/outfitter-fxry5n58.js +254 -0
  180. package/dist/shared/outfitter-g3hvjshg.js +1 -0
  181. package/dist/shared/{outfitter-f9znfhkn.d.ts → outfitter-gdc7b7de.d.ts} +1 -1
  182. package/dist/shared/outfitter-gyayfx5r.js +156 -0
  183. package/dist/shared/outfitter-h0wmtxw8.d.ts +23 -0
  184. package/dist/shared/{outfitter-z5sx06qe.d.ts → outfitter-hcexcvxe.d.ts} +1 -1
  185. package/dist/shared/outfitter-hf5bj2gq.js +117 -0
  186. package/dist/shared/{outfitter-e9rrfekb.d.ts → outfitter-htx4asgr.d.ts} +4 -3
  187. package/dist/shared/outfitter-jkct38dh.js +53 -0
  188. package/dist/shared/outfitter-jwxggvz4.js +42 -0
  189. package/dist/shared/outfitter-k6zyvg2n.js +306 -0
  190. package/dist/shared/outfitter-mstr60zz.js +215 -0
  191. package/dist/shared/outfitter-n0ed012k.js +101 -0
  192. package/dist/shared/outfitter-n13pqaft.js +19 -0
  193. package/dist/shared/outfitter-nxvjxrmw.d.ts +48 -0
  194. package/dist/shared/outfitter-p2wn07b7.js +160 -0
  195. package/dist/shared/{outfitter-5y646xzk.js → outfitter-px5sv5gn.js} +29 -9
  196. package/dist/shared/outfitter-q1g58t85.js +8 -0
  197. package/dist/shared/{outfitter-pj9vp00r.js → outfitter-qsd5638j.js} +26 -249
  198. package/dist/shared/outfitter-qsrx7m4w.js +72 -0
  199. package/dist/shared/outfitter-r2awqszh.d.ts +52 -0
  200. package/dist/shared/outfitter-rdpw2sbp.d.ts +77 -0
  201. package/dist/shared/outfitter-rp89dafm.js +109 -0
  202. package/dist/shared/outfitter-s1c0whzj.js +121 -0
  203. package/dist/shared/{outfitter-w1j80j1r.js → outfitter-ssrtakh3.js} +21 -5
  204. package/dist/shared/outfitter-ssynegbs.js +167 -0
  205. package/dist/shared/{outfitter-zwyvewr1.js → outfitter-svts4wk2.js} +1 -1
  206. package/dist/shared/outfitter-tavatb5p.js +166 -0
  207. package/dist/shared/outfitter-tqznjgbm.js +44 -0
  208. package/dist/shared/{outfitter-yraebrmw.d.ts → outfitter-wcrp7d7m.d.ts} +1 -1
  209. package/dist/shared/outfitter-wkt0a0ra.js +67 -0
  210. package/dist/shared/{outfitter-ha89qf8q.js → outfitter-wrcqq29p.js} +4 -4
  211. package/dist/shared/outfitter-wyg1tpp5.d.ts +43 -0
  212. package/dist/shared/outfitter-x0vpb7tj.js +126 -0
  213. package/dist/shared/{outfitter-m44n0qzw.js → outfitter-x39awx8g.js} +11 -26
  214. package/dist/shared/outfitter-x4cc5xsq.js +168 -0
  215. package/dist/shared/outfitter-x8w5sjnd.d.ts +39 -0
  216. package/dist/shared/{outfitter-amc4jbs1.d.ts → outfitter-xr6g13nz.d.ts} +2 -2
  217. package/dist/shared/outfitter-xs94pkfe.js +106 -0
  218. package/dist/shared/outfitter-y37yfehn.d.ts +37 -0
  219. package/dist/shared/{outfitter-fhnjpjwc.d.ts → outfitter-y6ee0k45.d.ts} +1 -1
  220. package/dist/shared/{outfitter-j833sxws.js → outfitter-ydw7x6bh.js} +1 -1
  221. package/dist/shared/outfitter-yhb23pjc.js +89 -0
  222. package/dist/shared/{outfitter-mtbpabf3.js → outfitter-ypcvwg1s.js} +1 -1
  223. package/dist/shared/outfitter-znbqe5zy.d.ts +45 -0
  224. package/dist/shared/{outfitter-dpj9erew.d.ts → outfitter-zng6w0t9.d.ts} +1 -1
  225. package/dist/targets/index.d.ts +2 -2
  226. package/dist/targets/index.js +2 -3
  227. package/dist/targets/registry.d.ts +2 -2
  228. package/dist/targets/registry.js +207 -14
  229. package/dist/targets/types.d.ts +1 -1
  230. package/package.json +203 -40
  231. package/dist/shared/chunk-x6644tk8.js +0 -6491
  232. package/dist/shared/outfitter-20f6a2n4.js +0 -35
  233. package/dist/shared/outfitter-5akzvppx.js +0 -125
  234. package/dist/shared/outfitter-7ch26yq8.js +0 -885
  235. package/dist/shared/outfitter-ehp18x1n.js +0 -1
  236. package/dist/shared/outfitter-h3q6ae6d.d.ts +0 -48
  237. package/dist/shared/outfitter-hvsaxgcp.js +0 -1
  238. package/dist/shared/outfitter-p71qb0f0.js +0 -82
  239. package/dist/shared/outfitter-pcj9gg2g.js +0 -909
  240. package/dist/shared/outfitter-xe5mzgdc.js +0 -208
  241. package/dist/shared/outfitter-z0we32cp.d.ts +0 -63
  242. package/template-versions.json +0 -22
  243. package/templates/.gitkeep +0 -0
  244. package/templates/basic/.gitignore.template +0 -30
  245. package/templates/basic/.lefthook.yml.template +0 -26
  246. package/templates/basic/package.json.template +0 -46
  247. package/templates/basic/src/index.ts.template +0 -26
  248. package/templates/basic/tsconfig.json.template +0 -34
  249. package/templates/cli/.gitignore.template +0 -4
  250. package/templates/cli/.lefthook.yml.template +0 -26
  251. package/templates/cli/README.md.template +0 -35
  252. package/templates/cli/biome.json.template +0 -4
  253. package/templates/cli/package.json.template +0 -53
  254. package/templates/cli/src/cli.ts.template +0 -8
  255. package/templates/cli/src/index.ts.template +0 -7
  256. package/templates/cli/src/program.ts.template +0 -31
  257. package/templates/cli/tsconfig.json.template +0 -34
  258. package/templates/daemon/.gitignore.template +0 -4
  259. package/templates/daemon/.lefthook.yml.template +0 -26
  260. package/templates/daemon/README.md.template +0 -67
  261. package/templates/daemon/biome.json.template +0 -4
  262. package/templates/daemon/package.json.template +0 -56
  263. package/templates/daemon/src/cli.ts.template +0 -96
  264. package/templates/daemon/src/daemon-main.ts.template +0 -79
  265. package/templates/daemon/src/daemon.ts.template +0 -11
  266. package/templates/daemon/src/index.ts.template +0 -7
  267. package/templates/daemon/tsconfig.json.template +0 -23
  268. package/templates/full-stack/.gitignore.template +0 -30
  269. package/templates/full-stack/README.md.template +0 -30
  270. package/templates/full-stack/apps/cli/package.json.template +0 -39
  271. package/templates/full-stack/apps/cli/src/cli.ts.template +0 -24
  272. package/templates/full-stack/apps/cli/src/index.test.ts.template +0 -18
  273. package/templates/full-stack/apps/cli/src/index.ts.template +0 -5
  274. package/templates/full-stack/apps/cli/tsconfig.json.template +0 -37
  275. package/templates/full-stack/apps/mcp/package.json.template +0 -40
  276. package/templates/full-stack/apps/mcp/src/index.test.ts.template +0 -18
  277. package/templates/full-stack/apps/mcp/src/index.ts.template +0 -6
  278. package/templates/full-stack/apps/mcp/src/mcp.ts.template +0 -22
  279. package/templates/full-stack/apps/mcp/src/server.ts.template +0 -10
  280. package/templates/full-stack/apps/mcp/tsconfig.json.template +0 -37
  281. package/templates/full-stack/package.json.template +0 -16
  282. package/templates/full-stack/packages/core/package.json.template +0 -36
  283. package/templates/full-stack/packages/core/src/handlers.ts.template +0 -31
  284. package/templates/full-stack/packages/core/src/index.test.ts.template +0 -30
  285. package/templates/full-stack/packages/core/src/index.ts.template +0 -8
  286. package/templates/full-stack/packages/core/src/types.ts.template +0 -13
  287. package/templates/full-stack/packages/core/tsconfig.json.template +0 -34
  288. package/templates/library/.gitignore.template +0 -30
  289. package/templates/library/README.md.template +0 -29
  290. package/templates/library/bunup.config.ts.template +0 -20
  291. package/templates/library/package.json.template +0 -55
  292. package/templates/library/src/handlers.ts.template +0 -31
  293. package/templates/library/src/index.test.ts.template +0 -35
  294. package/templates/library/src/index.ts.template +0 -8
  295. package/templates/library/src/types.ts.template +0 -13
  296. package/templates/library/tsconfig.json.template +0 -34
  297. package/templates/mcp/.gitignore.template +0 -4
  298. package/templates/mcp/.lefthook.yml.template +0 -26
  299. package/templates/mcp/README.md.template +0 -54
  300. package/templates/mcp/biome.json.template +0 -4
  301. package/templates/mcp/package.json.template +0 -53
  302. package/templates/mcp/src/index.ts.template +0 -7
  303. package/templates/mcp/src/mcp.ts.template +0 -33
  304. package/templates/mcp/src/server.ts.template +0 -8
  305. package/templates/mcp/tsconfig.json.template +0 -23
  306. package/templates/minimal/.gitignore.template +0 -30
  307. package/templates/minimal/.lefthook.yml.template +0 -26
  308. package/templates/minimal/package.json.template +0 -53
  309. package/templates/minimal/src/index.ts.template +0 -26
  310. package/templates/minimal/tsconfig.json.template +0 -34
  311. /package/dist/{shared/outfitter-344t1r38.js → commands/docs-types.js} +0 -0
  312. /package/dist/shared/{outfitter-mdt37hqm.js → outfitter-eepj7rf7.js} +0 -0
@@ -0,0 +1,98 @@
1
+ import { InitStructure } from "./outfitter-r2awqszh.js";
2
+ import { InitPresetId } from "./outfitter-5d9wbzhh.js";
3
+ import { PostScaffoldResult } from "./outfitter-hcexcvxe.js";
4
+ import { OutputMode } from "@outfitter/cli/types";
5
+ import { Result } from "@outfitter/contracts";
6
+ import { AddBlockResult } from "@outfitter/tooling";
7
+ import { Command } from "commander";
8
+ /**
9
+ * Options for the init command, corresponding to CLI flags and positional arguments.
10
+ */
11
+ interface InitOptions {
12
+ /** Custom binary name for CLI/daemon presets. */
13
+ readonly bin?: string | undefined;
14
+ /** Preview changes without writing to disk. */
15
+ readonly dryRun?: boolean | undefined;
16
+ /** Overwrite existing files without prompting. */
17
+ readonly force: boolean;
18
+ /** Timeout in milliseconds for `bun install`. */
19
+ readonly installTimeout?: number | undefined;
20
+ /** Use `workspace:*` protocol for `@outfitter` dependencies. */
21
+ readonly local?: boolean | undefined;
22
+ /** Package name override (defaults to directory name). */
23
+ readonly name: string | undefined;
24
+ /** Skip adding default tooling blocks. */
25
+ readonly noTooling?: boolean | undefined;
26
+ /** Preset to scaffold from. */
27
+ readonly preset?: InitPresetId | undefined;
28
+ /** Skip the initial git commit after scaffolding. */
29
+ readonly skipCommit?: boolean | undefined;
30
+ /** Skip git init and initial commit entirely. */
31
+ readonly skipGit?: boolean | undefined;
32
+ /** Skip running `bun install` after scaffolding. */
33
+ readonly skipInstall?: boolean | undefined;
34
+ /** Whether to create a single package or a workspace. */
35
+ readonly structure?: InitStructure | undefined;
36
+ /** Absolute or relative path to the target directory. */
37
+ readonly targetDir: string;
38
+ /** Comma-separated tooling block names to include. */
39
+ readonly with?: string | undefined;
40
+ /** Package name for the workspace root (workspace structure only). */
41
+ readonly workspaceName?: string | undefined;
42
+ /** Skip interactive prompts and use defaults. */
43
+ readonly yes?: boolean | undefined;
44
+ }
45
+ /**
46
+ * Result of a successful `outfitter init` run.
47
+ */
48
+ interface InitResult {
49
+ /** Tooling blocks that were added, if any. */
50
+ readonly blocksAdded?: AddBlockResult | undefined;
51
+ /** Present only for dry-run invocations; contains the planned operations and summary counts. */
52
+ readonly dryRunPlan?: {
53
+ readonly operations: readonly unknown[];
54
+ readonly summary: Record<string, number>;
55
+ } | undefined;
56
+ /** The resolved npm package name for the scaffolded project. */
57
+ readonly packageName: string;
58
+ /** Results from post-scaffold steps (install, git init, next-step hints). */
59
+ readonly postScaffold: PostScaffoldResult;
60
+ /** The preset that was used. */
61
+ readonly preset: InitPresetId;
62
+ /** Absolute path to the scaffolded project directory. */
63
+ readonly projectDir: string;
64
+ /** Absolute path to the workspace or project root. */
65
+ readonly rootDir: string;
66
+ /** Whether a single package or workspace was created. */
67
+ readonly structure: InitStructure;
68
+ }
69
+ /**
70
+ * Error returned when initialization fails.
71
+ */
72
+ declare class InitError extends Error {
73
+ readonly _tag: "InitError";
74
+ /** @param message - Human-readable description of the init failure. */
75
+ constructor(message: string);
76
+ }
77
+ /**
78
+ * Runs the full init flow: resolves user input (interactive or non-interactive),
79
+ * looks up the target preset, and delegates to the execution pipeline.
80
+ * @param options - Init options from CLI flags or programmatic callers
81
+ * @param presetOverride - Forces a specific preset, bypassing flag resolution and prompts
82
+ */
83
+ declare function runInit(options: InitOptions, presetOverride?: InitPresetId): Promise<Result<InitResult, InitError>>;
84
+ /**
85
+ * Registers the `init` command and its preset subcommands on a Commander program.
86
+ * @deprecated Use action-registry CLI wiring via `buildCliCommands(outfitterActions, ...)`.
87
+ */
88
+ declare function initCommand(program: Command): void;
89
+ /** Options controlling how init results are rendered (human-readable, JSON, or JSONL). */
90
+ interface PrintInitResultsOptions {
91
+ readonly mode?: OutputMode;
92
+ }
93
+ /**
94
+ * Renders init results to stdout. Handles dry-run plans, structured output modes,
95
+ * and human-readable summaries with next-step guidance.
96
+ */
97
+ declare function printInitResults(result: InitResult, options?: PrintInitResultsOptions): Promise<void>;
98
+ export { PrintInitResultsOptions, printInitResults, InitOptions, InitResult, InitError, runInit, initCommand };
@@ -0,0 +1,325 @@
1
+ // @bun
2
+ import {
3
+ checkTsdocOutputSchema
4
+ } from "./outfitter-k6zyvg2n.js";
5
+ import {
6
+ resolveDocsOutputMode
7
+ } from "./outfitter-ec83h4v2.js";
8
+ import {
9
+ outputModeSchema,
10
+ resolveCwdFromPreset,
11
+ resolveStringFlag
12
+ } from "./outfitter-7n7vsz95.js";
13
+ import {
14
+ printDocsListResults,
15
+ runDocsList
16
+ } from "./outfitter-yhb23pjc.js";
17
+ import {
18
+ printDocsApiResults,
19
+ runDocsApi
20
+ } from "./outfitter-cyhzstz0.js";
21
+ import {
22
+ printDocsSearchResults,
23
+ runDocsSearch
24
+ } from "./outfitter-hf5bj2gq.js";
25
+ import {
26
+ printDocsExportResults,
27
+ runDocsExport
28
+ } from "./outfitter-940h0x7b.js";
29
+ import {
30
+ printDocsShowResults,
31
+ runDocsShow
32
+ } from "./outfitter-c7sbs7es.js";
33
+
34
+ // apps/outfitter/src/actions/docs.ts
35
+ import { cwdPreset } from "@outfitter/cli/flags";
36
+ import { jqPreset, outputModePreset } from "@outfitter/cli/query";
37
+ import { defineAction, Result } from "@outfitter/contracts";
38
+ import { z } from "zod";
39
+ var docsListInputSchema = z.object({
40
+ cwd: z.string(),
41
+ kind: z.string().optional(),
42
+ package: z.string().optional(),
43
+ jq: z.string().optional(),
44
+ outputMode: outputModeSchema
45
+ });
46
+ var docsListCwd = cwdPreset();
47
+ var docsListOutputMode = outputModePreset({ includeJsonl: true });
48
+ var docsListJq = jqPreset();
49
+ var docsListAction = defineAction({
50
+ id: "docs.list",
51
+ description: "List documentation entries from the docs map",
52
+ surfaces: ["cli"],
53
+ input: docsListInputSchema,
54
+ cli: {
55
+ group: "docs",
56
+ command: "list",
57
+ description: "List documentation entries from the docs map",
58
+ options: [
59
+ {
60
+ flags: "-k, --kind <kind>",
61
+ description: "Filter by doc kind (readme, guide, reference, architecture, release, convention, deep, generated)"
62
+ },
63
+ {
64
+ flags: "-p, --package <name>",
65
+ description: "Filter by package name"
66
+ },
67
+ ...docsListOutputMode.options,
68
+ ...docsListJq.options,
69
+ ...docsListCwd.options
70
+ ],
71
+ mapInput: (context) => {
72
+ const { outputMode: presetOutputMode } = docsListOutputMode.resolve(context.flags);
73
+ const { jq } = docsListJq.resolve(context.flags);
74
+ const outputMode = resolveDocsOutputMode(context.flags, presetOutputMode);
75
+ const kind = resolveStringFlag(context.flags["kind"]);
76
+ const pkg = resolveStringFlag(context.flags["package"]);
77
+ return {
78
+ cwd: resolveCwdFromPreset(context.flags, docsListCwd),
79
+ outputMode,
80
+ jq,
81
+ ...kind !== undefined ? { kind } : {},
82
+ ...pkg !== undefined ? { package: pkg } : {}
83
+ };
84
+ }
85
+ },
86
+ handler: async (input) => {
87
+ const { outputMode, jq } = input;
88
+ const result = await runDocsList(input);
89
+ if (result.isErr()) {
90
+ return result;
91
+ }
92
+ await printDocsListResults(result.value, { mode: outputMode, jq });
93
+ return Result.ok(result.value);
94
+ }
95
+ });
96
+ var docsShowInputSchema = z.object({
97
+ id: z.string(),
98
+ cwd: z.string(),
99
+ jq: z.string().optional(),
100
+ outputMode: outputModeSchema
101
+ });
102
+ var docsShowCwd = cwdPreset();
103
+ var docsShowOutputMode = outputModePreset({ includeJsonl: true });
104
+ var docsShowJq = jqPreset();
105
+ var docsShowAction = defineAction({
106
+ id: "docs.show",
107
+ description: "Show a specific documentation entry and its content",
108
+ surfaces: ["cli"],
109
+ input: docsShowInputSchema,
110
+ cli: {
111
+ group: "docs",
112
+ command: "show <id>",
113
+ description: "Show a specific documentation entry and its content",
114
+ options: [
115
+ ...docsShowOutputMode.options,
116
+ ...docsShowJq.options,
117
+ ...docsShowCwd.options
118
+ ],
119
+ mapInput: (context) => {
120
+ const { outputMode: presetOutputMode } = docsShowOutputMode.resolve(context.flags);
121
+ const { jq } = docsShowJq.resolve(context.flags);
122
+ const outputMode = resolveDocsOutputMode(context.flags, presetOutputMode);
123
+ return {
124
+ id: context.args[0],
125
+ cwd: resolveCwdFromPreset(context.flags, docsShowCwd),
126
+ jq,
127
+ outputMode
128
+ };
129
+ }
130
+ },
131
+ handler: async (input) => {
132
+ const { outputMode, jq } = input;
133
+ const result = await runDocsShow(input);
134
+ if (result.isErr()) {
135
+ return result;
136
+ }
137
+ await printDocsShowResults(result.value, { mode: outputMode, jq });
138
+ return Result.ok(result.value);
139
+ }
140
+ });
141
+ var docsSearchInputSchema = z.object({
142
+ query: z.string(),
143
+ cwd: z.string(),
144
+ kind: z.string().optional(),
145
+ package: z.string().optional(),
146
+ jq: z.string().optional(),
147
+ outputMode: outputModeSchema
148
+ });
149
+ var docsSearchCwd = cwdPreset();
150
+ var docsSearchOutputMode = outputModePreset({ includeJsonl: true });
151
+ var docsSearchJq = jqPreset();
152
+ var docsSearchAction = defineAction({
153
+ id: "docs.search",
154
+ description: "Search documentation content for a query string",
155
+ surfaces: ["cli"],
156
+ input: docsSearchInputSchema,
157
+ cli: {
158
+ group: "docs",
159
+ command: "search <query>",
160
+ description: "Search documentation content for a query string",
161
+ options: [
162
+ {
163
+ flags: "-k, --kind <kind>",
164
+ description: "Filter by doc kind (readme, guide, reference, architecture, release, convention, deep, generated)"
165
+ },
166
+ {
167
+ flags: "-p, --package <name>",
168
+ description: "Filter by package name"
169
+ },
170
+ ...docsSearchOutputMode.options,
171
+ ...docsSearchJq.options,
172
+ ...docsSearchCwd.options
173
+ ],
174
+ mapInput: (context) => {
175
+ const { outputMode: presetOutputMode } = docsSearchOutputMode.resolve(context.flags);
176
+ const { jq } = docsSearchJq.resolve(context.flags);
177
+ const outputMode = resolveDocsOutputMode(context.flags, presetOutputMode);
178
+ const kind = resolveStringFlag(context.flags["kind"]);
179
+ const pkg = resolveStringFlag(context.flags["package"]);
180
+ return {
181
+ query: context.args[0],
182
+ cwd: resolveCwdFromPreset(context.flags, docsSearchCwd),
183
+ outputMode,
184
+ jq,
185
+ ...kind !== undefined ? { kind } : {},
186
+ ...pkg !== undefined ? { package: pkg } : {}
187
+ };
188
+ }
189
+ },
190
+ handler: async (input) => {
191
+ const { outputMode, jq, ...searchInput } = input;
192
+ const result = await runDocsSearch({ ...searchInput, outputMode, jq });
193
+ if (result.isErr()) {
194
+ return result;
195
+ }
196
+ await printDocsSearchResults(result.value, { mode: outputMode, jq });
197
+ return Result.ok(result.value);
198
+ }
199
+ });
200
+ var docsApiInputSchema = z.object({
201
+ cwd: z.string(),
202
+ level: z.enum(["documented", "partial", "undocumented"]).optional(),
203
+ packages: z.array(z.string()),
204
+ jq: z.string().optional(),
205
+ outputMode: outputModeSchema
206
+ });
207
+ var docsApiCwd = cwdPreset();
208
+ var docsApiOutputMode = outputModePreset({ includeJsonl: true });
209
+ var docsApiJq = jqPreset();
210
+ var docsApiAction = defineAction({
211
+ id: "docs.api",
212
+ description: "Extract API reference from TSDoc coverage data",
213
+ surfaces: ["cli"],
214
+ input: docsApiInputSchema,
215
+ output: checkTsdocOutputSchema,
216
+ cli: {
217
+ group: "docs",
218
+ command: "api",
219
+ description: "Extract API reference from TSDoc coverage data",
220
+ options: [
221
+ {
222
+ flags: "--level <level>",
223
+ description: "Filter declarations by coverage level (undocumented, partial, documented)"
224
+ },
225
+ {
226
+ flags: "--package <name>",
227
+ description: "Filter to specific package(s) by name (repeatable)"
228
+ },
229
+ ...docsApiOutputMode.options,
230
+ ...docsApiJq.options,
231
+ ...docsApiCwd.options
232
+ ],
233
+ mapInput: (context) => {
234
+ const { outputMode: presetOutputMode } = docsApiOutputMode.resolve(context.flags);
235
+ const { jq } = docsApiJq.resolve(context.flags);
236
+ const outputMode = resolveDocsOutputMode(context.flags, presetOutputMode);
237
+ const levelRaw = context.flags["level"];
238
+ const validLevels = new Set(["documented", "partial", "undocumented"]);
239
+ const level = typeof levelRaw === "string" && validLevels.has(levelRaw) ? levelRaw : undefined;
240
+ const pkgRaw = context.flags["package"];
241
+ let packages = [];
242
+ if (Array.isArray(pkgRaw)) {
243
+ packages = pkgRaw.filter((v) => typeof v === "string");
244
+ } else if (typeof pkgRaw === "string") {
245
+ packages = [pkgRaw];
246
+ }
247
+ return {
248
+ cwd: resolveCwdFromPreset(context.flags, docsApiCwd),
249
+ outputMode,
250
+ jq,
251
+ level,
252
+ packages
253
+ };
254
+ }
255
+ },
256
+ handler: async (input) => {
257
+ const { cwd, packages, level, outputMode, jq } = input;
258
+ const result = await runDocsApi({
259
+ cwd,
260
+ packages,
261
+ level,
262
+ outputMode,
263
+ jq
264
+ });
265
+ if (result.isErr()) {
266
+ return result;
267
+ }
268
+ await printDocsApiResults(result.value, { mode: outputMode, jq });
269
+ return Result.ok(result.value);
270
+ }
271
+ });
272
+ var docsExportTargetValues = [
273
+ "packages",
274
+ "llms",
275
+ "llms-full",
276
+ "all"
277
+ ];
278
+ var docsExportInputSchema = z.object({
279
+ cwd: z.string(),
280
+ target: z.enum(docsExportTargetValues).default("all"),
281
+ outputMode: outputModeSchema
282
+ });
283
+ var docsExportCwd = cwdPreset();
284
+ var docsExportOutputMode = outputModePreset({ includeJsonl: true });
285
+ var docsExportAction = defineAction({
286
+ id: "docs.export",
287
+ description: "Export documentation to packages, llms.txt, or both",
288
+ surfaces: ["cli"],
289
+ input: docsExportInputSchema,
290
+ cli: {
291
+ group: "docs",
292
+ command: "export",
293
+ description: "Export documentation to packages, llms.txt, or both",
294
+ options: [
295
+ {
296
+ flags: "-t, --target <target>",
297
+ description: "Export target (packages|llms|llms-full|all, default: all)"
298
+ },
299
+ ...docsExportOutputMode.options,
300
+ ...docsExportCwd.options
301
+ ],
302
+ mapInput: (context) => {
303
+ const { outputMode: presetOutputMode } = docsExportOutputMode.resolve(context.flags);
304
+ const outputMode = resolveDocsOutputMode(context.flags, presetOutputMode);
305
+ const targetRaw = resolveStringFlag(context.flags["target"]);
306
+ const target = targetRaw ?? "all";
307
+ return {
308
+ cwd: resolveCwdFromPreset(context.flags, docsExportCwd),
309
+ target,
310
+ outputMode
311
+ };
312
+ }
313
+ },
314
+ handler: async (input) => {
315
+ const { outputMode, ...exportInput } = input;
316
+ const result = await runDocsExport({ ...exportInput, outputMode });
317
+ if (result.isErr()) {
318
+ return result;
319
+ }
320
+ await printDocsExportResults(result.value, { mode: outputMode });
321
+ return Result.ok(result.value);
322
+ }
323
+ });
324
+
325
+ export { docsListAction, docsShowAction, docsSearchAction, docsApiAction, docsExportAction };
@@ -1,25 +1,46 @@
1
1
  // @bun
2
2
  import {
3
3
  loadDocsModule
4
- } from "./outfitter-zwyvewr1.js";
4
+ } from "./outfitter-svts4wk2.js";
5
5
 
6
6
  // apps/outfitter/src/commands/repo.ts
7
7
  import { existsSync } from "fs";
8
8
  import { createRequire } from "module";
9
- import { dirname, join } from "path";
9
+ import { dirname, join, resolve } from "path";
10
10
  import {
11
11
  booleanFlagPreset,
12
12
  composePresets,
13
13
  cwdPreset,
14
14
  stringListFlagPreset
15
15
  } from "@outfitter/cli/flags";
16
- import {
17
- resolveDocsCliOptions,
18
- withDocsCommonOptions,
19
- withDocsExportOptions
20
- } from "@outfitter/docs";
21
16
  import { Command } from "commander";
22
17
  var require2 = createRequire(import.meta.url);
18
+ var DOCS_COMMON_OPTION_FLAGS = [
19
+ "--cwd <path>",
20
+ "--packages-dir <path>",
21
+ "--output-dir <path>",
22
+ "--mdx-mode <mode>"
23
+ ];
24
+ var DOCS_EXPORT_OPTION_FLAGS = [
25
+ "--llms-file <path>",
26
+ "--llms-full-file <path>",
27
+ "--target <target>"
28
+ ];
29
+ function withDocsCommonOptions(command) {
30
+ return command.option(DOCS_COMMON_OPTION_FLAGS[0], "Workspace root to operate in").option(DOCS_COMMON_OPTION_FLAGS[1], "Packages directory relative to workspace").option(DOCS_COMMON_OPTION_FLAGS[2], "Output directory relative to workspace").option(DOCS_COMMON_OPTION_FLAGS[3], "MDX handling mode: strict or lossy");
31
+ }
32
+ function withDocsExportOptions(command) {
33
+ return withDocsCommonOptions(command).option(DOCS_EXPORT_OPTION_FLAGS[0], "llms.txt output path relative to workspace").option(DOCS_EXPORT_OPTION_FLAGS[1], "llms-full.txt output path relative to workspace").option(DOCS_EXPORT_OPTION_FLAGS[2], "Export target: packages, llms, llms-full, all", "all");
34
+ }
35
+ function resolveDocsCliOptions(options) {
36
+ if (typeof options.cwd !== "string" || options.cwd.length === 0) {
37
+ return options;
38
+ }
39
+ return {
40
+ ...options,
41
+ cwd: resolve(process.cwd(), options.cwd)
42
+ };
43
+ }
23
44
  function getIo(options) {
24
45
  return {
25
46
  out: options?.io?.out ?? ((line) => process.stdout.write(`${line}
@@ -82,7 +103,7 @@ function addDocsCheckSubcommand(command, options) {
82
103
  });
83
104
  }
84
105
  function addDocsSyncSubcommand(command, options) {
85
- const docsSyncCommand = command.command("docs").description("Assemble package docs into docs/packages");
106
+ const docsSyncCommand = command.command("docs").description("Assemble package docs mirrors locally");
86
107
  withDocsCommonOptions(docsSyncCommand).action(async (cmdOptions) => {
87
108
  const code = await options.runDocsSync(resolveDocsCliOptions(cmdOptions), options.io);
88
109
  applyExitCode(code);
@@ -175,6 +196,13 @@ function addToolingCheckSubcommands(command, runToolingCommand) {
175
196
  preset: toolingWithCwd,
176
197
  buildArgs: () => []
177
198
  });
199
+ registerToolingCheckSubcommand({
200
+ name: "markdown-links",
201
+ description: "Validate relative links in markdown files resolve to existing files",
202
+ toolingCommand: "check-markdown-links",
203
+ preset: toolingWithCwd,
204
+ buildArgs: () => []
205
+ });
178
206
  }
179
207
  function createRepoCommand(options) {
180
208
  const io = getIo(options);
@@ -201,4 +229,4 @@ if (import.meta.main) {
201
229
  main();
202
230
  }
203
231
 
204
- export { createRepoCommand };
232
+ export { DOCS_COMMON_OPTION_FLAGS, DOCS_EXPORT_OPTION_FLAGS, createRepoCommand };
@@ -0,0 +1,17 @@
1
+ // @bun
2
+ // apps/outfitter/src/actions/docs-output-mode.ts
3
+ function resolveDocsOutputMode(flags, presetOutputMode) {
4
+ const explicitOutput = typeof flags["output"] === "string";
5
+ if (explicitOutput) {
6
+ return presetOutputMode === "json" || presetOutputMode === "jsonl" ? presetOutputMode : "human";
7
+ }
8
+ if (process.env["OUTFITTER_JSONL"] === "1") {
9
+ return "jsonl";
10
+ }
11
+ if (process.env["OUTFITTER_JSON"] === "1") {
12
+ return "json";
13
+ }
14
+ return "human";
15
+ }
16
+
17
+ export { resolveDocsOutputMode };
@@ -3,25 +3,25 @@
3
3
  var CREATE_PRESETS = {
4
4
  basic: {
5
5
  id: "basic",
6
- template: "basic",
6
+ presetDir: "basic",
7
7
  summary: "Minimal Bun + TypeScript project.",
8
8
  defaultBlocks: ["scaffolding"]
9
9
  },
10
10
  cli: {
11
11
  id: "cli",
12
- template: "cli",
12
+ presetDir: "cli",
13
13
  summary: "CLI starter with Outfitter command ergonomics.",
14
14
  defaultBlocks: ["scaffolding"]
15
15
  },
16
16
  daemon: {
17
17
  id: "daemon",
18
- template: "daemon",
18
+ presetDir: "daemon",
19
19
  summary: "Daemon + control CLI starter.",
20
20
  defaultBlocks: ["scaffolding"]
21
21
  },
22
22
  mcp: {
23
23
  id: "mcp",
24
- template: "mcp",
24
+ presetDir: "mcp",
25
25
  summary: "MCP server starter.",
26
26
  defaultBlocks: ["scaffolding"]
27
27
  }
@@ -0,0 +1,51 @@
1
+ // @bun
2
+ import {
3
+ outputModeSchema,
4
+ resolveCwdFromPreset
5
+ } from "./outfitter-7n7vsz95.js";
6
+ import {
7
+ printDoctorResults,
8
+ runDoctor
9
+ } from "./outfitter-px5sv5gn.js";
10
+ import {
11
+ resolveOutputModeFromContext
12
+ } from "./outfitter-7r12fj7f.js";
13
+
14
+ // apps/outfitter/src/actions/doctor.ts
15
+ import { cwdPreset } from "@outfitter/cli/flags";
16
+ import { defineAction, Result } from "@outfitter/contracts";
17
+ import { z } from "zod";
18
+ var doctorInputSchema = z.object({
19
+ cwd: z.string(),
20
+ outputMode: outputModeSchema
21
+ });
22
+ var doctorCwd = cwdPreset();
23
+ var doctorAction = defineAction({
24
+ id: "doctor",
25
+ description: "Validate environment and dependencies",
26
+ surfaces: ["cli"],
27
+ input: doctorInputSchema,
28
+ cli: {
29
+ command: "doctor",
30
+ description: "Validate environment and dependencies",
31
+ options: [...doctorCwd.options],
32
+ mapInput: (context) => {
33
+ const outputMode = resolveOutputModeFromContext(context.flags);
34
+ return {
35
+ cwd: resolveCwdFromPreset(context.flags, doctorCwd),
36
+ outputMode
37
+ };
38
+ }
39
+ },
40
+ handler: async (input) => {
41
+ const { outputMode, ...doctorInput } = input;
42
+ const result = await runDoctor(doctorInput);
43
+ await printDoctorResults(result, { mode: outputMode });
44
+ if (result.exitCode !== 0) {
45
+ process.exit(result.exitCode);
46
+ }
47
+ return Result.ok(result);
48
+ }
49
+ });
50
+
51
+ export { doctorAction };
@@ -0,0 +1,75 @@
1
+ // @bun
2
+ // apps/outfitter/src/commands/upgrade-apply.ts
3
+ import { readFileSync } from "fs";
4
+ import { join } from "path";
5
+ import { InternalError, Result } from "@outfitter/contracts";
6
+ function getVersionPrefix(specifier) {
7
+ if (specifier.startsWith("workspace:")) {
8
+ const inner = specifier.slice("workspace:".length);
9
+ return `workspace:${getVersionPrefix(inner)}`;
10
+ }
11
+ const match = specifier.match(/^([\^~>=<]+)/);
12
+ return match?.[1] ?? "";
13
+ }
14
+ async function applyUpdates(cwd, updates) {
15
+ const pkgPath = join(cwd, "package.json");
16
+ let raw;
17
+ try {
18
+ raw = readFileSync(pkgPath, "utf-8");
19
+ } catch {
20
+ return Result.err(InternalError.create("Failed to read package.json for apply", { cwd }));
21
+ }
22
+ let pkg;
23
+ try {
24
+ pkg = JSON.parse(raw);
25
+ } catch {
26
+ return Result.err(InternalError.create("Invalid JSON in package.json", { cwd }));
27
+ }
28
+ const updateMap = new Map;
29
+ for (const update of updates) {
30
+ updateMap.set(update.name, update.latestVersion);
31
+ }
32
+ for (const section of ["dependencies", "devDependencies"]) {
33
+ const deps = pkg[section];
34
+ if (!deps)
35
+ continue;
36
+ for (const name of Object.keys(deps)) {
37
+ const newVersion = updateMap.get(name);
38
+ if (newVersion === undefined)
39
+ continue;
40
+ const currentSpecifier = deps[name];
41
+ if (currentSpecifier === undefined)
42
+ continue;
43
+ const prefix = getVersionPrefix(currentSpecifier);
44
+ deps[name] = `${prefix}${newVersion}`;
45
+ }
46
+ }
47
+ try {
48
+ const updated = `${JSON.stringify(pkg, null, 2)}
49
+ `;
50
+ await Bun.write(pkgPath, updated);
51
+ } catch {
52
+ return Result.err(InternalError.create("Failed to write updated package.json", { cwd }));
53
+ }
54
+ try {
55
+ const proc = Bun.spawn(["bun", "install"], {
56
+ cwd,
57
+ stdout: "pipe",
58
+ stderr: "pipe"
59
+ });
60
+ const exitCode = await proc.exited;
61
+ if (exitCode !== 0) {
62
+ const stderr = await new Response(proc.stderr).text();
63
+ return Result.err(InternalError.create("bun install failed", {
64
+ cwd,
65
+ exitCode,
66
+ stderr: stderr.trim()
67
+ }));
68
+ }
69
+ } catch {
70
+ return Result.err(InternalError.create("Failed to run bun install", { cwd }));
71
+ }
72
+ return Result.ok(undefined);
73
+ }
74
+
75
+ export { applyUpdates };
@@ -0,0 +1,13 @@
1
+ import { copyPresetFiles, replacePlaceholders } from "./outfitter-6rtcemk7.js";
2
+ /**
3
+ * @deprecated Use `getPresetsBaseDir` instead.
4
+ */
5
+ declare function getTemplatesDir(): string;
6
+ /**
7
+ * @deprecated Use `copyPresetFiles` instead.
8
+ */
9
+ declare function copyTemplateFiles(...args: Parameters<typeof copyPresetFiles>): ReturnType<typeof copyPresetFiles>;
10
+ declare function getOutputFilename(templateFilename: string): string;
11
+ declare function isBinaryFile(filename: string): boolean;
12
+ declare function replacePlaceholders2(content: string, values: Parameters<typeof replacePlaceholders>[1]): string;
13
+ export { getTemplatesDir, copyTemplateFiles, getOutputFilename, isBinaryFile, replacePlaceholders2 as replacePlaceholders };