@astryxdesign/cli 0.6.3-canary.4fb81b0 → 0.6.3-canary.533ecc7

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 (388) hide show
  1. package/README.md +36 -13
  2. package/api/blog/blog.doc.mjs +1 -0
  3. package/api/build/build.doc.mjs +1 -0
  4. package/api/component/_adapter.d.mts +6 -12
  5. package/api/component/_adapter.mjs +20 -10
  6. package/api/component/component.doc.mjs +2 -1
  7. package/api/component/component.mjs +60 -12
  8. package/api/component/component.type.d.mts +5 -4
  9. package/api/component/component.type.mjs +5 -4
  10. package/api/component/list/list.d.mts +0 -5
  11. package/api/component/list/list.mjs +40 -11
  12. package/api/discover/discover.doc.mjs +1 -0
  13. package/api/docs/_adapter.d.mts +210 -34
  14. package/api/docs/_adapter.mjs +674 -134
  15. package/api/docs/detail/detail.mjs +11 -3
  16. package/api/docs/detail/section/section.mjs +24 -13
  17. package/api/docs/detail/section/section.test.mjs +15 -6
  18. package/api/docs/docs.d.mts +5 -3
  19. package/api/docs/docs.doc.mjs +36 -15
  20. package/api/docs/docs.mjs +44 -8
  21. package/api/docs/docs.test.mjs +158 -4
  22. package/api/docs/docs.type.d.mts +165 -2
  23. package/api/docs/docs.type.mjs +101 -3
  24. package/api/docs/index/index.mjs +11 -3
  25. package/api/docs/index/index.test.mjs +1 -1
  26. package/api/docs/integration-tree.test.mjs +547 -0
  27. package/api/docs/integrationDocs.test.mjs +14 -14
  28. package/api/docs/list/list.mjs +28 -12
  29. package/api/docs/node/node.d.mts +43 -0
  30. package/api/docs/node/node.mjs +192 -0
  31. package/api/doctor/doctor.d.mts +54 -4
  32. package/api/doctor/doctor.doc.mjs +1 -0
  33. package/api/doctor/doctor.mjs +327 -16
  34. package/api/doctor/doctor.test.mjs +420 -7
  35. package/api/gap-report/gap-report.doc.mjs +1 -0
  36. package/api/hook/_adapter.mjs +19 -5
  37. package/api/hook/hook.doc.mjs +1 -0
  38. package/api/hook/list/list.d.mts +1 -1
  39. package/api/hook/list/list.mjs +69 -17
  40. package/api/index.d.mts +1 -1
  41. package/api/index.mjs +1 -0
  42. package/api/init/init.doc.mjs +2 -1
  43. package/api/integration/add-contribution.d.mts +2 -1
  44. package/api/integration/add-contribution.mjs +114 -12
  45. package/api/integration/add-contribution.test.mjs +174 -3
  46. package/api/integration/add-theme.mjs +34 -64
  47. package/api/integration/add-theme.test.mjs +105 -21
  48. package/api/integration/authoring-checks.mjs +108 -31
  49. package/api/integration/authoring-checks.test.mjs +171 -6
  50. package/api/integration/authoring-checks.type.d.mts +3 -1
  51. package/api/integration/authoring-checks.type.mjs +3 -1
  52. package/api/integration/integration-authoring.type.d.mts +2 -0
  53. package/api/integration/integration-authoring.type.mjs +2 -0
  54. package/api/integration/integration-block-exports.test.mjs +10 -6
  55. package/api/integration/integrationAdd.doc.mjs +7 -0
  56. package/api/integration/integrationAddAgentDoc.doc.mjs +1 -0
  57. package/api/integration/integrationAddCodemod.doc.mjs +1 -0
  58. package/api/integration/integrationAddComponent.doc.mjs +1 -0
  59. package/api/integration/integrationAddDoc.doc.mjs +8 -1
  60. package/api/integration/integrationAddTemplate.doc.mjs +1 -0
  61. package/api/integration/integrationAddTheme.doc.mjs +6 -5
  62. package/api/integration/integrationComponentConflicts.doc.mjs +1 -0
  63. package/api/integration/integrationDocConflicts.doc.mjs +2 -1
  64. package/api/integration/integrationPackCheck.doc.mjs +2 -1
  65. package/api/integration/integrationTemplateConflicts.doc.mjs +7 -5
  66. package/api/integration/pack-check.mjs +34 -0
  67. package/api/integration/pack-check.test.mjs +138 -47
  68. package/api/integration/pack-check.type.d.mts +26 -2
  69. package/api/integration/pack-check.type.mjs +14 -1
  70. package/api/integration/summarizeIssues.doc.mjs +1 -0
  71. package/api/integration/validate-integration-fixes.test.mjs +1389 -0
  72. package/api/integration/validate-integration.mjs +50 -102
  73. package/api/integration/validate-integration.test.mjs +88 -26
  74. package/api/integration/validate-unread-theme-folders.test.mjs +110 -0
  75. package/api/integration/validateIntegration.doc.mjs +2 -1
  76. package/api/json/assertResponse.doc.mjs +1 -0
  77. package/api/json/index.ts +2 -0
  78. package/api/json/isError.doc.mjs +1 -0
  79. package/api/json/parseResponse.doc.mjs +1 -0
  80. package/api/layout/_adapter.mjs +20 -5
  81. package/api/layout/layoutCheck.doc.mjs +1 -0
  82. package/api/layout/layoutExpand.doc.mjs +1 -0
  83. package/api/layout/layoutGrammar.doc.mjs +1 -0
  84. package/api/search/search.d.mts +26 -1
  85. package/api/search/search.doc.mjs +5 -3
  86. package/api/search/search.mjs +324 -35
  87. package/api/search/search.test.mjs +91 -2
  88. package/api/search/search.type.d.mts +13 -1
  89. package/api/search/search.type.mjs +4 -1
  90. package/api/swizzle/swizzle.doc.mjs +1 -0
  91. package/api/template/list/list.mjs +1 -0
  92. package/api/template/template-integration.test.mjs +1022 -3
  93. package/api/template/template-suffix.test.mjs +41 -21
  94. package/api/template/template.doc.mjs +28 -7
  95. package/api/template/template.mjs +45 -8
  96. package/api/template/template.type.d.mts +6 -8
  97. package/api/template/template.type.mjs +3 -2
  98. package/api/theme/_adapter.d.mts +2 -3
  99. package/api/theme/_adapter.mjs +4 -5
  100. package/api/theme/add/add.binary.test.mjs +10 -17
  101. package/api/theme/add/add.test.mjs +14 -1
  102. package/api/theme/generateTonalPalette.doc.mjs +1 -0
  103. package/api/theme/integration-themes.test.mjs +39 -28
  104. package/api/theme/list/list.test.mjs +19 -20
  105. package/api/theme/listThemes.doc.mjs +6 -5
  106. package/api/theme/template/template.test.mjs +5 -0
  107. package/api/theme/themeAdd.doc.mjs +4 -3
  108. package/api/theme/themeBuild.doc.mjs +1 -0
  109. package/api/theme/themeList.doc.mjs +6 -3
  110. package/api/theme/themeListAvailable.doc.mjs +5 -3
  111. package/api/theme/themePaletteGenerate.doc.mjs +1 -0
  112. package/api/theme/themeTargets.doc.mjs +1 -0
  113. package/api/theme/themeTemplate.doc.mjs +2 -1
  114. package/api/upgrade/_adapter.d.mts +32 -5
  115. package/api/upgrade/_adapter.mjs +97 -69
  116. package/api/upgrade/provider-agreement.test.mjs +152 -0
  117. package/api/upgrade/run/run.mjs +356 -59
  118. package/api/upgrade/upgrade.doc.mjs +6 -1
  119. package/api/upgrade/upgrade.type.d.mts +34 -0
  120. package/api/upgrade/upgrade.type.mjs +15 -0
  121. package/assets/codemods/__tests__/runner.test.mjs +330 -8
  122. package/assets/codemods/integration-discovery.mjs +8 -2
  123. package/assets/codemods/integration-discovery.test.mjs +15 -0
  124. package/assets/codemods/integration-runner.mjs +56 -4
  125. package/assets/codemods/integration-runner.protection.test.mjs +153 -0
  126. package/assets/codemods/run-codemod.mjs +177 -34
  127. package/assets/codemods/runner.mjs +350 -102
  128. package/assets/codemods/transform-prop.mjs +109 -0
  129. package/assets/codemods/transform-prop.test.mjs +95 -0
  130. package/assets/codemods/transforms/next/__tests__/migrate-native-picker-to-presentation.test.mjs +63 -0
  131. package/assets/codemods/transforms/next/__tests__/migrate-theme-catalog-to-descriptors.test.mjs +220 -0
  132. package/assets/codemods/transforms/next/index.mjs +19 -1
  133. package/assets/codemods/transforms/next/migrate-native-picker-to-presentation.mjs +148 -0
  134. package/assets/codemods/transforms/next/migrate-theme-catalog-to-descriptors.mjs +141 -0
  135. package/assets/codemods/transforms/v0.0.14/__tests__/rename-status-variants.test.mjs +86 -165
  136. package/assets/codemods/transforms/v0.0.14/rename-status-variants.mjs +72 -210
  137. package/assets/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +83 -115
  138. package/assets/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +57 -186
  139. package/assets/docs/getting-started.doc.mjs +2 -2
  140. package/assets/docs/principles.doc.mjs +6 -6
  141. package/assets/docs/styling-libraries.doc.mjs +2 -2
  142. package/assets/docs/styling.doc.mjs +4 -4
  143. package/assets/docs/theme.doc.mjs +4 -4
  144. package/assets/docs/tokens.doc.mjs +1 -1
  145. package/assets/docs/tree/api.doc.mjs +30 -0
  146. package/assets/docs/tree/cli.doc.mjs +23 -0
  147. package/assets/docs/tree/commands.doc.mjs +25 -0
  148. package/assets/docs/{cli-integrations.doc.mjs → tree/integrations.doc.mjs} +66 -38
  149. package/assets/docs/tree/integrations.test.mjs +62 -0
  150. package/assets/docs/tree/writing-docs.doc.mjs +286 -0
  151. package/assets/templates/blocks/components/DateInput/DateInputDateRange.tsx +1 -1
  152. package/assets/templates/blocks/components/Item/ItemDocumentTabs.doc.mjs +14 -0
  153. package/assets/templates/blocks/components/Item/ItemDocumentTabs.tsx +100 -0
  154. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.doc.mjs +14 -0
  155. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.tsx +61 -0
  156. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.doc.mjs +14 -0
  157. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.tsx +126 -0
  158. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.doc.mjs +15 -0
  159. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.tsx +86 -0
  160. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.doc.mjs +14 -0
  161. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.tsx +99 -0
  162. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.doc.mjs +14 -0
  163. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.tsx +122 -0
  164. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.doc.mjs +14 -0
  165. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.tsx +95 -0
  166. package/assets/templates/blocks/components/TimeInput/TimeInputConstrained.tsx +1 -0
  167. package/assets/templates/themes/butter/butterTheme.doc.mjs +11 -0
  168. package/assets/templates/themes/chocolate/chocolateTheme.doc.mjs +11 -0
  169. package/assets/templates/themes/gothic/gothicTheme.doc.mjs +11 -0
  170. package/assets/templates/themes/matcha/matchaTheme.doc.mjs +11 -0
  171. package/assets/templates/themes/neutral/neutralTheme.doc.mjs +11 -0
  172. package/assets/templates/themes/stone/stoneTheme.doc.mjs +11 -0
  173. package/assets/templates/themes/y2k/y2kTheme.doc.mjs +11 -0
  174. package/authoring/codemod/codemod.doc.mjs +1 -1
  175. package/authoring/codemod/type.ts +12 -0
  176. package/authoring/config/config.doc.mjs +1 -1
  177. package/authoring/debug/debug.doc.d.mts +11 -0
  178. package/authoring/debug/debug.doc.mjs +182 -0
  179. package/authoring/debug/parse.d.mts +3 -3
  180. package/authoring/doctypes/_schema.d.mts +71 -141
  181. package/authoring/doctypes/_schema.mjs +29 -2
  182. package/authoring/doctypes/base/graph-fields.doc.mjs +8 -6
  183. package/authoring/doctypes/base/type.ts +6 -5
  184. package/authoring/doctypes/command/command.doc.mjs +1 -1
  185. package/authoring/doctypes/command/type.ts +2 -2
  186. package/authoring/doctypes/component/type.ts +2 -2
  187. package/authoring/doctypes/doctypes-new.test.mjs +48 -6
  188. package/authoring/doctypes/enum/enum.doc.mjs +1 -1
  189. package/authoring/doctypes/enum/type.ts +1 -1
  190. package/authoring/doctypes/function/function.doc.mjs +3 -2
  191. package/authoring/doctypes/function/type.ts +3 -2
  192. package/authoring/doctypes/hook/type.ts +2 -2
  193. package/authoring/doctypes/load-contract.test.mjs +3 -2
  194. package/authoring/doctypes/namespace/namespace.doc.mjs +6 -10
  195. package/authoring/doctypes/namespace/parse.test.mjs +23 -25
  196. package/authoring/doctypes/namespace/type.ts +5 -2
  197. package/authoring/doctypes/parse.d.mts +4 -2
  198. package/authoring/doctypes/parse.mjs +10 -5
  199. package/authoring/doctypes/reference/reference.doc.mjs +7 -5
  200. package/authoring/doctypes/reference/type.ts +12 -10
  201. package/authoring/doctypes/schema/schema.doc.mjs +1 -1
  202. package/authoring/doctypes/schema/type.ts +1 -2
  203. package/authoring/doctypes/template/parse.d.mts +2 -0
  204. package/authoring/doctypes/template/parse.mjs +4 -0
  205. package/authoring/doctypes/template/parse.test.mjs +18 -0
  206. package/authoring/doctypes/template/template.doc.mjs +9 -3
  207. package/authoring/doctypes/template/type.ts +8 -0
  208. package/authoring/doctypes/theme/parse.d.mts +35 -0
  209. package/authoring/doctypes/theme/parse.mjs +76 -0
  210. package/authoring/doctypes/theme/theme.doc.d.mts +9 -0
  211. package/authoring/doctypes/theme/theme.doc.mjs +79 -0
  212. package/authoring/doctypes/theme/type.ts +42 -0
  213. package/authoring/doctypes/types.ts +2 -1
  214. package/authoring/gap-report/gap-report.doc.d.mts +12 -0
  215. package/authoring/gap-report/gap-report.doc.mjs +183 -0
  216. package/authoring/identity/identity.doc.mjs +2 -2
  217. package/authoring/index.d.mts +1 -0
  218. package/authoring/index.d.ts +7 -4
  219. package/authoring/index.mjs +2 -1
  220. package/authoring/integration/integration.doc.mjs +2 -2
  221. package/authoring/integration/type.ts +4 -10
  222. package/clients/cli/__tests__/cliManifest.test.ts +27 -29
  223. package/clients/cli/commands/blog.doc.mjs +1 -1
  224. package/clients/cli/commands/build-theme.adaptations.test.mjs +100 -1
  225. package/clients/cli/commands/build-theme.mjs +11 -45
  226. package/clients/cli/commands/build.doc.mjs +1 -1
  227. package/clients/cli/commands/build.mjs +5 -2
  228. package/clients/cli/commands/component/index.mjs +1 -1
  229. package/clients/cli/commands/component-ownership.test.mjs +3 -3
  230. package/clients/cli/commands/component-package.test.mjs +17 -0
  231. package/clients/cli/commands/component.doc.mjs +1 -1
  232. package/clients/cli/commands/discover.broken-integration.test.mjs +7 -8
  233. package/clients/cli/commands/discover.doc.mjs +1 -1
  234. package/clients/cli/commands/discover.mjs +1 -1
  235. package/clients/cli/commands/docs.doc.mjs +21 -9
  236. package/clients/cli/commands/docs.mjs +182 -68
  237. package/clients/cli/commands/docs.test.mjs +120 -16
  238. package/clients/cli/commands/doctor-integration-components.doc.mjs +1 -1
  239. package/clients/cli/commands/doctor-integration-docs.doc.mjs +3 -3
  240. package/clients/cli/commands/doctor-integration-templates.doc.mjs +15 -8
  241. package/clients/cli/commands/doctor-integration-validate.doc.mjs +1 -1
  242. package/clients/cli/commands/doctor-integration.doc.mjs +1 -1
  243. package/clients/cli/commands/doctor-integration.test.mjs +83 -8
  244. package/clients/cli/commands/doctor.doc.mjs +1 -1
  245. package/clients/cli/commands/doctor.mjs +24 -9
  246. package/clients/cli/commands/gap-report.doc.mjs +1 -1
  247. package/clients/cli/commands/hook.doc.mjs +1 -1
  248. package/clients/cli/commands/init.doc.mjs +1 -1
  249. package/clients/cli/commands/integration-add.controls.test.mjs +1 -1
  250. package/clients/cli/commands/integration-add.doc.mjs +11 -1
  251. package/clients/cli/commands/integration-pack.doc.mjs +1 -1
  252. package/clients/cli/commands/integration-real-world.test.mjs +3 -9
  253. package/clients/cli/commands/integration.doc.mjs +1 -1
  254. package/clients/cli/commands/integration.mjs +1 -0
  255. package/clients/cli/commands/layout-check.doc.mjs +1 -1
  256. package/clients/cli/commands/layout-expand.doc.mjs +1 -1
  257. package/clients/cli/commands/layout-grammar.doc.mjs +1 -1
  258. package/clients/cli/commands/layout.doc.mjs +1 -1
  259. package/clients/cli/commands/manifest.doc.mjs +1 -1
  260. package/clients/cli/commands/search.doc.mjs +1 -1
  261. package/clients/cli/commands/search.mjs +11 -2
  262. package/clients/cli/commands/setup-nudge.test.mjs +6 -0
  263. package/clients/cli/commands/swizzle.doc.mjs +1 -1
  264. package/clients/cli/commands/template.doc.mjs +24 -7
  265. package/clients/cli/commands/template.mjs +4 -91
  266. package/clients/cli/commands/text-json-parity.test.mjs +719 -0
  267. package/clients/cli/commands/theme-add.doc.mjs +2 -2
  268. package/clients/cli/commands/theme-build.doc.mjs +1 -1
  269. package/clients/cli/commands/theme-list.doc.mjs +2 -2
  270. package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -3
  271. package/clients/cli/commands/theme-palette.doc.mjs +1 -1
  272. package/clients/cli/commands/theme-targets.behavior.test.mjs +4 -3
  273. package/clients/cli/commands/theme-targets.doc.mjs +1 -1
  274. package/clients/cli/commands/theme-template.doc.mjs +1 -1
  275. package/clients/cli/commands/theme.doc.mjs +1 -1
  276. package/clients/cli/commands/upgrade.doc.mjs +3 -2
  277. package/clients/cli/commands/upgrade.file-protection.test.mjs +228 -0
  278. package/clients/cli/commands/upgrade.mjs +29 -7
  279. package/clients/cli/formatters/index.mjs +2 -0
  280. package/clients/cli/formatters/index.test.mjs +6 -0
  281. package/clients/cli/index.mjs +8 -0
  282. package/clients/cli/lib/hook-format.mjs +14 -5
  283. package/clients/cli/lib/manifest.mjs +9 -2
  284. package/foundation/agent-docs/agent-docs.mjs +1 -0
  285. package/foundation/agent-docs/agent-docs.test.mjs +10 -1
  286. package/foundation/config/project-themes.test.mjs +11 -19
  287. package/foundation/config/project.d.mts +20 -11
  288. package/foundation/config/project.mjs +123 -80
  289. package/foundation/config/project.test.mjs +144 -21
  290. package/foundation/discovery/authoring-self-docs.d.mts +6 -0
  291. package/foundation/discovery/authoring-self-docs.mjs +17 -7
  292. package/foundation/discovery/authoring-self-docs.test.mjs +20 -9
  293. package/foundation/discovery/authoring-surface.d.mts +74 -0
  294. package/foundation/discovery/authoring-surface.mjs +525 -0
  295. package/foundation/discovery/authoring-surface.test.mjs +392 -0
  296. package/foundation/discovery/cli-self-docs.d.mts +119 -0
  297. package/foundation/discovery/cli-self-docs.mjs +490 -0
  298. package/foundation/discovery/cli-self-docs.test.mjs +375 -0
  299. package/foundation/discovery/component-discovery.d.mts +38 -0
  300. package/foundation/discovery/component-discovery.mjs +48 -0
  301. package/foundation/discovery/component-loader.d.mts +35 -38
  302. package/foundation/discovery/component-loader.mjs +53 -222
  303. package/foundation/discovery/docs-discovery.d.mts +108 -10
  304. package/foundation/discovery/docs-discovery.mjs +191 -30
  305. package/foundation/discovery/docs-discovery.test.mjs +71 -32
  306. package/foundation/discovery/docs-output-budget.d.mts +2 -2
  307. package/foundation/discovery/docs-output-budget.mjs +1 -1
  308. package/foundation/discovery/docs-section-key.d.mts +28 -10
  309. package/foundation/discovery/docs-section-key.mjs +134 -33
  310. package/foundation/discovery/docs-section-key.test.mjs +41 -19
  311. package/foundation/discovery/template-adapter.d.mts +99 -6
  312. package/foundation/discovery/template-adapter.mjs +480 -57
  313. package/foundation/discovery/template-adapter.test.mjs +57 -0
  314. package/foundation/discovery/theme-discovery.d.mts +67 -7
  315. package/foundation/discovery/theme-discovery.mjs +916 -186
  316. package/foundation/discovery/theme-discovery.test.mjs +613 -219
  317. package/foundation/doc-compiler/bundle.d.mts +47 -0
  318. package/foundation/doc-compiler/bundle.mjs +278 -0
  319. package/foundation/doc-compiler/bundle.test.mjs +266 -0
  320. package/foundation/doc-compiler/compile.d.mts +220 -39
  321. package/foundation/doc-compiler/compile.mjs +311 -15
  322. package/foundation/doc-compiler/diagnostics.d.mts +126 -0
  323. package/foundation/doc-compiler/diagnostics.mjs +305 -0
  324. package/foundation/doc-compiler/doc-compiler.test.mjs +28 -1
  325. package/foundation/doc-compiler/doc-loads.test.mjs +1642 -0
  326. package/foundation/doc-compiler/import.d.mts +24 -0
  327. package/foundation/doc-compiler/import.mjs +59 -0
  328. package/foundation/doc-compiler/inputs.d.mts +102 -0
  329. package/foundation/doc-compiler/inputs.mjs +291 -0
  330. package/foundation/doc-compiler/inputs.test.mjs +299 -0
  331. package/foundation/doc-compiler/ir.d.mts +13 -0
  332. package/foundation/doc-compiler/ir.mjs +196 -12
  333. package/foundation/doc-compiler/lenses.d.mts +3 -2
  334. package/foundation/doc-compiler/lenses.mjs +2 -1
  335. package/foundation/doc-compiler/links.d.mts +135 -0
  336. package/foundation/doc-compiler/links.mjs +253 -0
  337. package/foundation/doc-compiler/links.test.mjs +139 -0
  338. package/foundation/doc-compiler/lower-doc.test.mjs +495 -0
  339. package/foundation/doc-compiler/overlays.d.mts +37 -0
  340. package/foundation/doc-compiler/overlays.mjs +206 -0
  341. package/foundation/doc-compiler/parse-readable.d.mts +9 -0
  342. package/foundation/doc-compiler/parse-readable.mjs +29 -0
  343. package/foundation/doc-compiler/read.d.mts +127 -0
  344. package/foundation/doc-compiler/read.mjs +325 -0
  345. package/foundation/doc-compiler/read.test.mjs +313 -0
  346. package/foundation/doc-compiler/source.d.mts +33 -0
  347. package/foundation/doc-compiler/source.mjs +128 -0
  348. package/foundation/doc-compiler/tree.d.mts +288 -0
  349. package/foundation/doc-compiler/tree.mjs +876 -0
  350. package/foundation/doc-compiler/tree.test.mjs +598 -0
  351. package/foundation/fs/file-protection.d.mts +33 -0
  352. package/foundation/fs/file-protection.mjs +825 -0
  353. package/foundation/fs/file-protection.test.mjs +250 -0
  354. package/foundation/integrations/autolink.d.mts +58 -1
  355. package/foundation/integrations/autolink.mjs +143 -57
  356. package/foundation/integrations/autolink.test.mjs +1 -1
  357. package/foundation/integrations/cli-requirement.d.mts +45 -0
  358. package/foundation/integrations/cli-requirement.mjs +154 -0
  359. package/foundation/integrations/cli-requirement.test.mjs +109 -0
  360. package/foundation/integrations/contribution-fixes.d.mts +145 -0
  361. package/foundation/integrations/contribution-fixes.mjs +1284 -0
  362. package/foundation/integrations/contribution-inventory.d.mts +3 -2
  363. package/foundation/integrations/contribution-inventory.mjs +27 -24
  364. package/foundation/integrations/contribution-inventory.test.mjs +86 -27
  365. package/foundation/integrations/integration-warnings.d.mts +9 -2
  366. package/foundation/integrations/integration-warnings.mjs +51 -26
  367. package/foundation/integrations/integration-warnings.test.mjs +74 -1
  368. package/foundation/integrations/integrations.d.mts +3 -0
  369. package/foundation/integrations/integrations.mjs +11 -97
  370. package/foundation/integrations/provider-ledger.test.mjs +275 -0
  371. package/foundation/integrations/provider-resolution.d.mts +152 -0
  372. package/foundation/integrations/provider-resolution.mjs +576 -0
  373. package/foundation/integrations/provider-resolution.test.mjs +369 -0
  374. package/foundation/integrations/theme-descriptor.d.mts +8 -0
  375. package/foundation/integrations/theme-descriptor.mjs +44 -0
  376. package/foundation/integrations/validate-contributions.mjs +121 -29
  377. package/foundation/response/error-codes.d.mts +3 -1
  378. package/foundation/response/error-codes.d.ts +2 -0
  379. package/foundation/response/error-codes.doc.mjs +12 -2
  380. package/foundation/response/error-codes.mjs +7 -1
  381. package/foundation/response/error-codes.test.mjs +55 -11
  382. package/foundation/response/response-types.doc.mjs +14 -9
  383. package/foundation/response/response.doc.mjs +1 -1
  384. package/foundation/text/string-utils.mjs +22 -10
  385. package/foundation/xle/expand.mjs +1 -1
  386. package/foundation/xle/xle.test.mjs +13 -0
  387. package/package.json +10 -9
  388. package/assets/templates/themes/manifest.json +0 -95
package/README.md CHANGED
@@ -15,6 +15,25 @@ npx @astryxdesign/cli template --list
15
15
 
16
16
  Once it's a project dependency (`npm install -D @astryxdesign/cli`), drop the scope and use the shorter `astryx` — e.g. `npx astryx component Button` or `pnpm exec astryx component Button`. Bare `astryx` resolves to an unrelated npm package until the CLI is installed, so prefer the scoped form above for first-run/one-off use.
17
17
 
18
+ ## Reading the CLI's own docs
19
+
20
+ The CLI documents itself, so these commands print what the installed version does:
21
+
22
+ - `astryx <command> --help`: one command's arguments and options.
23
+ - `astryx manifest --json`: every command, option, and response type, as JSON.
24
+ - `astryx docs cli`: the CLI's docs tree, one level at a time.
25
+ `astryx docs cli/commands` lists every command, `astryx docs cli/api` lists
26
+ the API's functions, schemas, and enums, and a route such as
27
+ `astryx docs cli/api/functions/search` prints one.
28
+ - `astryx docs authoring --index`: the authoring reference, with one section for
29
+ each file an author writes: the `astryx.config.*` file, the
30
+ `astryx.integration.*` manifest, codemods, and every doc type (`ComponentDoc`,
31
+ `TemplateDoc`, `ThemeDoc`, and the rest). Read one section with
32
+ `astryx docs authoring <section>`, for example `astryx docs authoring config`.
33
+ - `astryx docs cli/integrations`: the guide to building an integration package.
34
+ - `astryx docs`: every docs topic, including the design-system guides (for
35
+ example `tokens`, `theme`, and `layout`).
36
+
18
37
  ## Finding things: `astryx search`
19
38
 
20
39
  When you don't know whether what you need is a component, a hook, a docs topic,
@@ -170,6 +189,8 @@ if (isError(result)) {
170
189
  | `ERR_UNKNOWN_FEATURE` | An unrecognized `--features` value was passed to init. |
171
190
  | `ERR_UNKNOWN_CODEMOD` | A `--codemod` value did not match any registered codemod (upgrade). |
172
191
  | `ERR_CODEMOD_FAILED` | One or more codemods failed during an upgrade run. |
192
+ | `ERR_CODEMOD_PROTECTED` | A required codemod change remains blocked by a protected consumer file. |
193
+ | `ERR_CODEMOD_PROTECTION_SOURCE` | A working-tree protection declaration could not be read or parsed. |
173
194
  | `ERR_NOT_FOUND` | A generic discover/lookup query matched nothing in any package. |
174
195
  | `ERR_NO_DOC` | A component exists but has no typed `.doc.mjs` file. |
175
196
  | `ERR_NO_SHOWCASE` | No showcase exists for the requested component. |
@@ -179,7 +200,7 @@ if (isError(result)) {
179
200
  | `ERR_FILE_EXISTS` | Refused to overwrite an existing file. |
180
201
  | `ERR_PATH_TRAVERSAL` | A path escaped its allowed root, or a name contained traversal markers. |
181
202
  | `ERR_WRITE_FAILED` | Writing output files failed (and was rolled back). |
182
- | `ERR_THEME_INVALID` | A theme definition or contributed theme catalog is invalid. |
203
+ | `ERR_THEME_INVALID` | A theme definition or contributed theme descriptor is invalid. |
183
204
  | `ERR_THEME_LOAD` | A theme file could not be loaded / parsed into a defineTheme result. |
184
205
  | `ERR_PALETTE_GENERATION` | A palette generation request or one of its constraints was invalid. |
185
206
  | `ERR_VERSION_DETECT` | The current `@astryxdesign/core` version could not be detected. |
@@ -407,24 +428,25 @@ Every response has a `type` discriminant. The full set is below (generated from
407
428
  | `component.detail.source` | One component's source file, as {component, source}. |
408
429
  | `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. |
409
430
  | `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry. |
410
- | `docs.list` | All reference-doc topics as DocsListEntry[] ({topic, description}), in discovery order. |
411
- | `docs.detail` | One topic's full ReferenceDoc, with token-ref blocks inlined. |
412
- | `docs.index` | One topic's section index (--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). |
413
- | `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined. |
431
+ | `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. |
432
+ | `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). |
433
+ | `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). |
434
+ | `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). |
435
+ | `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). |
414
436
  | `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. |
415
437
  | `blog.detail` | One post's metadata plus the feed URL and the post's full plaintext body. |
416
438
  | `discover.list` | The configured external packages (name, category, components, version, description); when empty it carries meta.configured to tell "nothing configured" from "nothing discovered". |
417
439
  | `discover.detail` | A single external package entry, for an @scope/name query. |
418
440
  | `discover.detail.doc` | The validated ComponentDoc for one external component: an @scope/name/Component query, or a free-text term resolving to exactly one component. |
419
441
  | `discover.search` | The echoed query plus the matching {package, component} pairs, when a free-text term matches several components. |
420
- | `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 (docs), or displayName and kind (templates). |
442
+ | `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). |
421
443
  | `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. |
422
444
  | `build.kit` | The composition kit: echoed query, hasResults, matchCount (total matched, never a cap), directMatch, pages (closest templates), blocks (drop-in patterns) and domain (idea components/hooks) as SearchResultEntry[], frame and foundation name arrays, and hint {reason, commands} when thin. |
423
445
  | `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. |
424
446
  | `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and an optional maintainer note. |
425
447
  | `gap-report.categories` | The fixed gap category values and human-readable labels. |
426
448
  | `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. |
427
- | `template.list` | Every discovered template (page + block); each entry carries id, name, description, kind, owning package, optional category and componentsUsed, and readiness flags. |
449
+ | `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. |
428
450
  | `template.show` | The resolved template's raw source plus its description, kind, and the component names it composes. |
429
451
  | `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. |
430
452
  | `template.copy` | A scaffold receipt: template id, output directory, written file name, and file count. |
@@ -448,9 +470,9 @@ Every response has a `type` discriminant. The full set is below (generated from
448
470
  | `integration.add` | A contribution-writer receipt: kind, name, optional root {path, created}, integration-manifest path, every affected project-relative path, written, and dryRun. |
449
471
  | `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}]. |
450
472
  | `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}. |
451
- | `integration.template-conflicts` | The integration identity, structural issues, and non-blocking conflicts where an integration template id is also owned by Core; each conflict includes the exact package-qualified command. |
473
+ | `integration.template-conflicts` | The integration identity, issues, and conflicts as {severity: info \| warning, relationship: replaces \| accidental, replaces?, command}. |
452
474
  | `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. |
453
- | `integration.doc-conflicts` | The integration identity, structural issues, and Core doc overlaps classified as intentional replacements, intentional extensions, or accidental same-name conflicts. |
475
+ | `integration.doc-conflicts` | The integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` \| `error`) and `relationship` (`replaces` \| `extends` \| `accidental`). |
454
476
  | `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). |
455
477
  | `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). |
456
478
  | `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. |
@@ -646,9 +668,10 @@ wrong type fails there; a field this CLI does not know is ignored with a
646
668
  warning naming it, so a manifest written against a newer CLI still contributes
647
669
  everything this one understands.
648
670
 
649
- Discovery is resilient: a broken or misconfigured integration is skipped with a
650
- one-line warning on stderr instead of crashing the CLI, and it never corrupts a
651
- `--json` envelope. To inspect problems, run
671
+ Discovery is resilient. A manifest load failure skips that package with a warning.
672
+ An invalid contribution kind remains reportable without hiding other valid kinds,
673
+ and invalid template or component metadata is omitted without hiding valid siblings.
674
+ Warnings go to stderr and never corrupt a `--json` envelope. To inspect problems, run
652
675
  `astryx doctor integration validate <package>` for structure, then use `templates`,
653
676
  `components`, or `docs` under the same `astryx doctor integration` group to check
654
677
  Core identity overlaps before publishing. Bare `astryx doctor` checks overall
@@ -658,5 +681,5 @@ For the full authoring walkthrough (component doc format, template packaging
658
681
  and `exports` requirements, and codemod authoring), see the guide:
659
682
 
660
683
  ```bash
661
- astryx docs cli-integrations
684
+ astryx docs cli/integrations
662
685
  ```
@@ -11,6 +11,7 @@ export const doc = {
11
11
  type: 'function',
12
12
  kind: 'api',
13
13
  name: 'blog',
14
+ namespace: 'cli/api',
14
15
  displayName: 'blog()',
15
16
  summary: 'List blog posts, or read one, from the published RSS feed.',
16
17
  description:
@@ -11,6 +11,7 @@ export const doc = {
11
11
  type: 'function',
12
12
  kind: 'api',
13
13
  name: 'build',
14
+ namespace: 'cli/api',
14
15
  displayName: 'build()',
15
16
  summary:
16
17
  'Page-building assistant: the how-to-build playbook, or a composition kit for an idea.',
@@ -2,9 +2,8 @@
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
4
  /**
5
- * A loaded component doc. `loadDocs` returns the authored `.doc.mjs` shape,
6
- * which is either a single-component or multi-component doc; this loose view
7
- * captures the fields the API reads across both forms.
5
+ * A loaded component doc. The shared validated loader accepts stamped and legacy
6
+ * component docs; this loose view captures the fields the API reads across both.
8
7
  * @typedef {object} LoadedComponentDoc
9
8
  * @property {string} [name]
10
9
  * @property {string} [description]
@@ -15,9 +14,7 @@
15
14
  * @property {string} [import] set when the doc states its own import specifier
16
15
  */
17
16
  /**
18
- * Options object for `loadDocs`, matching its declared parameter shape (used
19
- * as a cast target so `lang` (which the API may hold as `string|null`) type
20
- * checks against `loadDocs`'s `lang?: string`).
17
+ * Options object for the shared component-doc loader.
21
18
  * @typedef {{zh?: boolean, dense?: boolean, lang?: string}} LoadDocsOpts
22
19
  */
23
20
  /**
@@ -184,9 +181,8 @@ export function scopeSubComponent(docs: LoadedComponentDoc, dirName: string, cor
184
181
  } | null;
185
182
  export { CORE_PACKAGE };
186
183
  /**
187
- * A loaded component doc. `loadDocs` returns the authored `.doc.mjs` shape,
188
- * which is either a single-component or multi-component doc; this loose view
189
- * captures the fields the API reads across both forms.
184
+ * A loaded component doc. The shared validated loader accepts stamped and legacy
185
+ * component docs; this loose view captures the fields the API reads across both.
190
186
  */
191
187
  export type LoadedComponentDoc = {
192
188
  name?: string | undefined;
@@ -203,9 +199,7 @@ export type LoadedComponentDoc = {
203
199
  import?: string | undefined;
204
200
  };
205
201
  /**
206
- * Options object for `loadDocs`, matching its declared parameter shape (used
207
- * as a cast target so `lang` (which the API may hold as `string|null`) type
208
- * checks against `loadDocs`'s `lang?: string`).
202
+ * Options object for the shared component-doc loader.
209
203
  */
210
204
  export type LoadDocsOpts = {
211
205
  zh?: boolean;
@@ -35,16 +35,15 @@ import {
35
35
  resolveIntegrationImportPath as resolveIntegrationImport,
36
36
  } from '../../foundation/discovery/component-discovery.mjs';
37
37
  import {Project} from '../../foundation/config/project.mjs';
38
- import {loadDocs} from '../../foundation/discovery/component-loader.mjs';
38
+ import {loadComponentDoc as loadValidatedComponentDoc} from '../../foundation/discovery/component-loader.mjs';
39
39
  import {searchComponents} from '../../foundation/text/string-utils.mjs';
40
40
  import {AstryxError} from '../error.mjs';
41
41
 
42
42
  export {CORE_PACKAGE};
43
43
 
44
44
  /**
45
- * A loaded component doc. `loadDocs` returns the authored `.doc.mjs` shape,
46
- * which is either a single-component or multi-component doc; this loose view
47
- * captures the fields the API reads across both forms.
45
+ * A loaded component doc. The shared validated loader accepts stamped and legacy
46
+ * component docs; this loose view captures the fields the API reads across both.
48
47
  * @typedef {object} LoadedComponentDoc
49
48
  * @property {string} [name]
50
49
  * @property {string} [description]
@@ -56,9 +55,7 @@ export {CORE_PACKAGE};
56
55
  */
57
56
 
58
57
  /**
59
- * Options object for `loadDocs`, matching its declared parameter shape (used
60
- * as a cast target so `lang` (which the API may hold as `string|null`) type
61
- * checks against `loadDocs`'s `lang?: string`).
58
+ * Options object for the shared component-doc loader.
62
59
  * @typedef {{zh?: boolean, dense?: boolean, lang?: string}} LoadDocsOpts
63
60
  */
64
61
 
@@ -381,9 +378,22 @@ export async function resolveUnscopedDoc(dirName, {coreDir, cwd, name}) {
381
378
  */
382
379
  export async function loadComponentDoc(docPath, opts = {}) {
383
380
  const {zh = false, dense = false, lang = null} = opts;
384
- return /** @type {LoadedComponentDoc} */ (
385
- await loadDocs(docPath, /** @type {LoadDocsOpts} */ ({zh, dense, lang}))
386
- );
381
+ try {
382
+ return /** @type {LoadedComponentDoc} */ (
383
+ await loadValidatedComponentDoc(
384
+ docPath,
385
+ /** @type {LoadDocsOpts} */ ({zh, dense, lang}),
386
+ )
387
+ );
388
+ } catch (err) {
389
+ throw new AstryxError(
390
+ `Cannot load component metadata: ${
391
+ err instanceof Error ? err.message : String(err)
392
+ }`,
393
+ undefined,
394
+ ERROR_CODES.ERR_INVALID_DOC,
395
+ );
396
+ }
387
397
  }
388
398
 
389
399
  /**
@@ -12,6 +12,7 @@ export const doc = {
12
12
  type: 'function',
13
13
  kind: 'api',
14
14
  name: 'component',
15
+ namespace: 'cli/api',
15
16
  displayName: 'component()',
16
17
  summary:
17
18
  'Resolve a component by name, or list the catalog, with optional focused slices (props, source, showcase, blocks).',
@@ -109,7 +110,7 @@ export const doc = {
109
110
  {
110
111
  type: 'component.list',
111
112
  description:
112
- "The catalog grouped by category. data.detail is the level ('names' | 'compact' | 'full') and data.components is the grouped map: names entries with name, package, and an optional canonical import for integrations; brief entries; or full ComponentDoc entries.",
113
+ "The catalog grouped by category. data.detail is the level ('names' | 'compact' | 'full') and data.components is the grouped map: names entries with name, package, and an optional canonical import for integration and legacy package components; brief entries; or full ComponentDoc entries.",
113
114
  },
114
115
  {
115
116
  type: 'component.detail',
@@ -143,14 +143,20 @@ export async function component(name, options = {}) {
143
143
  // Searches that package first — critical for names that exist in both core
144
144
  // and an external package (AppShell, Button, SideNav).
145
145
  if (packageScope) {
146
- const scoped = classifyScope(packageScope, {owners, loadedIntegrations, cwd, name});
146
+ const scoped = classifyScope(packageScope, {
147
+ owners,
148
+ loadedIntegrations,
149
+ cwd,
150
+ name,
151
+ });
147
152
 
148
153
  if (scoped.kind === 'core' || scoped.kind === 'integration') {
149
154
  const owner = scoped.owner;
150
155
  if (source) {
151
156
  return componentDetailSource(dirName, owner.sourcePath, {
152
157
  name,
153
- notFoundInPackage: scoped.kind === 'integration' ? packageScope : null,
158
+ notFoundInPackage:
159
+ scoped.kind === 'integration' ? packageScope : null,
154
160
  });
155
161
  }
156
162
  // showcase/blocks were previously dropped on the scoped path — a
@@ -187,17 +193,48 @@ export async function component(name, options = {}) {
187
193
  }
188
194
  const docs = await loadComponentDoc(extDocPath, docOpts);
189
195
  if (props) return componentDetailProps(docs);
190
- return componentDetail(docs, {package: scoped.ext.name, sourcePath: null}, dirName, coreDir);
196
+ return componentDetail(
197
+ docs,
198
+ {package: scoped.ext.name, sourcePath: null},
199
+ dirName,
200
+ coreDir,
201
+ );
202
+ }
203
+ throw new AstryxError(
204
+ `No component "${name}" in package "${packageScope}"`,
205
+ undefined,
206
+ ERROR_CODES.ERR_UNKNOWN_COMPONENT,
207
+ );
208
+ }
209
+
210
+ // Invalid integration metadata does not create ambiguity against a valid
211
+ // owner. Keep raw owners only when no doc owner is valid, so an integration-
212
+ // only component still exposes its source and returns ERR_INVALID_DOC for
213
+ // detail instead of degrading to an unrelated unknown-component error.
214
+ const validOwners = [];
215
+ for (const owner of owners) {
216
+ if (owner.package === CORE_PACKAGE) {
217
+ validOwners.push(owner);
218
+ continue;
219
+ }
220
+ try {
221
+ await loadComponentDoc(owner.docPath);
222
+ validOwners.push(owner);
223
+ } catch {
224
+ // Project/Doctor report invalid metadata; it is not an effective owner.
191
225
  }
192
- throw new AstryxError(`No component "${name}" in package "${packageScope}"`, undefined, ERROR_CODES.ERR_UNKNOWN_COMPONENT);
193
226
  }
227
+ const effectiveOwners = validOwners.length > 0 ? validOwners : owners;
194
228
 
195
- // ── Ambiguity: owned by MORE THAN ONE package, no --package ─────
196
- assertUnambiguousOwners(owners, dirName);
229
+ // ── Ambiguity: owned by MORE THAN ONE valid package, no --package ──
230
+ assertUnambiguousOwners(effectiveOwners, dirName);
197
231
 
198
232
  // ── Single non-core owner (an integration provides it, core does not) ──
199
- if (owners.length === 1 && owners[0].package !== CORE_PACKAGE) {
200
- const owner = owners[0];
233
+ if (
234
+ effectiveOwners.length === 1 &&
235
+ effectiveOwners[0].package !== CORE_PACKAGE
236
+ ) {
237
+ const owner = effectiveOwners[0];
201
238
  if (source) {
202
239
  return componentDetailSource(dirName, owner.sourcePath, {name});
203
240
  }
@@ -213,7 +250,11 @@ export async function component(name, options = {}) {
213
250
  // ── No-scope core path ─────────────────────────────────────────
214
251
  // `--source` reads core directly (no external/fuzzy fallback).
215
252
  if (source) {
216
- return componentDetailSource(dirName, resolveCoreSourcePath(coreDir, dirName), {name});
253
+ return componentDetailSource(
254
+ dirName,
255
+ resolveCoreSourcePath(coreDir, dirName),
256
+ {name},
257
+ );
217
258
  }
218
259
  if (showcase) {
219
260
  return componentDetailShowcase(dirName, {cwd, name});
@@ -232,10 +273,14 @@ export async function component(name, options = {}) {
232
273
  // scope the response to just the matching sub-component.
233
274
  const sub = scopeSubComponent(docs, dirName, coreDir);
234
275
  if (sub) {
235
- if (props) return componentDetailProps({props: sub.matchingComponent.props});
276
+ if (props)
277
+ return componentDetailProps({props: sub.matchingComponent.props});
236
278
  return componentDetail(
237
279
  sub.scoped,
238
- {package: resolved.resolvedOwnerPackage, sourcePath: resolved.resolvedSourcePath},
280
+ {
281
+ package: resolved.resolvedOwnerPackage,
282
+ sourcePath: resolved.resolvedSourcePath,
283
+ },
239
284
  dirName,
240
285
  coreDir,
241
286
  );
@@ -244,7 +289,10 @@ export async function component(name, options = {}) {
244
289
  if (props) return componentDetailProps(docs);
245
290
  return componentDetail(
246
291
  docs,
247
- {package: resolved.resolvedOwnerPackage, sourcePath: resolved.resolvedSourcePath},
292
+ {
293
+ package: resolved.resolvedOwnerPackage,
294
+ sourcePath: resolved.resolvedSourcePath,
295
+ },
248
296
  resolved.resolvedName,
249
297
  coreDir,
250
298
  );
@@ -31,9 +31,10 @@ export type ComponentListData = ({
31
31
  /**
32
32
  * A single entry in a `component.list` group at `detail: 'names'`. Pre-1.0 the
33
33
  * list moved from bare strings to package-qualified objects so consumers can
34
- * disambiguate ownership (core vs. an integration package). Integration entries
35
- * carry `import` — the package-authored specifier; core entries omit it (the
36
- * specifier is derived from the component name by the renderer).
34
+ * disambiguate ownership (core vs. an integration package). Integration and
35
+ * legacy `astryx.docs` package entries carry `import` — the same specifier their
36
+ * `component.detail` reports; core entries omit it (the specifier is derived
37
+ * from the component name by the renderer).
37
38
  */
38
39
  export type ComponentListEntry = {
39
40
  name: string;
@@ -42,7 +43,7 @@ export type ComponentListEntry = {
42
43
  */
43
44
  package: string;
44
45
  /**
45
- * - Import specifier; present for integration components, absent for core.
46
+ * - Import specifier; present for integration and legacy package components, absent for core.
46
47
  */
47
48
  import?: string | undefined;
48
49
  };
@@ -52,13 +52,14 @@
52
52
  /**
53
53
  * A single entry in a `component.list` group at `detail: 'names'`. Pre-1.0 the
54
54
  * list moved from bare strings to package-qualified objects so consumers can
55
- * disambiguate ownership (core vs. an integration package). Integration entries
56
- * carry `import` — the package-authored specifier; core entries omit it (the
57
- * specifier is derived from the component name by the renderer).
55
+ * disambiguate ownership (core vs. an integration package). Integration and
56
+ * legacy `astryx.docs` package entries carry `import` — the same specifier their
57
+ * `component.detail` reports; core entries omit it (the specifier is derived
58
+ * from the component name by the renderer).
58
59
  * @typedef {object} ComponentListEntry
59
60
  * @property {string} name
60
61
  * @property {string} package - Owner package, e.g. '@astryxdesign/core' or '@acme/astryx-meta'.
61
- * @property {string} [import] - Import specifier; present for integration components, absent for core.
62
+ * @property {string} [import] - Import specifier; present for integration and legacy package components, absent for core.
62
63
  */
63
64
 
64
65
  /**
@@ -1,11 +1,6 @@
1
1
  // @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
- /**
5
- * @typedef {import('../component.type.mjs').ComponentListResponse} ComponentListResponse
6
- * @typedef {import('../component.type.mjs').ComponentListEntry} ComponentListEntry
7
- * @typedef {import('../component.type.mjs').ComponentBriefEntry} ComponentBriefEntry
8
- */
9
4
  /**
10
5
  * Build the `component.list` envelope. The list taxonomy is collapsed: all
11
6
  * three detail levels emit ONE `component.list` type; the depth rides in
@@ -15,15 +15,16 @@ import {
15
15
  CORE_PACKAGE,
16
16
  discoverComponents,
17
17
  discoverExternalComponentsGrouped,
18
- discoverIntegrationComponents,
18
+ discoverValidIntegrationComponents,
19
19
  findComponentReadme,
20
+ findExternalComponentDoc,
20
21
  resolveImportPath,
21
22
  resolveIntegrationImportPath,
22
23
  } from '../../../foundation/discovery/component-discovery.mjs';
23
24
  import {discoverExternalPackages} from '../../../foundation/fs/paths.mjs';
24
25
  import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
25
26
  import {AstryxError} from '../../error.mjs';
26
- import {loadComponentDoc, loadIntegrationsSafely} from '../_adapter.mjs';
27
+ import {loadComponentDoc, loadIntegrationsSafely, withOwnership} from '../_adapter.mjs';
27
28
 
28
29
  /**
29
30
  * @typedef {import('../component.type.mjs').ComponentListResponse} ComponentListResponse
@@ -31,6 +32,29 @@ import {loadComponentDoc, loadIntegrationsSafely} from '../_adapter.mjs';
31
32
  * @typedef {import('../component.type.mjs').ComponentBriefEntry} ComponentBriefEntry
32
33
  */
33
34
 
35
+ /**
36
+ * The import a legacy `pkg.astryx.docs` component's detail reports, derived the
37
+ * same way (`withOwnership`) so list and detail agree.
38
+ * @param {{name: string, docsDir: string}} ext
39
+ * @param {string} name
40
+ * @param {string} coreDir
41
+ * @param {{zh: boolean, lang: string|null}} docOpts
42
+ * @returns {Promise<string>}
43
+ */
44
+ async function legacyImport(ext, name, coreDir, docOpts) {
45
+ const docPath = findExternalComponentDoc(ext.docsDir, name);
46
+ /** @type {import('../_adapter.mjs').LoadedComponentDoc} */
47
+ let docs = {};
48
+ if (docPath && docPath.endsWith('.doc.mjs')) {
49
+ try {
50
+ docs = await loadComponentDoc(docPath, docOpts);
51
+ } catch {
52
+ // Keep list resilient; validation owns malformed docs.
53
+ }
54
+ }
55
+ return withOwnership(docs, {package: ext.name, sourcePath: null}, name, coreDir).import;
56
+ }
57
+
34
58
  /**
35
59
  * Build the `component.list` envelope. The list taxonomy is collapsed: all
36
60
  * three detail levels emit ONE `component.list` type; the depth rides in
@@ -204,7 +228,8 @@ export async function componentList(
204
228
  const seenIntegration = new Set();
205
229
  for (const integration of loadedIntegrations) {
206
230
  seenIntegration.add(integration.name);
207
- const owned = discoverIntegrationComponents(integration);
231
+ const {components: owned} =
232
+ await discoverValidIntegrationComponents(integration);
208
233
  // Group integration components by their doc `group`, falling back to the
209
234
  // package name. Keys are package-qualified so they never collide with
210
235
  // core groups or each other.
@@ -267,20 +292,24 @@ export async function componentList(
267
292
  k => grouped[k].length > 1 || grouped[k][0] !== k,
268
293
  );
269
294
 
270
- if (hasGroups) {
271
- for (const [group, members] of Object.entries(grouped)) {
272
- listData[`${group} (${ext.name})`] = members.map(n => ({
295
+ /** @param {string[]} names */
296
+ const entriesFor = names =>
297
+ Promise.all(
298
+ names.map(async n => ({
273
299
  name: n,
274
300
  package: ext.name,
275
- }));
301
+ import: await legacyImport(ext, n, coreDir, {zh, lang}),
302
+ })),
303
+ );
304
+
305
+ if (hasGroups) {
306
+ for (const [group, members] of Object.entries(grouped)) {
307
+ listData[`${group} (${ext.name})`] = await entriesFor(members);
276
308
  }
277
309
  } else {
278
310
  const allComps = Object.values(grouped).flat().sort();
279
311
  if (allComps.length > 0) {
280
- listData[`${ext.category} (${ext.name})`] = allComps.map(n => ({
281
- name: n,
282
- package: ext.name,
283
- }));
312
+ listData[`${ext.category} (${ext.name})`] = await entriesFor(allComps);
284
313
  }
285
314
  }
286
315
  }
@@ -11,6 +11,7 @@ export const doc = {
11
11
  type: 'function',
12
12
  kind: 'api',
13
13
  name: 'discover',
14
+ namespace: 'cli/api',
14
15
  displayName: 'discover()',
15
16
  summary: 'Browse and search components from configured external packages.',
16
17
  description: