@astryxdesign/cli 0.6.5 → 0.6.6-canary.11a80dd

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 (464) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +91 -88
  3. package/api/build/_adapter.d.mts +70 -2
  4. package/api/build/_adapter.mjs +122 -10
  5. package/api/build/build.doc.mjs +3 -3
  6. package/api/build/build.test.mjs +111 -2
  7. package/api/build/build.type.d.mts +12 -0
  8. package/api/build/build.type.mjs +3 -0
  9. package/api/build/help/help.mjs +1 -1
  10. package/api/build/kit/kit.mjs +110 -22
  11. package/api/build/kit/rank.d.mts +32 -8
  12. package/api/build/kit/rank.mjs +291 -97
  13. package/api/build/kit/rank.test.mjs +231 -48
  14. package/api/build/kit/weights.d.mts +82 -0
  15. package/api/build/kit/weights.json +1 -0
  16. package/api/build/kit/weights.mjs +305 -0
  17. package/api/build/kit/weights.test.mjs +190 -0
  18. package/api/component/_adapter.d.mts +19 -0
  19. package/api/component/_adapter.mjs +33 -0
  20. package/api/component/component-replacement.test.mjs +603 -0
  21. package/api/component/component.mjs +49 -15
  22. package/api/component/component.test.mjs +32 -0
  23. package/api/component/component.type.d.mts +33 -3
  24. package/api/component/component.type.mjs +10 -3
  25. package/api/component/detail/blocks/blocks.d.mts +2 -1
  26. package/api/component/detail/blocks/blocks.mjs +5 -2
  27. package/api/component/detail/detail.mjs +5 -1
  28. package/api/component/detail/props/props.d.mts +2 -1
  29. package/api/component/detail/props/props.mjs +3 -2
  30. package/api/component/detail/showcase/showcase.d.mts +3 -1
  31. package/api/component/detail/showcase/showcase.mjs +3 -1
  32. package/api/component/detail/source/source.d.mts +3 -2
  33. package/api/component/detail/source/source.mjs +7 -3
  34. package/api/component/list/list.mjs +128 -10
  35. package/api/docs/_adapter.d.mts +11 -0
  36. package/api/docs/_adapter.mjs +25 -0
  37. package/api/docs/detail/detail.mjs +19 -3
  38. package/api/docs/detail/section/section.mjs +7 -1
  39. package/api/docs/docOverlays.test.mjs +10 -6
  40. package/api/docs/docs.d.mts +6 -0
  41. package/api/docs/docs.depth.test.mjs +134 -0
  42. package/api/docs/docs.doc.mjs +31 -2
  43. package/api/docs/docs.mjs +46 -1
  44. package/api/docs/docs.test.mjs +279 -0
  45. package/api/docs/docs.type.d.mts +81 -4
  46. package/api/docs/docs.type.mjs +41 -4
  47. package/api/docs/index/index.mjs +11 -2
  48. package/api/docs/index/index.test.mjs +7 -2
  49. package/api/docs/integration-tree.test.mjs +572 -0
  50. package/api/docs/integrationDocs.test.mjs +337 -0
  51. package/api/docs/node/node.d.mts +28 -3
  52. package/api/docs/node/node.mjs +149 -23
  53. package/api/doctor/_adapter.d.mts +50 -0
  54. package/api/doctor/_adapter.mjs +190 -0
  55. package/api/doctor/doctor.d.mts +0 -10
  56. package/api/doctor/doctor.doc.mjs +1 -3
  57. package/api/doctor/doctor.mjs +8 -123
  58. package/api/doctor/theme-checks.d.mts +24 -0
  59. package/api/doctor/theme-checks.mjs +1231 -0
  60. package/api/doctor/theme-checks.test.mjs +667 -0
  61. package/api/error.d.mts +22 -0
  62. package/api/error.mjs +42 -0
  63. package/api/gap-report/gap-report.d.mts +3 -1
  64. package/api/gap-report/gap-report.mjs +27 -3
  65. package/api/gap-report/gap-report.test.mjs +106 -0
  66. package/api/hook/_adapter.d.mts +1 -0
  67. package/api/hook/_adapter.mjs +3 -0
  68. package/api/hook/detail/detail.mjs +2 -2
  69. package/api/hook/detail/params/params.mjs +2 -2
  70. package/api/hook/hook.type.d.mts +12 -0
  71. package/api/hook/hook.type.mjs +3 -0
  72. package/api/hook/list/list.d.mts +1 -1
  73. package/api/hook/list/list.mjs +8 -8
  74. package/api/index.d.mts +1 -1
  75. package/api/index.mjs +4 -0
  76. package/api/init/run/run.d.mts +3 -5
  77. package/api/init/run/run.mjs +11 -11
  78. package/api/integration/__fixtures__/released-0.6.5-ocean.d.mts +14 -0
  79. package/api/integration/__fixtures__/released-0.6.5-ocean.mjs +15 -0
  80. package/api/integration/add-contribution.d.mts +2 -1
  81. package/api/integration/add-contribution.mjs +7 -3
  82. package/api/integration/add-contribution.test.mjs +3 -3
  83. package/api/integration/add-helpers.d.mts +26 -5
  84. package/api/integration/add-helpers.mjs +50 -5
  85. package/api/integration/add-theme.mjs +354 -28
  86. package/api/integration/add-theme.test.mjs +380 -16
  87. package/api/integration/authoring-checks.mjs +31 -8
  88. package/api/integration/authoring-checks.type.d.mts +8 -0
  89. package/api/integration/authoring-checks.type.mjs +7 -3
  90. package/api/integration/integration-authoring.type.d.mts +4 -1
  91. package/api/integration/integration-authoring.type.mjs +6 -1
  92. package/api/integration/integrationAdd.doc.mjs +6 -0
  93. package/api/integration/integrationAddTheme.doc.mjs +10 -0
  94. package/api/integration/integrationComponentConflicts.doc.mjs +6 -3
  95. package/api/integration/integrationDocConflicts.doc.mjs +1 -1
  96. package/api/integration/integrationTemplateConflicts.doc.mjs +1 -1
  97. package/api/integration/pack-check.component-replaces.test.mjs +126 -0
  98. package/api/integration/pack-check.d.mts +10 -0
  99. package/api/integration/pack-check.lifecycle-output.test.mjs +21 -2
  100. package/api/integration/pack-check.mjs +495 -4
  101. package/api/integration/pack-check.test.mjs +619 -10
  102. package/api/integration/validate-integration.d.mts +4 -2
  103. package/api/integration/validate-integration.mjs +7 -2
  104. package/api/integration/validate-integration.test.mjs +55 -0
  105. package/api/integration/validate-integration.type.d.mts +5 -0
  106. package/api/integration/validate-integration.type.mjs +5 -1
  107. package/api/integration/validateIntegration.doc.mjs +1 -1
  108. package/api/layout/check/check.d.mts +1 -0
  109. package/api/layout/check/check.mjs +1 -0
  110. package/api/layout/expand/expand.d.mts +1 -0
  111. package/api/layout/expand/expand.mjs +13 -7
  112. package/api/layout/expand/expand.receipt.test.mjs +74 -0
  113. package/api/layout/grammar/grammar.d.mts +1 -0
  114. package/api/layout/grammar/grammar.mjs +1 -0
  115. package/api/layout/layout.type.d.mts +1 -0
  116. package/api/layout/layout.type.mjs +1 -0
  117. package/api/layout/layoutCheck.doc.mjs +1 -1
  118. package/api/layout/layoutExpand.doc.mjs +2 -2
  119. package/api/layout/layoutGrammar.doc.mjs +1 -1
  120. package/api/search/search.d.mts +39 -8
  121. package/api/search/search.doc.mjs +4 -4
  122. package/api/search/search.mjs +248 -66
  123. package/api/search/search.test.mjs +829 -0
  124. package/api/search/search.type.d.mts +6 -6
  125. package/api/search/search.type.mjs +5 -5
  126. package/api/swizzle/_adapter.d.mts +10 -0
  127. package/api/swizzle/_adapter.mjs +23 -0
  128. package/api/swizzle/copy/copy.d.mts +5 -6
  129. package/api/swizzle/copy/copy.mjs +95 -13
  130. package/api/swizzle/list/list.mjs +2 -2
  131. package/api/swizzle/swizzle.doc.mjs +4 -0
  132. package/api/swizzle/swizzle.test.mjs +55 -5
  133. package/api/swizzle/swizzle.type.d.mts +8 -0
  134. package/api/swizzle/swizzle.type.mjs +2 -0
  135. package/api/template/copy/copy.mjs +27 -8
  136. package/api/template/copy/copy.receipt.test.mjs +77 -0
  137. package/api/template/show/show.mjs +17 -4
  138. package/api/template/show/show.test.mjs +76 -0
  139. package/api/template/skeleton/skeleton.mjs +2 -1
  140. package/api/template/template-integration.test.mjs +14 -0
  141. package/api/template/template.d.mts +1 -1
  142. package/api/template/template.doc.mjs +6 -2
  143. package/api/template/template.mjs +2 -0
  144. package/api/template/template.type.d.mts +17 -0
  145. package/api/template/template.type.mjs +8 -0
  146. package/api/theme/_adapter.d.mts +106 -6
  147. package/api/theme/_adapter.mjs +687 -18
  148. package/api/theme/add/add.binary.test.mjs +76 -3
  149. package/api/theme/add/add.d.mts +5 -9
  150. package/api/theme/add/add.mjs +87 -64
  151. package/api/theme/add/add.rollback.test.mjs +9 -9
  152. package/api/theme/add/add.staging.test.mjs +9 -9
  153. package/api/theme/add/add.test.mjs +461 -55
  154. package/api/theme/add/add.types.test.mjs +151 -0
  155. package/api/theme/build/build.d.mts +120 -2
  156. package/api/theme/build/build.family.test.mjs +13 -4
  157. package/api/theme/build/build.icon-lineage.test.mjs +117 -0
  158. package/api/theme/build/build.icon-preservation.test.mjs +639 -0
  159. package/api/theme/build/build.mjs +667 -195
  160. package/api/theme/build/build.project-core.test.mjs +165 -0
  161. package/api/theme/build/build.test.mjs +220 -1
  162. package/api/theme/build/font-warning.d.mts +11 -0
  163. package/api/theme/build/font-warning.mjs +28 -3
  164. package/api/theme/build/icon-imports.d.mts +47 -0
  165. package/api/theme/build/icon-imports.mjs +691 -0
  166. package/api/theme/eject/eject.binary.test.mjs +90 -0
  167. package/api/theme/eject/eject.d.mts +17 -0
  168. package/api/theme/eject/eject.mjs +65 -0
  169. package/api/theme/eject/eject.rollback.test.mjs +158 -0
  170. package/api/theme/eject/eject.staging.test.mjs +83 -0
  171. package/api/theme/eject/eject.test.mjs +160 -0
  172. package/api/theme/integration-themes.test.mjs +30 -6
  173. package/api/theme/list/list.d.mts +10 -0
  174. package/api/theme/list/list.mjs +75 -7
  175. package/api/theme/list/list.test.mjs +155 -4
  176. package/api/theme/remove/remove.d.mts +12 -0
  177. package/api/theme/remove/remove.mjs +15 -0
  178. package/api/theme/remove/remove.test.mjs +94 -0
  179. package/api/theme/template/template.mjs +3 -4
  180. package/api/theme/theme.d.mts +5 -2
  181. package/api/theme/theme.mjs +13 -8
  182. package/api/theme/theme.type.d.mts +106 -2
  183. package/api/theme/theme.type.mjs +54 -5
  184. package/api/theme/themeAdd.doc.d.mts +1 -3
  185. package/api/theme/themeAdd.doc.mjs +35 -22
  186. package/api/theme/themeBuild.doc.d.mts +4 -1
  187. package/api/theme/themeBuild.doc.mjs +15 -4
  188. package/api/theme/themeEject.doc.d.mts +8 -0
  189. package/api/theme/themeEject.doc.mjs +89 -0
  190. package/api/theme/themeListAvailable.doc.mjs +4 -4
  191. package/api/theme/themeListCopySources.doc.d.mts +8 -0
  192. package/api/theme/themeListCopySources.doc.mjs +60 -0
  193. package/api/theme/themeRemove.doc.d.mts +6 -0
  194. package/api/theme/themeRemove.doc.mjs +50 -0
  195. package/api/theme/themeTemplate.doc.mjs +4 -3
  196. package/api/theme/themeUse.doc.d.mts +6 -0
  197. package/api/theme/themeUse.doc.mjs +47 -0
  198. package/api/theme/use/use.d.mts +12 -0
  199. package/api/theme/use/use.mjs +15 -0
  200. package/api/theme/use/use.test.mjs +98 -0
  201. package/api/upgrade/_adapter.d.mts +1 -0
  202. package/api/upgrade/_adapter.mjs +3 -0
  203. package/api/upgrade/list/list.mjs +9 -3
  204. package/api/upgrade/run/run.mjs +20 -3
  205. package/api/upgrade/run/run.test.mjs +45 -1
  206. package/api/upgrade/upgrade.doc.mjs +1 -1
  207. package/api/upgrade/upgrade.type.d.mts +5 -0
  208. package/api/upgrade/upgrade.type.mjs +2 -0
  209. package/assets/codemods/integration-discovery.mjs +1 -1
  210. package/assets/codemods/integration-discovery.test.mjs +64 -0
  211. package/assets/codemods/transforms/next/__tests__/migrate-copied-themes-to-descriptors.test.mjs +129 -0
  212. package/assets/codemods/transforms/next/index.mjs +14 -1
  213. package/assets/codemods/transforms/next/migrate-copied-themes-to-descriptors.mjs +54 -0
  214. package/assets/docs/author-a-theme.doc.mjs +166 -0
  215. package/assets/docs/getting-started.doc.mjs +59 -15
  216. package/assets/docs/icons.doc.mjs +1 -0
  217. package/assets/docs/principles.doc.dense.mjs +2 -2
  218. package/assets/docs/principles.doc.mjs +2 -2
  219. package/assets/docs/principles.doc.zh.mjs +2 -2
  220. package/assets/docs/styling-libraries.doc.mjs +1 -1
  221. package/assets/docs/styling-overview.doc.mjs +211 -0
  222. package/assets/docs/styling.doc.mjs +2 -2
  223. package/assets/docs/theme.doc.dense.mjs +10 -198
  224. package/assets/docs/theme.doc.mjs +13 -770
  225. package/assets/docs/theme.doc.zh.mjs +31 -12
  226. package/assets/docs/tokens.doc.mjs +4 -4
  227. package/assets/docs/tree/add-a-theme.doc.mjs +6 -2
  228. package/assets/docs/tree/add-a-topic.doc.mjs +1 -1
  229. package/assets/docs/tree/check-your-docs.doc.mjs +2 -2
  230. package/assets/docs/tree/checks.doc.mjs +6 -5
  231. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +1 -1
  232. package/assets/docs/tree/define-the-theme.doc.mjs +2 -2
  233. package/assets/docs/tree/document-the-theme.doc.mjs +4 -4
  234. package/assets/docs/tree/fonts-and-assets.doc.mjs +25 -20
  235. package/assets/docs/tree/headers-and-footers.doc.mjs +68 -0
  236. package/assets/docs/tree/layout-spacing.doc.mjs +168 -0
  237. package/assets/docs/tree/layout.doc.mjs +52 -0
  238. package/assets/docs/tree/replace-a-core-component.doc.mjs +21 -4
  239. package/assets/docs/tree/responsive.doc.mjs +102 -0
  240. package/assets/docs/tree/scaffold.doc.mjs +145 -0
  241. package/assets/docs/tree/sections-and-placement.doc.mjs +1 -1
  242. package/assets/docs/tree/side-panels.doc.mjs +82 -0
  243. package/assets/docs/tree/structure.doc.mjs +144 -0
  244. package/assets/docs/tree/template-doc-overview.doc.mjs +13 -1
  245. package/assets/docs/tree/themes.doc.mjs +2 -2
  246. package/assets/docs/tree/troubleshooting.doc.mjs +13 -5
  247. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +22 -5
  248. package/assets/docs/tree/versioning.doc.mjs +11 -7
  249. package/assets/docs/use-a-theme.doc.mjs +212 -0
  250. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.doc.mjs +15 -0
  251. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +38 -0
  252. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.doc.mjs +20 -0
  253. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.tsx +48 -0
  254. package/assets/templates/pages/ai-chat/template.doc.mjs +16 -1
  255. package/assets/templates/pages/ai-chat-landing/template.doc.mjs +9 -1
  256. package/assets/templates/pages/blank/template.doc.mjs +3 -1
  257. package/assets/templates/pages/canvas-editor/template.doc.mjs +9 -1
  258. package/assets/templates/pages/centered-hero/template.doc.mjs +3 -1
  259. package/assets/templates/pages/checkout-wizard/template.doc.mjs +1 -0
  260. package/assets/templates/pages/classic-gallery/template.doc.mjs +3 -1
  261. package/assets/templates/pages/contact-form/template.doc.mjs +16 -1
  262. package/assets/templates/pages/dashboard/template.doc.mjs +15 -1
  263. package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +23 -1
  264. package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +10 -1
  265. package/assets/templates/pages/dashboard-comparison/template.doc.mjs +9 -1
  266. package/assets/templates/pages/dashboard-composition/template.doc.mjs +10 -1
  267. package/assets/templates/pages/dashboard-progress/template.doc.mjs +17 -1
  268. package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +2 -1
  269. package/assets/templates/pages/detail-page/template.doc.mjs +8 -0
  270. package/assets/templates/pages/documentation/template.doc.mjs +10 -1
  271. package/assets/templates/pages/documentation-design/template.doc.mjs +10 -1
  272. package/assets/templates/pages/documentation-technical/template.doc.mjs +10 -1
  273. package/assets/templates/pages/editor/template.doc.mjs +9 -1
  274. package/assets/templates/pages/file-explorer/template.doc.mjs +3 -1
  275. package/assets/templates/pages/form-two-column/template.doc.mjs +17 -1
  276. package/assets/templates/pages/form-wizard/template.doc.mjs +14 -1
  277. package/assets/templates/pages/form-wizard-dialog/template.doc.mjs +1 -0
  278. package/assets/templates/pages/gallery-hero/template.doc.mjs +10 -1
  279. package/assets/templates/pages/ide/template.doc.mjs +9 -1
  280. package/assets/templates/pages/incident-console/page.tsx +1 -1
  281. package/assets/templates/pages/incident-console/template.doc.mjs +10 -1
  282. package/assets/templates/pages/kanban-board/template.doc.mjs +11 -1
  283. package/assets/templates/pages/library/template.doc.mjs +15 -1
  284. package/assets/templates/pages/login/template.doc.mjs +10 -1
  285. package/assets/templates/pages/login-card/template.doc.mjs +11 -1
  286. package/assets/templates/pages/login-split/template.doc.mjs +10 -1
  287. package/assets/templates/pages/login-sso/template.doc.mjs +10 -1
  288. package/assets/templates/pages/messaging-shell/template.doc.mjs +11 -1
  289. package/assets/templates/pages/mixed-gallery/template.doc.mjs +10 -1
  290. package/assets/templates/pages/payment-form/template.doc.mjs +3 -1
  291. package/assets/templates/pages/product-detail/template.doc.mjs +9 -1
  292. package/assets/templates/pages/product-gallery/template.doc.mjs +10 -1
  293. package/assets/templates/pages/settings/template.doc.mjs +3 -1
  294. package/assets/templates/pages/settings-dialog/template.doc.mjs +9 -1
  295. package/assets/templates/pages/settings-sidebar/template.doc.mjs +9 -1
  296. package/assets/templates/pages/shell-nav/template.doc.mjs +10 -1
  297. package/assets/templates/pages/shell-side-nav/template.doc.mjs +14 -1
  298. package/assets/templates/pages/shell-top-nav/template.doc.mjs +11 -1
  299. package/assets/templates/pages/side-gallery/template.doc.mjs +3 -1
  300. package/assets/templates/pages/table/template.doc.mjs +11 -1
  301. package/assets/templates/pages/table-collapsible/page.tsx +1474 -0
  302. package/assets/templates/pages/table-collapsible/template.doc.mjs +12 -0
  303. package/assets/templates/pages/table-comparison/page.tsx +1449 -0
  304. package/assets/templates/pages/table-comparison/template.doc.mjs +12 -0
  305. package/assets/templates/pages/table-filter/template.doc.mjs +21 -1
  306. package/assets/templates/pages/table-grouped/template.doc.mjs +15 -1
  307. package/assets/templates/pages/table-inbox/template.doc.mjs +18 -6
  308. package/assets/templates/pages/table-page/template.doc.mjs +20 -1
  309. package/assets/templates/pages/table-tree/template.doc.mjs +14 -1
  310. package/assets/templates/pages/theme-showcase/template.doc.mjs +10 -1
  311. package/assets/templates/pages/work-item-detail/template.doc.mjs +10 -0
  312. package/assets/templates/themes/butter/icons.tsx +2 -0
  313. package/assets/templates/themes/chocolate/icons.tsx +2 -0
  314. package/assets/templates/themes/gothic/icons.tsx +2 -0
  315. package/assets/templates/themes/matcha/icons.tsx +2 -0
  316. package/assets/templates/themes/neutral/icons.tsx +2 -0
  317. package/assets/templates/themes/stone/icons.tsx +2 -0
  318. package/assets/templates/themes/y2k/icons.tsx +2 -0
  319. package/authoring/doctypes/command/command.doc.mjs +5 -0
  320. package/authoring/doctypes/command/type.ts +2 -0
  321. package/authoring/doctypes/component/component.doc.mjs +1 -1
  322. package/authoring/doctypes/component/type.ts +8 -4
  323. package/authoring/doctypes/template/parse.d.mts +2 -0
  324. package/authoring/doctypes/template/parse.mjs +1 -0
  325. package/authoring/doctypes/template/parse.test.mjs +21 -0
  326. package/authoring/doctypes/template/template.doc.mjs +6 -0
  327. package/authoring/doctypes/template/type.ts +11 -0
  328. package/authoring/integration/integration.doc.mjs +1 -1
  329. package/clients/cli/commands/blog.mjs +3 -3
  330. package/clients/cli/commands/build-theme.adaptations.test.mjs +1 -1
  331. package/clients/cli/commands/build-theme.ascii-output.test.mjs +11 -1
  332. package/clients/cli/commands/build-theme.batch-report.test.mjs +335 -0
  333. package/clients/cli/commands/build-theme.font-warning.test.mjs +36 -7
  334. package/clients/cli/commands/build-theme.import-path.test.mjs +3 -3
  335. package/clients/cli/commands/build-theme.mjs +346 -47
  336. package/clients/cli/commands/build-theme.watch.test.mjs +33 -0
  337. package/clients/cli/commands/build.mjs +8 -6
  338. package/clients/cli/commands/build.text-fields.test.mjs +1 -1
  339. package/clients/cli/commands/component/index.mjs +88 -12
  340. package/clients/cli/commands/component-replacement.text.test.mjs +271 -0
  341. package/clients/cli/commands/component.doc.mjs +9 -2
  342. package/clients/cli/commands/discover.mjs +29 -1
  343. package/clients/cli/commands/discover.no-source.test.mjs +75 -0
  344. package/clients/cli/commands/docs.depth.test.mjs +219 -0
  345. package/clients/cli/commands/docs.doc.mjs +15 -2
  346. package/clients/cli/commands/docs.mjs +273 -16
  347. package/clients/cli/commands/docs.test.mjs +383 -0
  348. package/clients/cli/commands/doctor-integration-components.doc.mjs +15 -4
  349. package/clients/cli/commands/doctor.doc.mjs +1 -1
  350. package/clients/cli/commands/doctor.mjs +4 -4
  351. package/clients/cli/commands/doctor.test.mjs +26 -52
  352. package/clients/cli/commands/gap-report.doc.mjs +2 -2
  353. package/clients/cli/commands/gap-report.mjs +12 -0
  354. package/clients/cli/commands/gap-report.test.mjs +63 -0
  355. package/clients/cli/commands/hook/index.mjs +7 -2
  356. package/clients/cli/commands/import-hint-correctness.test.mjs +28 -5
  357. package/clients/cli/commands/init.next-steps.test.mjs +18 -23
  358. package/clients/cli/commands/integration-add.doc.mjs +10 -0
  359. package/clients/cli/commands/integration-authoring.test.mjs +12 -2
  360. package/clients/cli/commands/integration-real-world.test.mjs +61 -12
  361. package/clients/cli/commands/integration.mjs +3 -1
  362. package/clients/cli/commands/layout-check.doc.mjs +2 -0
  363. package/clients/cli/commands/layout-expand.doc.mjs +5 -1
  364. package/clients/cli/commands/layout-grammar.doc.mjs +2 -0
  365. package/clients/cli/commands/layout.deprecation-lifecycle.test.mjs +140 -0
  366. package/clients/cli/commands/layout.doc.mjs +2 -0
  367. package/clients/cli/commands/layout.expand-receipt.test.mjs +94 -0
  368. package/clients/cli/commands/layout.mjs +56 -4
  369. package/clients/cli/commands/no-prompt-wording.test.mjs +4 -4
  370. package/clients/cli/commands/search.doc.mjs +5 -4
  371. package/clients/cli/commands/search.mjs +30 -6
  372. package/clients/cli/commands/search.test.mjs +69 -19
  373. package/clients/cli/commands/swizzle.doc.mjs +12 -3
  374. package/clients/cli/commands/swizzle.mjs +2 -1
  375. package/clients/cli/commands/swizzle.routing.test.mjs +2 -1
  376. package/clients/cli/commands/template.copy-receipt.test.mjs +60 -0
  377. package/clients/cli/commands/template.mjs +71 -6
  378. package/clients/cli/commands/template.show-media.test.mjs +62 -0
  379. package/clients/cli/commands/text-json-parity.test.mjs +40 -0
  380. package/clients/cli/commands/theme-add-lifecycle.test.mjs +135 -0
  381. package/clients/cli/commands/theme-add.doc.mjs +19 -19
  382. package/clients/cli/commands/theme-build.doc.mjs +3 -1
  383. package/clients/cli/commands/theme-eject.doc.mjs +47 -0
  384. package/clients/cli/commands/theme-list.behavior.test.mjs +44 -0
  385. package/clients/cli/commands/theme-list.doc.mjs +2 -2
  386. package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -2
  387. package/clients/cli/commands/theme-remove.doc.mjs +22 -0
  388. package/clients/cli/commands/theme-template.doc.mjs +4 -3
  389. package/clients/cli/commands/theme-use.doc.mjs +22 -0
  390. package/clients/cli/commands/theme.doc.mjs +21 -16
  391. package/clients/cli/commands/upgrade.ascii-output.test.mjs +14 -0
  392. package/clients/cli/commands/upgrade.config-ordering.test.mjs +2 -1
  393. package/clients/cli/commands/upgrade.mjs +1 -1
  394. package/clients/cli/commands/write-failure.test.mjs +175 -0
  395. package/clients/cli/index.mjs +5 -2
  396. package/clients/cli/lib/component-format.mjs +19 -2
  397. package/clients/cli/lib/component-format.test.mjs +1 -1
  398. package/clients/cli/lib/define-command.mjs +4 -0
  399. package/clients/cli/lib/manifest.mjs +44 -165
  400. package/clients/cli/lib/manifest.test.mjs +98 -7
  401. package/clients/cli/lib/resolve-theme.mjs +80 -78
  402. package/clients/cli/lib/resolve-theme.test.mjs +523 -27
  403. package/foundation/agent-docs/agent-docs.mjs +34 -28
  404. package/foundation/agent-docs/agent-docs.test.mjs +1181 -0
  405. package/foundation/agent-docs/app-theme-workflow.test.mjs +13 -0
  406. package/foundation/config/project.d.mts +20 -5
  407. package/foundation/config/project.mjs +43 -6
  408. package/foundation/config/theme-private-vars.d.mts +12 -0
  409. package/foundation/config/theme-private-vars.mjs +107 -0
  410. package/foundation/config/theme-private-vars.test.mjs +55 -0
  411. package/foundation/config/theme-state.d.mts +145 -0
  412. package/foundation/config/theme-state.mjs +417 -0
  413. package/foundation/config/theme-state.test.mjs +182 -0
  414. package/foundation/discovery/component-discovery.d.mts +5 -2
  415. package/foundation/discovery/component-discovery.mjs +12 -6
  416. package/foundation/discovery/component-replacement.d.mts +91 -0
  417. package/foundation/discovery/component-replacement.mjs +417 -0
  418. package/foundation/discovery/component-replacement.test.mjs +480 -0
  419. package/foundation/discovery/docs-output-budget.d.mts +6 -2
  420. package/foundation/discovery/docs-output-budget.mjs +2 -1
  421. package/foundation/discovery/docs-section-key.d.mts +4 -2
  422. package/foundation/discovery/docs-section-key.mjs +1 -1
  423. package/foundation/discovery/module-exports.d.mts +10 -0
  424. package/foundation/discovery/module-exports.mjs +146 -0
  425. package/foundation/discovery/package-exports.d.mts +29 -0
  426. package/foundation/discovery/package-exports.mjs +200 -0
  427. package/foundation/discovery/template-adapter.d.mts +14 -0
  428. package/foundation/discovery/template-adapter.fixture-refs.test.mjs +37 -1
  429. package/foundation/discovery/template-adapter.mjs +21 -1
  430. package/foundation/discovery/template-needs.d.mts +31 -0
  431. package/foundation/discovery/template-needs.mjs +156 -0
  432. package/foundation/discovery/template-needs.test.mjs +203 -0
  433. package/foundation/discovery/theme-discovery.d.mts +78 -5
  434. package/foundation/discovery/theme-discovery.mjs +143 -18
  435. package/foundation/discovery/theme-discovery.test.mjs +9 -3
  436. package/foundation/discovery/theme-imports.d.mts +15 -0
  437. package/foundation/discovery/theme-imports.mjs +217 -0
  438. package/foundation/discovery/theme-imports.test.mjs +173 -0
  439. package/foundation/doc-compiler/doc-loads.test.mjs +18 -8
  440. package/foundation/doc-compiler/inputs.mjs +2 -1
  441. package/foundation/doc-compiler/inputs.test.mjs +0 -1
  442. package/foundation/doc-compiler/lenses.d.mts +4 -2
  443. package/foundation/doc-compiler/lenses.mjs +1 -1
  444. package/foundation/doc-compiler/tree.test.mjs +649 -0
  445. package/foundation/env/package-manager.d.mts +28 -8
  446. package/foundation/env/package-manager.mjs +49 -10
  447. package/foundation/env/package-manager.test.mjs +93 -1
  448. package/foundation/fs/module-loader.d.mts +9 -0
  449. package/foundation/fs/module-loader.mjs +71 -2
  450. package/foundation/integrations/cli-requirement.d.mts +79 -13
  451. package/foundation/integrations/cli-requirement.mjs +115 -22
  452. package/foundation/integrations/cli-requirement.test.mjs +205 -8
  453. package/foundation/integrations/contribution-inventory.mjs +3 -3
  454. package/foundation/response/base.d.ts +9 -3
  455. package/foundation/response/json.d.mts +7 -4
  456. package/foundation/response/json.mjs +10 -6
  457. package/foundation/response/response-types.doc.d.mts +5 -5
  458. package/foundation/response/response-types.doc.mjs +52 -37
  459. package/foundation/response/response.doc.mjs +18 -4
  460. package/foundation/text/copyright-header.mjs +1 -1
  461. package/foundation/text/copyright-header.test.mjs +1 -1
  462. package/package.json +9 -9
  463. package/assets/docs/layout.doc.dense.mjs +0 -388
  464. package/assets/docs/layout.doc.mjs +0 -550
@@ -19,8 +19,10 @@ export function validateInstalledIntegration(spec: string, cwd?: string): Promis
19
19
  /**
20
20
  * Unified entry: validate the LOCAL integration (no `pkg`) or an INSTALLED one
21
21
  * (`pkg` given) and return the `integration.validate` envelope. The no-manifest
22
- * local case is guidance, not an error — it comes back with `name: null` and no
23
- * issues so the CLI can print a hint and stay exit-0.
22
+ * local case is guidance, not an error — it comes back with `validated: false`,
23
+ * `name: null` and no issues so the CLI can print a hint and stay exit-0.
24
+ * `validated` is what tells a machine consumer that empty `issues` means
25
+ * "nothing was checked" rather than "checked and healthy".
24
26
  *
25
27
  * This is the seam that keeps the CLI a thin wrapper: the command handler calls
26
28
  * this and only chooses how to render (human vs --json) + the exit code.
@@ -427,8 +427,10 @@ export async function validateInstalledIntegration(spec, cwd = process.cwd()) {
427
427
  /**
428
428
  * Unified entry: validate the LOCAL integration (no `pkg`) or an INSTALLED one
429
429
  * (`pkg` given) and return the `integration.validate` envelope. The no-manifest
430
- * local case is guidance, not an error — it comes back with `name: null` and no
431
- * issues so the CLI can print a hint and stay exit-0.
430
+ * local case is guidance, not an error — it comes back with `validated: false`,
431
+ * `name: null` and no issues so the CLI can print a hint and stay exit-0.
432
+ * `validated` is what tells a machine consumer that empty `issues` means
433
+ * "nothing was checked" rather than "checked and healthy".
432
434
  *
433
435
  * This is the seam that keeps the CLI a thin wrapper: the command handler calls
434
436
  * this and only chooses how to render (human vs --json) + the exit code.
@@ -445,6 +447,9 @@ export async function validateIntegration(pkg, options = {}) {
445
447
  return {
446
448
  type: 'integration.validate',
447
449
  data: {
450
+ // The one bit that separates "checked and clean" from "never checked":
451
+ // with no manifest there is nothing to validate, and issues stays [].
452
+ validated: result.found,
448
453
  name: result.found ? (result.name ?? null) : null,
449
454
  version: result.found ? (result.version ?? null) : null,
450
455
  issues: result.issues,
@@ -625,3 +625,58 @@ describe('integration diagnostics are read-only', () => {
625
625
  expect({pkg: snapshot(pkgDir), consumer: snapshot(consumer)}).toEqual(before);
626
626
  });
627
627
  });
628
+
629
+ describe('validated separates "checked and clean" from "never checked"', () => {
630
+ // `doctor integration validate --json` from a directory with no manifest
631
+ // returned {name: null, version: null, issues: []} and exit 0 — the same
632
+ // envelope a healthy, fully validated integration produces. Wire that into
633
+ // CI from the wrong directory and it is green forever.
634
+ it('is false for every check when no manifest is found', async () => {
635
+ const dir = path.join(tmpDir, 'plain');
636
+ fs.mkdirSync(dir, {recursive: true});
637
+ fs.writeFileSync(
638
+ path.join(dir, 'package.json'),
639
+ JSON.stringify({name: 'plain-app', version: '1.0.0'}),
640
+ );
641
+
642
+ const validate = await validateIntegration(undefined, {cwd: dir});
643
+ expect(validate.data.validated).toBe(false);
644
+ expect(validate.data.issues).toEqual([]);
645
+
646
+ const templates = await integrationTemplateConflicts(undefined, {cwd: dir});
647
+ const components = await integrationComponentConflicts(undefined, {cwd: dir});
648
+ const docs = await integrationDocConflicts(undefined, {cwd: dir});
649
+ expect(templates.data.validated).toBe(false);
650
+ expect(components.data.validated).toBe(false);
651
+ expect(docs.data.validated).toBe(false);
652
+ });
653
+
654
+ it('is true for a real integration, whose empty issue list then means healthy', async () => {
655
+ const dir = path.join(tmpDir, 'integration');
656
+ writePackage(dir, {manifest: 'export default {};\n'});
657
+
658
+ const validate = await validateIntegration(undefined, {cwd: dir});
659
+ expect(validate.data.validated).toBe(true);
660
+ expect(validate.data.name).toBe('@acme/widgets');
661
+
662
+ const templates = await integrationTemplateConflicts(undefined, {cwd: dir});
663
+ const components = await integrationComponentConflicts(undefined, {cwd: dir});
664
+ const docs = await integrationDocConflicts(undefined, {cwd: dir});
665
+ expect(templates.data.validated).toBe(true);
666
+ expect(components.data.validated).toBe(true);
667
+ expect(docs.data.validated).toBe(true);
668
+ });
669
+
670
+ it('is true for an installed package that could not be found — that is a real finding', async () => {
671
+ const consumer = path.join(tmpDir, 'consumer');
672
+ fs.mkdirSync(consumer, {recursive: true});
673
+ fs.writeFileSync(
674
+ path.join(consumer, 'package.json'),
675
+ JSON.stringify({name: 'consumer', version: '1.0.0'}),
676
+ );
677
+
678
+ const res = await validateIntegration('@acme/nope', {cwd: consumer});
679
+ expect(res.data.validated).toBe(true);
680
+ expect(summarizeIssues(res.data.issues).errors).toBeGreaterThan(0);
681
+ });
682
+ });
@@ -27,10 +27,15 @@ export type ValidateIntegrationOptions = {
27
27
  };
28
28
  /**
29
29
  * `astryx --json doctor integration validate [package]`.
30
+ *
31
+ * `validated` is false in exactly one case: no integration manifest was found,
32
+ * so nothing was checked. An empty `issues` then means "not looked at", not
33
+ * "healthy" — the two are otherwise byte-identical.
30
34
  */
31
35
  export type ValidateIntegrationResponse = {
32
36
  type: "integration.validate";
33
37
  data: {
38
+ validated: boolean;
34
39
  name: string | null;
35
40
  version: string | null;
36
41
  issues: import("../../foundation/integrations/issue").AstryxIntegrationIssue[];
@@ -32,9 +32,13 @@
32
32
 
33
33
  /**
34
34
  * `astryx --json doctor integration validate [package]`.
35
+ *
36
+ * `validated` is false in exactly one case: no integration manifest was found,
37
+ * so nothing was checked. An empty `issues` then means "not looked at", not
38
+ * "healthy" — the two are otherwise byte-identical.
35
39
  * @typedef {object} ValidateIntegrationResponse
36
40
  * @property {'integration.validate'} type
37
- * @property {{name: string | null, version: string | null, issues: import('../../foundation/integrations/issue').AstryxIntegrationIssue[]}} data
41
+ * @property {{validated: boolean, name: string | null, version: string | null, issues: import('../../foundation/integrations/issue').AstryxIntegrationIssue[]}} data
38
42
  */
39
43
 
40
44
  export {};
@@ -46,7 +46,7 @@ export const doc = {
46
46
  {
47
47
  type: 'integration.validate',
48
48
  description:
49
- 'The result envelope: `data.name` and `data.version` of the validated package (both null only when no local manifest is found; `data.name` is `(local package)` when the local package.json has no readable name), plus `data.issues`, an AstryxIntegrationIssue[] of {code, severity: `warning` | `error`, message}.',
49
+ 'The result envelope: `data.validated`, false only when no integration manifest was found — nothing was checked, so the empty `data.issues` means "not looked at", not "healthy"; `data.name` and `data.version` of the validated package (both null when `data.validated` is false; `data.name` is `(local package)` when the local package.json has no readable name), plus `data.issues`, an AstryxIntegrationIssue[] of {code, severity: `warning` | `error`, message}.',
50
50
  },
51
51
  ],
52
52
  examples: [
@@ -2,6 +2,7 @@
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
4
  /**
5
+ * @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
5
6
  * `astryx layout check "<expr>" [--form compact|outline]`
6
7
  * Validates without expanding; echoes both canonical surfaces.
7
8
  *
@@ -15,6 +15,7 @@ import {toCompact, toOutline} from '../../../foundation/xle/print.mjs';
15
15
  import {analyze, formatIssue} from '../_adapter.mjs';
16
16
 
17
17
  /**
18
+ * @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
18
19
  * `astryx layout check "<expr>" [--form compact|outline]`
19
20
  * Validates without expanding; echoes both canonical surfaces.
20
21
  *
@@ -2,6 +2,7 @@
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
4
  /**
5
+ * @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
5
6
  * `astryx layout expand "<expr>" [path]`
6
7
  *
7
8
  * @param {string} expression
@@ -18,7 +18,7 @@ import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
18
18
  import {assertWithin, isFilePathArg, PathSafetyError} from '../../../foundation/fs/path-safety.mjs';
19
19
  import {detectForm} from '../../../foundation/xle/parse.mjs';
20
20
  import {expand} from '../../../foundation/xle/expand.mjs';
21
- import {stripTemplateAssetRefs} from '../../template/template.mjs';
21
+ import {replaceDemoMedia} from '../../template/template.mjs';
22
22
  import {analyze, formatIssue} from '../_adapter.mjs';
23
23
 
24
24
  /** @param {string} name */
@@ -59,31 +59,36 @@ function collectHintNames(doc) {
59
59
  /**
60
60
  * Build the blockModules map expand() needs: import-mode for app components,
61
61
  * splice-mode (reading + asset-stripping the block source) for template blocks.
62
- * Only blocks actually referenced are read.
62
+ * Only blocks actually referenced are read. Also returns how many demo media
63
+ * references the splice-mode sources had replaced.
63
64
  *
64
65
  * @param {import('../../../foundation/xle/xle-ast').XLEDoc} doc
65
66
  * @param {import('../_adapter.mjs').LayoutBlock[]} blocks
66
- * @returns {Map<string, import('../../../foundation/xle/xle-ast').BlockModule>}
67
+ * @returns {{modules: Map<string, import('../../../foundation/xle/xle-ast').BlockModule>, demoMediaReplaced: number}}
67
68
  */
68
69
  function buildBlockModules(doc, blocks) {
69
70
  const referenced = collectHintNames(doc);
70
- if (referenced.size === 0) return new Map();
71
+ if (referenced.size === 0) return {modules: new Map(), demoMediaReplaced: 0};
71
72
  const byKey = new Map(blocks.map(b => [normKey(b.dirName), b]));
72
73
  /** @type {Map<string, import('../../../foundation/xle/xle-ast').BlockModule>} */
73
74
  const modules = new Map();
75
+ let demoMediaReplaced = 0;
74
76
  for (const name of referenced) {
75
77
  const block = byKey.get(normKey(name));
76
78
  if (!block) continue;
77
79
  if (block.kind === 'component') {
78
80
  modules.set(name, /** @type {import('../../../foundation/xle/xle-ast').BlockModule} */ (/** @type {unknown} */ ({mode: 'import', componentName: block.name, importPath: block.importPath, isDefault: block.isDefault})));
79
81
  } else if (block.filePath && fs.existsSync(block.filePath)) {
80
- modules.set(name, /** @type {import('../../../foundation/xle/xle-ast').BlockModule} */ ({mode: 'splice', componentName: block.dirName, source: stripTemplateAssetRefs(fs.readFileSync(block.filePath, 'utf-8'))}));
82
+ const spliced = replaceDemoMedia(fs.readFileSync(block.filePath, 'utf-8'));
83
+ demoMediaReplaced += spliced.demoMediaReplaced;
84
+ modules.set(name, /** @type {import('../../../foundation/xle/xle-ast').BlockModule} */ ({mode: 'splice', componentName: block.dirName, source: spliced.source}));
81
85
  }
82
86
  }
83
- return modules;
87
+ return {modules, demoMediaReplaced};
84
88
  }
85
89
 
86
90
  /**
91
+ * @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
87
92
  * `astryx layout expand "<expr>" [path]`
88
93
  *
89
94
  * @param {string} expression
@@ -115,7 +120,7 @@ export async function layoutExpand(expression, options = {}) {
115
120
  ERROR_CODES.ERR_INVALID_ARGUMENT,
116
121
  );
117
122
  }
118
- const blockModules = buildBlockModules(doc, blocks);
123
+ const {modules: blockModules, demoMediaReplaced} = buildBlockModules(doc, blocks);
119
124
  const result = expand(doc, registry, {componentName, blockModules});
120
125
 
121
126
  let written = null;
@@ -150,6 +155,7 @@ export async function layoutExpand(expression, options = {}) {
150
155
  blocksReferenced: [...blockModules.entries()].map(([name, m]) => ({name, mode: m.mode})),
151
156
  warnings: warnings.map(formatIssue),
152
157
  written,
158
+ demoMediaReplaced,
153
159
  },
154
160
  };
155
161
  }
@@ -0,0 +1,74 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file The layout.expand receipt discloses demo media replaced in the template
5
+ * blocks it splices. Blocks are picked by what their source contains, not by
6
+ * name, so catalog renames do not break the suite.
7
+ */
8
+
9
+ import {describe, it, expect, beforeAll} from 'vitest';
10
+ import * as fs from 'node:fs';
11
+ import {layoutExpand} from '../layout.mjs';
12
+ import {discoverTemplates} from '../../template/template.mjs';
13
+ import {buildRegistry} from '../../../foundation/xle/registry.mjs';
14
+
15
+ const SLOW = 60_000;
16
+ const FIXTURE_REF = /\/template-assets\/[\w.-]+\.\w+/g;
17
+
18
+ beforeAll(async () => {
19
+ await buildRegistry();
20
+ }, 120_000);
21
+
22
+ /** @param {string} name */
23
+ const hintKey = name => name.toLowerCase().replace(/[^a-z0-9]/g, '');
24
+
25
+ /** @type {Promise<Array<{hint: string, refs: number}>> | undefined} */
26
+ let catalog;
27
+
28
+ /**
29
+ * Template blocks a `{hint}` resolves to unambiguously, with the number of demo
30
+ * media references in each one's source.
31
+ * @returns {Promise<Array<{hint: string, refs: number}>>}
32
+ */
33
+ function catalogBlocks() {
34
+ catalog ??= discoverTemplates().then(found => {
35
+ const all = /** @type {Array<{dirName: string, type: string, filePath: string}>} */ (
36
+ found
37
+ ).filter(t => t.type === 'block' && t.filePath && fs.existsSync(t.filePath));
38
+ const seen = new Map();
39
+ for (const t of all) seen.set(hintKey(t.dirName), (seen.get(hintKey(t.dirName)) ?? 0) + 1);
40
+ return all
41
+ .filter(t => seen.get(hintKey(t.dirName)) === 1)
42
+ .map(t => ({
43
+ hint: hintKey(t.dirName),
44
+ refs: (fs.readFileSync(t.filePath, 'utf-8').match(FIXTURE_REF) ?? []).length,
45
+ }));
46
+ });
47
+ return catalog;
48
+ }
49
+
50
+ describe('layout.expand receipt - replaced demo media', () => {
51
+ it('counts the demo media of a spliced block once, however often it is referenced', async () => {
52
+ const block = (await catalogBlocks()).find(b => b.refs > 0);
53
+ if (!block) throw new Error('no template block carries demo media');
54
+ const res = await layoutExpand(`V > {${block.hint}}*3`);
55
+ expect(res.type).toBe('layout.expand');
56
+ expect(res.data.blocksReferenced).toHaveLength(1);
57
+ expect(res.data.demoMediaReplaced).toBe(block.refs);
58
+ expect(res.data.code).not.toContain('/template-assets/');
59
+ }, SLOW);
60
+
61
+ it('sums the demo media of every spliced block', async () => {
62
+ const [a, b] = (await catalogBlocks()).filter(x => x.refs > 0);
63
+ if (!b) throw new Error('fewer than two template blocks carry demo media');
64
+ const res = await layoutExpand(`V > {${a.hint}} + {${b.hint}}`);
65
+ expect(res.data.demoMediaReplaced).toBe(a.refs + b.refs);
66
+ }, SLOW);
67
+
68
+ it('reports 0 when nothing spliced carries demo media', async () => {
69
+ const plain = (await catalogBlocks()).find(b => b.refs === 0);
70
+ if (!plain) throw new Error('every template block carries demo media');
71
+ expect((await layoutExpand(`V > {${plain.hint}}`)).data.demoMediaReplaced).toBe(0);
72
+ expect((await layoutExpand('V > B"Save"')).data.demoMediaReplaced).toBe(0);
73
+ }, SLOW);
74
+ });
@@ -2,6 +2,7 @@
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
4
  /**
5
+ * @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
5
6
  * `astryx layout grammar` — the agent cheatsheet, with the alias table
6
7
  * generated from this branch's registry (never hand-maintained).
7
8
  *
@@ -13,6 +13,7 @@ import {buildRegistry} from '../../../foundation/xle/registry.mjs';
13
13
  import {MAX_REPEAT} from '../../../foundation/xle/expand.mjs';
14
14
 
15
15
  /**
16
+ * @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
16
17
  * `astryx layout grammar` — the agent cheatsheet, with the alias table
17
18
  * generated from this branch's registry (never hand-maintained).
18
19
  *
@@ -36,6 +36,7 @@ export type LayoutExpandResponse = {
36
36
  blocksReferenced: LayoutBlockReference[];
37
37
  warnings: string[];
38
38
  written: string | null;
39
+ demoMediaReplaced: number;
39
40
  };
40
41
  };
41
42
  /**
@@ -48,6 +48,7 @@
48
48
  * @property {LayoutBlockReference[]} data.blocksReferenced
49
49
  * @property {string[]} data.warnings
50
50
  * @property {string | null} data.written
51
+ * @property {number} data.demoMediaReplaced Astryx demo media references (images, posters, videos) replaced in the spliced template blocks: images with a neutral placeholder, videos with an empty source. Swap in your own media at those points in the code; no media is installed. 0 when no spliced block carried any.
51
52
  */
52
53
 
53
54
  /**
@@ -20,7 +20,7 @@ export const doc = {
20
20
  'expression without generating any TSX, and echoes it back in both canonical surfaces ' +
21
21
  '(compact and outline). Validation failures are reported in the layout.check envelope ' +
22
22
  '(valid: false) with line/col and suggestions (not thrown) so callers can lint an ' +
23
- 'expression and surface fixes.',
23
+ 'expression and surface fixes. **Deprecated (DEP-0006).** Use `build`, `template`, and `docs layout` instead. This function will be removed in a future minor release.',
24
24
  importPath: '@astryxdesign/cli/api',
25
25
  signature:
26
26
  'layoutCheck(expression: string, options?: LayoutCheckOptions): Promise<LayoutCheckResponse>',
@@ -20,7 +20,7 @@ export const doc = {
20
20
  'expression, then expands it into ready-to-use XDS TSX, auto-routing structural children ' +
21
21
  'into the right slots, scaffolding typed useState for interactive controls, and splicing or ' +
22
22
  'importing any referenced template blocks. Returns the code (and metadata) in a layout.expand ' +
23
- 'envelope, optionally writing it to a path within cwd.',
23
+ 'envelope, optionally writing it to a path within cwd. **Deprecated (DEP-0006).** Use `build`, `template`, and `docs layout` instead. This function will be removed in a future minor release.',
24
24
  importPath: '@astryxdesign/cli/api',
25
25
  signature:
26
26
  'layoutExpand(expression: string, options?: LayoutExpandOptions): Promise<LayoutExpandResponse>',
@@ -70,7 +70,7 @@ export const doc = {
70
70
  {
71
71
  type: 'layout.expand',
72
72
  description:
73
- 'The expansion: the parsed form, the generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, and written (the relative output path, or null when nothing was written).',
73
+ 'The expansion: the parsed form, the generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the relative output path, or null when nothing was written), and demoMediaReplaced (how many Astryx demo media references in the spliced template blocks, such as images, posters and videos, were replaced with placeholders for you to swap for your own media).',
74
74
  },
75
75
  ],
76
76
  throws: [
@@ -18,7 +18,7 @@ export const doc = {
18
18
  description:
19
19
  'The reference behind `astryx layout grammar`: the agent cheatsheet for writing XLE/XLO ' +
20
20
  "layout expressions, with the alias table generated from this branch's registry rather than " +
21
- 'hand-maintained, so short names always reflect the components actually installed.',
21
+ 'hand-maintained, so short names always reflect the components actually installed. **Deprecated (DEP-0006).** Use `build`, `template`, and `docs layout` instead. This function will be removed in a future minor release.',
22
22
  importPath: '@astryxdesign/cli/api',
23
23
  signature:
24
24
  'layoutGrammar(options?: LayoutGrammarOptions): Promise<LayoutGrammarResponse>',
@@ -66,6 +66,7 @@ export function scoreQuery(term: string, tokens: string[], candidate: Candidate)
66
66
  * @param {string} term - Lowercased search term.
67
67
  * @param {object} candidate
68
68
  * @param {string} candidate.name - Primary identifier (component/hook name, topic, template name).
69
+ * @param {string[]} [candidate.aliases] - Other names, scored like the name (a theme's display name).
69
70
  * @param {string} [candidate.domain] - A component, hook, or template name
70
71
  * also matches typed as words: `command palette` is CommandPalette.
71
72
  * @param {string[]} [candidate.keywords] - Authored intent (componentsUsed, category words).
@@ -76,8 +77,9 @@ export function scoreQuery(term: string, tokens: string[], candidate: Candidate)
76
77
  * @param {{fuzzy?: boolean}} [opts] - `fuzzy`: allow edit-distance (typo) matches. Default true; multi-word queries pass false.
77
78
  * @returns {{score: number, reason: string} | null}
78
79
  */
79
- export function scoreCandidate(term: string, { name, domain, keywords, weakKeywords, description, prose, guidance, }: {
80
+ export function scoreCandidate(term: string, { name, aliases, domain, keywords, weakKeywords, description, prose, guidance, }: {
80
81
  name: string;
82
+ aliases?: string[] | undefined;
81
83
  domain?: string | undefined;
82
84
  keywords?: string[] | undefined;
83
85
  weakKeywords?: string[] | undefined;
@@ -91,18 +93,42 @@ export function scoreCandidate(term: string, { name, domain, keywords, weakKeywo
91
93
  reason: string;
92
94
  } | null;
93
95
  /**
94
- * Unified ranked search across components, hooks, docs, and templates.
96
+ * The components (name and keywords) a search response was scored against, or
97
+ * null when that search was narrowed away from components.
98
+ * @param {object} response
99
+ * @returns {{name: string, keywords: string[]}[] | null}
100
+ */
101
+ export function searchedComponents(response: object): {
102
+ name: string;
103
+ keywords: string[];
104
+ }[] | null;
105
+ /**
106
+ * Every component the project can use, Core's and its integrations', with the
107
+ * keywords its own doc declares: the discovery and doc reads search's own
108
+ * candidates use, without the import paths and prose a result carries. `build`
109
+ * reads it to tell a part of a page from a page when its search was narrowed
110
+ * away from components.
111
+ * @param {string} coreDir
112
+ * @param {string} cwd
113
+ * @returns {Promise<{name: string, keywords: string[]}[]>}
114
+ */
115
+ export function componentKeywords(coreDir: string, cwd: string): Promise<{
116
+ name: string;
117
+ keywords: string[];
118
+ }[]>;
119
+ /**
120
+ * Unified ranked search across components, hooks, docs, templates, and themes.
95
121
  *
96
122
  * @param {string} query - Free-text search term.
97
123
  * @param {object} [options]
98
124
  * @param {string} [options.cwd]
99
- * @param {'component'|'hook'|'doc'|'template'} [options.type] - Restrict to one domain.
125
+ * @param {'component'|'hook'|'doc'|'template'|'theme'} [options.type] - Restrict to one domain.
100
126
  * @param {number} [options.limit] - Max results (default 20).
101
127
  * @returns {Promise<import('./search.type.mjs').SearchResponse>}
102
128
  */
103
129
  export function search(query: string, options?: {
104
130
  cwd?: string | undefined;
105
- type?: "component" | "hook" | "template" | "doc" | undefined;
131
+ type?: "theme" | "component" | "hook" | "template" | "doc" | undefined;
106
132
  limit?: number | undefined;
107
133
  }): Promise<import("./search.type.mjs").SearchResponse>;
108
134
  export namespace SYNONYMS {
@@ -135,8 +161,13 @@ export const STOPWORDS: Set<string>;
135
161
  * prefixed fields carry domain-specific payload used only by {@link toResult}.
136
162
  */
137
163
  export type Candidate = {
138
- domain: "component" | "hook" | "doc" | "template";
164
+ domain: "component" | "hook" | "doc" | "template" | "theme";
139
165
  name: string;
166
+ /**
167
+ * - Other names the candidate answers to, scored
168
+ * with the same name signals: a theme's display name.
169
+ */
170
+ aliases?: string[] | undefined;
140
171
  keywords?: string[] | undefined;
141
172
  weakKeywords?: string[] | undefined;
142
173
  description?: string | undefined;
@@ -168,9 +199,9 @@ export type Candidate = {
168
199
  */
169
200
  _parent?: string | undefined;
170
201
  /**
171
- * - The npm package that authored a docs-tree
172
- * doc part. Flat topics carry none: an extension's sections can come from
173
- * another package.
202
+ * - The npm package that owns the candidate:
203
+ * Core's package for its components, hooks, and templates, the integration's
204
+ * for what it contributed, and for a doc part the package that wrote it.
174
205
  */
175
206
  _package?: string | undefined;
176
207
  _displayName?: string | undefined;
@@ -14,7 +14,7 @@ export const doc = {
14
14
  namespace: 'cli/api',
15
15
  displayName: 'search()',
16
16
  summary:
17
- 'Unified ranked search across components, hooks, docs, and templates.',
17
+ 'Unified ranked search across components, hooks, docs, templates, and themes.',
18
18
  description:
19
19
  'The single "I\'m looking for X" entry point across every content domain. ' +
20
20
  'Ranking is keyword + fuzzy (not embeddings); name and keyword signals outrank ' +
@@ -35,7 +35,7 @@ export const doc = {
35
35
  },
36
36
  {
37
37
  name: 'options.type',
38
- type: "'component' | 'hook' | 'doc' | 'template'",
38
+ type: "'component' | 'hook' | 'doc' | 'template' | 'theme'",
39
39
  description: 'Restrict results to a single domain.',
40
40
  },
41
41
  {
@@ -48,14 +48,14 @@ export const doc = {
48
48
  name: 'options.cwd',
49
49
  type: 'string',
50
50
  description:
51
- "Directory to resolve @astryxdesign/core from. A docs-only search (`type: 'doc'`) does not need it, and a search with no `type` covers the docs alone when core is missing.",
51
+ "Directory to resolve @astryxdesign/core from. A docs-only or themes-only search (`type: 'doc'` or `type: 'theme'`) does not need it, and a search with no `type` covers the docs and themes alone when core is missing.",
52
52
  },
53
53
  ],
54
54
  returns: [
55
55
  {
56
56
  type: 'search',
57
57
  description:
58
- 'The query echoed back, `matchCount` (how many candidates matched in total, before `limit`), plus a ranked SearchResultEntry[] bounded by `limit`: each has domain, name, score, reason, description, and follow-up command, plus `import` for components and hooks, `title` for docs, and `displayName` and `kind` for templates. A doc result is the smallest part that answers: one section (with `section`, and a command that reads only it), one docs-tree route, or a topic, whose command lists its sections. `parent` is the command that opens the level above it: the section list of its topic, the namespace a tree node sits in, the Unorganized level for a flat topic, or the topic list for a top-level namespace. Every doc result also carries `package`, the npm package that authored it (for a section, the package its file came from).',
58
+ 'The query echoed back, `matchCount` (how many candidates matched in total, before `limit`), plus a ranked SearchResultEntry[] bounded by `limit`: each has domain, name, score, reason, description, and follow-up command, plus `import` for components and hooks, `title` for docs, `displayName` and `kind` for templates, and `displayName` for themes. A doc result is the smallest part that answers: one section (with `section`, and a command that reads only it), one docs-tree route, or a topic, whose command lists its sections. `parent` is the command that opens the level above it: the section list of its topic, the namespace a tree node sits in, the Unorganized level for a flat topic, or the topic list for a top-level namespace. Every doc result also carries `package`, the npm package that authored it (for a section, the package its file came from). A theme result is one theme you can import: `name` is its slug, its command is `astryx theme add --import <slug>`, and `package` is the npm package that ships it (`@astryxdesign/cli` for the CLI\'s own themes).',
59
59
  },
60
60
  ],
61
61
  throws: [