@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
@@ -11,12 +11,9 @@ export const doc = {
11
11
  name: 'gap-report',
12
12
  displayName: 'astryx gap-report',
13
13
  namespace: 'cli/commands',
14
- summary: 'Report a missing component or feature to the package that owns it',
14
+ summary: 'Route a design-system gap to its owning package',
15
15
  description:
16
- 'Reports a missing component, variant, layout, styling, accessibility, API, or documentation capability to the package that owns it: the --package you name, else the one package that provides the component, else Core. ' +
17
- 'Every configured handler receives the report: the project config handler first, then each integration handler in config order. Public handlers run only with --confirm-public; internal handlers always run. A failing handler does not stop the others. ' +
18
- "With no handler it files a GitHub issue for the owning package, only with --confirm-public (without it nothing is sent), or returns the package's issues URL when that is not on GitHub. " +
19
- 'The report records whether an agent or a person ran it.',
16
+ 'Reports a missing component, variant, layout, styling, accessibility, API, or documentation capability. The command selects an explicit package first, then a unique component owner, then Core. The report fans out to every effective handler: project config first, then each loaded integration in config order. Public handlers require --confirm-public per handler; internal handlers always run. A handler failure is isolated and does not prevent later handlers.',
20
17
  fn: 'gapReport',
21
18
  args: [
22
19
  {
@@ -48,14 +45,12 @@ export const doc = {
48
45
  {
49
46
  flag: '--package <pkg>',
50
47
  param: 'options.package',
51
- description:
52
- 'Package that owns the gap: @astryxdesign/core or a loaded integration. Overrides automatic routing; needed when more than one package provides the component',
48
+ description: 'Route to a specific loaded package',
53
49
  },
54
50
  {
55
51
  flag: '--confirm-public',
56
52
  param: 'options.confirmPublic',
57
- description:
58
- 'Allow public delivery: public handlers run, and with no handler it files a GitHub issue with your gh login',
53
+ description: 'Consent to public handlers or GitHub issue creation',
59
54
  },
60
55
  {
61
56
  flag: '--list-categories',
@@ -67,9 +62,13 @@ export const doc = {
67
62
  examples: [
68
63
  {label: 'List categories', cli: 'astryx gap-report --list-categories'},
69
64
  {
70
- label: 'Prepare a report (nothing public happens without --confirm-public)',
65
+ label: 'Route an agent report',
71
66
  cli: "astryx gap-report Button --category missing_variant --reason 'Need a compact size'",
72
67
  },
68
+ {
69
+ label: 'Confirm public filing',
70
+ cli: "astryx gap-report Button --category docs_gap --reason 'Missing keyboard example' --confirm-public",
71
+ },
73
72
  ],
74
73
  exitCodes: [
75
74
  {
@@ -18,22 +18,21 @@ export const doc = {
18
18
  'Non-interactive project setup (no prompts, so it behaves the same for humans, ' +
19
19
  'agents, and CI). By default it installs the AGENTS.md/CLAUDE.md agent-docs, ' +
20
20
  'including guidance from configured integrations, and prints getting-started ' +
21
- "steps. --features and --all print only the chosen features' guidance (no " +
22
- 'getting-started steps); the theme feature also writes an annotated theme template.',
21
+ 'guidance; features/--all add theme and page-building ' +
22
+ 'guidance and write an annotated theme template.',
23
23
  fn: 'init',
24
24
  options: [
25
25
  {
26
26
  flag: '--features <list>',
27
27
  param: 'options.features',
28
28
  description:
29
- 'Comma-separated features: agents (agent docs), theme (writes theme.template.ts), template (prints the page-building commands; writes no file). ' +
30
- 'An unknown feature exits 1 with ERR_UNKNOWN_FEATURE. Ignored with --all or --remove-agents',
29
+ 'Comma-separated features to install (agents, theme, template). An unknown feature exits 1 with ERR_UNKNOWN_FEATURE. ' +
30
+ 'Ignored with --all or --remove-agents',
31
31
  },
32
32
  {
33
33
  flag: '--all',
34
34
  param: 'options.all',
35
- description:
36
- 'Install all features (agents, theme, template); overrides --features. Prints their guidance instead of the getting-started steps',
35
+ description: 'Install all features (agents, theme, template); overrides --features',
37
36
  },
38
37
  {
39
38
  flag: '--remove-agents',
@@ -48,9 +47,7 @@ export const doc = {
48
47
  param: 'options.agent',
49
48
  choices: ['claude', 'cursor', 'codex', 'hermes', 'muse', 'all'],
50
49
  description:
51
- 'Target AI tool for agent docs: claude (CLAUDE.md or .claude/CLAUDE.md, else creates .claude/CLAUDE.md), cursor (.cursorrules if present, else AGENTS.md), ' +
52
- 'codex and muse (AGENTS.md), hermes (.hermes.md or HERMES.md if present, else AGENTS.md), all (every existing agent doc, else AGENTS.md and .claude/CLAUDE.md). ' +
53
- 'An unknown tool exits 1 with ERR_UNKNOWN_AGENT. ' +
50
+ 'Target AI tool for agent docs: claude, cursor, codex, hermes, muse, all. An unknown tool exits 1 with ERR_UNKNOWN_AGENT. ' +
54
51
  'Used only when agent docs are installed (the default, --all, or --features agents); --agent-docs-path takes precedence',
55
52
  },
56
53
  {
@@ -8,7 +8,7 @@ export const doc = {
8
8
  namespace: 'cli/commands',
9
9
  summary: 'Add one working contribution to an integration package',
10
10
  description:
11
- 'Writes the files one contribution needs, creates the integration manifest on first use, and declares a root only after a contribution the CLI can read exists behind it. A component or template import also needs an `exports` entry: add writes one only when package.json already has an `exports` map, so start a new package with `"exports": {}`. See {@link generic:quick-start}.',
11
+ 'Writes the complete minimum shape the selected contribution needs, creates the integration manifest on first use, declares the root only after a valid contribution exists, and verifies the result through the same discovery contract the packed-package check uses.',
12
12
  fn: 'integrationAdd',
13
13
  args: [
14
14
  {
@@ -60,14 +60,10 @@ export const doc = {
60
60
  flag: '--to <version>',
61
61
  param: 'options.to',
62
62
  description:
63
- 'Exact semver of the @astryxdesign/core version whose upgrade runs the codemod (e.g. 0.7.0); required for codemod and only valid there',
63
+ 'Exact semver the codemod migrates to (e.g. 1.2.0); required for codemod and only valid there',
64
64
  },
65
65
  ],
66
66
  examples: [
67
- {
68
- label: 'Preview',
69
- cli: 'astryx integration add component AcmeWidget --dry-run --json',
70
- },
71
67
  {
72
68
  label: 'Add a component',
73
69
  cli: 'astryx integration add component AcmeWidget',
@@ -75,7 +71,7 @@ export const doc = {
75
71
  {label: 'Add a doc topic', cli: 'astryx integration add doc deploying'},
76
72
  {
77
73
  label: 'Add a page template',
78
- cli: 'astryx integration add template acme-dashboard',
74
+ cli: 'astryx integration add template dashboard',
79
75
  },
80
76
  {
81
77
  label: 'Add a block template',
@@ -91,7 +87,7 @@ export const doc = {
91
87
  },
92
88
  {
93
89
  label: 'Add a guide to the package\'s own docs section',
94
- cli: 'astryx integration add doc releasing --parent acme',
90
+ cli: 'astryx integration add doc deploying --parent acme',
95
91
  },
96
92
  {
97
93
  label: 'Add a codemod',
@@ -102,6 +98,10 @@ export const doc = {
102
98
  cli: "astryx integration add agent-doc 'Run acme verify before finishing.'",
103
99
  },
104
100
  {label: 'Add a source theme', cli: 'astryx integration add theme ocean'},
101
+ {
102
+ label: 'Preview',
103
+ cli: 'astryx integration add component AcmeWidget --dry-run --json',
104
+ },
105
105
  ],
106
106
  exitCodes: [
107
107
  {code: 0, when: 'the contribution is written or the dry run succeeds'},
@@ -110,5 +110,5 @@ export const doc = {
110
110
  when: 'the kind, name, options, package, or target files are invalid or conflict',
111
111
  },
112
112
  ],
113
- related: ['integration verify', 'doctor integration validate', 'theme add'],
113
+ related: ['integration pack', 'doctor integration validate', 'theme add'],
114
114
  };
@@ -127,7 +127,10 @@ describe('integration authoring CLI', () => {
127
127
  );
128
128
  expect(added.status).toBe(0);
129
129
 
130
- const checked = await runCli(['integration', 'verify', '--json'], tmpDir);
130
+ const checked = await runCli(
131
+ ['integration', 'pack', '--check', '--json'],
132
+ tmpDir,
133
+ );
131
134
  // Without an exports map, the extensionless import cannot resolve —
132
135
  // pack-check must fail, not false-green.
133
136
  expect(checked.status).not.toBe(0);
@@ -147,67 +150,13 @@ describe('integration authoring CLI', () => {
147
150
  );
148
151
  });
149
152
 
150
- it('keeps `integration pack --check` as a deprecated alias of `integration verify`', async () => {
151
- // The old spelling runs the same check: the same JSON, the same exit code.
152
- const verify = await runCli(['integration', 'verify', '--json'], tmpDir);
153
- const old = await runCli(
154
- ['integration', 'pack', '--check', '--json'],
155
- tmpDir,
156
- );
157
- expect(old.status).toBe(verify.status);
158
- const verifyEnvelope = parseEnvelope(verify.stdout);
159
- const oldEnvelope = parseEnvelope(old.stdout);
160
- expect(oldEnvelope.type).toBe('integration.pack-check');
161
- expect(oldEnvelope.type).toBe(verifyEnvelope.type);
162
- expect(oldEnvelope.data.packable).toBe(verifyEnvelope.data.packable);
163
- expect(oldEnvelope.data.issues).toEqual(verifyEnvelope.data.issues);
164
- // The global flag may come first, as agents usually write it.
165
- const lead = await runCli(
166
- ['--json', 'integration', 'pack', '--check'],
167
- tmpDir,
168
- );
169
- expect(parseEnvelope(lead.stdout).type).toBe('integration.pack-check');
170
- // In text, it says to use the new name, on stderr, so stdout is the same.
171
- const text = await runCli(['integration', 'pack', '--check'], tmpDir);
172
- const verifyText = await runCli(['integration', 'verify'], tmpDir);
173
- expect(text.status).toBe(verifyText.status);
174
- expect(text.stdout).toBe(verifyText.stdout);
175
- expect(text.stderr).toContain('`integration pack --check` is deprecated');
176
- expect(text.stderr).toContain('astryx integration verify');
177
- // Without --check it fails, as it did, and names both spellings.
178
- const bare = await runCli(['integration', 'pack'], tmpDir);
179
- expect(bare.status).not.toBe(0);
180
- expect(bare.stderr).toContain('--check');
181
- expect(bare.stderr).toContain('astryx integration verify');
182
- // Help lists it, marked deprecated: nothing is hidden.
183
- const help = await runCli(['integration', '--help'], tmpDir);
184
- expect(help.stdout).toMatch(
185
- /pack .*Deprecated: the old name of `integration verify`/,
186
- );
187
- // `verify` itself takes no --check.
188
- const flag = await runCli(['integration', 'verify', '--check'], tmpDir);
189
- expect(flag.status).not.toBe(0);
190
- expect(flag.stderr).toContain("unknown option '--check'");
191
- // An unknown subcommand with a flag names the subcommand, in text and JSON.
192
- const unknown = await runCli(['integration', 'bogus', '--check'], tmpDir);
193
- expect(unknown.status).not.toBe(0);
194
- expect(unknown.stderr).toContain("unknown subcommand 'integration bogus'");
195
- expect(unknown.stderr).toMatch(/verify\s+\(available subcommand\)/);
196
- const unknownJson = await runCli(
197
- ['integration', 'bogus', '--check', '--json'],
198
- tmpDir,
199
- );
200
- expect(parseEnvelope(unknownJson.stdout)).toMatchObject({
201
- code: 'ERR_UNKNOWN_SUBCOMMAND',
202
- error: "unknown subcommand 'integration bogus'",
203
- suggestions: expect.arrayContaining([
204
- expect.objectContaining({name: 'verify'}),
205
- ]),
153
+ it('requires the explicit --check gate on pack', async () => {
154
+ const result = await runCli(['integration', 'pack', '--json'], tmpDir);
155
+ expect(result.status).not.toBe(0);
156
+ expect(parseEnvelope(result.stdout)).toMatchObject({
157
+ code: 'ERR_INVALID_ARGUMENT',
158
+ error: 'Pass --check to verify the integration tarball.',
206
159
  });
207
- // A flag alone is an unknown option, not an unknown subcommand.
208
- const flagOnly = await runCli(['integration', '--bogus'], tmpDir);
209
- expect(flagOnly.status).not.toBe(0);
210
- expect(flagOnly.stderr).toContain("unknown option '--bogus'");
211
160
  });
212
161
 
213
162
  it('refuses kind-specific options on another kind', async () => {
@@ -6,18 +6,22 @@ export const doc = {
6
6
  name: 'integration pack',
7
7
  displayName: 'astryx integration pack',
8
8
  namespace: 'cli/commands',
9
- summary: 'Deprecated: the old name of `integration verify`',
9
+ summary: 'Prove the packed integration is what consumers receive',
10
10
  description:
11
- '`astryx integration pack --check` is the name this check had before {@link command:integration verify}. It still runs the same check, with the same output, JSON, and exit codes, and prints a note that names `integration verify`. It will be removed in a later release.',
11
+ 'Runs the package lifecycle, packs with npm, checks every required contribution file against the real tarball, extracts it into a scratch consumer, and compares the local and packed contribution inventories through one shared contract.',
12
12
  fn: 'integrationPackCheck',
13
13
  options: [
14
14
  {
15
15
  flag: '--check',
16
- description: 'Run the check. Required, as before.',
16
+ description: 'Run the packed-package verification gate',
17
17
  },
18
18
  ],
19
19
  examples: [
20
- {label: 'The old spelling', cli: 'astryx integration pack --check'},
20
+ {label: 'Verify before publishing', cli: 'astryx integration pack --check'},
21
+ {
22
+ label: 'Machine-readable result',
23
+ cli: 'astryx integration pack --check --json',
24
+ },
21
25
  ],
22
26
  exitCodes: [
23
27
  {code: 0, when: 'the packed package exposes the same valid contributions'},
@@ -26,5 +30,5 @@ export const doc = {
26
30
  when: '--check is omitted or the tarball is incomplete or invalid',
27
31
  },
28
32
  ],
29
- related: ['integration verify'],
33
+ related: ['integration add', 'doctor integration validate'],
30
34
  };
@@ -214,7 +214,7 @@ export const oceanTheme = defineTheme({
214
214
  ]);
215
215
 
216
216
  const checked = await runCli(
217
- ['integration', 'verify', '--json'],
217
+ ['integration', 'pack', '--check', '--json'],
218
218
  providerDir,
219
219
  );
220
220
  expect(checked.status, checked.stderr).toBe(0);
@@ -8,16 +8,16 @@ export const doc = {
8
8
  namespace: 'cli/commands',
9
9
  summary: 'Author and verify an Astryx integration package',
10
10
  description:
11
- 'Add contributions to your package, then check the packed package the way an app receives it. The guides start at {@link namespace:integrations}.',
12
- subcommands: ['add', 'verify', 'pack'],
11
+ 'Add contributions that are valid on arrival, then prove the packed package exposes the same contributions a consumer will receive.',
12
+ subcommands: ['add', 'pack'],
13
13
  examples: [
14
14
  {
15
15
  label: 'Add a component',
16
16
  cli: 'astryx integration add component AcmeWidget',
17
17
  },
18
18
  {
19
- label: 'Check the package before publishing',
20
- cli: 'astryx integration verify',
19
+ label: 'Check the package tarball',
20
+ cli: 'astryx integration pack --check',
21
21
  },
22
22
  ],
23
23
  exitCodes: [
@@ -12,7 +12,6 @@ import {cliError} from '../lib/cli-error.mjs';
12
12
  import {defineCommand} from '../lib/define-command.mjs';
13
13
  import {doc as integrationGroup} from './integration.doc.mjs';
14
14
  import {doc as integrationAddCommand} from './integration-add.doc.mjs';
15
- import {doc as integrationVerifyCommand} from './integration-verify.doc.mjs';
16
15
  import {doc as integrationPackCommand} from './integration-pack.doc.mjs';
17
16
  import {doc as integrationAddFn} from '../../../api/integration/integrationAdd.doc.mjs';
18
17
  import {doc as integrationPackCheckFn} from '../../../api/integration/integrationPackCheck.doc.mjs';
@@ -25,16 +24,8 @@ import {doc as integrationPackCheckFn} from '../../../api/integration/integratio
25
24
  */
26
25
  function showGroupOrUnknown(command, label, options, invoked) {
27
26
  const extras = invoked?.args ?? [];
28
- // allowUnknownOption keeps an unknown flag among the args: a word there is
29
- // an unknown subcommand, and a flag alone is an unknown option.
30
- const word = extras.find(arg => !String(arg).startsWith('-'));
31
- if (word == null && extras.length > 0) {
32
- return cliError(`unknown option '${String(extras[0])}'`, {
33
- code: ERROR_CODES.ERR_INVALID_OPTION,
34
- });
35
- }
36
- if (word != null) {
37
- return cliError(`unknown subcommand '${label} ${String(word)}'`, {
27
+ if (extras.length > 0) {
28
+ return cliError(`unknown subcommand '${label} ${String(extras[0])}'`, {
38
29
  suggestions: (command.commands ?? []).map(child => ({
39
30
  name: child.name(),
40
31
  reason: 'available subcommand',
@@ -46,48 +37,6 @@ function showGroupOrUnknown(command, label, options, invoked) {
46
37
  return NO_RESULT_SET;
47
38
  }
48
39
 
49
- /**
50
- * Run `integration verify` and print its result, as text or JSON.
51
- * @param {import('commander').Command} program
52
- */
53
- async function verifyPackage(program) {
54
- const result = await integrationPackCheck({cwd: process.cwd()});
55
- if (program.opts().json) {
56
- jsonOut(result);
57
- } else {
58
- const {name, version, packable, tarball, inventory, issues} = result.data;
59
- const identity = [name, version].filter(Boolean).join('@');
60
- const blocks = [
61
- section(
62
- packable
63
- ? 'Integration package ready'
64
- : 'Integration package check failed',
65
- ),
66
- text(`${packable ? '[ok]' : '[fail]'} ${identity || 'local package'}`),
67
- ];
68
- if (tarball != null) {
69
- blocks.push(
70
- text(
71
- `${tarball.fileCount} packed files; ${inventory.packedFiles}/${inventory.expectedFiles} required files present.`,
72
- ),
73
- );
74
- }
75
- if (issues.length > 0) {
76
- blocks.push(
77
- list(
78
- issues.map(
79
- issue =>
80
- `[${issue.severity === 'error' ? 'fail' : 'warn'}] ${issue.message}`,
81
- ),
82
- ),
83
- );
84
- }
85
- emit(...blocks);
86
- }
87
- if (!result.data.packable) process.exitCode = 1;
88
- return NO_RESULT_SET;
89
- }
90
-
91
40
  /** @param {import('commander').Command} program */
92
41
  export function registerIntegration(program) {
93
42
  /** @type {import('commander').Command} */
@@ -96,10 +45,6 @@ export function registerIntegration(program) {
96
45
  action: (options, command) =>
97
46
  showGroupOrUnknown(integration, 'integration', options, command),
98
47
  });
99
- // An unknown subcommand given with a flag reports the unknown subcommand
100
- // and lists the ones the group has, not the unknown option. Each subcommand
101
- // still parses its own options.
102
- integration.allowUnknownOption(true);
103
48
 
104
49
  defineCommand(integration, integrationAddCommand, {
105
50
  fn: integrationAddFn,
@@ -157,29 +102,53 @@ export function registerIntegration(program) {
157
102
  },
158
103
  });
159
104
 
160
- defineCommand(integration, integrationVerifyCommand, {
161
- fn: integrationPackCheckFn,
162
- action: async () => verifyPackage(program),
163
- });
164
- // The name this check had before `integration verify`. It stays as a
165
- // deprecated alias, listed as one in help, so scripts that call it keep
166
- // working; it runs the same check with the same output and exit codes.
167
105
  defineCommand(integration, integrationPackCommand, {
168
106
  fn: integrationPackCheckFn,
169
107
  action: async options => {
170
108
  if (!options.check) {
171
- return cliError(
172
- 'Pass --check to verify the integration tarball, or run `astryx integration verify`.',
173
- {code: ERROR_CODES.ERR_INVALID_ARGUMENT},
174
- );
109
+ return cliError('Pass --check to verify the integration tarball.', {
110
+ code: ERROR_CODES.ERR_INVALID_ARGUMENT,
111
+ });
175
112
  }
176
- // stderr, and only in text: JSON callers get the same envelope as verify.
177
- if (!program.opts().json) {
178
- console.error(
179
- 'Note: `integration pack --check` is deprecated. Run `astryx integration verify`: it runs the same check.',
180
- );
113
+
114
+ const result = await integrationPackCheck({cwd: process.cwd()});
115
+ if (program.opts().json) {
116
+ jsonOut(result);
117
+ } else {
118
+ const {name, version, packable, tarball, inventory, issues} =
119
+ result.data;
120
+ const identity = [name, version].filter(Boolean).join('@');
121
+ const blocks = [
122
+ section(
123
+ packable
124
+ ? 'Integration package ready'
125
+ : 'Integration package check failed',
126
+ ),
127
+ text(
128
+ `${packable ? '[ok]' : '[fail]'} ${identity || 'local package'}`,
129
+ ),
130
+ ];
131
+ if (tarball != null) {
132
+ blocks.push(
133
+ text(
134
+ `${tarball.fileCount} packed files; ${inventory.packedFiles}/${inventory.expectedFiles} required files present.`,
135
+ ),
136
+ );
137
+ }
138
+ if (issues.length > 0) {
139
+ blocks.push(
140
+ list(
141
+ issues.map(
142
+ issue =>
143
+ `[${issue.severity === 'error' ? 'fail' : 'warn'}] ${issue.message}`,
144
+ ),
145
+ ),
146
+ );
147
+ }
148
+ emit(...blocks);
181
149
  }
182
- return verifyPackage(program);
150
+ if (!result.data.packable) process.exitCode = 1;
151
+ return NO_RESULT_SET;
183
152
  },
184
153
  });
185
154
  }
@@ -0,0 +1,65 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file CommandDoc for `astryx layout check`. The terminal binding of the
5
+ * `layoutCheck()` function (referenced via `fn`); its args/flags map to that
6
+ * function's params so a converter can build Commander config + --help from one
7
+ * source of truth.
8
+ * @position packages/cli/clients/cli/commands — command documentation
9
+ */
10
+
11
+ /** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
12
+ export const doc = {
13
+ type: 'command',
14
+ name: 'layout check',
15
+ displayName: 'astryx layout check',
16
+ namespace: 'cli/commands',
17
+ summary:
18
+ 'Validate a layout expression and echo canonical compact/outline forms',
19
+ description:
20
+ 'Parses and validates a compressed XLE/XLO expression without generating any TSX, and ' +
21
+ 'echoes it back in both canonical surfaces (compact and outline). An invalid but ' +
22
+ 'parseable expression is reported with line/col and suggestions, and exits non-zero.',
23
+ fn: 'layoutCheck',
24
+ args: [
25
+ {
26
+ name: 'expression',
27
+ param: 'expression',
28
+ required: false,
29
+ description:
30
+ 'The XLE/XLO expression. Pass - to read it from stdin; --file reads it from a file instead.',
31
+ },
32
+ ],
33
+ options: [
34
+ {
35
+ flag: '--file <file>',
36
+ description: 'Read the expression from a file (used instead of the argument when both are given)',
37
+ },
38
+ {
39
+ flag: '--form <form>',
40
+ param: 'options.form',
41
+ choices: ['compact', 'outline', 'auto'],
42
+ default: 'auto',
43
+ description: 'Input surface: compact, outline, or auto',
44
+ },
45
+ {
46
+ flag: '--loose',
47
+ param: 'options.loose',
48
+ description: 'Downgrade unknown {block} hints to TODO placeholders',
49
+ },
50
+ ],
51
+ examples: [
52
+ {
53
+ label: 'Validate an expression',
54
+ cli: "astryx layout check 'A[cp6] > L > LC > S[p6]' --json",
55
+ },
56
+ ],
57
+ exitCodes: [
58
+ {code: 0, when: 'the expression is valid'},
59
+ {
60
+ code: 1,
61
+ when: 'the expression is invalid, empty or over 5 MB (from stdin or --file), has a syntax error, or a bad --form',
62
+ },
63
+ ],
64
+ related: ['layout expand', 'layout grammar'],
65
+ };
@@ -0,0 +1,83 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file CommandDoc for `astryx layout expand`. The terminal binding of the
5
+ * `layoutExpand()` function (referenced via `fn`); its args/flags map to that
6
+ * function's params so a converter can build Commander config + --help from one
7
+ * source of truth.
8
+ * @position packages/cli/clients/cli/commands — command documentation
9
+ */
10
+
11
+ /** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
12
+ export const doc = {
13
+ type: 'command',
14
+ name: 'layout expand',
15
+ displayName: 'astryx layout expand',
16
+ namespace: 'cli/commands',
17
+ summary: 'Expand a layout expression into validated XDS TSX',
18
+ description:
19
+ 'Parses and validates a compressed XLE/XLO expression, then expands it into ' +
20
+ 'ready-to-use XDS TSX, routing children into slots, scaffolding typed useState for ' +
21
+ 'interactive controls, and splicing referenced blocks. Writes to a path, or returns the code.',
22
+ fn: 'layoutExpand',
23
+ args: [
24
+ {
25
+ name: 'expression',
26
+ param: 'expression',
27
+ required: false,
28
+ description:
29
+ 'The XLE/XLO expression. Pass - to read it from stdin; --file reads it from a file instead.',
30
+ },
31
+ {
32
+ name: 'path',
33
+ param: 'options.targetPath',
34
+ required: false,
35
+ description:
36
+ 'Where to write the TSX, relative to the project root. A path that ends in .tsx, .ts, .jsx, .js, .mjs, .cjs, .css, .scss, .json, .md or .html is the file to write; ' +
37
+ 'any other path is a directory, which receives <Name>.tsx (see --name). An existing file there is replaced. ' +
38
+ 'Omit it to print the code.',
39
+ },
40
+ ],
41
+ options: [
42
+ {
43
+ flag: '--file <file>',
44
+ description: 'Read the expression from a file (used instead of the argument when both are given)',
45
+ },
46
+ {
47
+ flag: '--form <form>',
48
+ param: 'options.form',
49
+ choices: ['compact', 'outline', 'auto'],
50
+ default: 'auto',
51
+ description: 'Input surface: compact, outline, or auto',
52
+ },
53
+ {
54
+ flag: '--name <name>',
55
+ param: 'options.name',
56
+ default: 'GeneratedLayout',
57
+ description: 'Generated component name (PascalCase)',
58
+ },
59
+ {
60
+ flag: '--loose',
61
+ param: 'options.loose',
62
+ description: 'Downgrade unknown {block} hints to TODO placeholders',
63
+ },
64
+ ],
65
+ examples: [
66
+ {
67
+ label: 'Expand to a file',
68
+ cli: "astryx layout expand 'V[g6] > C{card-callout}*4' ./src/Page.tsx",
69
+ },
70
+ {
71
+ label: 'From a file, named',
72
+ cli: 'astryx layout expand --file layout.xlo --name Dashboard',
73
+ },
74
+ ],
75
+ exitCodes: [
76
+ {code: 0, when: 'success'},
77
+ {
78
+ code: 1,
79
+ when: 'a missing, empty or over-5 MB expression (from stdin or --file), a bad --name or --form, a parse/validation error, or a path escape',
80
+ },
81
+ ],
82
+ related: ['layout check', 'layout grammar'],
83
+ };
@@ -0,0 +1,30 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file CommandDoc for `astryx layout grammar`. The terminal binding of the
5
+ * `layoutGrammar()` function (referenced via `fn`); it carries only CLI-surface
6
+ * facts so a converter can build Commander config + --help from one source of
7
+ * truth.
8
+ * @position packages/cli/clients/cli/commands — command documentation
9
+ */
10
+
11
+ /** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
12
+ export const doc = {
13
+ type: 'command',
14
+ name: 'layout grammar',
15
+ displayName: 'astryx layout grammar',
16
+ namespace: 'cli/commands',
17
+ summary:
18
+ 'Print the XLE/XLO cheatsheet (alias table generated from this branch)',
19
+ description:
20
+ 'Prints the XLE/XLO grammar cheatsheet for writing layout expressions, with the alias ' +
21
+ "table generated from this install's registry so short names always reflect the " +
22
+ 'components actually available.',
23
+ fn: 'layoutGrammar',
24
+ examples: [{label: 'Get the cheatsheet', cli: 'astryx layout grammar'}],
25
+ exitCodes: [
26
+ {code: 0, when: 'success'},
27
+ {code: 1, when: 'the component registry cannot be read'},
28
+ ],
29
+ related: ['layout expand', 'layout check'],
30
+ };