@astryxdesign/cli 0.6.5-canary.f261d2f → 0.6.5-canary.f2f43e1

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 (364) hide show
  1. package/README.md +58 -55
  2. package/api/build/_adapter.d.mts +19 -0
  3. package/api/build/_adapter.mjs +60 -1
  4. package/api/build/build.test.mjs +74 -1
  5. package/api/build/build.type.d.mts +8 -0
  6. package/api/build/build.type.mjs +2 -0
  7. package/api/build/kit/kit.mjs +40 -7
  8. package/api/build/kit/rank.d.mts +8 -0
  9. package/api/build/kit/rank.mjs +14 -0
  10. package/api/build/kit/weights.d.mts +82 -0
  11. package/api/build/kit/weights.json +1 -0
  12. package/api/build/kit/weights.mjs +305 -0
  13. package/api/build/kit/weights.test.mjs +190 -0
  14. package/api/component/_adapter.d.mts +19 -0
  15. package/api/component/_adapter.mjs +33 -0
  16. package/api/component/component-replacement.test.mjs +603 -0
  17. package/api/component/component.mjs +49 -15
  18. package/api/component/component.test.mjs +32 -0
  19. package/api/component/component.type.d.mts +33 -3
  20. package/api/component/component.type.mjs +10 -3
  21. package/api/component/detail/blocks/blocks.d.mts +2 -1
  22. package/api/component/detail/blocks/blocks.mjs +5 -2
  23. package/api/component/detail/detail.mjs +5 -1
  24. package/api/component/detail/props/props.d.mts +2 -1
  25. package/api/component/detail/props/props.mjs +3 -2
  26. package/api/component/detail/showcase/showcase.d.mts +3 -1
  27. package/api/component/detail/showcase/showcase.mjs +3 -1
  28. package/api/component/detail/source/source.d.mts +3 -2
  29. package/api/component/detail/source/source.mjs +7 -3
  30. package/api/component/list/list.mjs +128 -10
  31. package/api/docs/_adapter.d.mts +11 -0
  32. package/api/docs/_adapter.mjs +25 -0
  33. package/api/docs/detail/detail.mjs +19 -3
  34. package/api/docs/detail/section/section.mjs +7 -1
  35. package/api/docs/docOverlays.test.mjs +10 -6
  36. package/api/docs/docs.d.mts +6 -0
  37. package/api/docs/docs.depth.test.mjs +134 -0
  38. package/api/docs/docs.doc.mjs +31 -2
  39. package/api/docs/docs.mjs +46 -1
  40. package/api/docs/docs.test.mjs +1 -1
  41. package/api/docs/docs.type.d.mts +81 -4
  42. package/api/docs/docs.type.mjs +41 -4
  43. package/api/docs/index/index.mjs +11 -2
  44. package/api/docs/index/index.test.mjs +7 -2
  45. package/api/docs/integrationDocs.test.mjs +6 -5
  46. package/api/docs/node/node.d.mts +28 -3
  47. package/api/docs/node/node.mjs +149 -23
  48. package/api/doctor/_adapter.d.mts +43 -0
  49. package/api/doctor/_adapter.mjs +142 -0
  50. package/api/doctor/doctor.d.mts +0 -10
  51. package/api/doctor/doctor.doc.mjs +1 -3
  52. package/api/doctor/doctor.mjs +6 -123
  53. package/api/doctor/theme-checks.d.mts +12 -0
  54. package/api/doctor/theme-checks.mjs +1117 -0
  55. package/api/doctor/theme-checks.test.mjs +526 -0
  56. package/api/error.d.mts +22 -0
  57. package/api/error.mjs +42 -0
  58. package/api/gap-report/gap-report.d.mts +3 -1
  59. package/api/gap-report/gap-report.mjs +27 -3
  60. package/api/gap-report/gap-report.test.mjs +106 -0
  61. package/api/hook/_adapter.d.mts +1 -0
  62. package/api/hook/_adapter.mjs +3 -0
  63. package/api/hook/detail/detail.mjs +2 -2
  64. package/api/hook/detail/params/params.mjs +2 -2
  65. package/api/hook/hook.type.d.mts +12 -0
  66. package/api/hook/hook.type.mjs +3 -0
  67. package/api/hook/list/list.d.mts +1 -1
  68. package/api/hook/list/list.mjs +8 -8
  69. package/api/index.d.mts +1 -1
  70. package/api/index.mjs +4 -0
  71. package/api/init/run/run.d.mts +3 -5
  72. package/api/init/run/run.mjs +10 -11
  73. package/api/integration/__fixtures__/released-0.6.5-ocean.d.mts +14 -0
  74. package/api/integration/__fixtures__/released-0.6.5-ocean.mjs +15 -0
  75. package/api/integration/add-contribution.d.mts +2 -1
  76. package/api/integration/add-contribution.mjs +7 -3
  77. package/api/integration/add-helpers.d.mts +26 -5
  78. package/api/integration/add-helpers.mjs +50 -5
  79. package/api/integration/add-theme.mjs +352 -27
  80. package/api/integration/add-theme.test.mjs +379 -15
  81. package/api/integration/authoring-checks.mjs +31 -8
  82. package/api/integration/authoring-checks.type.d.mts +8 -0
  83. package/api/integration/authoring-checks.type.mjs +7 -3
  84. package/api/integration/integration-authoring.type.d.mts +4 -1
  85. package/api/integration/integration-authoring.type.mjs +6 -1
  86. package/api/integration/integrationAdd.doc.mjs +6 -0
  87. package/api/integration/integrationAddTheme.doc.mjs +10 -0
  88. package/api/integration/integrationComponentConflicts.doc.mjs +6 -3
  89. package/api/integration/integrationDocConflicts.doc.mjs +1 -1
  90. package/api/integration/integrationTemplateConflicts.doc.mjs +1 -1
  91. package/api/integration/pack-check.component-replaces.test.mjs +126 -0
  92. package/api/integration/pack-check.d.mts +10 -0
  93. package/api/integration/pack-check.lifecycle-output.test.mjs +21 -2
  94. package/api/integration/pack-check.mjs +483 -1
  95. package/api/integration/pack-check.test.mjs +568 -8
  96. package/api/integration/validate-integration.d.mts +4 -2
  97. package/api/integration/validate-integration.mjs +7 -2
  98. package/api/integration/validate-integration.test.mjs +55 -0
  99. package/api/integration/validate-integration.type.d.mts +5 -0
  100. package/api/integration/validate-integration.type.mjs +5 -1
  101. package/api/integration/validateIntegration.doc.mjs +1 -1
  102. package/api/layout/expand/expand.mjs +12 -7
  103. package/api/layout/expand/expand.receipt.test.mjs +74 -0
  104. package/api/layout/layout.type.d.mts +1 -0
  105. package/api/layout/layout.type.mjs +1 -0
  106. package/api/layout/layoutExpand.doc.mjs +1 -1
  107. package/api/search/search.d.mts +15 -8
  108. package/api/search/search.doc.mjs +4 -4
  109. package/api/search/search.mjs +179 -67
  110. package/api/search/search.test.mjs +128 -9
  111. package/api/search/search.type.d.mts +6 -6
  112. package/api/search/search.type.mjs +5 -5
  113. package/api/swizzle/_adapter.d.mts +10 -0
  114. package/api/swizzle/_adapter.mjs +23 -0
  115. package/api/swizzle/copy/copy.d.mts +5 -6
  116. package/api/swizzle/copy/copy.mjs +95 -13
  117. package/api/swizzle/list/list.mjs +2 -2
  118. package/api/swizzle/swizzle.doc.mjs +4 -0
  119. package/api/swizzle/swizzle.test.mjs +55 -5
  120. package/api/swizzle/swizzle.type.d.mts +8 -0
  121. package/api/swizzle/swizzle.type.mjs +2 -0
  122. package/api/template/copy/copy.mjs +15 -8
  123. package/api/template/copy/copy.receipt.test.mjs +77 -0
  124. package/api/template/show/show.mjs +17 -4
  125. package/api/template/show/show.test.mjs +76 -0
  126. package/api/template/skeleton/skeleton.mjs +2 -1
  127. package/api/template/template.d.mts +1 -1
  128. package/api/template/template.doc.mjs +6 -2
  129. package/api/template/template.mjs +2 -0
  130. package/api/template/template.type.d.mts +14 -0
  131. package/api/template/template.type.mjs +5 -0
  132. package/api/theme/_adapter.d.mts +106 -6
  133. package/api/theme/_adapter.mjs +687 -18
  134. package/api/theme/add/add.binary.test.mjs +76 -3
  135. package/api/theme/add/add.d.mts +5 -9
  136. package/api/theme/add/add.mjs +87 -64
  137. package/api/theme/add/add.rollback.test.mjs +9 -9
  138. package/api/theme/add/add.staging.test.mjs +9 -9
  139. package/api/theme/add/add.test.mjs +461 -55
  140. package/api/theme/add/add.types.test.mjs +151 -0
  141. package/api/theme/build/build.d.mts +50 -2
  142. package/api/theme/build/build.family.test.mjs +13 -4
  143. package/api/theme/build/build.icon-lineage.test.mjs +117 -0
  144. package/api/theme/build/build.icon-preservation.test.mjs +639 -0
  145. package/api/theme/build/build.mjs +463 -155
  146. package/api/theme/build/build.project-core.test.mjs +165 -0
  147. package/api/theme/build/build.test.mjs +220 -1
  148. package/api/theme/build/icon-imports.d.mts +47 -0
  149. package/api/theme/build/icon-imports.mjs +691 -0
  150. package/api/theme/eject/eject.binary.test.mjs +90 -0
  151. package/api/theme/eject/eject.d.mts +17 -0
  152. package/api/theme/eject/eject.mjs +65 -0
  153. package/api/theme/eject/eject.rollback.test.mjs +158 -0
  154. package/api/theme/eject/eject.staging.test.mjs +83 -0
  155. package/api/theme/eject/eject.test.mjs +160 -0
  156. package/api/theme/integration-themes.test.mjs +30 -6
  157. package/api/theme/list/list.d.mts +10 -0
  158. package/api/theme/list/list.mjs +75 -7
  159. package/api/theme/list/list.test.mjs +155 -4
  160. package/api/theme/remove/remove.d.mts +12 -0
  161. package/api/theme/remove/remove.mjs +15 -0
  162. package/api/theme/remove/remove.test.mjs +94 -0
  163. package/api/theme/template/template.mjs +3 -4
  164. package/api/theme/theme.d.mts +5 -2
  165. package/api/theme/theme.mjs +13 -8
  166. package/api/theme/theme.type.d.mts +106 -2
  167. package/api/theme/theme.type.mjs +54 -5
  168. package/api/theme/themeAdd.doc.d.mts +1 -3
  169. package/api/theme/themeAdd.doc.mjs +35 -22
  170. package/api/theme/themeBuild.doc.d.mts +4 -1
  171. package/api/theme/themeBuild.doc.mjs +15 -4
  172. package/api/theme/themeEject.doc.d.mts +8 -0
  173. package/api/theme/themeEject.doc.mjs +89 -0
  174. package/api/theme/themeListAvailable.doc.mjs +4 -4
  175. package/api/theme/themeListCopySources.doc.d.mts +8 -0
  176. package/api/theme/themeListCopySources.doc.mjs +60 -0
  177. package/api/theme/themeRemove.doc.d.mts +6 -0
  178. package/api/theme/themeRemove.doc.mjs +50 -0
  179. package/api/theme/themeTemplate.doc.mjs +4 -3
  180. package/api/theme/themeUse.doc.d.mts +6 -0
  181. package/api/theme/themeUse.doc.mjs +47 -0
  182. package/api/theme/use/use.d.mts +12 -0
  183. package/api/theme/use/use.mjs +15 -0
  184. package/api/theme/use/use.test.mjs +98 -0
  185. package/api/upgrade/_adapter.d.mts +1 -0
  186. package/api/upgrade/_adapter.mjs +3 -0
  187. package/api/upgrade/list/list.mjs +9 -3
  188. package/api/upgrade/run/run.mjs +20 -3
  189. package/api/upgrade/run/run.test.mjs +45 -1
  190. package/api/upgrade/upgrade.doc.mjs +1 -1
  191. package/api/upgrade/upgrade.type.d.mts +5 -0
  192. package/api/upgrade/upgrade.type.mjs +2 -0
  193. package/assets/codemods/integration-discovery.mjs +1 -1
  194. package/assets/codemods/integration-discovery.test.mjs +64 -0
  195. package/assets/codemods/transforms/next/__tests__/migrate-copied-themes-to-descriptors.test.mjs +129 -0
  196. package/assets/codemods/transforms/next/index.mjs +14 -1
  197. package/assets/codemods/transforms/next/migrate-copied-themes-to-descriptors.mjs +54 -0
  198. package/assets/docs/author-a-theme.doc.mjs +161 -0
  199. package/assets/docs/getting-started.doc.mjs +59 -15
  200. package/assets/docs/icons.doc.mjs +1 -0
  201. package/assets/docs/principles.doc.dense.mjs +2 -2
  202. package/assets/docs/principles.doc.mjs +2 -2
  203. package/assets/docs/principles.doc.zh.mjs +2 -2
  204. package/assets/docs/styling-libraries.doc.mjs +1 -1
  205. package/assets/docs/styling.doc.mjs +2 -2
  206. package/assets/docs/theme.doc.dense.mjs +10 -198
  207. package/assets/docs/theme.doc.mjs +13 -770
  208. package/assets/docs/theme.doc.zh.mjs +31 -12
  209. package/assets/docs/tokens.doc.mjs +4 -4
  210. package/assets/docs/tree/add-a-theme.doc.mjs +6 -2
  211. package/assets/docs/tree/checks.doc.mjs +5 -4
  212. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +1 -1
  213. package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
  214. package/assets/docs/tree/document-the-theme.doc.mjs +4 -4
  215. package/assets/docs/tree/fonts-and-assets.doc.mjs +25 -20
  216. package/assets/docs/tree/headers-and-footers.doc.mjs +68 -0
  217. package/assets/docs/tree/layout-spacing.doc.mjs +168 -0
  218. package/assets/docs/tree/layout.doc.mjs +32 -0
  219. package/assets/docs/tree/replace-a-core-component.doc.mjs +21 -4
  220. package/assets/docs/tree/responsive.doc.mjs +102 -0
  221. package/assets/docs/tree/scaffold.doc.mjs +145 -0
  222. package/assets/docs/tree/side-panels.doc.mjs +82 -0
  223. package/assets/docs/tree/structure.doc.mjs +144 -0
  224. package/assets/docs/tree/themes.doc.mjs +2 -2
  225. package/assets/docs/tree/troubleshooting.doc.mjs +4 -0
  226. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +22 -5
  227. package/assets/docs/tree/versioning.doc.mjs +4 -1
  228. package/assets/docs/use-a-theme.doc.mjs +97 -0
  229. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.doc.mjs +15 -0
  230. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +38 -0
  231. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.doc.mjs +20 -0
  232. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.tsx +48 -0
  233. package/assets/templates/pages/table-collapsible/page.tsx +1474 -0
  234. package/assets/templates/pages/table-collapsible/template.doc.mjs +12 -0
  235. package/assets/templates/pages/table-comparison/page.tsx +1449 -0
  236. package/assets/templates/pages/table-comparison/template.doc.mjs +12 -0
  237. package/assets/templates/themes/butter/icons.tsx +2 -0
  238. package/assets/templates/themes/chocolate/icons.tsx +2 -0
  239. package/assets/templates/themes/gothic/icons.tsx +2 -0
  240. package/assets/templates/themes/matcha/icons.tsx +2 -0
  241. package/assets/templates/themes/neutral/icons.tsx +2 -0
  242. package/assets/templates/themes/stone/icons.tsx +2 -0
  243. package/assets/templates/themes/y2k/icons.tsx +2 -0
  244. package/authoring/doctypes/command/command.doc.mjs +5 -0
  245. package/authoring/doctypes/command/type.ts +2 -0
  246. package/authoring/doctypes/component/component.doc.mjs +1 -1
  247. package/authoring/doctypes/component/type.ts +8 -4
  248. package/authoring/integration/integration.doc.mjs +1 -1
  249. package/clients/cli/commands/build-theme.mjs +279 -30
  250. package/clients/cli/commands/build.mjs +7 -6
  251. package/clients/cli/commands/build.text-fields.test.mjs +1 -1
  252. package/clients/cli/commands/component/index.mjs +88 -12
  253. package/clients/cli/commands/component-replacement.text.test.mjs +271 -0
  254. package/clients/cli/commands/component.doc.mjs +9 -2
  255. package/clients/cli/commands/discover.mjs +29 -1
  256. package/clients/cli/commands/discover.no-source.test.mjs +75 -0
  257. package/clients/cli/commands/docs.depth.test.mjs +219 -0
  258. package/clients/cli/commands/docs.doc.mjs +15 -2
  259. package/clients/cli/commands/docs.mjs +273 -16
  260. package/clients/cli/commands/docs.test.mjs +2 -3
  261. package/clients/cli/commands/doctor-integration-components.doc.mjs +15 -4
  262. package/clients/cli/commands/doctor.doc.mjs +1 -1
  263. package/clients/cli/commands/doctor.mjs +4 -4
  264. package/clients/cli/commands/doctor.test.mjs +9 -51
  265. package/clients/cli/commands/gap-report.doc.mjs +2 -2
  266. package/clients/cli/commands/gap-report.mjs +12 -0
  267. package/clients/cli/commands/gap-report.test.mjs +63 -0
  268. package/clients/cli/commands/hook/index.mjs +7 -2
  269. package/clients/cli/commands/import-hint-correctness.test.mjs +5 -5
  270. package/clients/cli/commands/init.next-steps.test.mjs +18 -23
  271. package/clients/cli/commands/integration-add.doc.mjs +10 -0
  272. package/clients/cli/commands/integration-authoring.test.mjs +12 -2
  273. package/clients/cli/commands/integration-real-world.test.mjs +61 -12
  274. package/clients/cli/commands/integration.mjs +3 -1
  275. package/clients/cli/commands/layout-check.doc.mjs +1 -0
  276. package/clients/cli/commands/layout-expand.doc.mjs +4 -1
  277. package/clients/cli/commands/layout-grammar.doc.mjs +1 -0
  278. package/clients/cli/commands/layout.doc.mjs +1 -0
  279. package/clients/cli/commands/layout.expand-receipt.test.mjs +94 -0
  280. package/clients/cli/commands/layout.mjs +61 -4
  281. package/clients/cli/commands/no-prompt-wording.test.mjs +4 -4
  282. package/clients/cli/commands/search.doc.mjs +5 -4
  283. package/clients/cli/commands/search.mjs +30 -6
  284. package/clients/cli/commands/search.test.mjs +63 -17
  285. package/clients/cli/commands/swizzle.doc.mjs +12 -3
  286. package/clients/cli/commands/swizzle.mjs +2 -1
  287. package/clients/cli/commands/template.copy-receipt.test.mjs +60 -0
  288. package/clients/cli/commands/template.mjs +70 -6
  289. package/clients/cli/commands/template.show-media.test.mjs +62 -0
  290. package/clients/cli/commands/text-json-parity.test.mjs +40 -0
  291. package/clients/cli/commands/theme-add-lifecycle.test.mjs +132 -0
  292. package/clients/cli/commands/theme-add.doc.mjs +19 -19
  293. package/clients/cli/commands/theme-eject.doc.mjs +47 -0
  294. package/clients/cli/commands/theme-list.behavior.test.mjs +44 -0
  295. package/clients/cli/commands/theme-list.doc.mjs +2 -2
  296. package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -2
  297. package/clients/cli/commands/theme-remove.doc.mjs +22 -0
  298. package/clients/cli/commands/theme-template.doc.mjs +4 -3
  299. package/clients/cli/commands/theme-use.doc.mjs +22 -0
  300. package/clients/cli/commands/theme.doc.mjs +21 -16
  301. package/clients/cli/commands/upgrade.ascii-output.test.mjs +14 -0
  302. package/clients/cli/commands/upgrade.mjs +1 -1
  303. package/clients/cli/commands/write-failure.test.mjs +175 -0
  304. package/clients/cli/index.mjs +4 -1
  305. package/clients/cli/lib/component-format.mjs +19 -2
  306. package/clients/cli/lib/manifest.mjs +44 -165
  307. package/clients/cli/lib/manifest.test.mjs +98 -7
  308. package/clients/cli/lib/resolve-theme.mjs +80 -78
  309. package/clients/cli/lib/resolve-theme.test.mjs +523 -27
  310. package/foundation/agent-docs/agent-docs.mjs +31 -28
  311. package/foundation/agent-docs/agent-docs.test.mjs +35 -32
  312. package/foundation/agent-docs/app-theme-workflow.test.mjs +13 -0
  313. package/foundation/config/project.d.mts +20 -5
  314. package/foundation/config/project.mjs +43 -6
  315. package/foundation/config/theme-private-vars.d.mts +12 -0
  316. package/foundation/config/theme-private-vars.mjs +107 -0
  317. package/foundation/config/theme-private-vars.test.mjs +55 -0
  318. package/foundation/config/theme-state.d.mts +145 -0
  319. package/foundation/config/theme-state.mjs +417 -0
  320. package/foundation/config/theme-state.test.mjs +182 -0
  321. package/foundation/discovery/component-discovery.d.mts +5 -2
  322. package/foundation/discovery/component-discovery.mjs +12 -6
  323. package/foundation/discovery/component-replacement.d.mts +91 -0
  324. package/foundation/discovery/component-replacement.mjs +417 -0
  325. package/foundation/discovery/component-replacement.test.mjs +480 -0
  326. package/foundation/discovery/docs-output-budget.d.mts +6 -2
  327. package/foundation/discovery/docs-output-budget.mjs +2 -1
  328. package/foundation/discovery/docs-section-key.d.mts +4 -2
  329. package/foundation/discovery/docs-section-key.mjs +1 -1
  330. package/foundation/discovery/module-exports.d.mts +10 -0
  331. package/foundation/discovery/module-exports.mjs +146 -0
  332. package/foundation/discovery/package-exports.d.mts +29 -0
  333. package/foundation/discovery/package-exports.mjs +200 -0
  334. package/foundation/discovery/template-adapter.d.mts +13 -0
  335. package/foundation/discovery/template-adapter.fixture-refs.test.mjs +37 -1
  336. package/foundation/discovery/template-adapter.mjs +16 -1
  337. package/foundation/discovery/theme-discovery.d.mts +78 -5
  338. package/foundation/discovery/theme-discovery.mjs +143 -18
  339. package/foundation/discovery/theme-discovery.test.mjs +9 -3
  340. package/foundation/discovery/theme-imports.d.mts +15 -0
  341. package/foundation/discovery/theme-imports.mjs +217 -0
  342. package/foundation/discovery/theme-imports.test.mjs +173 -0
  343. package/foundation/doc-compiler/doc-loads.test.mjs +18 -8
  344. package/foundation/doc-compiler/inputs.mjs +2 -1
  345. package/foundation/doc-compiler/lenses.d.mts +4 -2
  346. package/foundation/doc-compiler/lenses.mjs +1 -1
  347. package/foundation/doc-compiler/tree.test.mjs +2 -2
  348. package/foundation/fs/module-loader.d.mts +9 -0
  349. package/foundation/fs/module-loader.mjs +71 -2
  350. package/foundation/integrations/cli-requirement.d.mts +22 -0
  351. package/foundation/integrations/cli-requirement.mjs +31 -0
  352. package/foundation/integrations/cli-requirement.test.mjs +70 -0
  353. package/foundation/integrations/contribution-inventory.mjs +3 -3
  354. package/foundation/response/base.d.ts +9 -3
  355. package/foundation/response/json.d.mts +7 -4
  356. package/foundation/response/json.mjs +10 -6
  357. package/foundation/response/response-types.doc.d.mts +5 -5
  358. package/foundation/response/response-types.doc.mjs +50 -35
  359. package/foundation/response/response.doc.mjs +18 -4
  360. package/foundation/text/copyright-header.mjs +1 -1
  361. package/foundation/text/copyright-header.test.mjs +1 -1
  362. package/package.json +9 -9
  363. package/assets/docs/layout.doc.dense.mjs +0 -388
  364. package/assets/docs/layout.doc.mjs +0 -550
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import {jsonOut} from '../../../foundation/response/json.mjs';
8
- import {emit, section, text, records, code} from '../formatters/index.mjs';
8
+ import {emit, section, text, records, code, record} from '../formatters/index.mjs';
9
9
  import {cliError} from '../lib/cli-error.mjs';
10
10
  import {template as templateApi} from '../../../api/template/template.mjs';
11
11
  import {Project} from '../../../foundation/config/project.mjs';
@@ -111,6 +111,52 @@ export function registerTemplate(program) {
111
111
  case 'template.list': {
112
112
  const pages = result.data.filter(t => t.type === 'page');
113
113
  const blocks = result.data.filter(t => t.type === 'block');
114
+
115
+ // Bare `template` (no --list, no name) shows a grouped summary so a
116
+ // no-context agent or terminal doesn't receive 150 KB of catalog. The
117
+ // full catalog stays reachable via `template --list`.
118
+ if (!options.list && !name) {
119
+ /** @param {import('../../../api/template/template.type.mjs').TemplateListEntry[]} items */
120
+ const grouped = items => {
121
+ /** @type {Map<string, string[]>} */
122
+ const groups = new Map();
123
+ for (const t of items) {
124
+ const cat = t.category || 'Other';
125
+ const list = groups.get(cat);
126
+ if (list) {
127
+ list.push(t.id);
128
+ } else {
129
+ groups.set(cat, [t.id]);
130
+ }
131
+ }
132
+ /** @type {string[]} */
133
+ const lines = [];
134
+ for (const [cat, ids] of groups) {
135
+ lines.push(`${cat}: ${ids.join(', ')}`);
136
+ }
137
+ return lines.join('\n');
138
+ };
139
+ emit(
140
+ section(`Page Templates (${pages.length})`),
141
+ pages.length > 0 && text(grouped(pages)),
142
+ section(`Block Templates (${blocks.length})`),
143
+ blocks.length > 0 && text(grouped(blocks)),
144
+ section('Usage'),
145
+ text(
146
+ [
147
+ `${run} template <id> Show full source`,
148
+ `${run} template <id> [target-path] Scaffold page or block`,
149
+ `${run} template <id> --skeleton Layout reference`,
150
+ `${run} template --list Full catalog with descriptions`,
151
+ `${run} template --list --type block List only blocks`,
152
+ `${run} template --list --package <pkg> List from one package`,
153
+ `${run} template --cdn CDN starter page, no build step`,
154
+ ].join('\n'),
155
+ ),
156
+ );
157
+ break;
158
+ }
159
+
114
160
  // Project each entry to its JSON-mirroring fields; the WIP marker is
115
161
  // folded into `name` (as before) and the package is shown only when it
116
162
  // isn't the built-in core package.
@@ -146,6 +192,7 @@ export function registerTemplate(program) {
146
192
  case 'template.skeleton': {
147
193
  const {template: tName, description, components, skeleton} = result.data;
148
194
  emit(
195
+ record({package: result.package}),
149
196
  text(
150
197
  `# ${tName}${description ? ' — ' + description : ''}\n` +
151
198
  `# Components: ${components.join(', ')}`,
@@ -156,16 +203,33 @@ export function registerTemplate(program) {
156
203
  }
157
204
 
158
205
  case 'template.show': {
159
- // Source must survive piping byte-for-byte.
160
- emit(code(result.data.source));
206
+ // Source must survive piping byte-for-byte, so the package it comes
207
+ // from (cli-surface INV28) and the note about replaced demo media go
208
+ // to stderr, the note in the copy receipt's words. (Text mode only:
209
+ // --json returned above with both in the envelope.)
210
+ const {source, demoMediaReplaced} = result.data;
211
+ console.error(`package: ${result.package}`);
212
+ emit(code(source));
213
+ if (demoMediaReplaced > 0) {
214
+ console.error(
215
+ `Replaced ${demoMediaReplaced} Astryx demo media reference${demoMediaReplaced === 1 ? '' : 's'}: ` +
216
+ 'images now show a neutral placeholder and videos have an empty source. Supply your own media there.',
217
+ );
218
+ }
161
219
  break;
162
220
  }
163
221
 
164
222
  case 'template.copy': {
223
+ const {outputDir, fileName, demoMediaReplaced} = result.data;
224
+ const file = `${outputDir}/${fileName}`;
165
225
  emit(
166
- text(
167
- `Copied template to ${result.data.outputDir}/${result.data.fileName}`,
168
- ),
226
+ text(`Copied template to ${file}`),
227
+ record({package: result.package}),
228
+ demoMediaReplaced > 0 &&
229
+ text(
230
+ `Replaced ${demoMediaReplaced} Astryx demo media reference${demoMediaReplaced === 1 ? '' : 's'} in ${file}: ` +
231
+ 'images now show a neutral placeholder and videos have an empty source. Supply your own media there.',
232
+ ),
169
233
  );
170
234
  break;
171
235
  }
@@ -0,0 +1,62 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx template <name>` says how many demo media references it
5
+ * replaced: in `--json` as `demoMediaReplaced`, and in text on stderr, so that
6
+ * stdout stays exactly the source a copy writes and can be piped into a file.
7
+ */
8
+
9
+ import {describe, it, expect, beforeAll, afterAll} from 'vitest';
10
+ import * as fs from 'node:fs';
11
+ import * as os from 'node:os';
12
+ import * as path from 'node:path';
13
+ import {runCli} from '../../../test-utils/run-cli.mjs';
14
+ import {discoverTemplates} from '../../../api/template/template.mjs';
15
+
16
+ const SLOW = 60_000;
17
+
18
+ /** A page template whose source carries demo media, and one that carries none. */
19
+ async function pickPages() {
20
+ const pages = /** @type {Array<{dirName: string, type: string, filePath: string}>} */ (
21
+ await discoverTemplates()
22
+ ).filter(t => t.type === 'page' && fs.existsSync(t.filePath));
23
+ const hasMedia = (/** @type {{filePath: string}} */ t) =>
24
+ /\/template-assets\/[\w.-]+\.\w+/.test(fs.readFileSync(t.filePath, 'utf-8'));
25
+ const withMedia = pages.find(hasMedia);
26
+ const without = pages.find(t => !hasMedia(t));
27
+ if (!withMedia || !without) throw new Error('catalog lacks a page with and without demo media');
28
+ return {withMedia: withMedia.dirName, without: without.dirName};
29
+ }
30
+
31
+ describe('template show discloses replaced demo media', () => {
32
+ /** @type {string} */
33
+ let dir;
34
+ beforeAll(() => {
35
+ dir = fs.mkdtempSync(path.join(os.tmpdir(), 'tmpl-show-cli-'));
36
+ });
37
+ afterAll(() => fs.rmSync(dir, {recursive: true, force: true}));
38
+
39
+ it('--json carries demoMediaReplaced, and text states it on stderr with stdout left as the source', async () => {
40
+ const {withMedia} = await pickPages();
41
+ const json = await runCli(['template', withMedia, '--type', 'page', '--json'], dir);
42
+ expect(json.status).toBe(0);
43
+ const {data} = JSON.parse(json.stdout);
44
+ expect(data.demoMediaReplaced).toBeGreaterThan(0);
45
+
46
+ const human = await runCli(['template', withMedia, '--type', 'page'], dir);
47
+ expect(human.status).toBe(0);
48
+ expect(human.stdout.trimEnd()).toBe(data.source.trimEnd());
49
+ expect(human.stderr).toContain(
50
+ `Replaced ${data.demoMediaReplaced} Astryx demo media reference`,
51
+ );
52
+ }, SLOW);
53
+
54
+ it('says nothing about media when none was replaced', async () => {
55
+ const {without} = await pickPages();
56
+ const json = await runCli(['template', without, '--type', 'page', '--json'], dir);
57
+ expect(JSON.parse(json.stdout).data.demoMediaReplaced).toBe(0);
58
+ const human = await runCli(['template', without, '--type', 'page'], dir);
59
+ expect(human.status).toBe(0);
60
+ expect(human.stderr).not.toMatch(/demo media/i);
61
+ }, SLOW);
62
+ });
@@ -35,6 +35,17 @@ import {runCli} from '../../../test-utils/run-cli.mjs';
35
35
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
36
36
  const REPO_ROOT = path.resolve(__dirname, '../../../../..');
37
37
 
38
+ /**
39
+ * Response types whose text output is the artifact's source, printed byte for
40
+ * byte so it can be piped (spec cli-surface INV28). Their JSON still names the
41
+ * package; their text does not.
42
+ */
43
+ const VERBATIM_TYPES = new Set([
44
+ 'component.detail.source',
45
+ 'component.detail.showcase',
46
+ 'template.show',
47
+ ]);
48
+
38
49
  // ─── Helpers ────────────────────────────────────────────────────────────────
39
50
 
40
51
  /**
@@ -438,6 +449,24 @@ const CASES = [
438
449
  // Themes are rendered as list items, not records.
439
450
  skipFieldChecks: true,
440
451
  },
452
+ {
453
+ name: 'theme remove',
454
+ args: ['theme', 'remove', 'does-not-exist'],
455
+ errorExpected: true,
456
+ skipFieldChecks: true,
457
+ },
458
+ {
459
+ name: 'theme use',
460
+ args: ['theme', 'use', 'does-not-exist'],
461
+ errorExpected: true,
462
+ skipFieldChecks: true,
463
+ },
464
+ {
465
+ name: 'theme eject',
466
+ args: ['theme', 'eject', 'does-not-exist'],
467
+ errorExpected: true,
468
+ skipFieldChecks: true,
469
+ },
441
470
  {
442
471
  name: 'theme build',
443
472
  args: ['theme', 'build', 'nonexistent.ts'],
@@ -561,6 +590,15 @@ describe('text-json-parity', () => {
561
590
  expect(run.textStatus).toBe(run.jsonStatus);
562
591
  });
563
592
 
593
+ // spec cli-surface INV28: text names the package the envelope names.
594
+ // Verbatim source output prints only the source, so a pipe gets the
595
+ // file byte for byte.
596
+ it('text names the package the JSON envelope names', () => {
597
+ if (run.json?.package === undefined) return;
598
+ if (VERBATIM_TYPES.has(run.json.type)) return;
599
+ expect(run.text).toContain(run.json.package);
600
+ });
601
+
564
602
  if (!tc.skipFieldChecks && !tc.errorExpected) {
565
603
  it('every text record key exists in the JSON data', () => {
566
604
  if (!run.json?.data) return;
@@ -569,6 +607,8 @@ describe('text-json-parity', () => {
569
607
  if (run.json.meta) {
570
608
  for (const k of jsonLeafKeys(run.json.meta)) jsonKeys.add(k);
571
609
  }
610
+ // The envelope's own `package` (spec cli-surface INV28) is JSON too.
611
+ if (run.json.package !== undefined) jsonKeys.add('package');
572
612
  const violations = [];
573
613
  for (const key of textKeys.keys()) {
574
614
  if (!jsonKeys.has(key)) {
@@ -0,0 +1,132 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file Compatibility and deprecation coverage for the two-step theme-add lifecycle. */
4
+
5
+ import {afterEach, beforeEach, describe, expect, it} from 'vitest';
6
+ import * as fs from 'node:fs';
7
+ import * as os from 'node:os';
8
+ import * as path from 'node:path';
9
+ import {runCli} from '../../../test-utils/run-cli.mjs';
10
+
11
+ let tmpDir;
12
+
13
+ beforeEach(() => {
14
+ tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-theme-add-cli-'));
15
+ fs.mkdirSync(path.join(tmpDir, 'src'));
16
+ fs.writeFileSync(
17
+ path.join(tmpDir, 'package.json'),
18
+ JSON.stringify({name: 'app', private: true}),
19
+ );
20
+ });
21
+
22
+ afterEach(() => {
23
+ fs.rmSync(tmpDir, {recursive: true, force: true});
24
+ });
25
+
26
+ describe('theme add compatibility lifecycle', () => {
27
+ it('keeps copy stdout and emits one text-only deprecation warning', async () => {
28
+ const result = await runCli(['theme', 'add', 'neutral'], tmpDir);
29
+
30
+ expect(result.status, result.stderr).toBe(0);
31
+ expect(result.stdout).toContain(
32
+ '[ok] Added Neutral theme from @astryxdesign/cli to src/themes/neutral/',
33
+ );
34
+ expect(result.stdout).toContain('This is your copy of the Neutral theme');
35
+ expect(result.stderr.match(/source copying is deprecated/g)).toHaveLength(
36
+ 1,
37
+ );
38
+ expect(result.stderr).toContain('pnpm exec astryx theme eject neutral');
39
+ expect(result.stderr).toContain(
40
+ 'pnpm exec astryx theme add neutral --import',
41
+ );
42
+ expect(fs.existsSync(path.join(tmpDir, 'src/themes/neutral'))).toBe(true);
43
+ expect(fs.existsSync(path.join(tmpDir, 'src/astryx-themes.ts'))).toBe(
44
+ false,
45
+ );
46
+ });
47
+
48
+ it('keeps theme.add data and adds machine-readable deprecation metadata', async () => {
49
+ const result = await runCli(['theme', 'add', 'neutral', '--json'], tmpDir);
50
+
51
+ expect(result.status, result.stderr).toBe(0);
52
+ expect(result.stderr).not.toContain('source copying is deprecated');
53
+ expect(JSON.parse(result.stdout)).toMatchObject({
54
+ type: 'theme.add',
55
+ data: {
56
+ slug: 'neutral',
57
+ package: '@astryxdesign/cli',
58
+ outputDir: 'src/themes/neutral',
59
+ },
60
+ meta: {
61
+ deprecations: [
62
+ {
63
+ id: 'DEP-0005',
64
+ replacements: ['theme eject', 'theme add --import'],
65
+ },
66
+ ],
67
+ },
68
+ });
69
+ });
70
+
71
+ it('keeps the list JSON unchanged and names the stage commands in text', async () => {
72
+ fs.mkdirSync(path.join(tmpDir, 'src/themes/broken'), {recursive: true});
73
+ fs.writeFileSync(
74
+ path.join(tmpDir, 'src/themes/broken/brokenTheme.ts'),
75
+ 'export const brokenTheme = {};\n',
76
+ );
77
+
78
+ const textResult = await runCli(['theme', 'add', '--list'], tmpDir);
79
+ expect(textResult.status, textResult.stderr).toBe(0);
80
+ expect(textResult.stdout).toContain(
81
+ 'Import one: pnpm exec astryx theme add <slug> --import [--package <package>]',
82
+ );
83
+ expect(textResult.stdout).toContain(
84
+ 'Fork source: pnpm exec astryx theme eject <slug> [target-path]',
85
+ );
86
+ expect(textResult.stdout).not.toContain('theme add <slug> [target-path]');
87
+ expect(textResult.stderr).not.toContain('deprecated');
88
+
89
+ const result = await runCli(['theme', 'add', '--list', '--json'], tmpDir);
90
+
91
+ expect(result.status, result.stderr).toBe(0);
92
+ const payload = JSON.parse(result.stdout);
93
+ expect(payload).toMatchObject({type: 'theme.list'});
94
+ expect(payload.meta).toBeUndefined();
95
+ expect(payload.data.some(theme => theme.slug === 'broken')).toBe(false);
96
+ expect(Object.keys(payload.data[0]).sort()).toEqual([
97
+ 'description',
98
+ 'displayName',
99
+ 'maintained',
100
+ 'package',
101
+ 'slug',
102
+ ]);
103
+ expect(result.stderr).not.toContain('deprecated');
104
+ });
105
+
106
+ it.each([
107
+ ['target path', ['src/brand']],
108
+ ['overwrite', ['--overwrite']],
109
+ ])('rejects --import with a %s before writing', async (_label, extra) => {
110
+ const result = await runCli(
111
+ ['theme', 'add', 'neutral', '--import', ...extra, '--json'],
112
+ tmpDir,
113
+ );
114
+
115
+ expect(result.status).not.toBe(0);
116
+ expect(JSON.parse(result.stdout)).toMatchObject({
117
+ code: 'ERR_THEME_INVALID',
118
+ error: expect.stringContaining('cannot be combined'),
119
+ });
120
+ expect(fs.existsSync(path.join(tmpDir, 'src/astryx-themes.ts'))).toBe(
121
+ false,
122
+ );
123
+ expect(fs.existsSync(path.join(tmpDir, 'src/brand'))).toBe(false);
124
+ });
125
+
126
+ it('lists --import in help', async () => {
127
+ const result = await runCli(['theme', 'add', '--help'], tmpDir);
128
+
129
+ expect(result.status, result.stderr).toBe(0);
130
+ expect(result.stdout).toContain('--import');
131
+ });
132
+ });
@@ -1,12 +1,6 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- /**
4
- * @file CommandDoc for `astryx theme add`. The terminal binding of the
5
- * `themeAdd()` function (referenced via `fn`); its args/flags map to that
6
- * function's params so a converter can build Commander config + --help from one
7
- * source of truth.
8
- * @position packages/cli/clients/cli/commands — command documentation
9
- */
3
+ /** @file CommandDoc for `astryx theme add`. */
10
4
 
11
5
  /** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
12
6
  export const doc = {
@@ -14,11 +8,9 @@ export const doc = {
14
8
  name: 'theme add',
15
9
  displayName: 'astryx theme add',
16
10
  namespace: 'cli/commands',
17
- summary: 'Scaffold a theme into your project as editable source',
11
+ summary: 'Copy a theme, or import its built output into the app',
18
12
  description:
19
- "Copies a bundled or installed integration theme's source into your project so you own it. " +
20
- 'Writes are staged then renamed, rolling back on failure. Running it with no slug, or with ' +
21
- '--list, lists available themes; use --package when more than one owner provides the slug.',
13
+ 'With --import, records the theme in the generated app module and imports its built module and stylesheets. Without --import, keeps the released source-copy behavior, emits one text warning, and adds meta.deprecations with DEP-0005 and the theme eject/theme add --import replacements to JSON. A bare command or --list delegates to themeListCopySources() so the released list fields stay unchanged; use --package when owners share a slug.',
22
14
  fn: 'themeAdd',
23
15
  args: [
24
16
  {name: 'slug', param: 'slug', required: false},
@@ -28,10 +20,15 @@ export const doc = {
28
20
  {
29
21
  flag: '-f, --overwrite',
30
22
  param: 'options.overwrite',
31
- description:
32
- 'Replace existing files. Without it, existing files fail the command with ERR_FILE_EXISTS and nothing is written',
23
+ description: 'Replace copied files. Cannot be combined with --import',
33
24
  },
34
25
  {flag: '--list', description: 'List available themes'},
26
+ {
27
+ flag: '--import',
28
+ param: 'options.import',
29
+ description:
30
+ 'Use the built theme through the generated app module instead of copying source',
31
+ },
35
32
  {
36
33
  flag: '--package <package>',
37
34
  param: 'options.package',
@@ -39,18 +36,21 @@ export const doc = {
39
36
  },
40
37
  ],
41
38
  examples: [
42
- {label: 'Scaffold a theme', cli: 'astryx theme add matcha'},
43
39
  {
44
- label: 'Pick the owner when two packages ship the same slug',
45
- cli: 'astryx theme add ocean --package @acme/themes',
40
+ label: 'Import a built theme into the app',
41
+ cli: 'astryx theme add ocean --import',
42
+ },
43
+ {
44
+ label: 'Select a package theme over a local theme',
45
+ cli: 'astryx theme add ocean --import --package @acme/themes',
46
46
  },
47
47
  ],
48
48
  exitCodes: [
49
- {code: 0, when: 'success'},
49
+ {code: 0, when: 'the theme is listed, copied, or imported'},
50
50
  {
51
51
  code: 1,
52
- when: 'unknown or ambiguous theme, a path escape, a missing descriptor or source, or an existing file without --overwrite',
52
+ when: 'the theme, its source or built imports, its record, the target path, or the option combination is invalid',
53
53
  },
54
54
  ],
55
- related: ['theme list', 'theme build'],
55
+ related: ['theme list', 'theme remove', 'theme use', 'theme eject'],
56
56
  };
@@ -0,0 +1,47 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file CommandDoc for `astryx theme eject`. */
4
+
5
+ /** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
6
+ export const doc = {
7
+ type: 'command',
8
+ name: 'theme eject',
9
+ displayName: 'astryx theme eject',
10
+ namespace: 'cli/commands',
11
+ summary: 'Fork a theme as editable local source',
12
+ description:
13
+ "Copies a bundled or installed package theme's complete source into the local themes root, including a local descriptor. Writes are atomic. Existing files require --overwrite. Use --package when package themes share a slug.",
14
+ fn: 'themeEject',
15
+ args: [
16
+ {name: 'slug', param: 'slug', required: true},
17
+ {name: 'path', param: 'options.targetPath', required: false},
18
+ ],
19
+ options: [
20
+ {
21
+ flag: '-f, --overwrite',
22
+ param: 'options.overwrite',
23
+ description:
24
+ 'Replace existing files. Without it, an existing file fails with ERR_FILE_EXISTS and nothing is written',
25
+ },
26
+ {
27
+ flag: '--package <package>',
28
+ param: 'options.package',
29
+ description: 'Select the package that owns the theme',
30
+ },
31
+ ],
32
+ examples: [
33
+ {label: 'Fork a theme into the local root', cli: 'astryx theme eject ocean'},
34
+ {
35
+ label: 'Fork one package theme elsewhere',
36
+ cli: 'astryx theme eject ocean src/themes/my-ocean --package @acme/themes',
37
+ },
38
+ ],
39
+ exitCodes: [
40
+ {code: 0, when: 'all source and descriptor files are written'},
41
+ {
42
+ code: 1,
43
+ when: 'the theme is unknown or ambiguous, a path escapes, a source file is missing, or a destination exists',
44
+ },
45
+ ],
46
+ related: ['theme add', 'theme build', 'theme list'],
47
+ };
@@ -0,0 +1,44 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file CLI behavior for `astryx theme list`.
5
+ *
6
+ * `theme list` shows the themes this project can add now. Themes in packages
7
+ * it has not installed are `discover`'s, so the list ends by pointing there:
8
+ * an agent that never learns `discover` exists searches the registry instead.
9
+ */
10
+
11
+ import {describe, it, expect, beforeEach, afterEach} from 'vitest';
12
+ import * as fs from 'node:fs';
13
+ import * as path from 'node:path';
14
+ import * as os from 'node:os';
15
+ import {runCli} from '../../../test-utils/run-cli.mjs';
16
+
17
+ let tmpDir;
18
+ beforeEach(() => {
19
+ tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-cli-theme-list-'));
20
+ });
21
+ afterEach(() => {
22
+ fs.rmSync(tmpDir, {recursive: true, force: true});
23
+ });
24
+
25
+ describe('astryx theme list', () => {
26
+ it('lists bundled themes and points at import, eject, and discover', async () => {
27
+ const {status, stdout} = await runCli(['theme', 'list'], {cwd: tmpDir});
28
+
29
+ expect(status).toBe(0);
30
+ expect(stdout).toMatch(/^slug:\s+neutral$/m);
31
+ expect(stdout).toMatch(/^package:\s+@astryxdesign\/cli$/m);
32
+ expect(stdout).toMatch(/Import one: .*theme add <slug> --import/m);
33
+ expect(stdout).toMatch(/Fork source: .*theme eject <slug>/m);
34
+ expect(stdout).toMatch(/More themes in packages you could add: .*discover theme$/m);
35
+ });
36
+
37
+ it('keeps the JSON envelope free of the hint', async () => {
38
+ const {status, stdout} = await runCli(['--json', 'theme', 'list'], {cwd: tmpDir});
39
+
40
+ expect(status).toBe(0);
41
+ expect(stdout).not.toContain('discover');
42
+ expect(JSON.parse(stdout).type).toBe('theme.list');
43
+ });
44
+ });
@@ -16,8 +16,8 @@ export const doc = {
16
16
  namespace: 'cli/commands',
17
17
  summary: 'List themes available to add',
18
18
  description:
19
- 'Lists themes bundled with this CLI and source themes contributed by installed integrations, ' +
20
- 'each with its slug, display name, description, maintained flag, and owner package.',
19
+ 'Lists bundled, package, and local themes with their owner, source, added state, and default state. ' +
20
+ 'Earlier descriptor-less copies are not listed as themes; the receipt names them with the upgrade command.',
21
21
  fn: 'themeListAvailable',
22
22
  options: [
23
23
  {
@@ -21,8 +21,7 @@ export const doc = {
21
21
  'JSON is also supported. Existing author-owned files are left untouched unless --overwrite is explicit. ' +
22
22
  'When used in a theme integration, keep the palette request under the theme slug, ' +
23
23
  'write the candidate and receipt under that same slug, import the candidate from the theme source, ' +
24
- 'and keep all three inside the theme directory: `astryx theme add` copies that whole ' +
25
- 'directory into the consumer project, so nothing else has to list them.',
24
+ 'and keep all three inside the theme directory. The package ships that directory as one source unit for discovery and explicit eject, while apps use its built exports.',
26
25
  fn: 'themePaletteGenerate',
27
26
  args: [{name: 'config', param: 'configPath', required: true}],
28
27
  options: [
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file CommandDoc for `astryx theme remove`. */
4
+
5
+ /** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
6
+ export const doc = {
7
+ type: 'command',
8
+ name: 'theme remove',
9
+ displayName: 'astryx theme remove',
10
+ namespace: 'cli/commands',
11
+ summary: 'Remove a non-default theme from the app',
12
+ description:
13
+ 'Removes one added theme from the generated module and regenerates the whole module. Choose another default with theme use before removing the current default.',
14
+ fn: 'themeRemove',
15
+ args: [{name: 'slug', param: 'slug', required: true}],
16
+ examples: [{label: 'Remove an added theme', cli: 'astryx theme remove ocean'}],
17
+ exitCodes: [
18
+ {code: 0, when: 'the module is regenerated without the theme'},
19
+ {code: 1, when: 'the theme is not added, is the default, or state is invalid'},
20
+ ],
21
+ related: ['theme add', 'theme use', 'theme list'],
22
+ };
@@ -19,8 +19,9 @@ export const doc = {
19
19
  'Writes theme.template.ts: the annotated reference for the whole theme surface, covering every ' +
20
20
  'defineTheme field, the token families, the component override syntax, and how a theme is ' +
21
21
  'consumed, naming the CLI command that prints the authoritative reference for each. Read ' +
22
- 'it, copy what you need into your own theme file, delete it. Use `theme add <slug>` instead ' +
23
- 'to start from a theme we ship. Leaves an existing file untouched unless --overwrite.',
22
+ 'it, copy what you need into your own theme file, delete it. Use `theme add <slug> --import` to ' +
23
+ 'use an installed built theme, extend that theme for ordinary customization, or use ' +
24
+ '`theme eject <slug>` for a complete source fork. Leaves an existing file untouched unless --overwrite.',
24
25
  fn: 'themeTemplate',
25
26
  args: [{name: 'path', param: 'options.targetPath', required: false}],
26
27
  options: [
@@ -38,5 +39,5 @@ export const doc = {
38
39
  {code: 0, when: 'success, including when an existing file was left untouched'},
39
40
  {code: 1, when: 'the target path escapes the project, or the file cannot be written'},
40
41
  ],
41
- related: ['theme add', 'theme list', 'theme build'],
42
+ related: ['theme add', 'theme eject', 'theme list', 'theme build'],
42
43
  };
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file CommandDoc for `astryx theme use`. */
4
+
5
+ /** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
6
+ export const doc = {
7
+ type: 'command',
8
+ name: 'theme use',
9
+ displayName: 'astryx theme use',
10
+ namespace: 'cli/commands',
11
+ summary: 'Choose the app default from its added themes',
12
+ description:
13
+ 'Sets one added slug as the default and regenerates the generated theme module. Add the theme first if it is not already in the app.',
14
+ fn: 'themeUse',
15
+ args: [{name: 'slug', param: 'slug', required: true}],
16
+ examples: [{label: 'Choose the default theme', cli: 'astryx theme use ocean'}],
17
+ exitCodes: [
18
+ {code: 0, when: 'the module is regenerated with the selected default'},
19
+ {code: 1, when: 'the theme is not added or state is invalid'},
20
+ ],
21
+ related: ['theme add', 'theme remove', 'theme list'],
22
+ };