@astryxdesign/cli 0.6.5 → 0.6.6-canary.0e97faa

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 (444) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +60 -57
  3. package/api/build/_adapter.d.mts +55 -2
  4. package/api/build/_adapter.mjs +100 -10
  5. package/api/build/build.doc.mjs +2 -2
  6. package/api/build/build.test.mjs +111 -2
  7. package/api/build/build.type.d.mts +8 -0
  8. package/api/build/build.type.mjs +2 -0
  9. package/api/build/help/help.mjs +1 -1
  10. package/api/build/kit/kit.mjs +99 -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 +15 -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 +14 -0
  145. package/api/template/template.type.mjs +5 -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 +50 -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 +465 -155
  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/icon-imports.d.mts +47 -0
  163. package/api/theme/build/icon-imports.mjs +691 -0
  164. package/api/theme/eject/eject.binary.test.mjs +90 -0
  165. package/api/theme/eject/eject.d.mts +17 -0
  166. package/api/theme/eject/eject.mjs +65 -0
  167. package/api/theme/eject/eject.rollback.test.mjs +158 -0
  168. package/api/theme/eject/eject.staging.test.mjs +83 -0
  169. package/api/theme/eject/eject.test.mjs +160 -0
  170. package/api/theme/integration-themes.test.mjs +30 -6
  171. package/api/theme/list/list.d.mts +10 -0
  172. package/api/theme/list/list.mjs +75 -7
  173. package/api/theme/list/list.test.mjs +155 -4
  174. package/api/theme/remove/remove.d.mts +12 -0
  175. package/api/theme/remove/remove.mjs +15 -0
  176. package/api/theme/remove/remove.test.mjs +94 -0
  177. package/api/theme/template/template.mjs +3 -4
  178. package/api/theme/theme.d.mts +5 -2
  179. package/api/theme/theme.mjs +13 -8
  180. package/api/theme/theme.type.d.mts +106 -2
  181. package/api/theme/theme.type.mjs +54 -5
  182. package/api/theme/themeAdd.doc.d.mts +1 -3
  183. package/api/theme/themeAdd.doc.mjs +35 -22
  184. package/api/theme/themeBuild.doc.d.mts +4 -1
  185. package/api/theme/themeBuild.doc.mjs +15 -4
  186. package/api/theme/themeEject.doc.d.mts +8 -0
  187. package/api/theme/themeEject.doc.mjs +89 -0
  188. package/api/theme/themeListAvailable.doc.mjs +4 -4
  189. package/api/theme/themeListCopySources.doc.d.mts +8 -0
  190. package/api/theme/themeListCopySources.doc.mjs +60 -0
  191. package/api/theme/themeRemove.doc.d.mts +6 -0
  192. package/api/theme/themeRemove.doc.mjs +50 -0
  193. package/api/theme/themeTemplate.doc.mjs +4 -3
  194. package/api/theme/themeUse.doc.d.mts +6 -0
  195. package/api/theme/themeUse.doc.mjs +47 -0
  196. package/api/theme/use/use.d.mts +12 -0
  197. package/api/theme/use/use.mjs +15 -0
  198. package/api/theme/use/use.test.mjs +98 -0
  199. package/api/upgrade/_adapter.d.mts +1 -0
  200. package/api/upgrade/_adapter.mjs +3 -0
  201. package/api/upgrade/list/list.mjs +9 -3
  202. package/api/upgrade/run/run.mjs +20 -3
  203. package/api/upgrade/run/run.test.mjs +45 -1
  204. package/api/upgrade/upgrade.doc.mjs +1 -1
  205. package/api/upgrade/upgrade.type.d.mts +5 -0
  206. package/api/upgrade/upgrade.type.mjs +2 -0
  207. package/assets/codemods/integration-discovery.mjs +1 -1
  208. package/assets/codemods/integration-discovery.test.mjs +64 -0
  209. package/assets/codemods/transforms/next/__tests__/migrate-copied-themes-to-descriptors.test.mjs +129 -0
  210. package/assets/codemods/transforms/next/index.mjs +14 -1
  211. package/assets/codemods/transforms/next/migrate-copied-themes-to-descriptors.mjs +54 -0
  212. package/assets/docs/author-a-theme.doc.mjs +161 -0
  213. package/assets/docs/getting-started.doc.mjs +59 -15
  214. package/assets/docs/icons.doc.mjs +1 -0
  215. package/assets/docs/principles.doc.dense.mjs +2 -2
  216. package/assets/docs/principles.doc.mjs +2 -2
  217. package/assets/docs/principles.doc.zh.mjs +2 -2
  218. package/assets/docs/styling-libraries.doc.mjs +1 -1
  219. package/assets/docs/styling-overview.doc.mjs +211 -0
  220. package/assets/docs/styling.doc.mjs +2 -2
  221. package/assets/docs/theme.doc.dense.mjs +10 -198
  222. package/assets/docs/theme.doc.mjs +13 -770
  223. package/assets/docs/theme.doc.zh.mjs +31 -12
  224. package/assets/docs/tokens.doc.mjs +4 -4
  225. package/assets/docs/tree/add-a-theme.doc.mjs +6 -2
  226. package/assets/docs/tree/add-a-topic.doc.mjs +1 -1
  227. package/assets/docs/tree/check-your-docs.doc.mjs +2 -2
  228. package/assets/docs/tree/checks.doc.mjs +6 -5
  229. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +1 -1
  230. package/assets/docs/tree/define-the-theme.doc.mjs +2 -2
  231. package/assets/docs/tree/document-the-theme.doc.mjs +4 -4
  232. package/assets/docs/tree/fonts-and-assets.doc.mjs +25 -20
  233. package/assets/docs/tree/headers-and-footers.doc.mjs +68 -0
  234. package/assets/docs/tree/layout-spacing.doc.mjs +168 -0
  235. package/assets/docs/tree/layout.doc.mjs +32 -0
  236. package/assets/docs/tree/replace-a-core-component.doc.mjs +21 -4
  237. package/assets/docs/tree/responsive.doc.mjs +102 -0
  238. package/assets/docs/tree/scaffold.doc.mjs +145 -0
  239. package/assets/docs/tree/sections-and-placement.doc.mjs +1 -1
  240. package/assets/docs/tree/side-panels.doc.mjs +82 -0
  241. package/assets/docs/tree/structure.doc.mjs +144 -0
  242. package/assets/docs/tree/template-doc-overview.doc.mjs +13 -1
  243. package/assets/docs/tree/themes.doc.mjs +2 -2
  244. package/assets/docs/tree/troubleshooting.doc.mjs +13 -5
  245. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +22 -5
  246. package/assets/docs/tree/versioning.doc.mjs +11 -7
  247. package/assets/docs/use-a-theme.doc.mjs +209 -0
  248. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.doc.mjs +15 -0
  249. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +38 -0
  250. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.doc.mjs +20 -0
  251. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.tsx +48 -0
  252. package/assets/templates/pages/ai-chat/template.doc.mjs +16 -1
  253. package/assets/templates/pages/ai-chat-landing/template.doc.mjs +9 -1
  254. package/assets/templates/pages/blank/template.doc.mjs +3 -1
  255. package/assets/templates/pages/canvas-editor/template.doc.mjs +9 -1
  256. package/assets/templates/pages/centered-hero/template.doc.mjs +3 -1
  257. package/assets/templates/pages/checkout-wizard/template.doc.mjs +1 -0
  258. package/assets/templates/pages/classic-gallery/template.doc.mjs +3 -1
  259. package/assets/templates/pages/contact-form/template.doc.mjs +16 -1
  260. package/assets/templates/pages/dashboard/template.doc.mjs +15 -1
  261. package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +23 -1
  262. package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +10 -1
  263. package/assets/templates/pages/dashboard-comparison/template.doc.mjs +9 -1
  264. package/assets/templates/pages/dashboard-composition/template.doc.mjs +10 -1
  265. package/assets/templates/pages/dashboard-progress/template.doc.mjs +17 -1
  266. package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +2 -1
  267. package/assets/templates/pages/detail-page/template.doc.mjs +8 -0
  268. package/assets/templates/pages/documentation/template.doc.mjs +10 -1
  269. package/assets/templates/pages/documentation-design/template.doc.mjs +10 -1
  270. package/assets/templates/pages/documentation-technical/template.doc.mjs +10 -1
  271. package/assets/templates/pages/editor/template.doc.mjs +9 -1
  272. package/assets/templates/pages/file-explorer/template.doc.mjs +3 -1
  273. package/assets/templates/pages/form-two-column/template.doc.mjs +17 -1
  274. package/assets/templates/pages/form-wizard/template.doc.mjs +14 -1
  275. package/assets/templates/pages/form-wizard-dialog/template.doc.mjs +1 -0
  276. package/assets/templates/pages/gallery-hero/template.doc.mjs +10 -1
  277. package/assets/templates/pages/ide/template.doc.mjs +9 -1
  278. package/assets/templates/pages/incident-console/template.doc.mjs +10 -1
  279. package/assets/templates/pages/kanban-board/template.doc.mjs +11 -1
  280. package/assets/templates/pages/library/template.doc.mjs +15 -1
  281. package/assets/templates/pages/login/template.doc.mjs +10 -1
  282. package/assets/templates/pages/login-card/template.doc.mjs +11 -1
  283. package/assets/templates/pages/login-split/template.doc.mjs +10 -1
  284. package/assets/templates/pages/login-sso/template.doc.mjs +10 -1
  285. package/assets/templates/pages/messaging-shell/template.doc.mjs +11 -1
  286. package/assets/templates/pages/mixed-gallery/template.doc.mjs +10 -1
  287. package/assets/templates/pages/payment-form/template.doc.mjs +3 -1
  288. package/assets/templates/pages/product-detail/template.doc.mjs +9 -1
  289. package/assets/templates/pages/product-gallery/template.doc.mjs +10 -1
  290. package/assets/templates/pages/settings/template.doc.mjs +3 -1
  291. package/assets/templates/pages/settings-dialog/template.doc.mjs +9 -1
  292. package/assets/templates/pages/settings-sidebar/template.doc.mjs +9 -1
  293. package/assets/templates/pages/shell-nav/template.doc.mjs +10 -1
  294. package/assets/templates/pages/shell-side-nav/template.doc.mjs +14 -1
  295. package/assets/templates/pages/shell-top-nav/template.doc.mjs +11 -1
  296. package/assets/templates/pages/side-gallery/template.doc.mjs +3 -1
  297. package/assets/templates/pages/table/template.doc.mjs +11 -1
  298. package/assets/templates/pages/table-collapsible/page.tsx +1474 -0
  299. package/assets/templates/pages/table-collapsible/template.doc.mjs +12 -0
  300. package/assets/templates/pages/table-comparison/page.tsx +1449 -0
  301. package/assets/templates/pages/table-comparison/template.doc.mjs +12 -0
  302. package/assets/templates/pages/table-filter/template.doc.mjs +21 -1
  303. package/assets/templates/pages/table-grouped/template.doc.mjs +15 -1
  304. package/assets/templates/pages/table-inbox/template.doc.mjs +18 -6
  305. package/assets/templates/pages/table-page/template.doc.mjs +20 -1
  306. package/assets/templates/pages/table-tree/template.doc.mjs +14 -1
  307. package/assets/templates/pages/theme-showcase/template.doc.mjs +10 -1
  308. package/assets/templates/pages/work-item-detail/template.doc.mjs +10 -0
  309. package/assets/templates/themes/butter/icons.tsx +2 -0
  310. package/assets/templates/themes/chocolate/icons.tsx +2 -0
  311. package/assets/templates/themes/gothic/icons.tsx +2 -0
  312. package/assets/templates/themes/matcha/icons.tsx +2 -0
  313. package/assets/templates/themes/neutral/icons.tsx +2 -0
  314. package/assets/templates/themes/stone/icons.tsx +2 -0
  315. package/assets/templates/themes/y2k/icons.tsx +2 -0
  316. package/authoring/doctypes/command/command.doc.mjs +5 -0
  317. package/authoring/doctypes/command/type.ts +2 -0
  318. package/authoring/doctypes/component/component.doc.mjs +1 -1
  319. package/authoring/doctypes/component/type.ts +8 -4
  320. package/authoring/doctypes/template/parse.d.mts +2 -0
  321. package/authoring/doctypes/template/parse.mjs +1 -0
  322. package/authoring/doctypes/template/parse.test.mjs +21 -0
  323. package/authoring/doctypes/template/template.doc.mjs +6 -0
  324. package/authoring/doctypes/template/type.ts +11 -0
  325. package/authoring/integration/integration.doc.mjs +1 -1
  326. package/clients/cli/commands/build-theme.mjs +282 -31
  327. package/clients/cli/commands/build.mjs +7 -6
  328. package/clients/cli/commands/build.text-fields.test.mjs +1 -1
  329. package/clients/cli/commands/component/index.mjs +88 -12
  330. package/clients/cli/commands/component-replacement.text.test.mjs +271 -0
  331. package/clients/cli/commands/component.doc.mjs +9 -2
  332. package/clients/cli/commands/discover.mjs +29 -1
  333. package/clients/cli/commands/discover.no-source.test.mjs +75 -0
  334. package/clients/cli/commands/docs.depth.test.mjs +219 -0
  335. package/clients/cli/commands/docs.doc.mjs +15 -2
  336. package/clients/cli/commands/docs.mjs +273 -16
  337. package/clients/cli/commands/docs.test.mjs +382 -0
  338. package/clients/cli/commands/doctor-integration-components.doc.mjs +15 -4
  339. package/clients/cli/commands/doctor.doc.mjs +1 -1
  340. package/clients/cli/commands/doctor.mjs +4 -4
  341. package/clients/cli/commands/doctor.test.mjs +9 -51
  342. package/clients/cli/commands/gap-report.doc.mjs +2 -2
  343. package/clients/cli/commands/gap-report.mjs +12 -0
  344. package/clients/cli/commands/gap-report.test.mjs +63 -0
  345. package/clients/cli/commands/hook/index.mjs +7 -2
  346. package/clients/cli/commands/import-hint-correctness.test.mjs +5 -5
  347. package/clients/cli/commands/init.next-steps.test.mjs +18 -23
  348. package/clients/cli/commands/integration-add.doc.mjs +10 -0
  349. package/clients/cli/commands/integration-authoring.test.mjs +12 -2
  350. package/clients/cli/commands/integration-real-world.test.mjs +61 -12
  351. package/clients/cli/commands/integration.mjs +3 -1
  352. package/clients/cli/commands/layout-check.doc.mjs +2 -0
  353. package/clients/cli/commands/layout-expand.doc.mjs +5 -1
  354. package/clients/cli/commands/layout-grammar.doc.mjs +2 -0
  355. package/clients/cli/commands/layout.deprecation-lifecycle.test.mjs +140 -0
  356. package/clients/cli/commands/layout.doc.mjs +2 -0
  357. package/clients/cli/commands/layout.expand-receipt.test.mjs +94 -0
  358. package/clients/cli/commands/layout.mjs +56 -4
  359. package/clients/cli/commands/no-prompt-wording.test.mjs +4 -4
  360. package/clients/cli/commands/search.doc.mjs +5 -4
  361. package/clients/cli/commands/search.mjs +30 -6
  362. package/clients/cli/commands/search.test.mjs +63 -17
  363. package/clients/cli/commands/swizzle.doc.mjs +12 -3
  364. package/clients/cli/commands/swizzle.mjs +2 -1
  365. package/clients/cli/commands/template.copy-receipt.test.mjs +60 -0
  366. package/clients/cli/commands/template.mjs +70 -6
  367. package/clients/cli/commands/template.show-media.test.mjs +62 -0
  368. package/clients/cli/commands/text-json-parity.test.mjs +40 -0
  369. package/clients/cli/commands/theme-add-lifecycle.test.mjs +132 -0
  370. package/clients/cli/commands/theme-add.doc.mjs +19 -19
  371. package/clients/cli/commands/theme-eject.doc.mjs +47 -0
  372. package/clients/cli/commands/theme-list.behavior.test.mjs +44 -0
  373. package/clients/cli/commands/theme-list.doc.mjs +2 -2
  374. package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -2
  375. package/clients/cli/commands/theme-remove.doc.mjs +22 -0
  376. package/clients/cli/commands/theme-template.doc.mjs +4 -3
  377. package/clients/cli/commands/theme-use.doc.mjs +22 -0
  378. package/clients/cli/commands/theme.doc.mjs +21 -16
  379. package/clients/cli/commands/upgrade.ascii-output.test.mjs +14 -0
  380. package/clients/cli/commands/upgrade.mjs +1 -1
  381. package/clients/cli/commands/write-failure.test.mjs +175 -0
  382. package/clients/cli/index.mjs +4 -1
  383. package/clients/cli/lib/component-format.mjs +19 -2
  384. package/clients/cli/lib/define-command.mjs +4 -0
  385. package/clients/cli/lib/manifest.mjs +44 -165
  386. package/clients/cli/lib/manifest.test.mjs +98 -7
  387. package/clients/cli/lib/resolve-theme.mjs +80 -78
  388. package/clients/cli/lib/resolve-theme.test.mjs +523 -27
  389. package/foundation/agent-docs/agent-docs.mjs +31 -28
  390. package/foundation/agent-docs/agent-docs.test.mjs +1163 -0
  391. package/foundation/agent-docs/app-theme-workflow.test.mjs +13 -0
  392. package/foundation/config/project.d.mts +20 -5
  393. package/foundation/config/project.mjs +43 -6
  394. package/foundation/config/theme-private-vars.d.mts +12 -0
  395. package/foundation/config/theme-private-vars.mjs +107 -0
  396. package/foundation/config/theme-private-vars.test.mjs +55 -0
  397. package/foundation/config/theme-state.d.mts +145 -0
  398. package/foundation/config/theme-state.mjs +417 -0
  399. package/foundation/config/theme-state.test.mjs +182 -0
  400. package/foundation/discovery/component-discovery.d.mts +5 -2
  401. package/foundation/discovery/component-discovery.mjs +12 -6
  402. package/foundation/discovery/component-replacement.d.mts +91 -0
  403. package/foundation/discovery/component-replacement.mjs +417 -0
  404. package/foundation/discovery/component-replacement.test.mjs +480 -0
  405. package/foundation/discovery/docs-output-budget.d.mts +6 -2
  406. package/foundation/discovery/docs-output-budget.mjs +2 -1
  407. package/foundation/discovery/docs-section-key.d.mts +4 -2
  408. package/foundation/discovery/docs-section-key.mjs +1 -1
  409. package/foundation/discovery/module-exports.d.mts +10 -0
  410. package/foundation/discovery/module-exports.mjs +146 -0
  411. package/foundation/discovery/package-exports.d.mts +29 -0
  412. package/foundation/discovery/package-exports.mjs +200 -0
  413. package/foundation/discovery/template-adapter.d.mts +14 -0
  414. package/foundation/discovery/template-adapter.fixture-refs.test.mjs +37 -1
  415. package/foundation/discovery/template-adapter.mjs +21 -1
  416. package/foundation/discovery/theme-discovery.d.mts +78 -5
  417. package/foundation/discovery/theme-discovery.mjs +143 -18
  418. package/foundation/discovery/theme-discovery.test.mjs +9 -3
  419. package/foundation/discovery/theme-imports.d.mts +15 -0
  420. package/foundation/discovery/theme-imports.mjs +217 -0
  421. package/foundation/discovery/theme-imports.test.mjs +173 -0
  422. package/foundation/doc-compiler/doc-loads.test.mjs +18 -8
  423. package/foundation/doc-compiler/inputs.mjs +2 -1
  424. package/foundation/doc-compiler/inputs.test.mjs +0 -1
  425. package/foundation/doc-compiler/lenses.d.mts +4 -2
  426. package/foundation/doc-compiler/lenses.mjs +1 -1
  427. package/foundation/doc-compiler/tree.test.mjs +649 -0
  428. package/foundation/fs/module-loader.d.mts +9 -0
  429. package/foundation/fs/module-loader.mjs +71 -2
  430. package/foundation/integrations/cli-requirement.d.mts +79 -13
  431. package/foundation/integrations/cli-requirement.mjs +115 -22
  432. package/foundation/integrations/cli-requirement.test.mjs +205 -8
  433. package/foundation/integrations/contribution-inventory.mjs +3 -3
  434. package/foundation/response/base.d.ts +9 -3
  435. package/foundation/response/json.d.mts +7 -4
  436. package/foundation/response/json.mjs +10 -6
  437. package/foundation/response/response-types.doc.d.mts +5 -5
  438. package/foundation/response/response-types.doc.mjs +52 -37
  439. package/foundation/response/response.doc.mjs +18 -4
  440. package/foundation/text/copyright-header.mjs +1 -1
  441. package/foundation/text/copyright-header.test.mjs +1 -1
  442. package/package.json +9 -9
  443. package/assets/docs/layout.doc.dense.mjs +0 -388
  444. package/assets/docs/layout.doc.mjs +0 -550
package/CHANGELOG.md CHANGED
@@ -1,5 +1,89 @@
1
1
  # @xds/cli
2
2
 
3
+ # 0.6.6
4
+
5
+ #### New Features
6
+
7
+ - Add a shared `upload` icon, and use it for FileInput's upload affordance instead of the directional `arrowUp`
8
+ Themes draw `upload` through `icons.upload`, separately from `arrowUp`, so sort arrows and every other `arrowUp` use stay unchanged. Every bundled theme and theme template draws `upload` in its own icon style. FileInput keeps its icon size, placement, color, and accessibility in both modes; a theme with no `upload` artwork shows the default upload-into-tray glyph there.
9
+
10
+ A complete `IconRegistry` may still omit `upload` in this release. The next minor makes it required, so add an `upload` entry to any registry you type as `IconRegistry`.
11
+
12
+ - Templates declare their `keywords`, and `build` tells a part of a page from a page by the components the project can use (#6805)
13
+ - `build` chooses where to start with a checked-in table of word weights blended with the page ranker
14
+ - `astryx docs <route> --depth <levels>` reads as far down the docs tree as you ask, from one doc to everything below it.
15
+ `--depth 0` reads only the namespace you name, `--depth 1` adds the docs right below it (what a read without `--depth` shows), and `--depth all` goes to the bottom. With `--depth`, `--detail` sets how much of each doc below shows: `brief` (the default) is one line each, named by where it sits so you can open it, `compact` adds its sections, and `full` prints it whole. So `astryx docs cli --depth all` is a map of every CLI doc, and `astryx docs cli/integrations --depth all --detail full` prints the integration guides as one read. Where a read stops, a namespace says how many docs sit below it. `--json` returns the same tree as `docs.node`: each child carries its own `slots` while the read goes deeper, `childCount` where it stops, and its text at `compact` or `full`. `docs()` takes the same `depth` and `detail` options. Reads without `--depth` are unchanged.
16
+ - Point at `discover` where people look for things to add
17
+ Nothing an agent reads named `discover`, so agents asked to find a theme searched the package registry instead. The agent block `astryx init` writes now lists `discover <words>` (integrations you could add, and the ones you have), `theme list` ends with `More themes in packages you could add: astryx discover theme`, and a text search ends with `More in packages you could add: astryx discover <query>` (except `--type hook`, since no integration adds hooks). JSON output is unchanged.
18
+ - `integration add theme --from <base>` forks an existing theme as the starting point instead of a blank scaffold. The new theme copies the base's source files — renamed and rewritten for the new slug — with no link back. Use `--from` when you want to change a lot; for a small change that stays linked, use `extends` in `defineTheme`.
19
+
20
+ #### Fixes
21
+
22
+ - Say when a command did nothing: `upgrade` reports `sourcePathFound`, the integration checks report `validated`.
23
+ Two commands could legitimately do nothing and produce an envelope identical to a clean success. Both now carry the fact in a field of their own response instead of only in human text.
24
+
25
+ `astryx upgrade` defaults `--path` to `./src`. A project laid out as `app/` (or a typo) skipped every code codemod and still reported exit 0, `filesChanged: 0`, `errors: []` and "Upgrade complete". The only warning was a log line `--json` suppresses by design. `upgrade.run` now carries `sourcePathFound`, and the human completion line names the directory it did not find.
26
+
27
+ `astryx doctor integration validate|components|docs|templates` returned `{name: null, version: null, issues: []}` and exit 0 when no integration manifest was found — the same shape as a validated, healthy integration. All four envelopes now carry `validated`, false only when nothing was inspected.
28
+
29
+ - `astryx manifest --json` now takes each command's examples from its CommandDoc and its response types from the API function it wraps, so no example differs from the documented one and `upgrade` lists `upgrade.registry`, which `upgrade --registry --json` already emits.
30
+ - `astryx template <name> <path>` and `astryx layout expand` now say when they replaced Astryx demo media. The `template.copy` and `layout.expand` receipts carry `demoMediaReplaced`, the number of demo image and video references that became placeholders (one per reference, however many fixture paths its URL carries), and the text output names the file to update (when `layout expand` prints the code instead, the same line follows it as a comment, so the output is still valid TSX). Nothing about the copy itself changed.
31
+ - `astryx template <name>` and `template()` now return the same source that `astryx template <name> <path>` writes, and say how many Astryx demo media references they replaced. Demo images and videos that only Astryx's own previews serve are replaced the same way in both, so code copied from the printed source no longer points at media your project doesn't have. `template.show` gains `demoMediaReplaced` (0 when the template carried none); in text mode the count is stated on stderr so the printed source stays exact.
32
+ - A write that fails reports ERR_WRITE_FAILED instead of a raw Node errno.
33
+ `astryx template` into an unwritable directory returned `{"error": "EACCES: permission denied, open '/home/you/project/readonly/x.tsx'", "code": "ERR_UNKNOWN"}`, and `swizzle` returned the `mkdir` equivalent. Two things were wrong: ERR_WRITE_FAILED is already in the frozen error registry for exactly this case, and the message carried an absolute host path where every other Astryx message names its target relative to the project.
34
+
35
+ Both now throw ERR_WRITE_FAILED with the errno kept (it is the part that says what to fix) and the target named relative to the project. Nothing is left half-written: a `swizzle` that fails part-way removes the files it already copied and puts back any it replaced before it reports the error, and the message names any file it could not restore.
36
+
37
+ - When `discover --available` runs without a discover source, the CLI now
38
+ explains what discover sources are and where to find Astryx packages on npm, instead of the misleading message that told users to add package names they had no way to find. The base `discover` with no integrations also gains a pointer to npm and the integrations docs.
39
+ - A package with a namespace doc or a placed guide needs `@astryxdesign/cli` 0.6.4, not 0.7.0.
40
+ Published 0.6.4 reads an integration's docs tree: it lists the namespace and reads each guide placed in it. 0.6.3 rejects a namespace doc and hides every doc topic the package ships. `integration add doc --parent` wrote `"@astryxdesign/cli": ">=0.7.0"`, a range no released CLI satisfies, and `integration verify` failed a docs-tree package whose CLI peer started at 0.6.4. `integration add doc --parent` now writes `">=0.6.4"`, marked optional, and `integration verify` accepts it. A template that sets `replaces` or `keywords` still needs `">=0.7.0"`.
41
+ - `gap-report` fails when a listed integration cannot load, instead of reporting a clean result.
42
+ An integration whose `astryx.integration` module throws on import or fails validation was left out of the handler set. With no other handler, the report fell through to the built-in GitHub fallback for Core: the command exited 0 with `consent_required`, printed nothing on stderr, and offered `--confirm-public` to file on Core's public tracker a report the integration might have been meant to receive.
43
+
44
+ The unloadable integration now records a failed delivery in its config position, with the load error and the fix in its message. Like any handler, it turns the fallback off, so the report never goes to another package's tracker. The command exits 1, and a failed or partial report now prints each failed delivery on stderr as well as in the receipt.
45
+
46
+ - `astryx integration add theme <name> --from <base>` now adds the packages the copied theme files import to `dependencies`.
47
+ A fork of a bundled theme such as `neutral` copies its `icons.tsx`, which imports `lucide-react`, but the package did not declare it. So `astryx theme build` on the fork failed with "Cannot find module 'lucide-react'", and an app that installed the package hit the same error. `--from` now adds each package the copied files import, at the range the bundled themes use. It leaves out Core and React, which every Astryx app already has, and anything the package already declares.
48
+ - `astryx integration pack` without `--check` now points only at `astryx integration verify`.
49
+ It used to say "Pass --check to verify the integration tarball, or run `astryx integration verify`", which sent people to the deprecated spelling. It now says that `integration pack` is now `integration verify`, and that `npm pack` builds the tarball. The error code and exit code are unchanged, and `integration pack --check` still runs the same check as before.
50
+ - Search: differentiate all-word matches by total quality; index themes
51
+ Within the all-words tier, every candidate whose strongest token hit was a keyword scored the same (e.g. 157), regardless of how the other query words matched. A doc matching both words by keyword outranked nothing, and `search "how to use a theme"` put API reference docs above the consumer theme guide.
52
+
53
+ The bonus now uses the sum of ALL token scores instead of just the strongest, so a candidate matching every word by keyword outranks one matching keyword + prose. The `theme` doc also gains consumer-facing keywords so it surfaces for questions like "how to use a theme" and "how to apply a theme".
54
+
55
+ Themes are now a search domain: bundled and integration-provided themes appear in results with their slug, displayName, package, and the `astryx theme add` command. `--type theme` filters to them. Like `--type doc`, it works outside an app, where an open search now covers the docs and themes. Search help, the manifest, and the API reference list the new domain and its result fields.
56
+
57
+ - Search ranks a theme's description as prose, not as keywords
58
+ A word a theme shares with your query only through its description, such as `minimal`, `focus` or `content`, now ranks the theme like any other description instead of like a declared keyword, so it no longer lands above the components, hooks and docs that declare that word. A theme still comes first for its own slug or display name: `astryx search neutral` finds the Neutral theme first.
59
+ - A package that ships a theme or a doc section `id` needs `@astryxdesign/cli` 0.6.4, not 0.7.0.
60
+ Published 0.6.4 reads typed theme descriptors and section ids; 0.6.3 rejects both and hides the package's themes or doc topics. The 0.6.5 notes said a stable CLI before 0.7.0 rejects them, so `integration add theme` wrote `"@astryxdesign/cli": ">=0.7.0"`, a range no released CLI satisfies, and `integration verify` failed a theme or section-id package whose CLI peer started at 0.6.4. `integration add theme` now writes `">=0.6.4"`, marked optional, and `integration verify` accepts it for themes and section ids. A template that sets `replaces` or `keywords` still needs `">=0.7.0"`.
61
+ - `theme build` resolves real icon imports from the selected theme instead of matching comment or string contents. Generated modules preserve named, aliased, default, and namespace registry imports, plus inherited icons with child overrides. Normal builds and `--check` reject unsupported inline registries with `ERR_THEME_INVALID` before generating or writing output. Move such a registry into its own module and import it into the theme file.
62
+ - `astryx theme build` in an app uses the app's installed `@astryxdesign/core`, and says to install Core when there is none.
63
+ Run one-off with `npx @astryxdesign/cli`, it failed with "Build @astryxdesign/core first (e.g. `pnpm -F @astryxdesign/core build`)" even when the app had Core installed, because it looked for Core only next to the CLI. It now generates with the Core the project installed, the same Core the app's `<Theme>` runs on. In an app without Core, the error now says to install it (`npm install @astryxdesign/core`). The build command stays only for the Astryx repository itself. The error code (`ERR_CORE_NOT_FOUND`) is unchanged.
64
+
65
+ #### Other Changes
66
+
67
+ - `TemplateDoc` gains an optional `keywords` list: the ideas, domains, and other names a builder might use for what the template serves. `parseTemplate` validates it, discovery carries it from every template source, `astryx search` matches it as it matches a template's description, and `astryx build` ranks page templates on it. Each Core page template's closing list of ideas moved out of its `description` into `keywords`, so descriptions describe the layout.
68
+ - `build` starts a part of a page where it lives (`spec:AST-048` FR3), and the project's own components say what a part is: an idea whose head noun is a word of a component's name or keywords, Core's or an integration's, asks for a part, unless the noun names a family of page templates or the idea lists three or more pieces. A part starts from the base template of the family the idea names, else from the app shell; a change to an existing page or part (an idea whose "existing" names a page family or a component, such as "the existing table", and that does not ask for a new page) starts from the app shell. The start's reason says which case applies and why.
69
+ - A family's base template leads its family unless a variant matches two terms of its own; a base that cannot start on its own never displaces the variant that leads.
70
+
71
+ Integration templates that set `keywords` need `@astryxdesign/cli` 0.7.0 or later. The template metadata object is strict, so a stable CLI before 0.7.0 rejects the field, drops that template, and hides the package's doc topics; only `template --list` and `search` print a warning. `integration verify` fails a package whose template sets `keywords` until it declares `@astryxdesign/cli >=0.7.0`, as it does for `replaces`.
72
+
73
+ - `api/build/kit/weights.mjs` scores each candidate start (the app shell and every ready page template) from the idea's stemmed words using the tables in `weights.json`, and blends those scores with the ranker's own. The blend decides the start of every whole page; a part or an edit starts where it did before, and the ranker's pick of a template the tables do not list stands. Without a weights file the ranker's pick stands. The response's shape is unchanged.
74
+
75
+ #### Contributors
76
+
77
+ Thanks to everyone who contributed to this release:
78
+
79
+ - @AstryxBot
80
+ - @cixzhang
81
+ - @jiunshinn
82
+ - @josephfarina
83
+ - @rubyycheung
84
+
85
+ ---
86
+
3
87
  # 0.6.5
4
88
 
5
89
  #### New Features
@@ -17,16 +101,19 @@
17
101
  One source file that four codemods each changed was reported as four files changed, so `filesChanged` matched `transformsApplied` and the documented meaning, "Total files changed", was not true. The human summary said the same thing: "Found 4 changes across 4 files" for one file.
18
102
 
19
103
  `filesChanged` is now the count of distinct files. `transformsApplied` is unchanged: a code or config codemod counts once for each file it changed, and a project codemod counts once. A file that both a core codemod and an integration codemod changed counts once in `filesChanged`.
104
+
20
105
  - A parse error prints the Astryx error format in text mode.
21
106
  `astryx theme list --lang zh-Hans` printed Commander's own line — `error: option '--lang <locale>' argument 'zh-Hans' is invalid…` — while every other CLI error prints `Error: …`. `--json` was already correct (`ERR_INVALID_LANG`), so the two modes agreed only on the exit code.
22
107
 
23
108
  Commander writes that line before any Astryx code runs, so the JSON shim — the one place that already sees every parse failure — now suppresses it and writes the Astryx line itself, from the same message, for both modes. Every parse failure is covered: unknown option, unknown command, missing argument, and an invalid value for a global option. `--help` and `--version` are untouched and still exit 0.
109
+
24
110
  - The CLI reference now matches what the commands do. Every `--help` ends with the command's examples and a `More:` line that names its full docs page. Function docs show each parameter's default, mark required parameters, list the error codes each function throws, and use examples that run. The response-type list adds `help`, `version`, and `upgrade.registry`, and `astryx manifest` now lists `upgrade.registry` for `upgrade`. The `--zh`, `--dense`, `--lang`, and `--detail` descriptions name the commands they change, and command summaries say when to use each command. When `astryx template` refuses to overwrite a file, it now says to re-run with `--overwrite` (or `-f`). The `upgrade` command page (`astryx docs cli/commands/upgrade`) now explains which files codemods never edit, what happens when one of them needs a change, and how to regenerate it.
25
111
  - `astryx integration pack --check` now checks the tarball when a `prepack`, `prepare`, or `postpack` script prints to stdout. Before, any lifecycle output made the check fail with "npm pack produced unparseable JSON output" before it looked at the tarball. A failing lifecycle script still fails the check, and its output stays in the `pack_failed` message.
26
112
  - `astryx doctor integration docs` fails when a namespace doc or a placement fails, as its help says.
27
113
  Such a failure hides the doc from the docs tree, so it now exits 1 with an `invalid_doc_graph` error instead of a warning. A link that names no doc still only warns, since it prints as written. `doctor integration docs` and `doctor integration components` also no longer print an `[ok]` line after a check that failed.
28
114
 
29
115
  A mistyped subcommand under `doctor` now fails and lists the subcommands the group has: `astryx doctor integrations` used to run the project checks, and `astryx doctor integration bogus` exited 0 in text though it exited 1 with `--json`.
116
+
30
117
  - A package that ships a theme, or a doc section with an `id`, now declares the CLI that can read it.
31
118
  A stable CLI before 0.7.0 rejects both: it cannot read the typed theme descriptors that `astryx integration add theme` writes, and it rejects a section `id`. Either way it hides the package's themes or doc topics with no warning. `astryx integration add theme` now adds `"@astryxdesign/cli": ">=0.7.0"` to `peerDependencies`, marked optional, and `astryx integration verify` fails with `themes_need_cli` or `section_ids_need_cli` when a package needs that peer range and does not declare it.
32
119
  - `astryx integration verify` resolves every public import in the packed package, not in your source folder.
package/README.md CHANGED
@@ -69,7 +69,7 @@ Results for "button" (20 of 239):
69
69
 
70
70
  Options:
71
71
 
72
- - `--type <component|hook|doc|template>`: restrict to a single domain
72
+ - `--type <component|hook|doc|template|theme>`: restrict to a single domain (`doc` and `theme` work outside an app too)
73
73
  - `--limit <n>`: cap the number of results (default 20)
74
74
  - `--verbose`: also print each result's match score and reason
75
75
  - `--json`: typed `{ apiVersion, type: 'search', data: { query, matchCount, results } }` envelope — `matchCount` is how many candidates matched in total, `results` the slice `--limit` allowed
@@ -78,24 +78,24 @@ Options:
78
78
 
79
79
  <!-- BEGIN GENERATED: commands -->
80
80
 
81
- | Command | Description |
82
- | ------------- | --------------------------------------------------------------------------------------------- |
83
- | `blog` | Read the Astryx blog from the published feed |
84
- | `build` | Build a page: the template to start from, or the workflow playbook (no query) |
85
- | `component` | List components or print component docs |
86
- | `discover` | Browse and search integrations: the ones you have and the ones you could add |
87
- | `docs` | Print reference docs |
88
- | `doctor` | Diagnose Astryx projects and integration packages |
89
- | `gap-report` | Report a missing component or feature to the package that owns it |
90
- | `hook` | List hooks or print hook docs |
91
- | `init` | Initialize the design system in your project |
92
- | `integration` | Author and verify an Astryx integration package |
93
- | `layout` | Generate XDS layouts from compressed expressions (XLE/XLO) |
94
- | `search` | Search components, hooks, docs, and templates in one ranked list |
95
- | `swizzle` | Copy component source for customization |
96
- | `template` | List, show, or scaffold page and block templates |
97
- | `theme` | Create and build themes: add a shipped one, compile to CSS, or list what a theme can override |
98
- | `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components |
81
+ | Command | Description |
82
+ | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83
+ | `blog` | Read the Astryx blog from the published feed |
84
+ | `build` | Build a page: the template to start from, or the workflow playbook (no query) |
85
+ | `component` | List components or print component docs |
86
+ | `discover` | Browse and search integrations: the ones you have and the ones you could add |
87
+ | `docs` | Print reference docs |
88
+ | `doctor` | Diagnose Astryx projects and integration packages |
89
+ | `gap-report` | Report a missing component or feature to the package that owns it |
90
+ | `hook` | List hooks or print hook docs |
91
+ | `init` | Initialize the design system in your project |
92
+ | `integration` | Author and verify an Astryx integration package |
93
+ | `layout` | Generate XDS layouts from compressed expressions (XLE/XLO) [DEPRECATED: DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.] |
94
+ | `search` | Search components, hooks, docs, templates, and themes in one ranked list |
95
+ | `swizzle` | Copy component source for customization |
96
+ | `template` | List, show, or scaffold page and block templates |
97
+ | `theme` | Add, switch, build, and author themes |
98
+ | `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components |
99
99
 
100
100
  <!-- END GENERATED: commands -->
101
101
  <!-- Generated by scripts/generate-cli-readme.mjs from `astryx manifest`. Run `pnpm -F @astryxdesign/cli readme`. -->
@@ -104,7 +104,7 @@ Options:
104
104
 
105
105
  `--json` works with every command listed in `jsonSupported` (`astryx manifest --json`), which is every command except the bare groups such as `astryx theme`. The other four change only the reads named here; other commands ignore them:
106
106
 
107
- - `--json`: Output as typed JSON envelope: `{ apiVersion, type, data, meta? }` (errors: `{ apiVersion, error, code, suggestions? }`)
107
+ - `--json`: Output as typed JSON envelope: `{ apiVersion, type, package?, data, meta? }` (errors: `{ apiVersion, error, code, suggestions? }`)
108
108
  - `--detail <level>`: Detail level for `component`, `hook`, and docs tree reads (such as `astryx docs cli/commands/build`), increasing in size: `brief` (names only, default for lists) < `compact` (names + 1-line descriptions) < `full` (full docs per entry). Single-item views default to `full`.
109
109
  - `--zh`: Simplified Chinese for component reads and for docs topics that have a translation (English otherwise)
110
110
  - `--dense`: Token-efficient dense text for `astryx component <Name>` and `astryx docs <topic>`
@@ -303,11 +303,12 @@ Shape:
303
303
  ```
304
304
 
305
305
  The manifest is **derived from Commander metadata** (commands, arguments, options)
306
- so it can't drift from the real command definitions. The two facts Commander
307
- doesn't track (`--json` support and emitted response types) are layered on from
308
- the `JSON_SUPPORTED` allowlist and a small declarative `RESPONSE_TYPES` map in
309
- `src/lib/manifest.mjs`, guarded by a drift test (`manifest.test.mjs`) so adding a
310
- command without describing it fails CI.
306
+ so it can't drift from the real command definitions. The facts Commander doesn't
307
+ track come from each command's docs: examples from its CommandDoc, and emitted
308
+ response types from the returns of the FunctionDoc it wraps (plus the few
309
+ envelopes the CLI layer builds itself). `--json` support comes from the
310
+ `JSON_SUPPORTED` allowlist. Drift tests (`manifest.test.mjs`) fail CI when a
311
+ command is added without describing it.
311
312
 
312
313
  **Backwards-compat:** the bare `astryx --json` envelope keeps `type: "help"` and its
313
314
  original shallow fields (`name`, `version`, `commands` as a `string[]` of names,
@@ -423,18 +424,18 @@ Every response has a `type` discriminant. The full set is below (generated from
423
424
  | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
424
425
  | `init.run` | The install receipt: the `mode` (`default` \| `features`), the features run, agent-doc files written, any soft `docsError`, whether theme guidance was emitted, the template outcome (`workflow` \| `created` \| `skipped`) plus its path, and whether the next-steps were emitted. |
425
426
  | `init.remove` | Confirmation that the managed agent-docs block was removed (`data.removed: true`) — returned when --remove-agents is set. |
426
- | `component.list` | The component catalog grouped by component group (each component's group field): `detail` (the level: names \| compact \| full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries, or a full ComponentDoc per entry. |
427
+ | `component.list` | The component catalog grouped by component group (each component's group field): `detail` (the level: names \| compact \| full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries ({name, package, description, import}), or a full ComponentDoc per entry with its package. |
427
428
  | `component.batch` | The component specialization of the shared `BatchResponse` and `BatchRow` types. An explicit programmatic selector array, or two or more CLI selectors, returns one ordered receipt: `count` plus `results`, one row per selector including duplicates. Every row carries `selector` and `status` (found \| not_found \| ambiguous \| error). A found row carries `result`, the same {type, data} response as one selector. An ambiguous row carries `code`, `error`, and `candidates` ({package, component, kind, installed}). Other failed rows carry `code`, `error`, and optional `suggestions` ({name, reason}). |
428
- | `component.detail` | One component's authored ComponentDoc plus ownership fields (package, the owner; import, the specifier; sourceAvailable, whether source exists) and parentDoc (present when the component is documented inside another component's doc, naming that doc). |
429
- | `component.detail.props` | Just one component's props table (ComponentPropDoc[]). |
430
- | `component.detail.source` | One component's source file, as {component, source}. |
431
- | `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. |
432
- | `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry. |
429
+ | `component.detail` | One component's authored ComponentDoc plus ownership fields (package, the owner; import, the specifier; sourceAvailable, whether source exists) and parentDoc (present when the component is documented inside another component's doc, naming that doc). The envelope's package names the same owner. |
430
+ | `component.detail.props` | Just one component's props table (ComponentPropDoc[]). The envelope's package names the npm package that owns the component. |
431
+ | `component.detail.source` | One component's source file, as {component, source}. The envelope's package names the npm package that owns the component. |
432
+ | `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. The envelope's package names the npm package that owns the component. |
433
+ | `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry ({name, package, displayName, description, isShowcase, category}); each block names the package that owns it, and the envelope's package names the component's owner. |
433
434
  | `docs.list` | All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load. |
434
- | `docs.detail` | One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
435
- | `docs.index` | One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, summary} (pass the id as the section argument; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
436
- | `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open its topic index and the sections before and after it). |
437
- | `docs.node` | One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names). |
435
+ | `docs.detail` | One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined and each section naming the package that wrote it, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
436
+ | `docs.index` | One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, package, summary} (pass the id as the section argument; package is the npm package that wrote the section; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
437
+ | `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open its topic index and the sections before and after it). The envelope's package names the npm package that wrote the section. |
438
+ | `docs.node` | One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down, each naming its package) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names). |
438
439
  | `blog.list` | The feed URL plus every post parsed from the RSS feed, each with slug, title, description, date, type, authors, link, and plaintext URL. |
439
440
  | `blog.detail` | One post's metadata plus the feed URL and the post's full plaintext body. |
440
441
  | `discover.list` | The integrations the project loads (name, category, components, version, a list per other kind they add, and latest when a source knows it); with a discover source, meta.available lists what the project could add and meta.sources reports each source; when empty it carries meta.configured to tell "nothing configured" from "nothing discovered". |
@@ -442,46 +443,48 @@ Every response has a `type` discriminant. The full set is below (generated from
442
443
  | `discover.detail.doc` | The validated ComponentDoc for one installed component, for an @scope/name/Component query. |
443
444
  | `discover.item` | One item that is not an installed component, for an @scope/name/<item> query: its kind, name, package, version, and whether the project has the package. |
444
445
  | `discover.search` | The echoed query plus every matching item and package across all packages, each with its kind and whether the project has it, even when only one matches; total is set when --limit cut the list. |
445
- | `search` | The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, score, reason, description, command}, plus import (components, hooks), title, parent (the command that opens the level above), package (for a docs-tree hit), and, for a hit on one section, section (docs), or displayName and kind (templates). |
446
+ | `search` | The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, package, score, reason, description, command} (package is the npm package that owns the result), plus import (components, hooks), title, parent (the command that opens the level above), and, for a hit on one section, section (docs), or displayName and kind (templates). |
446
447
  | `build.help` | The how-to-build-a-page playbook, emitted when no query is given: `playbook: true`, a title, the ordered steps (title, commands, optional returns), the on-system rules, and related lookups. Commands are bare subcommands for the caller to render with its own invocation. |
447
- | `build.kit` | The template to start from and its kit: query, hasResults, matchCount (never a cap), directMatch, start {name, command, basis, reason, alternatives, ...}, pages (search's closest templates), blocks and domain as SearchResultEntry[], frame, foundation, and hint {reason, commands} when thin. |
448
- | `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. |
449
- | `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling. |
448
+ | `build.kit` | The template to start from and its kit: query, hasResults, matchCount (never a cap), directMatch, start {name, package, command, basis, reason, alternatives, ...} (the start and each alternative name the package that owns the template), pages (search's closest templates), blocks and domain as SearchResultEntry[] (each naming its package), frame and foundation (Core component names), and hint {reason, commands} when thin. |
449
+ | `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. The envelope's package is @astryxdesign/core. |
450
+ | `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling. The envelope's package names the same owning package. |
450
451
  | `gap-report.categories` | The fixed gap category values and human-readable labels. |
451
452
  | `gap-report.file` | An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project \| integration \| fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals. |
452
453
  | `template.list` | The effective discovered TemplateListEntry[] for pages and blocks. A winning replacement entry includes optional `replaces`, naming the Core id omitted from the default list. |
453
- | `template.show` | The resolved template's raw source plus its description, kind, and the component names it composes. |
454
- | `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. |
455
- | `template.copy` | A scaffold receipt: template id, output directory, written file name, and file count. |
454
+ | `template.show` | The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media). |
455
+ | `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. The envelope's package names the npm package that owns the template. |
456
+ | `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media). The envelope's package names the npm package that owns the template. |
456
457
  | `template.cdn` | A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
457
- | `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. |
458
- | `hook.detail` | One hook's full authored HookDoc. |
459
- | `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). |
460
- | `theme.build` | A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load). |
458
+ | `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. The envelope's package is @astryxdesign/core, the only package that ships hooks. |
459
+ | `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core. |
460
+ | `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). The envelope's package is @astryxdesign/core. |
461
+ | `theme.build` | A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, cssDts, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load). |
461
462
  | `theme.build.check` | The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing \| outdated}), and the full list of checked paths. Writes nothing. |
462
463
  | `theme.build.batch` | Several themes built in one invocation: `count` plus one {file, receipt} per theme in argument order, where receipt is that theme's theme.build (or theme.build.check) envelope, or null when it produced no CSS. |
463
- | `theme.list` | Every bundled or installed integration theme as a ThemeListEntry[]: each with slug, displayName, description, maintained flag, and owner package. |
464
- | `theme.add` | A scaffold receipt: resolved slug, displayName, maintained flag, owner package, outputDir (relative to cwd), the theme entry file, its exportName, and the files written. |
464
+ | `theme.list` | Every bundled, installed package, and local theme as a ThemeListEntry[]. Each entry has slug, displayName, description, maintained, owner package or local root, source, added, and default fields. Optional meta.unmigratedCopies names earlier descriptor-less copies, their missing descriptor, and the upgrade command; those copies are not data entries. |
465
+ | `theme.add` | The released source-copy receipt: slug, displayName, maintained flag, owner package, outputDir, source entry, exportName, and files. Its additive meta.deprecations entry names DEP-0005 and the source-fork/import replacements. |
466
+ | `theme.app` | The app theme record after add, remove, or use. It includes every added theme and its built imports, the default slug, generated module path, and the command change. After add, the envelope package names the npm package that owns the added theme; a local theme has none. |
467
+ | `theme.eject` | A local source-fork receipt with the resolved slug, displayName, source theme maintained flag, source-selector package, outputDir, source entry, exportName, and every file written, including the descriptor. The written local descriptor always uses maintained: false. |
465
468
  | `theme.template` | A write receipt for the annotated theme template: the path (relative to cwd), whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
466
469
  | `theme.targets` | The whole themeable surface: the echoed filter, componentCount, and targets, one per theming target — {key, className, component, props, states, deprecatedFor?}, where props and states are its legal override keys and deprecatedFor names the canonical replacement key. |
467
470
  | `theme.palette.generate` | An author-reviewable OKLCH palette candidate, its reproducibility receipt, summary counts, and optional candidate/receipt file-write result. |
468
- | `upgrade.list` | Every available codemod, oldest→newest, as {name, title, version, optional}; returned for --list without running anything. |
471
+ | `upgrade.list` | Every available codemod, oldest→newest, as {name, package, title, version, optional}; returned for --list without running anything. |
469
472
  | `upgrade.registry` | The copied-composition receipt for --registry: applied, ok, the counts (found, current, wouldUpdate, updated, wouldMerge, merged, wouldRefreshReceipt, receiptsRefreshed, conflicts, missing, invalid, failed), and items. |
470
473
  | `upgrade.status` | A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary. |
471
- | `upgrade.run` | The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, and (apply mode) filesChanged, transformsApplied, and per-codemod errors. |
474
+ | `upgrade.run` | The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, sourcePathFound (false when the resolved source directory does not exist, so no source file was read), and (apply mode) filesChanged, transformsApplied, and per-codemod errors. |
472
475
  | `manifest` | The CLI capability manifest: name, version, apiVersion, description, globalOptions, commands (each name, description, arguments, options, json, aliases?, responseTypes?, examples?, exitCodes? as [{code, when}], subcommands?), jsonSupported, and the flat responseTypes index. |
473
476
  | `help` | Help, in one of two shapes. A bare `astryx --json` returns the root manifest: name, version, commands (the command names), jsonSupported, and manifest (the full payload `astryx manifest --json` returns). `--help --json` on any command, or `astryx help [command] --json`, returns that command's help: command, description, usage, options (each flags, description, and defaultValue and choices when set), and subcommands (each name and description). data.manifest marks the first shape; data.usage marks the second. |
474
477
  | `version` | The CLI version, for `astryx --version --json`: {version}. |
475
478
  | `doctor` | The health-check report: `checks` (each with id, label, status: pass \| warn \| fail \| info, a message, and an optional fix, always present on warn and fail) plus a `summary` of counts per status. |
476
479
  | `integration.add` | A contribution-writer receipt: kind, name, optional root {path, created}, integration-manifest path, every affected project-relative path, written, and dryRun. |
477
480
  | `integration.pack-check` | The packed-package check: name, version, packable, tarball {filename, fileCount, size, unpackedSize} or null, inventory {manifest, roots [{kind, path, expectedFiles, missingFiles, complete}], expectedFiles, packedFiles}, contributions {local, packed}, each null or {themes [{slug, exportName}], components, templates [{id, type, name}], codemods [{version, id}], docs, agentDocsAppend}, and issues [{code, severity, message}]. |
478
- | `integration.validate` | The validation result: the package name and version (both null when no local manifest is found) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning \| error, message}. |
479
- | `integration.template-conflicts` | The integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}. |
480
- | `integration.component-conflicts` | The integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. |
481
- | `integration.doc-conflicts` | The integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` \| `error`) and `relationship` (`replaces` \| `extends` \| `accidental`). |
482
- | `layout.expand` | The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, and written (the output path, or null when nothing was written). |
483
- | `layout.check` | The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline). |
484
- | `layout.grammar` | The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry. |
481
+ | `integration.validate` | The validation result: validated (false when no integration manifest was found, so nothing was checked and the empty issues list proves nothing), the package name and version (both null when validated is false) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning \| error, message}. |
482
+ | `integration.template-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}. |
483
+ | `integration.component-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. |
484
+ | `integration.doc-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` \| `error`) and `relationship` (`replaces` \| `extends` \| `accidental`). |
485
+ | `layout.expand` | The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the output path, or null when nothing was written), and demoMediaReplaced (count of demo media placeholders). Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
486
+ | `layout.check` | The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline). Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
487
+ | `layout.grammar` | The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry. Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
485
488
 
486
489
  <!-- END GENERATED: response-types -->
487
490
  <!-- Generated by scripts/generate-cli-readme.mjs from the response-types EnumDoc. Run `pnpm -F @astryxdesign/cli readme`. -->
@@ -7,8 +7,16 @@
7
7
  * @property {string} name The template's own id, as search reports it.
8
8
  * @property {string} command `astryx template <id> --type page`, the command that selects exactly this template: an integration replacement is selected by the Core id it replaces, and `--type page` keeps a block with the same id from making it ambiguous. Search prints template commands the same way.
9
9
  * @property {string} displayName Human-facing name.
10
- * @property {string} description What the page is: its layout and the ideas it serves.
10
+ * @property {string} description What the page is and how it is laid out.
11
+ * @property {string} package The npm package that owns this template.
11
12
  * @property {string} category The template's own `Family - Variant` label; empty when it declares none.
13
+ * @property {string[]} keywords The ideas the page serves, as its own descriptor names them; empty when it declares none.
14
+ */
15
+ /**
16
+ * A component the project can use, as the ranker reads it.
17
+ * @typedef {object} ComponentWords
18
+ * @property {string} name The component's name, e.g. `DateRangeInput`.
19
+ * @property {string[]} keywords The keywords its own doc declares.
12
20
  */
13
21
  /**
14
22
  * Every ready page template the project can scaffold, in discovery order. This
@@ -23,6 +31,30 @@
23
31
  * @returns {Promise<PageTemplate[]>}
24
32
  */
25
33
  export function loadPageTemplates(cwd: string): Promise<PageTemplate[]>;
34
+ /**
35
+ * The components the project can use, Core's and its integrations', each with
36
+ * the keywords its own doc declares: what the ranker reads to tell a part of a
37
+ * page from a page. Search's own discovery, so both agree on what exists; empty
38
+ * when Core cannot be found.
39
+ *
40
+ * @param {string} cwd
41
+ * @returns {Promise<ComponentWords[]>}
42
+ */
43
+ export function loadComponents(cwd: string): Promise<ComponentWords[]>;
44
+ /**
45
+ * The matcher weights checked in beside the kit (`kit/weights.json`), read
46
+ * once; null when the file is absent or unreadable.
47
+ * @returns {import('./kit/weights.mjs').WeightsFile | null}
48
+ */
49
+ export function loadWeights(): import("./kit/weights.mjs").WeightsFile | null;
50
+ /**
51
+ * Whether a parsed weights file has the shape the kit reads: every row has a
52
+ * weight per candidate, every bias a number per candidate, and three blend
53
+ * numbers per member (the tables plus the ranker) and one for the shell.
54
+ * @param {any} file
55
+ * @returns {file is import('./kit/weights.mjs').WeightsFile}
56
+ */
57
+ export function isWeightsFile(file: any): file is import("./kit/weights.mjs").WeightsFile;
26
58
  /**
27
59
  * A page template the kit can recommend starting from.
28
60
  */
@@ -40,11 +72,32 @@ export type PageTemplate = {
40
72
  */
41
73
  displayName: string;
42
74
  /**
43
- * What the page is: its layout and the ideas it serves.
75
+ * What the page is and how it is laid out.
44
76
  */
45
77
  description: string;
78
+ /**
79
+ * The npm package that owns this template.
80
+ */
81
+ package: string;
46
82
  /**
47
83
  * The template's own `Family - Variant` label; empty when it declares none.
48
84
  */
49
85
  category: string;
86
+ /**
87
+ * The ideas the page serves, as its own descriptor names them; empty when it declares none.
88
+ */
89
+ keywords: string[];
90
+ };
91
+ /**
92
+ * A component the project can use, as the ranker reads it.
93
+ */
94
+ export type ComponentWords = {
95
+ /**
96
+ * The component's name, e.g. `DateRangeInput`.
97
+ */
98
+ name: string;
99
+ /**
100
+ * The keywords its own doc declares.
101
+ */
102
+ keywords: string[];
50
103
  };