@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
@@ -137,7 +137,7 @@ describe('progressive reads', () => {
137
137
  const full = await runCli(['docs', 'theme', '--full']);
138
138
  expect(full.status).toBe(0);
139
139
  expect(full.stdout).toMatch(/^## Wrap your app in a theme/m);
140
- expect(full.stdout.length).toBeGreaterThan(index.stdout.length * 3);
140
+ expect(full.stdout.length).toBeGreaterThan(index.stdout.length);
141
141
  expect((await runCli(['--detail', 'full', 'docs', 'theme', '--full'])).stdout).toBe(
142
142
  full.stdout,
143
143
  );
@@ -198,8 +198,7 @@ describe('blocks as text', () => {
198
198
  it('prints the labels of a real section above their fences', async () => {
199
199
  const {status, stdout} = await runCli(['docs', 'theme', 'quick-start']);
200
200
  expect(status).toBe(0);
201
- expect(stdout).toContain('Install a theme package:\n```bash\nnpm install');
202
- expect(stdout).not.toContain('// Install a theme package');
201
+ expect(stdout).toContain('Basic theme setup:\n```tsx\nimport {Theme}');
203
202
  }, SLOW);
204
203
  });
205
204
 
@@ -8,11 +8,16 @@ export const doc = {
8
8
  name: 'doctor integration components',
9
9
  displayName: 'astryx doctor integration components',
10
10
  namespace: 'cli/commands',
11
- summary: 'Warn when integration component names conflict with Core',
11
+ summary: 'Check integration component names and replacements against Core',
12
12
  description:
13
13
  'Compares one local or installed integration with Core component names. A ' +
14
14
  'conflict is allowed and exits successfully, but the report recommends ' +
15
- 'renaming and gives the exact --package command for an intentional overlap.',
15
+ 'renaming and gives the exact --package command for an intentional overlap. ' +
16
+ "It also checks each component's replaces: in a package that declares the CLI " +
17
+ 'range that turns replacement on, a missing Core target, an invalid value, a ' +
18
+ 'component named after a different Core component, or two replacements for one ' +
19
+ 'Core component is an error. In a package without that range they are warnings, ' +
20
+ 'with one more warning naming the range to declare.',
16
21
  fn: 'integrationComponentConflicts',
17
22
  args: [
18
23
  {
@@ -31,8 +36,14 @@ export const doc = {
31
36
  },
32
37
  ],
33
38
  exitCodes: [
34
- {code: 0, when: 'the check completed; component conflicts are warnings'},
35
- {code: 1, when: 'the integration is invalid or Core cannot be resolved'},
39
+ {
40
+ code: 0,
41
+ when: 'the check completed; component name conflicts, and replaces findings for a package without the CLI range, are warnings',
42
+ },
43
+ {
44
+ code: 1,
45
+ when: 'the integration is invalid, Core cannot be resolved, or a package that declares the CLI range has an invalid replaces',
46
+ },
36
47
  ],
37
48
  related: ['doctor integration templates', 'component'],
38
49
  };
@@ -16,7 +16,7 @@ export const doc = {
16
16
  summary: 'Diagnose Astryx projects and integration packages',
17
17
  description:
18
18
  'Runs read-only project health diagnostics by default: Node version, @astryxdesign/core ' +
19
- 'install and version alignment, themes, config, integrations (linked without a config entry, ' +
19
+ 'install and version alignment, generated app themes when present, earlier copied-theme migration, config, integrations (linked without a config entry, ' +
20
20
  'provider identity, contribution issues), agent docs, core peer dependencies, package manager, ' +
21
21
  "and the docs the CLI reads. It writes nothing, but loading astryx.config runs that file's code. " +
22
22
  'The `integration` subcommands provide authoring checks for one integration package.',
@@ -258,10 +258,10 @@ async function runProjectDoctor(program) {
258
258
  async function runIntegrationValidation(program, pkg) {
259
259
  const result = await validateIntegration(pkg);
260
260
  if (program.opts().json) jsonOut(result);
261
- else if (result.data.name === null) {
261
+ else if (!result.data.validated) {
262
262
  emit(
263
263
  text(
264
- 'No astryx.integration.* found next to package.json. ' +
264
+ 'Nothing was validated: no astryx.integration.* found next to package.json. ' +
265
265
  'To validate an installed integration: astryx doctor integration validate <package>',
266
266
  ),
267
267
  );
@@ -284,10 +284,10 @@ async function runAuthoringCheck(program, pkg, kind) {
284
284
  : await integrationDocConflicts(pkg);
285
285
 
286
286
  if (program.opts().json) jsonOut(result);
287
- else if (result.data.name === null) {
287
+ else if (!result.data.validated) {
288
288
  emit(
289
289
  text(
290
- 'No astryx.integration.* found next to package.json. ' +
290
+ 'Nothing was checked: no astryx.integration.* found next to package.json. ' +
291
291
  `To check an installed integration: astryx doctor integration ${kind} <package>`,
292
292
  ),
293
293
  );
@@ -14,7 +14,6 @@ import {
14
14
  checkNodeVersion,
15
15
  checkCoreInstalled,
16
16
  checkVersionAlignment,
17
- checkThemes,
18
17
  checkConfig,
19
18
  checkAgentDocs,
20
19
  checkPeerDeps,
@@ -63,33 +62,6 @@ function installPkg(name, version = '1.0.0') {
63
62
  return dir;
64
63
  }
65
64
 
66
- /**
67
- * Mirror pnpm's layout: the real package lives under node_modules/.pnpm and
68
- * the entry in the scope directory is a symlink to it.
69
- */
70
- function installPkgPnpmStyle(name, version = '1.0.0') {
71
- const realDir = path.join(
72
- tmpDir,
73
- 'node_modules',
74
- '.pnpm',
75
- `${name.replace('/', '+')}@${version}`,
76
- 'node_modules',
77
- ...name.split('/'),
78
- );
79
- fs.mkdirSync(realDir, {recursive: true});
80
- fs.writeFileSync(
81
- path.join(realDir, 'package.json'),
82
- JSON.stringify({name, version, main: 'index.js'}),
83
- );
84
- fs.writeFileSync(path.join(realDir, 'index.js'), 'module.exports = {};');
85
- const linkPath = path.join(tmpDir, 'node_modules', ...name.split('/'));
86
- fs.mkdirSync(path.dirname(linkPath), {recursive: true});
87
- // 'junction' keeps this working on Windows without elevated permissions;
88
- // it is ignored on posix.
89
- fs.symlinkSync(realDir, linkPath, 'junction');
90
- return linkPath;
91
- }
92
-
93
65
  function find(checks, id) {
94
66
  return checks.find(c => c.id === id);
95
67
  }
@@ -128,29 +100,15 @@ describe('doctor — individual checks', () => {
128
100
  expect(res.status).toBe('info');
129
101
  });
130
102
 
131
- it('themes: WARN when no theme packages installed', () => {
132
- const res = checkThemes({cwd: tmpDir, configTheme: null});
133
- expect(res.status).toBe('warn');
134
- });
135
-
136
- it('themes: WARN when theme installed but not wired', () => {
137
- installPkg('@astryxdesign/theme-neutral', '0.0.14');
138
- const res = checkThemes({cwd: tmpDir, configTheme: null});
139
- expect(res.status).toBe('warn');
140
- expect(res.message).toContain('@astryxdesign/theme-neutral');
141
- });
142
-
143
- it('themes: PASS when theme installed and wired via config', () => {
144
- installPkg('@astryxdesign/theme-neutral', '0.0.14');
145
- const res = checkThemes({cwd: tmpDir, configTheme: 'default'});
146
- expect(res.status).toBe('pass');
147
- });
148
-
149
- it('themes: detects pnpm-style symlinked theme packages (#3530)', () => {
150
- installPkgPnpmStyle('@astryxdesign/theme-neutral', '0.1.2');
151
- const res = checkThemes({cwd: tmpDir, configTheme: 'default'});
152
- expect(res.status).toBe('pass');
153
- expect(res.message).toContain('@astryxdesign/theme-neutral');
103
+ it('app themes: reports unmanaged state as one INFO check', async () => {
104
+ fs.writeFileSync(path.join(tmpDir, 'package.json'), '{"name":"app"}\n');
105
+ const result = await runChecks({cwd: tmpDir});
106
+ const themeChecks = result.checks.filter(check =>
107
+ check.id.startsWith('theme-'),
108
+ );
109
+ expect(themeChecks).toEqual([
110
+ expect.objectContaining({id: 'theme-management', status: 'info'}),
111
+ ]);
154
112
  });
155
113
 
156
114
  it('config: INFO when no astryx.config.mjs', async () => {
@@ -13,7 +13,7 @@ export const doc = {
13
13
  namespace: 'cli/commands',
14
14
  summary: 'Report a missing component or feature to the package that owns it',
15
15
  description:
16
- 'Reports a missing component, variant, layout, styling, accessibility, API, or documentation capability to the package that owns it: the --package you name, else the one package that provides the component, else Core. ' +
16
+ 'Reports a missing component, variant, layout, styling, accessibility, API, or documentation capability to the package that owns it: the --package you name, else the integration whose component replaces it, else the one package that provides the component, else Core. ' +
17
17
  'Every configured handler receives the report: the project config handler first, then each integration handler in config order. Public handlers run only with --confirm-public; internal handlers always run. A failing handler does not stop the others. ' +
18
18
  "With no handler it files a GitHub issue for the owning package, only with --confirm-public (without it nothing is sent), or returns the package's issues URL when that is not on GitHub. " +
19
19
  'The report records whether an agent or a person ran it.',
@@ -49,7 +49,7 @@ export const doc = {
49
49
  flag: '--package <pkg>',
50
50
  param: 'options.package',
51
51
  description:
52
- 'Package that owns the gap: @astryxdesign/core or a loaded integration. Overrides automatic routing; needed when more than one package provides the component',
52
+ 'Package that owns the gap: @astryxdesign/core or a loaded integration. Overrides automatic routing, which picks the integration whose component replaces the named Core component, else the one package that provides it, else Core; needed when more than one package provides the component',
53
53
  },
54
54
  {
55
55
  flag: '--confirm-public',
@@ -55,6 +55,18 @@ export function registerGapReport(program) {
55
55
  result.type === 'gap-report.file' &&
56
56
  (result.data.status === 'failed' || result.data.status === 'partial');
57
57
 
58
+ // stderr in both modes, so a caller that reads only the exit code or the
59
+ // JSON envelope still sees which delivery failed and why.
60
+ if (isFailure && result.type === 'gap-report.file') {
61
+ for (const delivery of result.data.deliveries) {
62
+ if (delivery.status === 'failed') {
63
+ console.error(
64
+ `gap-report: delivery to ${delivery.handler} failed: ${delivery.message ?? 'no message'}`,
65
+ );
66
+ }
67
+ }
68
+ }
69
+
58
70
  if (program.opts().json) {
59
71
  jsonOut(result);
60
72
  if (isFailure) process.exitCode = 1;
@@ -172,6 +172,69 @@ export default {};\n`,
172
172
  }
173
173
  });
174
174
 
175
+ it('exits nonzero and names the integration on stderr when one fails to load', async () => {
176
+ const cwd = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-gap-broken-'));
177
+ try {
178
+ fs.writeFileSync(
179
+ path.join(cwd, 'package.json'),
180
+ JSON.stringify({name: 'fixture-app'}),
181
+ );
182
+ fs.writeFileSync(
183
+ path.join(cwd, 'astryx.config.mjs'),
184
+ "export default {integrations: ['@test/broken']};\n",
185
+ );
186
+ const integrationDir = path.join(cwd, 'node_modules', '@test', 'broken');
187
+ fs.mkdirSync(integrationDir, {recursive: true});
188
+ fs.writeFileSync(
189
+ path.join(integrationDir, 'package.json'),
190
+ JSON.stringify({
191
+ name: '@test/broken',
192
+ version: '1.0.0',
193
+ type: 'module',
194
+ }),
195
+ );
196
+ fs.writeFileSync(
197
+ path.join(integrationDir, 'astryx.integration.mjs'),
198
+ "throw new Error('intentional integration load failure');\n",
199
+ );
200
+
201
+ const cli = await runCli(
202
+ [
203
+ 'gap-report',
204
+ 'General',
205
+ '--category',
206
+ 'docs_gap',
207
+ '--reason',
208
+ 'Need a keyboard example',
209
+ '--json',
210
+ ],
211
+ {cwd},
212
+ );
213
+
214
+ expect(cli.status).toBe(1);
215
+ expect(JSON.parse(cli.stdout)).toMatchObject({
216
+ type: 'gap-report.file',
217
+ data: {
218
+ status: 'failed',
219
+ filedCount: 0,
220
+ deliveries: [
221
+ {
222
+ handlerType: 'integration',
223
+ handler: '@test/broken',
224
+ status: 'failed',
225
+ },
226
+ ],
227
+ },
228
+ });
229
+ expect(cli.stderr).toContain(
230
+ 'gap-report: delivery to @test/broken failed:',
231
+ );
232
+ expect(cli.stderr).toContain('intentional integration load failure');
233
+ } finally {
234
+ fs.rmSync(cwd, {recursive: true, force: true});
235
+ }
236
+ });
237
+
175
238
  it('reports missing required fields through the JSON error contract', async () => {
176
239
  const cli = await runCli(['gap-report', 'Button', '--json']);
177
240
  expect(cli.status).toBe(1);
@@ -14,7 +14,7 @@ import {
14
14
  } from '../../lib/hook-format.mjs';
15
15
  import {getCliInvocation} from '../../../../foundation/env/package-manager.mjs';
16
16
  import {jsonOut} from '../../../../foundation/response/json.mjs';
17
- import {emit, section, text, list, records, code} from '../../formatters/index.mjs';
17
+ import {emit, section, text, list, records, code, record} from '../../formatters/index.mjs';
18
18
  import {cliError} from '../../lib/cli-error.mjs';
19
19
  import {defineCommand} from '../../lib/define-command.mjs';
20
20
  import {resultSet} from '../../../../foundation/debug/index.mjs';
@@ -103,6 +103,7 @@ export function registerHook(program) {
103
103
  // ── Text output ────────────────────────────────────────────
104
104
  switch (result.type) {
105
105
  case 'hook.list': {
106
+ emit(record({package: result.package}));
106
107
  // One list type across all three detail levels; the depth is carried
107
108
  // in result.data.detail and the grouped map in result.data.components.
108
109
  if (result.data.detail === 'full') {
@@ -172,6 +173,7 @@ export function registerHook(program) {
172
173
  // under `component <name> --blocks`.
173
174
  const related = result.data.relatedComponents ?? [];
174
175
  emit(
176
+ record({package: result.package}),
175
177
  code(doc),
176
178
  related.length > 0 &&
177
179
  text(
@@ -182,7 +184,10 @@ export function registerHook(program) {
182
184
  }
183
185
 
184
186
  case 'hook.detail.params': {
185
- emit(code(formatHookParams({params: result.data, name})));
187
+ emit(
188
+ record({package: result.package}),
189
+ code(formatHookParams({params: result.data, name})),
190
+ );
186
191
  break;
187
192
  }
188
193
  }
@@ -85,7 +85,7 @@ describe('import hint correctness', () => {
85
85
  }
86
86
  });
87
87
 
88
- describe('CLI --detail brief shows correct import path', () => {
88
+ describe('CLI --detail compact shows correct import path', () => {
89
89
  // Test a representative set across different patterns
90
90
  const representative = [
91
91
  {name: 'Button', expected: '@astryxdesign/core/Button'},
@@ -101,8 +101,8 @@ describe('import hint correctness', () => {
101
101
  ];
102
102
 
103
103
  for (const {name, expected} of representative) {
104
- it(`npx astryx component ${name} --detail brief shows ${expected}`, async () => {
105
- const result = await runCli(['component', name, '--detail', 'brief'], REPO_ROOT);
104
+ it(`npx astryx component ${name} --detail compact shows ${expected}`, async () => {
105
+ const result = await runCli(['component', name, '--detail', 'compact'], REPO_ROOT);
106
106
  expect(result.code).toBe(0);
107
107
  expect(result.stdout).toContain(expected);
108
108
  });
@@ -179,11 +179,11 @@ describe('import hint correctness', () => {
179
179
  }
180
180
  });
181
181
 
182
- it('component <Name> --detail brief also shows the integration package', async () => {
182
+ it('component <Name> --detail compact also shows the integration package', async () => {
183
183
  const fixtureDir = createIntegrationFixture();
184
184
  try {
185
185
  const result = await runCli(
186
- ['component', 'Widget', '--detail', 'brief'],
186
+ ['component', 'Widget', '--detail', 'compact'],
187
187
  fixtureDir,
188
188
  );
189
189
  expect(result.code).toBe(0);
@@ -1,22 +1,11 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file Regression test for `astryx init` "Next steps" theme guidance.
4
+ * @file Regression tests for `astryx init` app-theme next steps.
5
5
  *
6
- * The init command previously steered users toward the slower runtime
7
- * style-injection path:
8
- *
9
- * import { neutralTheme } from '@astryxdesign/theme-neutral'
10
- * <Theme theme={neutralTheme}>...</Theme>
11
- *
12
- * ...which contradicted the runtime console warning emitted by core's
13
- * <Theme> component (packages/core/src/theme/Theme.tsx) recommending the
14
- * pre-built path, and left users with an unstyled app because the base CSS
15
- * imports were never mentioned (facebook/astryx#3080).
16
- *
17
- * These assertions lock in the corrected guidance: base CSS imports, the
18
- * pre-built (`/built` + `theme.css`) theme path, and the custom-theme build
19
- * command.
6
+ * The guidance follows the generated-module workflow: base CSS once, add an
7
+ * installed theme, import the generated record once, extend to customize, and
8
+ * eject only to make an independent source fork.
20
9
  */
21
10
 
22
11
  import {describe, it, expect} from 'vitest';
@@ -30,17 +19,23 @@ describe('init Next steps theme guidance', () => {
30
19
  expect(text).toContain("'@astryxdesign/core/astryx.css'");
31
20
  });
32
21
 
33
- it('uses the pre-built theme path matching the runtime recommendation', () => {
34
- expect(text).toContain("'@astryxdesign/theme-neutral/built'");
35
- expect(text).toContain("'@astryxdesign/theme-neutral/theme.css'");
22
+ it('adds an installed theme through the CLI', () => {
23
+ expect(text).toContain('npm install @astryxdesign/theme-neutral');
24
+ expect(text).toContain('npx astryx theme add neutral --import');
25
+ });
26
+
27
+ it('wires the generated theme record once', () => {
28
+ expect(text).toContain("{ themes, defaultThemeSlug } from './astryx-themes'");
29
+ expect(text).toContain('themes[defaultThemeSlug]');
36
30
  });
37
31
 
38
- it('mentions building custom themes via `astryx theme build`', () => {
39
- expect(text).toContain('astryx theme build <file>');
32
+ it('names extension for customization and eject only for a source fork', () => {
33
+ expect(text).toContain('Extend an imported theme');
34
+ expect(text).toContain('npx astryx theme eject <slug>');
35
+ expect(text).toContain('only to fork source');
40
36
  });
41
37
 
42
- it('does not steer users to the runtime style-injection import', () => {
43
- // The bare source import (no `/built`) is the slow runtime-injection path.
44
- expect(text).not.toContain("from '@astryxdesign/theme-neutral'");
38
+ it('does not teach a direct package theme import', () => {
39
+ expect(text).not.toContain("from '@astryxdesign/theme-neutral");
45
40
  });
46
41
  });
@@ -56,6 +56,12 @@ export const doc = {
56
56
  description:
57
57
  "Namespace of this package to place the doc in, as a guide in its `guides` slot; writes the namespace doc when it is missing, and declares the CLI that reads it as an optional `@astryxdesign/cli` peer. Only valid for doc, and not with --replaces or --extends",
58
58
  },
59
+ {
60
+ flag: '--from <theme>',
61
+ param: 'options.from',
62
+ description:
63
+ 'Existing theme slug to fork as a starting point instead of a blank scaffold; the new theme copies the base and has no link back, and package.json `dependencies` gains the npm packages the copied files import (other than Core and React). Only valid for theme',
64
+ },
59
65
  {
60
66
  flag: '--to <version>',
61
67
  param: 'options.to',
@@ -102,6 +108,10 @@ export const doc = {
102
108
  cli: "astryx integration add agent-doc 'Run acme verify before finishing.'",
103
109
  },
104
110
  {label: 'Add a source theme', cli: 'astryx integration add theme ocean'},
111
+ {
112
+ label: 'Fork an existing theme',
113
+ cli: 'astryx integration add theme ocean --from neutral',
114
+ },
105
115
  ],
106
116
  exitCodes: [
107
117
  {code: 0, when: 'the contribution is written or the dry run succeeds'},
@@ -174,11 +174,21 @@ describe('integration authoring CLI', () => {
174
174
  expect(text.stdout).toBe(verifyText.stdout);
175
175
  expect(text.stderr).toContain('`integration pack --check` is deprecated');
176
176
  expect(text.stderr).toContain('astryx integration verify');
177
- // Without --check it fails, as it did, and names both spellings.
177
+ // Without --check it fails, as it did, and points only at the new name:
178
+ // suggesting `--check` would send people to the deprecated spelling.
178
179
  const bare = await runCli(['integration', 'pack'], tmpDir);
179
180
  expect(bare.status).not.toBe(0);
180
- expect(bare.stderr).toContain('--check');
181
+ expect(bare.stderr).toContain(
182
+ '`integration pack` is now `integration verify`',
183
+ );
181
184
  expect(bare.stderr).toContain('astryx integration verify');
185
+ expect(bare.stderr).toContain('npm pack');
186
+ expect(bare.stderr).not.toContain('--check');
187
+ const bareJson = await runCli(['--json', 'integration', 'pack'], tmpDir);
188
+ expect(parseEnvelope(bareJson.stdout)).toMatchObject({
189
+ code: 'ERR_INVALID_ARGUMENT',
190
+ error: expect.stringContaining('astryx integration verify'),
191
+ });
182
192
  // Help lists it, marked deprecated: nothing is hidden.
183
193
  const help = await runCli(['integration', '--help'], tmpDir);
184
194
  expect(help.stdout).toMatch(
@@ -3,7 +3,8 @@
3
3
  /**
4
4
  * @file Real package-boundary coverage for integration authoring. Authors a
5
5
  * provider through the CLI, packs it, installs the tarball into a separate
6
- * no-config consumer, then exercises packed docs, codemods, and source themes.
6
+ * no-config consumer, then exercises packed docs, codemods, built themes, and
7
+ * explicit source ejection.
7
8
  */
8
9
 
9
10
  import {afterEach, describe, expect, it} from 'vitest';
@@ -201,6 +202,15 @@ export const oceanTheme = defineTheme({
201
202
  });
202
203
  `,
203
204
  );
205
+ const providerBuild = await runCli(
206
+ ['theme', 'build', 'themes/ocean/oceanTheme.ts', '--json'],
207
+ providerDir,
208
+ );
209
+ expect(providerBuild.status, providerBuild.stderr).toBe(0);
210
+ expect(parseEnvelope(providerBuild.stdout)).toMatchObject({
211
+ type: 'theme.build',
212
+ data: {name: 'ocean'},
213
+ });
204
214
 
205
215
  const providerPackage = JSON.parse(
206
216
  fs.readFileSync(path.join(providerDir, 'package.json'), 'utf-8'),
@@ -313,8 +323,8 @@ export const oceanTheme = defineTheme({
313
323
  expect(fs.lstatSync(alternateInstalledDir).isSymbolicLink()).toBe(false);
314
324
 
315
325
  // The consumer installs both providers from tarballs. Link this checkout's
316
- // Core package as the consumer's normal app dependency so the copied source
317
- // can resolve the same peer it would get from `npm install @astryxdesign/core`.
326
+ // Core package as the consumer's normal app dependency so an ejected source
327
+ // can build against the same peer it would get from `npm install @astryxdesign/core`.
318
328
  const coreScope = path.join(consumerDir, 'node_modules', '@astryxdesign');
319
329
  const coreLink = path.join(coreScope, 'core');
320
330
  fs.mkdirSync(coreScope, {recursive: true});
@@ -427,7 +437,7 @@ export const oceanTheme = defineTheme({
427
437
  }
428
438
 
429
439
  const ambiguous = await runCli(
430
- ['theme', 'add', 'ocean', 'src/themes/ambiguous', '--json'],
440
+ ['theme', 'add', 'ocean', '--json'],
431
441
  consumerDir,
432
442
  );
433
443
  expect(ambiguous.status).not.toBe(0);
@@ -435,11 +445,50 @@ export const oceanTheme = defineTheme({
435
445
  code: 'ERR_AMBIGUOUS_THEME',
436
446
  });
437
447
 
448
+ const addedTheme = await runCli(
449
+ [
450
+ 'theme',
451
+ 'add',
452
+ 'ocean',
453
+ '--import',
454
+ '--package',
455
+ '@acme/brand-integration',
456
+ '--json',
457
+ ],
458
+ consumerDir,
459
+ );
460
+ expect(addedTheme.status, addedTheme.stderr).toBe(0);
461
+ expect(parseEnvelope(addedTheme.stdout)).toMatchObject({
462
+ type: 'theme.app',
463
+ data: {
464
+ default: 'ocean',
465
+ change: {action: 'add', slug: 'ocean', changed: true},
466
+ themes: [
467
+ {
468
+ slug: 'ocean',
469
+ owner: '@acme/brand-integration',
470
+ module: '@acme/brand-integration/themes/ocean',
471
+ stylesheet: '@acme/brand-integration/themes/ocean.css',
472
+ },
473
+ ],
474
+ },
475
+ });
476
+ const generatedModule = fs.readFileSync(
477
+ path.join(consumerDir, 'src', 'astryx-themes.js'),
478
+ 'utf-8',
479
+ );
480
+ expect(generatedModule).toContain(
481
+ 'from "@acme/brand-integration/themes/ocean"',
482
+ );
483
+ expect(generatedModule).toContain(
484
+ 'import "@acme/brand-integration/themes/ocean.css"',
485
+ );
486
+
438
487
  const target = path.join('src', 'themes', 'acme-ocean');
439
488
  const copied = await runCli(
440
489
  [
441
490
  'theme',
442
- 'add',
491
+ 'eject',
443
492
  'ocean',
444
493
  target,
445
494
  '--package',
@@ -450,17 +499,17 @@ export const oceanTheme = defineTheme({
450
499
  );
451
500
  expect(copied.status, copied.stderr).toBe(0);
452
501
  expect(parseEnvelope(copied.stdout)).toMatchObject({
453
- type: 'theme.add',
502
+ type: 'theme.eject',
454
503
  data: {
455
504
  slug: 'ocean',
456
505
  package: '@acme/brand-integration',
457
506
  outputDir: target,
458
- files: [
507
+ files: expect.arrayContaining([
459
508
  'oceanTheme.ts',
460
509
  'oceanTheme.doc.mjs',
461
510
  'tokens/ocean.palette.receipt.json',
462
511
  'tokens/ocean.palette.ts',
463
- ],
512
+ ]),
464
513
  },
465
514
  });
466
515
  expect(
@@ -501,7 +550,7 @@ export const oceanTheme = defineTheme({
501
550
  const duplicate = await runCli(
502
551
  [
503
552
  'theme',
504
- 'add',
553
+ 'eject',
505
554
  'ocean',
506
555
  target,
507
556
  '--package',
@@ -517,7 +566,7 @@ export const oceanTheme = defineTheme({
517
566
  const overwritten = await runCli(
518
567
  [
519
568
  'theme',
520
- 'add',
569
+ 'eject',
521
570
  'ocean',
522
571
  target,
523
572
  '--package',
@@ -528,7 +577,7 @@ export const oceanTheme = defineTheme({
528
577
  consumerDir,
529
578
  );
530
579
  expect(overwritten.status, overwritten.stderr).toBe(0);
531
- expect(parseEnvelope(overwritten.stdout).type).toBe('theme.add');
580
+ expect(parseEnvelope(overwritten.stdout).type).toBe('theme.eject');
532
581
 
533
582
  const installedCodemod = path.join(
534
583
  installedDir,
@@ -594,7 +643,7 @@ export const oceanTheme = defineTheme({
594
643
  const corruptedInstall = await runCli(
595
644
  [
596
645
  'theme',
597
- 'add',
646
+ 'eject',
598
647
  'ocean',
599
648
  'src/themes/corrupted',
600
649
  '--package',
@@ -115,6 +115,7 @@ export function registerIntegration(program) {
115
115
  extends: options.extends,
116
116
  parent: options.parent,
117
117
  to: options.to,
118
+ from: options.from,
118
119
  });
119
120
  } catch (error) {
120
121
  const err =
@@ -168,8 +169,9 @@ export function registerIntegration(program) {
168
169
  fn: integrationPackCheckFn,
169
170
  action: async options => {
170
171
  if (!options.check) {
172
+ // One way forward: the new name. `npm pack` is what builds a tarball.
171
173
  return cliError(
172
- 'Pass --check to verify the integration tarball, or run `astryx integration verify`.',
174
+ '`integration pack` is now `integration verify`: run `astryx integration verify` to check the package the way npm will publish it. To build the tarball, run `npm pack`.',
173
175
  {code: ERROR_CODES.ERR_INVALID_ARGUMENT},
174
176
  );
175
177
  }
@@ -61,5 +61,6 @@ export const doc = {
61
61
  when: 'the expression is invalid, empty or over 5 MB (from stdin or --file), has a syntax error, or a bad --form',
62
62
  },
63
63
  ],
64
+ deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
64
65
  related: ['layout expand', 'layout grammar'],
65
66
  };