@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
@@ -1,149 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/component-lookups`: exact single and batch component
5
- * lookup through the CLI and programmatic API.
6
- */
7
-
8
- /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
9
- export const docs = {
10
- type: 'generic',
11
- name: 'component-lookups',
12
- placement: {parent: 'namespace:cli', slot: 'guides', order: 5},
13
- title: 'Looking up components',
14
- category: 'guide',
15
- description:
16
- 'Look up one or several exact component identities, choose a focused projection, and handle complete batch receipts.',
17
- sections: [
18
- {
19
- id: 'several',
20
- title: 'Look up several components',
21
- category: 'guide',
22
- content: [
23
- {
24
- type: 'prose',
25
- text: '`astryx component` accepts exact selectors as a variadic positional argument. With no selector it browses the catalog. With one selector it keeps the normal single-component response. With two or more it prints one complete ordered batch receipt.',
26
- },
27
- {
28
- type: 'code',
29
- lang: 'bash',
30
- label: 'Several component docs',
31
- code: 'astryx component Button Badge Text\nastryx --json component Button Badge Text',
32
- },
33
- {
34
- type: 'prose',
35
- text: 'Every selector gets one row in input order. Duplicate selectors stay duplicate rows. A missing or ambiguous component does not hide successful neighbors or stop later selectors from resolving.',
36
- },
37
- {
38
- type: 'prose',
39
- text: 'A batch accepts at most 100 selectors, including duplicates, in every projection mode. A larger request returns a top-level `ERR_INVALID_ARGUMENT` before any component resolves. It emits no `component.batch` receipt and no partial results.',
40
- },
41
- {
42
- type: 'prose',
43
- text: 'Focused component controls apply to every found row. Use the same control you use for one component:',
44
- },
45
- {
46
- type: 'code',
47
- lang: 'bash',
48
- label: 'Focused batch lookups',
49
- code: 'astryx --json component Button Card --props\nastryx component Button Card --source\nastryx component Button Card --showcase\nastryx component Button Card --blocks\nastryx component Button Card --detail compact\nastryx component Button Card --lang dense\nastryx component Button Card --package @astryxdesign/core',
50
- },
51
- ],
52
- },
53
- {
54
- id: 'selectors',
55
- title: 'Selector forms',
56
- category: 'reference',
57
- content: [
58
- {
59
- type: 'prose',
60
- text: 'A selector is an exact component identity, not free-text search. Use one of these forms:',
61
- },
62
- {
63
- type: 'list',
64
- style: 'unordered',
65
- items: [
66
- '`Button` for an unqualified component name.',
67
- '`widgets/Button` for a component in an unscoped package.',
68
- '`@acme/widgets/Button` for a component in a scoped package.',
69
- '`@acme/widgets@1.2.3/Button` to require that exact installed package version.',
70
- ],
71
- },
72
- {
73
- type: 'prose',
74
- text: 'A version qualifies the package, never the component. The lookup does not fall through to another installed version. An unqualified name owned by several installed packages is `ambiguous` and lists every candidate. Use a package-qualified selector or `--package` to choose one.',
75
- },
76
- {
77
- type: 'prose',
78
- text: '`astryx discover` remains free-text package discovery. Its words form one query; they are not component batch selectors.',
79
- },
80
- ],
81
- },
82
- {
83
- id: 'output',
84
- title: 'Batch output and exit status',
85
- category: 'reference',
86
- content: [
87
- {
88
- type: 'prose',
89
- text: 'JSON uses `component.batch` with `{count, results}`. Each row echoes `selector` and has one status: `found`, `not_found`, `ambiguous`, or `error`. A found row carries the normal single-component `{type, data}` under `result`. Failed rows carry `code` and `error`, plus `suggestions` or `candidates` when available.',
90
- },
91
- {
92
- type: 'code',
93
- lang: 'bash',
94
- label: 'Outcome and duplicate examples',
95
- code: 'astryx --json component Button Badge # all found, exit 0\nastryx --json component Button MissingWidget # mixed, exit 1\nastryx --json component MissingWidget MissingPanel # all failed, exit 1\nastryx --json component Button Button # two ordered rows, exit 0',
96
- },
97
- {
98
- type: 'code',
99
- lang: 'bash',
100
- label: 'A complete failed JSON receipt',
101
- code: 'astryx --json component MissingWidget MissingPanel',
102
- },
103
- {
104
- type: 'code',
105
- lang: 'json',
106
- code: '{\n "apiVersion": 1,\n "type": "component.batch",\n "data": {\n "count": 2,\n "results": [\n {\n "selector": "MissingWidget",\n "status": "not_found",\n "code": "ERR_UNKNOWN_COMPONENT",\n "error": "No component named \\"MissingWidget\\""\n },\n {\n "selector": "MissingPanel",\n "status": "not_found",\n "code": "ERR_UNKNOWN_COMPONENT",\n "error": "No component named \\"MissingPanel\\""\n }\n ]\n }\n}',
107
- },
108
- {
109
- type: 'code',
110
- lang: 'text',
111
- label: 'The same receipt in text mode',
112
- code: 'Component batch\n\ncount: 2\n\nResults\n\nMissingWidget\n\nselector: MissingWidget\nstatus: not_found\ncode: ERR_UNKNOWN_COMPONENT\nerror: No component named "MissingWidget"\n\nMissingPanel\n\nselector: MissingPanel\nstatus: not_found\ncode: ERR_UNKNOWN_COMPONENT\nerror: No component named "MissingPanel"',
113
- },
114
- {
115
- type: 'prose',
116
- text: 'The CLI emits every row first, then exits 1 when any row is not `found`. This includes mixed receipts and receipts where every row failed. JSON and text use the same exit status. A batch where every row is `found` exits 0.',
117
- },
118
- ],
119
- },
120
- {
121
- id: 'api',
122
- title: 'Programmatic API',
123
- category: 'reference',
124
- content: [
125
- {
126
- type: 'prose',
127
- text: 'The argument shape chooses the response shape. Omit the argument for the catalog, pass a string for the existing single-component response, and pass an array for `component.batch`. An array always means batch, including empty and one-item arrays, so filtering a selector list cannot silently change the response type. The published `ComponentBatchResponse` specializes the shared `BatchResponse` and `BatchRow` types.',
128
- },
129
- {
130
- type: 'code',
131
- lang: 'javascript',
132
- code: "import {component} from '@astryxdesign/cli/api';\n\nconst catalog = await component(); // component.list\nconst button = await component('Button'); // component.detail\nconst empty = await component([]); // component.batch, count 0\nconst oneRow = await component(['Button']); // component.batch, count 1\nconst batch = await component(['Button', 'Badge']); // component.batch, count 2\nawait component(Array(101).fill('Button')); // ERR_INVALID_ARGUMENT before lookup",
133
- },
134
- {
135
- type: 'code',
136
- lang: 'json',
137
- label: 'Exact empty-array response',
138
- code: '{\n "type": "component.batch",\n "data": {\n "count": 0,\n "results": []\n }\n}',
139
- },
140
- {
141
- type: 'code',
142
- lang: 'javascript',
143
- label: 'Handle every row without losing partial results',
144
- code: "const receipt = await component(['Button', 'MissingWidget']);\n\nfor (const row of receipt.data.results) {\n if (row.status === 'found') {\n useComponentDoc(row.selector, row.result);\n } else if (row.status === 'ambiguous') {\n choosePackage(row.selector, row.candidates);\n } else {\n reportLookupFailure(row.selector, row.code, row.error);\n }\n}",
145
- },
146
- ],
147
- },
148
- ],
149
- };
@@ -1,23 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/components`: guides for adding and
5
- * documenting components in an integration package.
6
- */
7
-
8
- /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
9
- export const docs = {
10
- type: 'namespace',
11
- name: 'components',
12
- placement: {parent: 'namespace:building-blocks', slot: 'guides', order: 10},
13
- title: 'Components',
14
- summary:
15
- 'Add components to an integration, document their public contract, and make them work in every app that installs the package.',
16
- keywords: ['integration component', 'ship a component', 'component docs'],
17
- slots: {
18
- guides: {
19
- title: 'Components',
20
- accepts: {kinds: ['generic', 'namespace']},
21
- },
22
- },
23
- };
@@ -1,23 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /** @file astryx docs cli/integrations/building-blocks/configuration — set how your integration behaves. */
4
-
5
- /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
6
- export const docs = {
7
- type: 'namespace',
8
- name: 'configuration',
9
- placement: {parent: 'namespace:building-blocks', slot: 'guides', order: 60},
10
- title: 'Configuration',
11
- summary:
12
- 'Set how your integration behaves in an app: agent guidance, debug and gap reports, and more as it grows.',
13
- keywords: ['configuration', 'agent guidance', 'debug', 'gap reports'],
14
- slots: {
15
- guides: {title: 'Configuration', accepts: {kinds: ['generic', 'namespace']}},
16
- },
17
- blocks: [
18
- {
19
- type: 'prose',
20
- text: 'Beyond the things you ship, an integration can set how it behaves in an app: the guidance it gives the AI agents working there, and the record it keeps of each CLI run. Open one below to set it up.',
21
- },
22
- ],
23
- };
@@ -1,182 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/debug-and-gap-reports`: receive a record
5
- * of each CLI run with `debug`, and handle `astryx gap-report` with
6
- * `gapReport`, both named exports of the integration manifest.
7
- */
8
-
9
- /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
- export const docs = {
11
- type: 'generic',
12
- name: 'debug-and-gap-reports',
13
- placement: {parent: 'namespace:configuration', slot: 'guides', order: 20},
14
- title: 'Debug and gap reports',
15
- category: 'guide',
16
- keywords: ['gap report', 'debug handler'],
17
- description:
18
- 'Receive a record of each CLI run in apps that use your package, and handle the gap reports they send about it.',
19
- sections: [
20
- {
21
- id: 'record-runs-with-debug',
22
- title: 'Record runs with debug',
23
- content: [
24
- {
25
- type: 'prose',
26
- text: 'Export a `debug` function from `astryx.integration.mjs`, and the CLI calls it once for each command run in an app that loads your package.',
27
- },
28
- {
29
- type: 'code',
30
- lang: 'js',
31
- code: `// astryx.integration.mjs
32
- import {appendFileSync} from 'node:fs';
33
-
34
- /** @param {import('@astryxdesign/cli/authoring').DebugEvent} event */
35
- export function debug(event) {
36
- if (event.outcome !== 'ok') {
37
- appendFileSync('acme-failed-runs.ndjson', JSON.stringify(event) + '\\n');
38
- }
39
- }
40
-
41
- export default {
42
- components: './components',
43
- };`,
44
- },
45
- {
46
- type: 'prose',
47
- text: 'The event is a `DebugEvent` with `command`, `outcome`, `exitCode`, `durationMs`, `error`, and more, its values scrubbed (`redacted: true`). Every field is in {@link generic:authoring}.',
48
- },
49
- {
50
- type: 'prose',
51
- text: "Keep the function synchronous: the CLI calls it as the process exits and never waits for a promise. The app's own `debug` handler runs first, then yours. A handler that throws is skipped, and the command's output and exit code stay the same.",
52
- },
53
- {
54
- type: 'prose',
55
- text: "An app records every command only when its `astryx.config` names `integrations` or `debug`, as listing your package does. Otherwise your handler runs only for commands that load the app's project, such as `component` and `docs`, and not for `--version` or a mistyped command. In an app whose config names neither word, each of those commands also prints a warning on stderr.",
56
- },
57
- {
58
- type: 'prose',
59
- text: '`debug` is a named export, not a manifest field, so a CLI that does not know it ignores it and loads the rest of your manifest.',
60
- },
61
- ],
62
- },
63
- {
64
- id: 'turn-off-debug-in-an-app',
65
- title: 'Turn off debug in an app',
66
- content: [
67
- {
68
- type: 'prose',
69
- text: "An app can refuse every integration's `debug` handler and keep its own. It sets `inheritDebug` in its package.json:",
70
- },
71
- {
72
- type: 'code',
73
- lang: 'json',
74
- code: '{"astryx": {"inheritDebug": false}}',
75
- },
76
- {
77
- type: 'prose',
78
- text: 'From then on, your handler no longer runs in that app.',
79
- },
80
- ],
81
- },
82
- {
83
- id: 'handle-gap-reports',
84
- title: 'Handle gap reports',
85
- content: [
86
- {
87
- type: 'prose',
88
- text: 'Export a `gapReport` handler, and `astryx gap-report` in an app sends it each gap report, such as a missing component or variant. The handler files the report and returns a receipt.',
89
- },
90
- {
91
- type: 'code',
92
- lang: 'js',
93
- code: `/** @type {import('@astryxdesign/cli/authoring').GapReportHandler} */
94
- export const gapReport = {
95
- audience: 'public',
96
- async handle(report, {signal}) {
97
- if (report.target.package !== '@acme/astryx-widgets') return {status: 'skipped'};
98
- const body = JSON.stringify(report);
99
- const response = await fetch('https://tracker.example.com/issues', {method: 'POST', body, signal});
100
- const {url} = await response.json();
101
- return {status: 'filed', url};
102
- },
103
- };`,
104
- },
105
- {
106
- type: 'prose',
107
- text: 'Every handler in the app gets every report, so check `report.target.package` and skip reports about other packages. The receipt `status` is one of:',
108
- },
109
- {
110
- type: 'table',
111
- headers: ['`status`', 'Meaning'],
112
- rows: [
113
- [
114
- '`filed`',
115
- 'You created or queued the report. Return `url` or `message`.',
116
- ],
117
- [
118
- '`routed_only`',
119
- 'You point the caller to where to file it. `url` is required.',
120
- ],
121
- ['`skipped`', 'You chose not to act, for example on a duplicate.'],
122
- ],
123
- },
124
- {
125
- type: 'prose',
126
- text: 'The CLI waits 30 seconds, then aborts `signal`. A throw, a timeout, or an invalid receipt fails your delivery, and the command exits 1; the other handlers still run. Like `debug`, `gapReport` is a named export that older CLIs ignore.',
127
- },
128
- ],
129
- },
130
- {
131
- id: 'ask-before-filing-in-public',
132
- title: 'Ask before filing in public',
133
- content: [
134
- {
135
- type: 'prose',
136
- text: "Set `audience: 'public'` when your handler writes somewhere the public can read. The CLI runs it only when the caller passes `--confirm-public`; an `'internal'` handler always runs.",
137
- },
138
- {
139
- type: 'code',
140
- lang: 'bash',
141
- code: "npx astryx gap-report AcmeCarousel --category missing_variant --reason 'Need a vertical layout'",
142
- },
143
- {
144
- type: 'code',
145
- lang: 'text',
146
- code: `handlerType: integration
147
- handler: @acme/astryx-widgets
148
- audience: public
149
- status: consent_required
150
- message: Rerun with --confirm-public to file this report.`,
151
- },
152
- {
153
- type: 'prose',
154
- text: 'With `--confirm-public`, the same delivery reads `status: filed` and shows your `url`. The report goes to the package named by `--package`, else the package that owns the component, else Core.',
155
- },
156
- ],
157
- },
158
- {
159
- id: 'fall-back-to-issues-url',
160
- title: 'Fall back to issuesUrl',
161
- content: [
162
- {
163
- type: 'prose',
164
- text: "When the app has no `gapReport` handler at all, the CLI routes the report to the target package's `issuesUrl` from its manifest instead.",
165
- },
166
- {
167
- type: 'list',
168
- style: 'unordered',
169
- items: [
170
- 'A GitHub issues URL, such as `https://github.com/acme/widgets/issues`, gets an issue filed with the GitHub CLI, `gh`, once the caller passes `--confirm-public`.',
171
- 'Any other URL comes back as a `routed_only` receipt for the caller to open.',
172
- 'With no `issuesUrl`, the command fails: `Package "@acme/astryx-widgets" provides neither a report handler nor an issues URL.`',
173
- ],
174
- },
175
- {
176
- type: 'prose',
177
- text: 'One handler anywhere in the app, from the app or from any package, turns the fallback off for every report. See {@link command:gap-report}.',
178
- },
179
- ],
180
- },
181
- ],
182
- };
@@ -1,118 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/building-blocks/themes/define-the-theme`:
5
- * map the palette to tokens, keep light-dark() to colors, and avoid Core internals.
6
- */
7
-
8
- /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
9
- export const docs = {
10
- type: 'generic',
11
- name: 'define-the-theme',
12
- placement: {parent: 'namespace:themes', slot: 'guides', order: 30},
13
- title: 'Define the theme',
14
- category: 'guide',
15
- description:
16
- 'Point theme tokens at the palette, keep light-dark() to colors, and avoid Core internals.',
17
- sections: [
18
- {
19
- id: 'map-the-palette-to-tokens',
20
- title: 'Map the palette to tokens',
21
- content: [
22
- {
23
- type: 'prose',
24
- text: 'A theme token is a named slot that Astryx components read for a value — `--color-accent` for the accent color, and so on. Components never read your palette directly; they read tokens. Defining a theme means pointing each token at a palette shade, so the components wear your colors.',
25
- },
26
- {
27
- type: 'prose',
28
- text: 'Import the palette in `oceanTheme.ts` and point your tokens at its stops. Each token takes a `[light, dark]` pair — the shade to use in light mode and the one in dark mode.',
29
- },
30
- {
31
- type: 'code',
32
- lang: 'ts',
33
- code: `// themes/ocean/oceanTheme.ts
34
- import {defineTheme} from '@astryxdesign/core/theme';
35
- import {palette} from './tokens/ocean.palette';
36
-
37
- const {light, dark} = palette.ocean;
38
-
39
- export const oceanTheme = defineTheme({
40
- name: 'ocean',
41
- tokens: {
42
- '--color-accent': [light['45'], dark['70']],
43
- },
44
- });`,
45
- },
46
- {
47
- type: 'prose',
48
- text: 'Local imports must stay inside the theme folder. One that leaves it, such as `../../shared/colors`, fails with `invalid_theme`, and the theme disappears from `theme list`. `npx astryx theme template` writes a file that explains every `defineTheme` field. For the full token set, scope selectors, and component theming, read {@link generic:theme}.',
49
- },
50
- ],
51
- },
52
- {
53
- id: 'build-on-another-theme',
54
- title: 'Build on another theme',
55
- content: [
56
- {
57
- type: 'prose',
58
- text: 'To base a theme on an existing one, `extends` it: import the base theme and override only the tokens you change. The derived theme keeps a live link to the base and inherits its later changes — unlike `--from`, which forks a copy ({@link generic:add-a-theme}).',
59
- },
60
- {
61
- type: 'code',
62
- lang: 'ts',
63
- code: `import {defineTheme} from '@astryxdesign/core/theme';
64
- import {oceanTheme} from './oceanTheme';
65
-
66
- export const oceanContrastTheme = defineTheme({
67
- name: 'ocean-contrast',
68
- extends: oceanTheme,
69
- tokens: {
70
- '--color-accent': ['#0051a3', '#4aa3ff'],
71
- },
72
- });`,
73
- },
74
- ],
75
- },
76
- {
77
- id: 'keep-light-dark-to-colors',
78
- title: 'Keep light-dark() to colors',
79
- content: [
80
- {
81
- type: 'prose',
82
- text: 'Each `[light, dark]` pair compiles to a `light-dark()` value, which switches only colors. Give it colors. For a value that is not a plain color — a gradient — put `light-dark()` on each color stop, not around the whole value: a browser without `light-dark()` drops the declaration, and the stop form is the one that degrades safely.',
83
- },
84
- ],
85
- },
86
- {
87
- id: 'avoid-core-internals',
88
- title: 'Do not set Core private variables',
89
- content: [
90
- {
91
- type: 'prose',
92
- text: 'Core private variables start with `--_`, such as `--_field-radius`. They are internals and can change in any Core release, so `theme build` reports each one it finds as an `[error]`. Set the standard CSS property instead — `borderRadius`, `padding` — and let the build emit the internal variable where Core needs it.',
93
- },
94
- ],
95
- },
96
- {
97
- id: 'declare-the-peers',
98
- title: 'Declare the peer dependencies',
99
- content: [
100
- {
101
- type: 'prose',
102
- text: 'The theme imports `@astryxdesign/core/theme`, so declare Core as a peer dependency, with the range of Core versions you test the theme against — a range, not an exact version, so a Core patch release does not force a republish. `integration add theme` already declared the optional `@astryxdesign/cli` peer that reads themes:',
103
- },
104
- {
105
- type: 'code',
106
- lang: 'json',
107
- code: `"peerDependencies": {
108
- "@astryxdesign/core": "^0.7.0",
109
- "@astryxdesign/cli": ">=0.7.0"
110
- },
111
- "peerDependenciesMeta": {
112
- "@astryxdesign/cli": {"optional": true}
113
- }`,
114
- },
115
- ],
116
- },
117
- ],
118
- };
@@ -1,57 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/components/describe-the-component`:
5
- * choose and maintain the ComponentDoc shape that matches a component's public
6
- * source.
7
- */
8
-
9
- /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
10
- export const docs = {
11
- type: 'namespace',
12
- name: 'describe-the-component',
13
- placement: {parent: 'namespace:components', slot: 'guides', order: 20},
14
- title: 'Describe the component',
15
- summary:
16
- 'Write and maintain the default component doc, then adapt it when one family owns several exports or a member needs its own file.',
17
- keywords: [
18
- 'component doc',
19
- 'component documentation',
20
- 'component family',
21
- 'subcomponent',
22
- ],
23
- slots: {
24
- guides: {
25
- title: 'Describe the component',
26
- accepts: {kinds: ['generic']},
27
- },
28
- },
29
- blocks: [
30
- {
31
- type: 'prose',
32
- text: 'A component\'s `.doc.mjs` is part of the integration\'s public contract, not optional commentary. Astryx uses it for CLI output and search, and people and agents read it to decide whether the component fits and how to use it.',
33
- },
34
- {
35
- type: 'list',
36
- style: 'unordered',
37
- items: [
38
- 'Change the source and its `.doc.mjs` together.',
39
- 'Update the doc whenever the public name, import, behavior, props, defaults, examples, or accessibility requirements change.',
40
- '`integration verify` checks the doc shape and packed import, but it cannot prove the prose still matches the component.',
41
- ],
42
- },
43
- {
44
- type: 'prose',
45
- text: 'Every component doc has one stable identity and enough usage guidance for a reader to choose it correctly. Pick the shape below that matches your module.',
46
- },
47
- {
48
- type: 'prose',
49
- text: 'After every source or doc change, read the component back. This output is what people and agents receive.',
50
- },
51
- {
52
- type: 'code',
53
- lang: 'bash',
54
- code: 'npx astryx component AcmeCarousel',
55
- },
56
- ],
57
- };
@@ -1,21 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/docs`: the guides to writing docs for an
5
- * integration package, which join the same docs tree as the CLI's own
6
- * (spec:AST-046, spec:AST-047).
7
- */
8
-
9
- /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
10
- export const docs = {
11
- type: 'namespace',
12
- name: 'docs',
13
- placement: {parent: 'namespace:building-blocks', slot: 'guides', order: 40},
14
- title: 'Docs',
15
- summary:
16
- 'Write docs that ship with your package and that people and agents find by search or one level at a time.',
17
- keywords: ['writing docs', 'doc topic', 'docs section', 'placement', 'links'],
18
- slots: {
19
- guides: {title: 'Guides', accepts: {kinds: ['generic']}},
20
- },
21
- };
@@ -1,28 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/templates/document-the-template`:
5
- * document page and block templates for discovery and correct reuse.
6
- */
7
-
8
- /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
9
- export const docs = {
10
- type: 'namespace',
11
- name: 'document-the-template',
12
- placement: {parent: 'namespace:templates', slot: 'build', order: 20},
13
- title: 'Document the template',
14
- summary:
15
- 'Write the doc that helps people and agents find, choose, and trust your template: its name, description, readiness, preview, and any Core replacement.',
16
- keywords: [
17
- 'template doc',
18
- 'template documentation',
19
- 'page template',
20
- 'block template',
21
- ],
22
- slots: {
23
- guides: {
24
- title: 'Guides',
25
- accepts: {kinds: ['generic']},
26
- },
27
- },
28
- };
@@ -1,68 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/building-blocks/themes/document-the-theme`:
5
- * document a theme by extending the core theme topic, not in agent guidance.
6
- */
7
-
8
- /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
9
- export const docs = {
10
- type: 'generic',
11
- name: 'document-the-theme',
12
- placement: {parent: 'namespace:themes', slot: 'guides', order: 50},
13
- title: 'Document the theme',
14
- category: 'guide',
15
- description:
16
- 'Document a theme by extending the core theme topic, so an app reads it in `astryx docs theme`.',
17
- sections: [
18
- {
19
- id: 'extend-the-theme-topic',
20
- title: 'Extend the core theme topic',
21
- content: [
22
- {
23
- type: 'prose',
24
- text: 'Give your theme a doc topic that extends the core `theme` topic, so an app that lists your package sees your theme at the end of `astryx docs theme`. Add it with `extends: \'theme\'` ({@link generic:extend-or-replace}).',
25
- },
26
- {
27
- type: 'code',
28
- lang: 'javascript',
29
- code: `// docs/ocean-theme.doc.mjs
30
- /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
31
- export default {
32
- type: 'generic',
33
- name: 'ocean-theme',
34
- extends: 'theme',
35
- title: 'Ocean theme',
36
- description: 'Use the Ocean theme from @acme/astryx-widgets.',
37
- sections: [
38
- {
39
- id: 'use-the-ocean-theme',
40
- title: 'Use the Ocean theme',
41
- content: [
42
- {
43
- type: 'prose',
44
- text: "Add \`@acme/astryx-widgets\` to the app's dependencies and apply the Ocean theme with \`<Theme theme={oceanTheme}>\`.",
45
- },
46
- ],
47
- },
48
- ],
49
- };`,
50
- },
51
- {
52
- type: 'prose',
53
- text: 'Keep the section short: how to add the package, apply the theme ({@link generic:use-a-theme-in-an-app}), and — if the theme uses a custom font — which fonts the app must load ({@link generic:fonts-and-assets}). Extend `theme` rather than a topic another package replaces, or an app that lists that package first drops your section.',
54
- },
55
- ],
56
- },
57
- {
58
- id: 'not-agent-guidance',
59
- title: 'Not agent guidance',
60
- content: [
61
- {
62
- type: 'prose',
63
- text: 'Do not put theme usage in `agentDocs`. Agent lines land in every app\'s agent file and are for guidance needed every session; a theme\'s install-and-use steps belong in a doc topic that people and agents read on demand. See {@link generic:agent-guidance}.',
64
- },
65
- ],
66
- },
67
- ],
68
- };