@astryxdesign/cli 0.6.4-canary.f0355e3 → 0.6.4

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 (331) hide show
  1. package/README.md +96 -99
  2. package/api/build/build.doc.mjs +1 -6
  3. package/api/build/build.test.mjs +0 -22
  4. package/api/build/kit/kit.mjs +5 -44
  5. package/api/component/_adapter.d.mts +0 -25
  6. package/api/component/_adapter.mjs +5 -59
  7. package/api/component/component.d.mts +3 -6
  8. package/api/component/component.doc.mjs +17 -37
  9. package/api/component/component.mjs +9 -249
  10. package/api/component/component.type.d.mts +0 -25
  11. package/api/component/component.type.mjs +0 -44
  12. package/api/discover/_adapter.d.mts +6 -114
  13. package/api/discover/_adapter.mjs +17 -372
  14. package/api/discover/detail/detail.d.mts +6 -18
  15. package/api/discover/detail/detail.mjs +13 -67
  16. package/api/discover/detail/detail.test.mjs +0 -85
  17. package/api/discover/discover.d.mts +9 -3
  18. package/api/discover/discover.doc.mjs +18 -61
  19. package/api/discover/discover.mjs +36 -220
  20. package/api/discover/discover.test.mjs +2 -11
  21. package/api/discover/discover.type.d.mts +8 -147
  22. package/api/discover/discover.type.mjs +12 -102
  23. package/api/discover/list/list.d.mts +6 -20
  24. package/api/discover/list/list.mjs +12 -45
  25. package/api/discover/list/list.test.mjs +0 -46
  26. package/api/discover/search/search.d.mts +16 -18
  27. package/api/discover/search/search.mjs +56 -102
  28. package/api/discover/search/search.test.mjs +10 -144
  29. package/api/docs/_adapter.d.mts +3 -8
  30. package/api/docs/_adapter.mjs +6 -14
  31. package/api/docs/docOverlays.test.mjs +1 -27
  32. package/api/docs/docs.doc.mjs +2 -2
  33. package/api/docs/docs.test.mjs +243 -0
  34. package/api/docs/integration-tree.test.mjs +555 -0
  35. package/api/docs/integrationDocs.test.mjs +314 -0
  36. package/api/doctor/doctor.d.mts +3 -8
  37. package/api/doctor/doctor.doc.mjs +8 -17
  38. package/api/doctor/doctor.mjs +9 -90
  39. package/api/doctor/doctor.test.mjs +10 -122
  40. package/api/doctor/doctor.type.d.mts +1 -1
  41. package/api/doctor/doctor.type.mjs +1 -1
  42. package/api/gap-report/gap-report.doc.mjs +10 -19
  43. package/api/hook/hook.doc.mjs +3 -6
  44. package/api/index.d.mts +2 -1
  45. package/api/index.mjs +5 -5
  46. package/api/init/init.doc.mjs +12 -17
  47. package/api/integration/add-helpers.d.mts +2 -5
  48. package/api/integration/add-helpers.mjs +9 -36
  49. package/api/integration/add-theme.mjs +1 -22
  50. package/api/integration/add-theme.test.mjs +0 -34
  51. package/api/integration/authoring-checks.mjs +2 -2
  52. package/api/integration/integrationPackCheck.doc.mjs +3 -3
  53. package/api/integration/pack-check.mjs +9 -82
  54. package/api/integration/pack-check.test.mjs +0 -90
  55. package/api/integration/pack-check.type.mjs +1 -1
  56. package/api/json/assertResponse.doc.mjs +1 -1
  57. package/api/json/index.ts +1 -0
  58. package/api/json/isError.doc.mjs +1 -1
  59. package/api/layout/_adapter.d.mts +34 -0
  60. package/api/layout/_adapter.mjs +148 -0
  61. package/api/layout/check/check.d.mts +16 -0
  62. package/api/layout/check/check.mjs +40 -0
  63. package/api/layout/expand/expand.d.mts +22 -0
  64. package/api/layout/expand/expand.mjs +155 -0
  65. package/api/layout/expand/expand.path-safety.test.mjs +53 -0
  66. package/api/layout/grammar/grammar.d.mts +13 -0
  67. package/api/layout/grammar/grammar.mjs +87 -0
  68. package/api/layout/layout.d.mts +6 -0
  69. package/api/layout/layout.mjs +17 -0
  70. package/api/layout/layout.test.mjs +297 -0
  71. package/api/layout/layout.type.d.mts +89 -0
  72. package/api/layout/layout.type.mjs +103 -0
  73. package/api/layout/layoutCheck.doc.d.mts +11 -0
  74. package/api/layout/layoutCheck.doc.mjs +85 -0
  75. package/api/layout/layoutExpand.doc.d.mts +11 -0
  76. package/api/layout/layoutExpand.doc.mjs +107 -0
  77. package/api/layout/layoutGrammar.doc.d.mts +11 -0
  78. package/api/layout/layoutGrammar.doc.mjs +57 -0
  79. package/api/search/search.d.mts +1 -27
  80. package/api/search/search.doc.mjs +2 -2
  81. package/api/search/search.mjs +16 -228
  82. package/api/search/search.test.mjs +512 -0
  83. package/api/swizzle/swizzle.doc.mjs +5 -7
  84. package/api/template/copy/copy.mjs +1 -1
  85. package/api/template/copy/copy.test.mjs +0 -9
  86. package/api/template/template-integration.test.mjs +65 -1
  87. package/api/template/template.doc.mjs +1 -2
  88. package/api/template/template.mjs +1 -1
  89. package/api/theme/add/add.mjs +25 -17
  90. package/api/theme/add/add.staging.test.mjs +23 -40
  91. package/api/theme/build/build.family.test.mjs +12 -7
  92. package/api/theme/build/build.mjs +18 -8
  93. package/api/theme/generateTonalPalette.doc.mjs +2 -1
  94. package/api/theme/listThemes.doc.mjs +1 -1
  95. package/api/theme/themeAdd.doc.mjs +10 -9
  96. package/api/theme/themeBuild.doc.mjs +13 -13
  97. package/api/theme/themeList.doc.mjs +1 -1
  98. package/api/theme/themeListAvailable.doc.mjs +1 -2
  99. package/api/theme/themePaletteGenerate.doc.mjs +8 -15
  100. package/api/theme/themeTargets.doc.mjs +2 -3
  101. package/api/theme/themeTemplate.doc.mjs +1 -2
  102. package/api/upgrade/run/run.mjs +4 -6
  103. package/api/upgrade/upgrade.doc.mjs +22 -24
  104. package/api/upgrade/upgrade.type.mjs +2 -2
  105. package/assets/codemods/__tests__/runner.test.mjs +1 -3
  106. package/assets/codemods/integration-runner.mjs +3 -3
  107. package/assets/codemods/runner.mjs +4 -5
  108. package/assets/docs/README.md +2 -4
  109. package/assets/docs/browser-support.doc.mjs +11 -11
  110. package/assets/docs/color.doc.mjs +2 -8
  111. package/assets/docs/elevation.doc.mjs +4 -6
  112. package/assets/docs/getting-started.doc.mjs +16 -5
  113. package/assets/docs/icons.doc.mjs +21 -2
  114. package/assets/docs/illustrations.doc.mjs +15 -7
  115. package/assets/docs/internationalization.doc.mjs +5 -7
  116. package/assets/docs/layout.doc.dense.mjs +82 -130
  117. package/assets/docs/layout.doc.mjs +77 -133
  118. package/assets/docs/migration.doc.mjs +21 -19
  119. package/assets/docs/motion.doc.mjs +3 -16
  120. package/assets/docs/principles.doc.dense.mjs +5 -5
  121. package/assets/docs/principles.doc.mjs +0 -8
  122. package/assets/docs/principles.doc.zh.mjs +6 -6
  123. package/assets/docs/shape.doc.mjs +3 -8
  124. package/assets/docs/spacing.doc.mjs +2 -7
  125. package/assets/docs/styling-libraries.doc.mjs +2 -6
  126. package/assets/docs/styling.doc.mjs +23 -19
  127. package/assets/docs/theme.doc.dense.mjs +18 -58
  128. package/assets/docs/theme.doc.mjs +46 -56
  129. package/assets/docs/theme.doc.zh.mjs +8 -9
  130. package/assets/docs/tokens.doc.dense.mjs +2 -2
  131. package/assets/docs/tokens.doc.mjs +8 -389
  132. package/assets/docs/tokens.doc.zh.mjs +2 -2
  133. package/assets/docs/tree/integrations.doc.mjs +451 -25
  134. package/assets/docs/tree/integrations.test.mjs +62 -0
  135. package/assets/docs/tree/writing-docs.doc.mjs +286 -0
  136. package/assets/docs/typography.doc.mjs +4 -24
  137. package/assets/docs/working-with-ai.doc.mjs +22 -30
  138. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
  139. package/authoring/config/config.doc.mjs +2 -10
  140. package/authoring/config/parse.d.mts +0 -2
  141. package/authoring/config/parse.mjs +0 -19
  142. package/authoring/config/parse.test.mjs +0 -8
  143. package/authoring/config/type.ts +2 -13
  144. package/authoring/doctypes/_schema.d.mts +2 -3
  145. package/authoring/doctypes/_schema.mjs +0 -6
  146. package/authoring/doctypes/base/graph-fields.doc.mjs +3 -3
  147. package/authoring/doctypes/base/type.ts +2 -4
  148. package/authoring/doctypes/command/command.doc.mjs +1 -1
  149. package/authoring/doctypes/command/type.ts +1 -1
  150. package/authoring/doctypes/component/component.doc.mjs +0 -6
  151. package/authoring/doctypes/component/type.ts +0 -8
  152. package/authoring/doctypes/reference/reference.doc.mjs +0 -7
  153. package/authoring/doctypes/reference/type.ts +0 -5
  154. package/authoring/doctypes/schema/schema.doc.mjs +2 -2
  155. package/authoring/doctypes/template/template.doc.mjs +1 -1
  156. package/authoring/doctypes/template/type.ts +2 -2
  157. package/authoring/index.d.mts +0 -1
  158. package/authoring/index.d.ts +0 -10
  159. package/authoring/index.mjs +0 -1
  160. package/authoring/integration/integration.doc.mjs +10 -12
  161. package/clients/cli/command-result-coverage.test.mjs +7 -7
  162. package/clients/cli/commands/component/index.mjs +55 -152
  163. package/clients/cli/commands/component-ownership.test.mjs +0 -89
  164. package/clients/cli/commands/component.doc.mjs +9 -27
  165. package/clients/cli/commands/debug-result-summary.test.mjs +2 -2
  166. package/clients/cli/commands/discover.doc.mjs +9 -53
  167. package/clients/cli/commands/discover.mjs +118 -393
  168. package/clients/cli/commands/docs.doc.mjs +1 -1
  169. package/clients/cli/commands/docs.mjs +17 -60
  170. package/clients/cli/commands/docs.test.mjs +294 -0
  171. package/clients/cli/commands/doctor-integration-docs.doc.mjs +2 -3
  172. package/clients/cli/commands/doctor-integration.test.mjs +0 -53
  173. package/clients/cli/commands/doctor.doc.mjs +1 -3
  174. package/clients/cli/commands/doctor.mjs +5 -49
  175. package/clients/cli/commands/gap-report.doc.mjs +9 -10
  176. package/clients/cli/commands/init.doc.mjs +6 -9
  177. package/clients/cli/commands/integration-add.doc.mjs +9 -9
  178. package/clients/cli/commands/integration-authoring.test.mjs +10 -61
  179. package/clients/cli/commands/integration-pack.doc.mjs +9 -5
  180. package/clients/cli/commands/integration-real-world.test.mjs +1 -1
  181. package/clients/cli/commands/integration.doc.mjs +4 -4
  182. package/clients/cli/commands/integration.mjs +43 -74
  183. package/clients/cli/commands/layout-check.doc.mjs +65 -0
  184. package/clients/cli/commands/layout-expand.doc.mjs +83 -0
  185. package/clients/cli/commands/layout-grammar.doc.mjs +30 -0
  186. package/clients/cli/commands/layout.doc.mjs +34 -0
  187. package/clients/cli/commands/layout.error-codes.test.mjs +66 -0
  188. package/clients/cli/commands/layout.exit-parity.test.mjs +41 -0
  189. package/clients/cli/commands/layout.mjs +275 -0
  190. package/clients/cli/commands/layout.path-help.test.mjs +33 -0
  191. package/clients/cli/commands/layout.stdin-cap.test.mjs +47 -0
  192. package/clients/cli/commands/layout.text-fields.test.mjs +39 -0
  193. package/clients/cli/commands/manifest.doc.mjs +1 -1
  194. package/clients/cli/commands/search.doc.mjs +3 -10
  195. package/clients/cli/commands/search.mjs +2 -21
  196. package/clients/cli/commands/search.test.mjs +4 -21
  197. package/clients/cli/commands/swizzle.doc.mjs +1 -1
  198. package/clients/cli/commands/template.doc.mjs +1 -1
  199. package/clients/cli/commands/text-json-parity.test.mjs +16 -5
  200. package/clients/cli/commands/theme-add.doc.mjs +1 -1
  201. package/clients/cli/commands/theme-palette-generate.doc.mjs +2 -3
  202. package/clients/cli/commands/theme-palette.doc.mjs +2 -1
  203. package/clients/cli/commands/theme-targets.doc.mjs +2 -2
  204. package/clients/cli/commands/theme.doc.mjs +1 -2
  205. package/clients/cli/commands/upgrade.doc.mjs +3 -62
  206. package/clients/cli/index.mjs +10 -28
  207. package/clients/cli/lib/define-command.mjs +4 -28
  208. package/clients/cli/lib/define-command.test.mjs +0 -54
  209. package/clients/cli/lib/exit-codes.test.mjs +9 -18
  210. package/clients/cli/lib/json-shim.mjs +14 -24
  211. package/clients/cli/lib/json-shim.test.mjs +20 -6
  212. package/clients/cli/lib/manifest.mjs +13 -18
  213. package/clients/cli/lib/manifest.test.mjs +2 -5
  214. package/foundation/agent-docs/agent-docs.mjs +1 -1
  215. package/foundation/agent-docs/agent-docs.test.mjs +1159 -0
  216. package/foundation/discovery/authoring-self-docs.mjs +0 -1
  217. package/foundation/discovery/authoring-self-docs.test.mjs +2 -6
  218. package/foundation/discovery/cli-self-docs.mjs +2 -16
  219. package/foundation/discovery/cli-self-docs.test.mjs +0 -20
  220. package/foundation/discovery/docs-discovery.mjs +1 -5
  221. package/foundation/discovery/docs-discovery.test.mjs +0 -21
  222. package/foundation/discovery/docs-section-key.d.mts +1 -1
  223. package/foundation/discovery/docs-section-key.mjs +1 -1
  224. package/foundation/discovery/template-adapter.mjs +1 -1
  225. package/foundation/doc-compiler/doc-loads.test.mjs +14 -3
  226. package/foundation/doc-compiler/tree.d.mts +0 -4
  227. package/foundation/doc-compiler/tree.mjs +1 -6
  228. package/foundation/doc-compiler/tree.test.mjs +598 -0
  229. package/foundation/integrations/cli-requirement.d.mts +6 -26
  230. package/foundation/integrations/cli-requirement.mjs +11 -46
  231. package/foundation/integrations/cli-requirement.test.mjs +2 -7
  232. package/foundation/integrations/contribution-inventory.mjs +1 -1
  233. package/foundation/integrations/integrations.d.mts +1 -14
  234. package/foundation/integrations/integrations.mjs +1 -41
  235. package/foundation/integrations/integrations.test.mjs +0 -31
  236. package/foundation/response/error-codes.doc.mjs +8 -6
  237. package/foundation/response/error-codes.test.mjs +5 -30
  238. package/foundation/response/response-types.doc.d.mts +3 -4
  239. package/foundation/response/response-types.doc.mjs +27 -40
  240. package/foundation/response/response-types.doc.test.mjs +0 -23
  241. package/foundation/response/response.doc.mjs +10 -11
  242. package/foundation/xle/browser.d.mts +3 -3
  243. package/foundation/xle/browser.mjs +3 -3
  244. package/foundation/xle/expand.mjs +2 -2
  245. package/foundation/xle/parse.mjs +1 -1
  246. package/foundation/xle/print.mjs +2 -2
  247. package/foundation/xle/splice.mjs +1 -1
  248. package/package.json +9 -9
  249. package/api/discover/_adapter.test.mjs +0 -215
  250. package/api/discover/_catalog-view.d.mts +0 -115
  251. package/api/discover/_catalog-view.mjs +0 -203
  252. package/api/discover/_catalog-view.test.mjs +0 -128
  253. package/api/discover/detail/item/item.d.mts +0 -26
  254. package/api/discover/detail/item/item.mjs +0 -78
  255. package/api/discover/detail/item/item.test.mjs +0 -73
  256. package/api/integration/pack-check.lifecycle-output.test.mjs +0 -107
  257. package/api/theme/add/add.rollback.test.mjs +0 -158
  258. package/api/theme/build/build.rollback.test.mjs +0 -148
  259. package/api/upgrade/run/files-changed.test.mjs +0 -111
  260. package/assets/codemods/file-count.test.mjs +0 -163
  261. package/assets/docs/tree/add-a-component.doc.mjs +0 -75
  262. package/assets/docs/tree/add-a-theme.doc.mjs +0 -85
  263. package/assets/docs/tree/add-a-topic.doc.mjs +0 -144
  264. package/assets/docs/tree/agent-guidance.doc.mjs +0 -138
  265. package/assets/docs/tree/block-template.doc.mjs +0 -130
  266. package/assets/docs/tree/build-the-template.doc.mjs +0 -28
  267. package/assets/docs/tree/building-blocks.doc.mjs +0 -46
  268. package/assets/docs/tree/check-your-docs.doc.mjs +0 -137
  269. package/assets/docs/tree/checks.doc.mjs +0 -119
  270. package/assets/docs/tree/codemods.doc.mjs +0 -147
  271. package/assets/docs/tree/component-family.doc.mjs +0 -113
  272. package/assets/docs/tree/component-imports.doc.mjs +0 -69
  273. package/assets/docs/tree/component-lookups.doc.mjs +0 -149
  274. package/assets/docs/tree/components.doc.mjs +0 -23
  275. package/assets/docs/tree/configuration.doc.mjs +0 -23
  276. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +0 -182
  277. package/assets/docs/tree/define-the-theme.doc.mjs +0 -118
  278. package/assets/docs/tree/describe-the-component.doc.mjs +0 -57
  279. package/assets/docs/tree/docs.doc.mjs +0 -21
  280. package/assets/docs/tree/document-the-template.doc.mjs +0 -28
  281. package/assets/docs/tree/document-the-theme.doc.mjs +0 -68
  282. package/assets/docs/tree/export-template-assets.doc.mjs +0 -147
  283. package/assets/docs/tree/extend-or-replace.doc.mjs +0 -103
  284. package/assets/docs/tree/fonts-and-assets.doc.mjs +0 -106
  285. package/assets/docs/tree/generate-a-palette.doc.mjs +0 -66
  286. package/assets/docs/tree/grade-template-with-agent.doc.mjs +0 -105
  287. package/assets/docs/tree/help.doc.mjs +0 -16
  288. package/assets/docs/tree/links.doc.mjs +0 -98
  289. package/assets/docs/tree/package-and-test.doc.mjs +0 -32
  290. package/assets/docs/tree/page-template.doc.mjs +0 -71
  291. package/assets/docs/tree/publishing.doc.mjs +0 -111
  292. package/assets/docs/tree/quick-start.doc.mjs +0 -272
  293. package/assets/docs/tree/replace-a-core-component.doc.mjs +0 -104
  294. package/assets/docs/tree/replace-a-core-template.doc.mjs +0 -172
  295. package/assets/docs/tree/sections-and-placement.doc.mjs +0 -108
  296. package/assets/docs/tree/see-it-in-an-app.doc.mjs +0 -59
  297. package/assets/docs/tree/ship.doc.mjs +0 -16
  298. package/assets/docs/tree/short-and-findable.doc.mjs +0 -108
  299. package/assets/docs/tree/single-component.doc.mjs +0 -165
  300. package/assets/docs/tree/start-a-template.doc.mjs +0 -143
  301. package/assets/docs/tree/subcomponent.doc.mjs +0 -115
  302. package/assets/docs/tree/template-assets.doc.mjs +0 -64
  303. package/assets/docs/tree/template-doc-overview.doc.mjs +0 -109
  304. package/assets/docs/tree/template-fonts.doc.mjs +0 -102
  305. package/assets/docs/tree/template-grading-rubric.doc.mjs +0 -452
  306. package/assets/docs/tree/template-icons.doc.mjs +0 -97
  307. package/assets/docs/tree/template-images-media.doc.mjs +0 -127
  308. package/assets/docs/tree/template-styles.doc.mjs +0 -93
  309. package/assets/docs/tree/templates.doc.mjs +0 -34
  310. package/assets/docs/tree/test-in-an-app.doc.mjs +0 -115
  311. package/assets/docs/tree/test-template-in-app.doc.mjs +0 -128
  312. package/assets/docs/tree/themes.doc.mjs +0 -39
  313. package/assets/docs/tree/troubleshooting.doc.mjs +0 -149
  314. package/assets/docs/tree/upgrading.doc.mjs +0 -103
  315. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +0 -51
  316. package/assets/docs/tree/verify-packed-template.doc.mjs +0 -77
  317. package/assets/docs/tree/versioning.doc.mjs +0 -161
  318. package/assets/docs/tree/write-good-templates.doc.mjs +0 -64
  319. package/assets/docs/tree/write-the-template-file.doc.mjs +0 -154
  320. package/authoring/discover/discover.doc.d.mts +0 -13
  321. package/authoring/discover/discover.doc.mjs +0 -138
  322. package/authoring/discover/parse.d.mts +0 -24
  323. package/authoring/discover/parse.mjs +0 -128
  324. package/authoring/discover/parse.test.mjs +0 -124
  325. package/authoring/discover/type.ts +0 -87
  326. package/clients/cli/commands/component-batch.test.mjs +0 -341
  327. package/clients/cli/commands/discover.sources.test.mjs +0 -267
  328. package/clients/cli/commands/integration-verify.doc.mjs +0 -22
  329. package/clients/cli/lib/parse-error-format.test.mjs +0 -81
  330. package/foundation/response/batch.type.d.mts +0 -33
  331. package/foundation/response/batch.type.mjs +0 -34
@@ -216,7 +216,6 @@ export const ComponentDocKindSchema: z.ZodObject<{
216
216
  theming: z.ZodOptional<z.ZodUnknown>;
217
217
  playground: z.ZodOptional<z.ZodUnknown>;
218
218
  examples: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
219
- replaces: z.ZodOptional<z.ZodString>;
220
219
  name: z.ZodString;
221
220
  displayName: z.ZodOptional<z.ZodString>;
222
221
  description: z.ZodOptional<z.ZodString>;
@@ -317,7 +316,6 @@ export const FunctionDocKindSchema: z.ZodObject<{
317
316
  export const GenericDocKindSchema: z.ZodObject<{
318
317
  type: z.ZodLiteral<"generic">;
319
318
  title: z.ZodOptional<z.ZodString>;
320
- keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
321
319
  sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
322
320
  id: z.ZodOptional<z.ZodString>;
323
321
  title: z.ZodString;
@@ -386,6 +384,7 @@ export const GenericDocKindSchema: z.ZodObject<{
386
384
  import: z.ZodOptional<z.ZodString>;
387
385
  group: z.ZodOptional<z.ZodString>;
388
386
  category: z.ZodOptional<z.ZodString>;
387
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
389
388
  parent: z.ZodOptional<z.ZodString>;
390
389
  relatedDocs: z.ZodOptional<z.ZodArray<z.ZodString>>;
391
390
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -841,6 +840,7 @@ export const LegacyDocSchema: z.ZodUnion<readonly [z.ZodObject<{
841
840
  displayName: z.ZodOptional<z.ZodString>;
842
841
  group: z.ZodOptional<z.ZodString>;
843
842
  category: z.ZodOptional<z.ZodString>;
843
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
844
844
  isHiddenFromOverview: z.ZodOptional<z.ZodBoolean>;
845
845
  hidden: z.ZodOptional<z.ZodBoolean>;
846
846
  hiddenComponents: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -865,7 +865,6 @@ export const LegacyDocSchema: z.ZodUnion<readonly [z.ZodObject<{
865
865
  }>>;
866
866
  title: z.ZodString;
867
867
  description: z.ZodString;
868
- keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
869
868
  sections: z.ZodArray<z.ZodObject<{
870
869
  id: z.ZodOptional<z.ZodString>;
871
870
  title: z.ZodString;
@@ -307,7 +307,6 @@ const ComponentBaseSchema = z
307
307
  theming: z.unknown().optional(),
308
308
  playground: z.unknown().optional(),
309
309
  examples: z.array(z.unknown()).optional(),
310
- replaces: z.string().min(1).optional(),
311
310
  })
312
311
  .passthrough();
313
312
 
@@ -415,9 +414,6 @@ export const GenericDocKindSchema = z
415
414
  ...BaseDocFields,
416
415
  type: z.literal('generic'),
417
416
  title: nonEmptyString.optional(),
418
- // Search terms the title and sections do not use; `astryx search` matches
419
- // them as keywords of the whole topic (ReferenceDoc `keywords`).
420
- keywords: z.array(z.string()).optional(),
421
417
  sections: z.array(ReferenceSectionSchema).min(1).optional(),
422
418
  replaces: nonEmptyString.optional(),
423
419
  extends: nonEmptyString.optional(),
@@ -734,8 +730,6 @@ const LegacyBaseDocSchema = z.object({
734
730
  const LegacyReferenceDocSchema = LegacyBaseDocSchema.extend({
735
731
  title: nonEmptyString,
736
732
  description: z.string(),
737
- // As on the stamped schema: search terms for the whole topic.
738
- keywords: z.array(z.string()).optional(),
739
733
  sections: z.array(ReferenceSectionSchema).min(1),
740
734
  replaces: nonEmptyString.optional(),
741
735
  extends: nonEmptyString.optional(),
@@ -12,7 +12,7 @@ export const doc = {
12
12
  displayName: 'Authored doc graph fields',
13
13
  namespace: 'authoring',
14
14
  description:
15
- "Fields every authored doc kind can declare for the docs tree: `placement`, plus two reserved fields, `aliases` and `audience`. The docs tree reads `placement` for every guide, the CLI's and each integration's. Nothing reads `aliases` or `audience` today: a reference topic outside the docs tree that sets one fails to load, and other doc kinds accept them and ignore them.",
15
+ "Placement, compatibility aliases, and audience: fields every authored doc kind declares for the docs tree. The docs tree reads `placement` for every guide, the CLI's and each integration's; aliases and audience are not built yet. A reference topic outside the docs tree that sets one fails to load, and other doc kinds accept them and ignore them.",
16
16
  appliesTo: 'Every supported .doc.mjs object',
17
17
  fields: [
18
18
  {
@@ -45,13 +45,13 @@ export const doc = {
45
45
  name: 'aliases',
46
46
  type: 'string[]',
47
47
  description:
48
- 'Reserved: prior names or routes the docs tree will keep resolving to this doc, without creating another identity. Nothing reads it today, and a topic that sets it fails to load.',
48
+ 'Prior names or routes the docs tree will keep resolving to this doc, without creating another identity. Not read yet: a topic that sets it fails to load.',
49
49
  },
50
50
  {
51
51
  name: 'audience',
52
52
  type: "'public' | 'internal'",
53
53
  description:
54
- "Reserved: which docs bundle includes this doc ('public' when omitted). Nothing reads it today, and a topic that sets it fails to load.",
54
+ "Which docs bundle includes this doc ('public' when omitted). Not read yet: a topic that sets it fails to load.",
55
55
  default: "'public'",
56
56
  },
57
57
  ],
@@ -39,11 +39,9 @@ export interface DocPlacement {
39
39
  export interface AuthoredDocGraphFields {
40
40
  /** The doc's one parent in the docs tree: a namespace of its own package. */
41
41
  placement?: DocPlacement;
42
- /** Reserved: prior routes or names the docs tree will keep resolving.
43
- * Nothing reads it yet. */
42
+ /** Prior routes or names the docs tree will keep resolving. Not read yet. */
44
43
  aliases?: string[];
45
- /** Reserved: docs bundle audience; omit for public docs. Nothing reads it
46
- * yet. */
44
+ /** Docs bundle audience; omit for public docs. Not read yet. */
47
45
  audience?: DocAudience;
48
46
  }
49
47
 
@@ -151,7 +151,7 @@ export const doc = {
151
151
  name: 'subcommands',
152
152
  type: 'string[]',
153
153
  description:
154
- 'Subcommand names (for command groups like `theme`).',
154
+ 'Subcommand names (for command groups like `theme` / `layout`).',
155
155
  },
156
156
  {
157
157
  name: 'examples',
@@ -75,7 +75,7 @@ export interface CommandDoc extends AuthoredDocGraphFields {
75
75
  args?: CommandArgDoc[];
76
76
  /** Flags/options. */
77
77
  options?: CommandOptionDoc[];
78
- /** Subcommand names (for command groups like `theme`). */
78
+ /** Subcommand names (for command groups like `theme` / `layout`). */
79
79
  subcommands?: string[];
80
80
  /** Terminal examples. */
81
81
  examples?: CommandExampleDoc[];
@@ -52,12 +52,6 @@ export const doc = {
52
52
  description:
53
53
  'Exact public package specifier consumers use to import an integration-owned component. The packed-package gate resolves this specifier and verifies it exports the component name.',
54
54
  },
55
- {
56
- name: 'replaces',
57
- type: 'string',
58
- description:
59
- "Integration components only: the exact `name` of the Core ComponentDoc this component takes over for unqualified lookup, so every app that loads the integration gets it from component detail, lists, search, swizzle, and issue routing. The Core original stays reachable with `--package @astryxdesign/core`. Set it only to intentionally own a Core identity; give an alternative or variant its own name instead.",
60
- },
61
55
  {
62
56
  name: 'keywords',
63
57
  type: 'string[]',
@@ -48,14 +48,6 @@ export interface ComponentBaseDoc extends AuthoredDocGraphFields {
48
48
  displayName: string;
49
49
  /** Exact consumer import specifier for integration-owned components. */
50
50
  import?: string;
51
- /** Integration components only: the exact `name` of the Core ComponentDoc
52
- * this component takes over for unqualified lookup, so every app that loads
53
- * the integration gets this component from component detail, lists, search,
54
- * swizzle, and issue routing. The Core original stays reachable with
55
- * `--package @astryxdesign/core`. Set it only to intentionally own a Core
56
- * identity; give an alternative or variant its own name instead. Older CLIs
57
- * that do not read `replaces` keep the component under its own name. */
58
- replaces?: string;
59
51
  /** Search keywords for CLI discovery. Terms a developer might type when
60
52
  * looking for this component: synonyms, related UI concepts, and common
61
53
  * names from other design systems (MUI, Chakra, Radix, and others).
@@ -51,13 +51,6 @@ export const doc = {
51
51
  type: 'string',
52
52
  description: "Navigation category: 'guide' or 'foundations'.",
53
53
  },
54
- {
55
- name: 'keywords',
56
- type: 'string[]',
57
- description:
58
- "Words a reader may search for that the title and sections do not use: a synonym, a task, or another library's name for the same thing. `astryx search` matches each as a keyword of the whole topic, so an exact one ranks the topic like its own title does.",
59
- example: "['dark mode', 'color scheme']",
60
- },
61
54
  {
62
55
  name: 'replaces',
63
56
  type: 'string',
@@ -127,11 +127,6 @@ export interface ReferenceDoc extends AuthoredDocGraphFields {
127
127
  description: string;
128
128
  /** Navigation category: 'guide' or 'foundations'. */
129
129
  category?: string;
130
- /** Words a reader may search for that the title and sections do not use:
131
- * a synonym, a task ("dark mode"), or another library's name for the same
132
- * thing. `astryx search` matches each as a keyword of the whole topic, so
133
- * an exact one ranks the topic like its own title does. */
134
- keywords?: string[];
135
130
  /** Name of an existing topic this doc takes the place of. Authored by an
136
131
  * integration whose guide should be served instead of the built-in one —
137
132
  * `replaces: 'getting-started'` on a doc named `getting-started` swaps the
@@ -49,7 +49,7 @@ export const doc = {
49
49
  name: 'namespace',
50
50
  type: 'string',
51
51
  description:
52
- "The group that reads this doc: 'authoring' for a file an author writes (a section of {@link generic:authoring}), or 'cli/api' for a shape the CLI returns (the docs tree adopts it by kind, as the leaf `cli/api/schemas/<name>`). Every schema doc the CLI ships declares one, and `astryx doctor` fails on one that is missing or that nothing reads.",
52
+ "The group that reads this doc: 'authoring' for a file an author writes (a section of `astryx docs authoring`), or 'cli/api' for a shape the CLI returns (the docs tree adopts it by kind, as the leaf `cli/api/schemas/<name>`). Every schema doc the CLI ships declares one, and `astryx doctor` fails on one that is missing or that nothing reads.",
53
53
  },
54
54
  {
55
55
  name: 'aliases',
@@ -162,7 +162,7 @@ export const doc = {
162
162
  type: '{ dir: string }',
163
163
  description: 'Where component sources live.',
164
164
  fields: [
165
- {name: 'components.dir', type: 'string', description: 'Glob root for Acme*.tsx files.', required: true},
165
+ {name: 'components.dir', type: 'string', description: 'Glob root for XDS*.tsx files.', required: true},
166
166
  ],
167
167
  },
168
168
  ],
@@ -56,7 +56,7 @@ export const doc = {
56
56
  name: 'replaces',
57
57
  type: 'string',
58
58
  description:
59
- "Integration templates only: the exact id of the Core template this one replaces for unqualified lookup. Find it with `astryx --json template --list --package @astryxdesign/core`; the Core original stays selectable with `--package @astryxdesign/core`. A page replaces only a Core page and a block only a Core block. Needs @astryxdesign/cli 0.7.0 or later: earlier CLIs reject the field, drop that template, and hide the package's doc topics.",
59
+ "Integration templates only: the exact id of the Core template this one replaces for unqualified lookup. Find it with `astryx --json template --list --package @astryxdesign/core`; the Core original stays selectable with `--package @astryxdesign/core`. A page replaces only a Core page and a block only a Core block. Needs @astryxdesign/cli 0.7.0 or later: earlier CLIs reject the field and withhold the package's templates and doc topics.",
60
60
  },
61
61
  {
62
62
  name: 'isReady',
@@ -33,8 +33,8 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
33
33
  * replaces for unqualified lookup (find it with
34
34
  * `astryx --json template --list --package @astryxdesign/core`). The Core
35
35
  * original stays selectable with `--package @astryxdesign/core`. Needs
36
- * `@astryxdesign/cli` 0.7.0 or later: earlier CLIs reject the field,
37
- * drop that template, and hide the package's doc topics. */
36
+ * `@astryxdesign/cli` 0.7.0 or later: earlier CLIs reject the field and
37
+ * withhold the package's templates and doc topics. */
38
38
  replaces?: string;
39
39
  /** Whether this template is ready for use. Templates with
40
40
  * isReady: false show as "(WIP)" in the gallery and CLI. */
@@ -3,7 +3,6 @@
3
3
 
4
4
  export { parseConfig } from "./config/parse.mjs";
5
5
  export { parseIntegration } from "./integration/parse.mjs";
6
- export { parseDiscoverCatalog } from "./discover/parse.mjs";
7
6
  export { parseCodemod } from "./codemod/parse.mjs";
8
7
  export { parseDebugEvent } from "./debug/parse.mjs";
9
8
  export { parseDoc } from "./doctypes/parse.mjs";
@@ -44,15 +44,6 @@ export type {
44
44
  GapReportTarget,
45
45
  GapReportHandlerReceipt,
46
46
  } from './gap-report/type.js'; // gap-report handler contract
47
- export type {
48
- DiscoverSource,
49
- DiscoverSourceContext,
50
- DiscoverCatalog,
51
- DiscoverPackage,
52
- DiscoverVersion,
53
- DiscoverContribution,
54
- DiscoverKind,
55
- } from './discover/type.js'; // discover source contract
56
47
  export type {AstryxCodemod, AstryxConfigCodemod} from './codemod/type.js'; // codemods/*
57
48
 
58
49
  // ═══════════════════════════════════════════════════════════════════════
@@ -76,7 +67,6 @@ export {
76
67
  parseGapReportHandler,
77
68
  parseGapReportReceipt,
78
69
  } from './gap-report/parse.mjs';
79
- export {parseDiscoverCatalog} from './discover/parse.mjs';
80
70
  export {parseCodemod} from './codemod/parse.mjs';
81
71
  export {parseDebugEvent} from './debug/parse.mjs';
82
72
 
@@ -20,7 +20,6 @@ export {
20
20
  parseGapReportHandler,
21
21
  parseGapReportReceipt,
22
22
  } from './gap-report/parse.mjs';
23
- export {parseDiscoverCatalog} from './discover/parse.mjs';
24
23
  export {parseCodemod} from './codemod/parse.mjs';
25
24
  export {parseDebugEvent} from './debug/parse.mjs';
26
25
  export {parseDoc} from './doctypes/parse.mjs';
@@ -23,49 +23,48 @@ export const doc = {
23
23
  name: 'providerId',
24
24
  type: 'string',
25
25
  description:
26
- 'The name that marks this package as the source of everything it contributes. Leave it out to use the package name from package.json. Set it to the old name only during a rename, so the IDs of what the package already contributed stay the same. If two packages use the same name here, the one you are working on wins; otherwise the one the CLI reads first wins, and the CLI warns about the other.',
26
+ 'Stable logical provider ID. Omit to use package.json#name; set it to the prior package name only when an explicit rename must preserve artifact IDs. If two packages claim the same ID, the package being authored is used, otherwise the first-loaded one, and the CLI warns about the other.',
27
27
  example: "'@acme/widgets'",
28
28
  },
29
29
  {
30
30
  name: 'components',
31
31
  type: 'string',
32
32
  description:
33
- 'The folder that holds your components and their docs, relative to package.json.',
33
+ 'Relative path to the components/docs root (resolved to absolute).',
34
34
  example: "'./src/components'",
35
35
  },
36
36
  {
37
37
  name: 'templates',
38
38
  type: 'string',
39
39
  description:
40
- 'The folder that holds your templates, relative to package.json.',
40
+ 'Relative path to the templates root (resolved to absolute).',
41
41
  example: "'./src/templates'",
42
42
  },
43
43
  {
44
44
  name: 'codemods',
45
45
  type: 'string',
46
- description:
47
- 'The folder that holds your codemods, relative to package.json.',
46
+ description: 'Relative path to the codemods root (resolved to absolute).',
48
47
  example: "'./codemods'",
49
48
  },
50
49
  {
51
50
  name: 'docs',
52
51
  type: 'string',
53
52
  description:
54
- 'The folder that holds your doc topics, relative to package.json. Every {topic}.doc.{ts,mjs,js} in it shows up in `astryx docs` next to the built-in topics; a topic can also set `replaces` or `extends` to take over a built-in topic or add to it.',
53
+ 'Relative path to the reference-docs (topics) root (resolved to absolute). Every {topic}.doc.{ts,mjs,js} under it is served by `astryx docs` beside the built-in topics; a topic may also declare `replaces` or `extends` to take the place of a built-in one or merge onto it.',
55
54
  example: "'./docs'",
56
55
  },
57
56
  {
58
57
  name: 'themes',
59
58
  type: 'string',
60
59
  description:
61
- 'The folder that holds your themes, relative to package.json, with one folder per theme. Each theme folder has the theme source and a matching .doc.mjs file with the same name. Installed themes show up in `astryx theme list` and can be copied with `astryx theme add`.',
60
+ 'Relative path to a source-theme root with one directory per theme slug. Each directory contains a source module and mandatory same-stem, strongly typed .doc.mjs descriptor. Installed themes appear in `astryx theme list` and can be copied with `astryx theme add`.',
62
61
  example: "'./themes'",
63
62
  },
64
63
  {
65
64
  name: 'agentDocs',
66
65
  type: '{ append?: readonly string[] }',
67
66
  description:
68
- 'Lines of guidance your package adds to the end of the agent instructions the CLI manages. The CLI owns the heading, labels, bullets, and which files it writes.',
67
+ 'Static package guidance appended to the end of the managed agent block. The CLI owns the section heading, package labels, bullets, target files, and writes.',
69
68
  example: "{ append: ['Run acme verify.'] }",
70
69
  },
71
70
  {
@@ -95,10 +94,9 @@ export const doc = {
95
94
  {
96
95
  type: 'prose',
97
96
  text:
98
- 'The provider name defaults to the package name in package.json. ' +
99
- 'During a rename, set `providerId` to the old package name so the IDs ' +
100
- 'of what the package already contributed stay the same. The package ' +
101
- 'version always comes from package.json.',
97
+ 'Provider identity defaults to package.json#name. During an explicit ' +
98
+ 'package rename, set `providerId` to the prior canonical package name so ' +
99
+ 'existing artifact IDs remain stable. Package version always comes from package.json.',
102
100
  },
103
101
  {
104
102
  type: 'prose',
@@ -29,17 +29,17 @@ import {program} from './index.mjs';
29
29
  import {reportsResult, reportsResultVia} from './lib/define-command.mjs';
30
30
 
31
31
  /**
32
- * Commands with no action of their own: a group that prints its subcommand
33
- * list and does nothing else has no run to report on.
32
+ * Commands with no action of their own: bare `astryx layout` prints its
33
+ * subcommand list and does nothing else, so there is no run to report on.
34
34
  *
35
35
  * Pinned as a SET rather than skipped silently — if a command joins this list,
36
36
  * that is a real change to what the CLI does and it should be read, not
37
- * absorbed. Every group ships an action today: `theme`, for instance, HAS one
38
- * — the one that rejects an unknown subcommand — so it goes through the
39
- * converter like any other. Its bare form prints help and never returns from
40
- * that action, which the recorder covers where help is recorded, not here.
37
+ * absorbed. (`theme` is deliberately NOT here: it HAS an action — the one that
38
+ * rejects an unknown subcommand — so it goes through the converter like any
39
+ * other. Its bare form prints help and never returns from that action, which
40
+ * the recorder covers where help is recorded, not here.)
41
41
  */
42
- const NO_ACTION_OF_THEIR_OWN = [];
42
+ const NO_ACTION_OF_THEIR_OWN = ['layout'];
43
43
 
44
44
  /**
45
45
  * Commands that record for themselves instead of returning a descriptor.
@@ -38,7 +38,6 @@ import {doc as componentFn} from '../../../../api/component/component.doc.mjs';
38
38
  *
39
39
  * @typedef {(
40
40
  * | import('../../../../api/component/component.type.mjs').ComponentListResponse
41
- * | import('../../../../api/component/component.type.mjs').ComponentBatchResponse
42
41
  * | import('../../../../api/component/component.type.mjs').ComponentDetailResponse
43
42
  * | import('../../../../api/component/component.type.mjs').ComponentDetailPropsResponse
44
43
  * | import('../../../../api/component/component.type.mjs').ComponentDetailSourceResponse
@@ -68,11 +67,6 @@ function summarize(result) {
68
67
  );
69
68
  return resultSet({count, resultKind: 'component'});
70
69
  }
71
- case 'component.batch':
72
- return resultSet({
73
- count: result.data.results.filter(row => row.status === 'found').length,
74
- resultKind: 'component',
75
- });
76
70
  case 'component.detail':
77
71
  case 'component.detail.props':
78
72
  case 'component.detail.source':
@@ -88,103 +82,19 @@ function summarize(result) {
88
82
  }
89
83
  }
90
84
 
91
- /**
92
- * Project one single-component API result through the existing formatter kit.
93
- * @param {import('../../../../api/component/component.type.mjs').ComponentSingleResponse} result
94
- * @param {string} requestedName
95
- * @param {'full'|'compact'|'brief'} detail
96
- * @param {ReturnType<typeof resolveTheme>} themeData
97
- * @returns {import('../../formatters/index.mjs').Block[]}
98
- */
99
- function componentDetailBlocks(result, requestedName, detail, themeData) {
100
- const resolvedName = (requestedName.split('/').pop() ?? requestedName).replace(
101
- /^XDS/,
102
- '',
103
- );
104
- switch (result.type) {
105
- case 'component.detail': {
106
- /** @type {import('../../formatters/index.mjs').Block[]} */
107
- const out = [];
108
- if (result.data.parentDoc) {
109
- out.push(record(result.data, {fields: ['parentDoc']}));
110
- }
111
- out.push(
112
- detail === 'brief'
113
- ? code(
114
- formatBrief(result.data, resolvedName, result.data.import, {
115
- themeData,
116
- }),
117
- )
118
- : detail === 'compact'
119
- ? code(
120
- formatCompact(result.data, resolvedName, result.data.import),
121
- )
122
- : code(
123
- formatFull(result.data, {
124
- themeData,
125
- importHint: result.data.import,
126
- }),
127
- ),
128
- );
129
- return out;
130
- }
131
- case 'component.detail.props':
132
- return [code(formatProps({props: result.data}, resolvedName))];
133
- case 'component.detail.source':
134
- case 'component.detail.showcase':
135
- return [code(result.data.source)];
136
- case 'component.detail.blocks': {
137
- const {showcase, examples, related} = result.data;
138
- /** @type {import('../../formatters/index.mjs').Block[]} */
139
- const out = [];
140
- if (showcase) {
141
- out.push(
142
- section('Showcase'),
143
- record(showcase, {fields: ['displayName', 'description']}),
144
- );
145
- }
146
- if (examples.length > 0) {
147
- out.push(
148
- section('Examples'),
149
- records(examples, {fields: ['name', 'description']}),
150
- );
151
- }
152
- if (related.length > 0) {
153
- out.push(
154
- section(
155
- `Related: ${related.length} blocks that use ${result.data.component}`,
156
- ),
157
- list(related.map(block => block.name)),
158
- );
159
- }
160
- if (!showcase && examples.length === 0 && related.length === 0) {
161
- out.push(text(`No blocks found for ${result.data.component}`));
162
- }
163
- return out;
164
- }
165
- default:
166
- return [];
167
- }
168
- }
169
-
170
85
  /**
171
86
  * @param {import('commander').Command} program
172
87
  */
173
88
  export function registerComponent(program) {
174
89
  defineCommand(program, componentCommand, {
175
90
  fn: componentFn,
176
- action: async (
177
- /** @type {string[] | undefined} */ names,
178
- /** @type {{list?: boolean, category?: string, props?: boolean, source?: boolean, showcase?: boolean, blocks?: boolean, package?: string}} */ options,
179
- ) => {
91
+ action: async (/** @type {string | undefined} */ name, /** @type {{list?: boolean, category?: string, props?: boolean, source?: boolean, showcase?: boolean, blocks?: boolean, package?: string}} */ options) => {
180
92
  const run = getCliInvocation();
181
- const name = names?.length === 1 ? names[0] : undefined;
182
- const apiInput = !names?.length ? undefined : name ?? names;
183
93
  const zh = program.opts().zh || false;
184
94
  const dense = program.opts().dense || false;
185
95
  const lang = program.opts().lang || null;
186
96
  const detailSource = program.getOptionValueSource('detail');
187
- const isListView = options.list || options.category || !names?.length;
97
+ const isListView = options.list || options.category || !name;
188
98
  // Default detail level is full for single-component view, brief for list views.
189
99
  // (List views are scannable name lists; users can opt into compact/full.)
190
100
  let detail = program.opts().detail || 'full';
@@ -209,7 +119,7 @@ export function registerComponent(program) {
209
119
  /** @type {ComponentResult} */
210
120
  let result;
211
121
  try {
212
- result = /** @type {ComponentResult} */ (await componentApi(apiInput, {
122
+ result = /** @type {ComponentResult} */ (await componentApi(name, {
213
123
  cwd: process.cwd(),
214
124
  list: options.list,
215
125
  category: options.category,
@@ -227,12 +137,6 @@ export function registerComponent(program) {
227
137
  }
228
138
 
229
139
  const answered = summarize(result);
230
- if (
231
- result.type === 'component.batch' &&
232
- result.data.results.some(row => row.status !== 'found')
233
- ) {
234
- process.exitCode = 1;
235
- }
236
140
  if (json) {
237
141
  jsonOut(result);
238
142
  return answered;
@@ -248,7 +152,7 @@ export function registerComponent(program) {
248
152
  const listFooter = text(
249
153
  [
250
154
  `Import from the path shown (e.g. import {Button} from '@astryxdesign/core/Button')`,
251
- `Usage: ${run} component <name> [name...]`,
155
+ `Usage: ${run} component <name>`,
252
156
  ].join('\n'),
253
157
  );
254
158
 
@@ -327,65 +231,64 @@ export function registerComponent(program) {
327
231
  break;
328
232
  }
329
233
 
330
- case 'component.batch': {
234
+ case 'component.detail': {
235
+ const resolvedName = (name || '').replace(/^XDS/, '');
236
+ const importHint = result.data.import;
237
+ if (result.data.parentDoc) emit(record(result.data, {fields: ['parentDoc']}));
238
+ const doc =
239
+ detail === 'brief'
240
+ ? code(formatBrief(result.data, resolvedName, importHint, {themeData}))
241
+ : detail === 'compact'
242
+ ? code(formatCompact(result.data, resolvedName, importHint))
243
+ : code(formatFull(result.data, {themeData, importHint}));
244
+ emit(doc);
245
+ break;
246
+ }
247
+
248
+ case 'component.detail.props': {
249
+ const resolvedName = (name || '').replace(/^XDS/, '');
250
+ emit(code(formatProps({props: result.data}, resolvedName)));
251
+ break;
252
+ }
253
+
254
+ case 'component.detail.source': {
255
+ emit(code(result.data.source));
256
+ break;
257
+ }
258
+
259
+ case 'component.detail.showcase': {
260
+ emit(code(result.data.source));
261
+ break;
262
+ }
263
+
264
+ case 'component.detail.blocks': {
265
+ const {showcase, examples, related} = result.data;
331
266
  /** @type {import('../../formatters/index.mjs').Block[]} */
332
- const out = [
333
- section('Component batch'),
334
- record({count: result.data.count}),
335
- section('Results'),
336
- ];
337
- for (const row of result.data.results) {
338
- out.push(section(row.selector));
339
- if (row.status === 'found') {
340
- out.push(
341
- record(row, {fields: ['selector', 'status']}),
342
- section('Result'),
343
- ...componentDetailBlocks(
344
- row.result,
345
- row.selector,
346
- detail,
347
- themeData,
348
- ),
349
- );
350
- continue;
351
- }
267
+ const out = [];
268
+ if (showcase) {
352
269
  out.push(
353
- record(row, {
354
- fields: ['selector', 'status', 'code', 'error'],
355
- }),
270
+ section('Showcase'),
271
+ record(showcase, {fields: ['displayName', 'description']}),
356
272
  );
357
- if (row.status === 'ambiguous') {
358
- out.push(
359
- section('Candidates'),
360
- records(row.candidates, {
361
- fields: ['package', 'component', 'kind', 'installed'],
362
- }),
363
- );
364
- } else if (row.suggestions?.length) {
365
- out.push(
366
- section('Suggestions'),
367
- records(row.suggestions, {fields: ['name', 'reason']}),
368
- );
369
- }
273
+ }
274
+ if (examples.length > 0) {
275
+ out.push(
276
+ section('Examples'),
277
+ records(examples, {fields: ['name', 'description']}),
278
+ );
279
+ }
280
+ if (related.length > 0) {
281
+ out.push(
282
+ section(`Related: ${related.length} blocks that use ${result.data.component}`),
283
+ list(related.map(b => b.name)),
284
+ );
285
+ }
286
+ if (!showcase && examples.length === 0 && related.length === 0) {
287
+ out.push(text(`No blocks found for ${result.data.component}`));
370
288
  }
371
289
  emit(...out);
372
290
  break;
373
291
  }
374
-
375
- case 'component.detail':
376
- case 'component.detail.props':
377
- case 'component.detail.source':
378
- case 'component.detail.showcase':
379
- case 'component.detail.blocks':
380
- emit(
381
- ...componentDetailBlocks(
382
- result,
383
- name ?? '',
384
- detail,
385
- themeData,
386
- ),
387
- );
388
- break;
389
292
  }
390
293
  return answered;
391
294
  },