@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,51 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/building-blocks/themes/use-a-theme-in-an-app`:
5
- * an app installs the integration and applies or extends the theme, like any theme.
6
- */
7
-
8
- /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
9
- export const docs = {
10
- type: 'generic',
11
- name: 'use-a-theme-in-an-app',
12
- placement: {parent: 'namespace:themes', slot: 'guides', order: 40},
13
- title: 'Use and extend the theme',
14
- category: 'guide',
15
- description:
16
- 'An app installs the integration and applies or extends your theme, the same as any theme.',
17
- sections: [
18
- {
19
- id: 'apply-the-theme',
20
- title: 'Apply the theme',
21
- content: [
22
- {
23
- type: 'prose',
24
- text: 'An app installs the integration as a dependency and applies your theme like any Astryx theme: wrap the app in `<Theme>`. The theme comes from the installed package — there is no copy step. Your theme only names its fonts; the app loads them ({@link generic:fonts-and-assets}).',
25
- },
26
- {
27
- type: 'code',
28
- lang: 'tsx',
29
- code: `import {Theme} from '@astryxdesign/core/theme';
30
- import {oceanTheme} from '@acme/astryx-widgets/themes/ocean';
31
-
32
- <Theme theme={oceanTheme}>{/* app */}</Theme>`,
33
- },
34
- {
35
- type: 'prose',
36
- text: 'The import specifier is whatever your integration exports for the theme. Applying a theme — `mode`, SSR, and the production build — works the same for every theme; see {@link generic:theme}.',
37
- },
38
- ],
39
- },
40
- {
41
- id: 'extend-the-theme',
42
- title: 'Extend to customize',
43
- content: [
44
- {
45
- type: 'prose',
46
- text: 'To change a theme, an app does not copy it — it derives a new one with `extends`: import your theme and override only the tokens it changes. See {@link generic:define-the-theme}.',
47
- },
48
- ],
49
- },
50
- ],
51
- };
@@ -1,77 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/templates/build-the-template/package-and-test/verify-packed-template`:
5
- * what `integration verify` checks for templates, and what it leaves to the
6
- * app test.
7
- */
8
-
9
- /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
- export const docs = {
11
- type: 'generic',
12
- name: 'verify-packed-template',
13
- placement: {
14
- parent: 'namespace:package-and-test',
15
- slot: 'guides',
16
- order: 20,
17
- },
18
- title: 'Verify the packed package',
19
- category: 'guide',
20
- description:
21
- 'Catch missing files, exports, and CLI requirements before you publish, and know what still needs the app test.',
22
- sections: [
23
- {
24
- id: 'run-the-package-check',
25
- title: 'Run the package check',
26
- content: [
27
- {
28
- type: 'code',
29
- lang: 'bash',
30
- code: 'npx astryx integration verify',
31
- },
32
- {
33
- type: 'prose',
34
- text: '`integration verify` runs `npm pack`, including lifecycle scripts, unpacks the `.tgz` file into a temporary app without installing its dependencies, and checks the unpacked integration. It publishes nothing and removes the `.tgz` file and the temporary app.',
35
- },
36
- {
37
- type: 'list',
38
- style: 'ordered',
39
- items: [
40
- 'It validates the manifest, every template doc, its source file, and the templates directory.',
41
- 'It checks that the manifest and every template file are in the `.tgz` file.',
42
- 'It checks that each packed template keeps the same id, type, `name`, and `replaces` as your working copy. It does not compare template source or other doc fields.',
43
- 'It resolves each template through its public package path in the unpacked package.',
44
- 'It checks that the resolved template module has a default export.',
45
- 'It checks the CLI peer that features such as template replacement require.',
46
- ],
47
- },
48
- {
49
- type: 'prose',
50
- text: 'Each failure prints a `[fail]` line with its message; add `--json` to see each issue code. {@link generic:troubleshooting} lists the common messages and their fixes. Fix every error, and review every warning before publishing.',
51
- },
52
- ],
53
- },
54
- {
55
- id: 'know-what-it-does-not-prove',
56
- title: 'Know what it does not prove',
57
- content: [
58
- {
59
- type: 'prose',
60
- text: '`integration verify` checks the packed templates and their public entrypoints. It does not copy a template into an app or run a browser build, so it cannot show the following.',
61
- },
62
- {
63
- type: 'list',
64
- style: 'unordered',
65
- items: [
66
- 'Whether a relative helper or stylesheet survives the copy.',
67
- 'Whether the copied file type-checks in every supported app toolchain.',
68
- 'Whether package-owned CSS, fonts, icons, images, or media load in a browser.',
69
- 'Whether layout, color modes, keyboard and pointer input, and real content work.',
70
- 'Whether a template id collides with Core, or whether a `replaces` target exists. Run `npx astryx doctor integration templates` for those.',
71
- 'How the template scores on quality.',
72
- ],
73
- },
74
- ],
75
- },
76
- ],
77
- };
@@ -1,161 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/versioning`: version an integration
5
- * package, know which changes break apps, declare peer ranges, keep apps on
6
- * older CLIs working, and match codemod folders to versions.
7
- */
8
-
9
- /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
- export const docs = {
11
- type: 'generic',
12
- name: 'versioning',
13
- placement: {parent: 'namespace:ship', slot: 'guides', order: 30},
14
- title: 'Versioning',
15
- category: 'guide',
16
- keywords: ['peer dependency', 'semver', 'cli version'],
17
- description:
18
- 'Version your package, declare its peers, and keep apps on older CLIs working.',
19
- sections: [
20
- {
21
- id: 'pick-a-version',
22
- title: 'Pick a version',
23
- content: [
24
- {
25
- type: 'prose',
26
- text: 'Version your package with semver: a major version for a breaking change, a minor version for a new feature, and a patch for a fix.',
27
- },
28
- {
29
- type: 'code',
30
- lang: 'bash',
31
- code: '# 1.0.0 -> 2.0.0: a breaking change\nnpm version major\n# 1.0.0 -> 1.1.0: a new feature\nnpm version minor\n# 1.0.0 -> 1.0.1: a fix\nnpm version patch',
32
- },
33
- {
34
- type: 'list',
35
- style: 'unordered',
36
- items: [
37
- 'Before 1.0.0, npm treats each minor version as breaking: an app that asks for `^0.6.0` never gets `0.7.0`. Bump the minor version for a breaking change, and the patch for anything else.',
38
- 'Ship a codemod with each breaking change so apps can migrate; see {@link generic:codemods}.',
39
- ],
40
- },
41
- ],
42
- },
43
- {
44
- id: 'know-what-breaks-apps',
45
- title: 'Know what breaks apps',
46
- content: [
47
- {
48
- type: 'prose',
49
- text: 'A breaking change stops code, commands, or links that worked in an app from working after the upgrade. For an integration, these names are part of its API.',
50
- },
51
- {
52
- type: 'table',
53
- headers: ['You change or remove', 'What stops working in the app'],
54
- rows: [
55
- [
56
- 'A component name, such as `AcmeCarousel`',
57
- 'Imports, and `npx astryx component AcmeCarousel`',
58
- ],
59
- [
60
- 'A template id, such as `acme-dashboard`',
61
- '`npx astryx template acme-dashboard`',
62
- ],
63
- ['A theme slug, such as `ocean`', '`npx astryx theme add ocean`'],
64
- [
65
- 'A topic name or route, such as `acme/deploying`',
66
- 'Reads of the old name, and links to it from other docs',
67
- ],
68
- [
69
- "A component's `import` path",
70
- 'Imports written from the old path',
71
- ],
72
- [
73
- 'An `exports` entry',
74
- 'Imports of that path, which fail with `ERR_PACKAGE_PATH_NOT_EXPORTED`',
75
- ],
76
- ['A prop', 'Code that passes it'],
77
- ],
78
- },
79
- {
80
- type: 'prose',
81
- text: 'List each breaking change in your release notes, with the codemod that migrates it. Any changelog tool works. If `package.json` has a `files` allowlist, add `CHANGELOG.md` to it so npm packs it.',
82
- },
83
- ],
84
- },
85
- {
86
- id: 'declare-peer-ranges',
87
- title: 'Declare peer ranges',
88
- content: [
89
- {
90
- type: 'prose',
91
- text: 'Declare the Astryx packages that your code imports as peer dependencies, in `peerDependencies`, so the app installs one copy of each. Keep each range as wide as your tests prove.',
92
- },
93
- {
94
- type: 'table',
95
- headers: ['Peer', 'Declare it when', 'Range'],
96
- rows: [
97
- [
98
- '`@astryxdesign/core`',
99
- 'Your code imports Core, as a theme does with `@astryxdesign/core/theme`',
100
- 'The Core versions you test, such as `^0.6.0`',
101
- ],
102
- [
103
- '`@astryxdesign/theme-*`',
104
- 'Your code imports that theme package',
105
- 'The versions you test',
106
- ],
107
- [
108
- '`@astryxdesign/cli`',
109
- 'You ship a docs section, a placed guide, a template that sets `replaces`, a doc section with an `id`, or a theme',
110
- '`>=0.7.0`, optional in `peerDependenciesMeta`',
111
- ],
112
- ],
113
- },
114
- {
115
- type: 'code',
116
- lang: 'json',
117
- code: '{\n "peerDependencies": {\n "@astryxdesign/core": "^0.6.0",\n "@astryxdesign/cli": ">=0.7.0"\n },\n "peerDependenciesMeta": {\n "@astryxdesign/cli": {"optional": true}\n }\n}',
118
- },
119
- {
120
- type: 'prose',
121
- text: '`integration verify` fails a package that needs the CLI peer and lacks it, or whose range admits a stable CLI before 0.7.0. `integration add doc --parent` and `integration add theme` write the peer for you.',
122
- },
123
- ],
124
- },
125
- {
126
- id: 'support-older-clis',
127
- title: 'Support older CLIs',
128
- content: [
129
- {
130
- type: 'prose',
131
- text: 'An app may run an older CLI than the one you build with. A CLI reads what it knows and skips the rest, but some newer files make an older CLI hide your docs.',
132
- },
133
- {
134
- type: 'list',
135
- style: 'unordered',
136
- items: [
137
- 'An unknown field in `astryx.integration.mjs` is ignored with an `unknown_manifest_key` warning, and the rest of the manifest still loads.',
138
- 'A named export that the CLI does not know is ignored with no warning, so `debug` and `gapReport` are safe to add.',
139
- 'A stable CLI before 0.7.0 prints each `{@link ...}` as written.',
140
- 'A stable CLI before 0.7.0 cannot read a docs section, a section `id`, a template that sets `replaces`, or a theme folder that `integration add theme` writes. It can then hide every doc topic your package ships.',
141
- 'Stable 0.6.3 still loads your components, but 0.6.0 cannot read the component docs that `integration add component` writes: `component AcmeCarousel` fails there.',
142
- ],
143
- },
144
- {
145
- type: 'prose',
146
- text: '`integration verify` requires the CLI peer for a docs section, a placed guide, a template `replaces`, a doc section with an `id`, and a theme. A stable CLI before 0.7.0 cannot read any of them, and when it hides your topics, `docs` gives no warning.',
147
- },
148
- ],
149
- },
150
- {
151
- id: 'codemods-and-versions',
152
- title: 'Name codemod folders after Core versions',
153
- content: [
154
- {
155
- type: 'prose',
156
- text: 'Name each codemod folder after the Core version whose upgrade should run it, not after your package\'s version. Which folders an app runs, and when, is in "Choose when a codemod runs" in {@link generic:codemods}.',
157
- },
158
- ],
159
- },
160
- ],
161
- };
@@ -1,64 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/write-good-templates`:
5
- * what makes a template good, the rubric that scores it, and grading with an agent.
6
- */
7
-
8
- /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
9
- export const docs = {
10
- type: 'namespace',
11
- name: 'write-good-templates',
12
- placement: {parent: 'namespace:templates', slot: 'quality', order: 10},
13
- title: 'How to write good templates',
14
- summary:
15
- 'Write templates people trust: what good means, the rubric that scores it, and how to grade one with an agent.',
16
- keywords: [
17
- 'template quality',
18
- 'template rubric',
19
- 'grade template',
20
- 'template review',
21
- ],
22
- blocks: [
23
- {
24
- type: 'prose',
25
- text: 'A good template does more than render. It gives an app a clear product starting point that is easy to understand, safe to change, and complete after Astryx copies it out of the package. A rubric scores that quality so you can grade as you build.',
26
- },
27
- {
28
- type: 'list',
29
- style: 'unordered',
30
- items: [
31
- 'Its purpose and primary task are clear before someone reads every detail.',
32
- 'It composes Astryx components instead of rebuilding their behavior with raw HTML or custom styles.',
33
- 'Its hierarchy, spacing, interactions, and reading order still work at narrow widths and in every supported color mode.',
34
- 'Its source, imports, styles, fonts, icons, images, and media still work from the copied location.',
35
- 'Its metadata makes the template easy to find and accurately explains when to use it.',
36
- 'Its example content is realistic enough to expose overflow, empty-space, and hierarchy problems.',
37
- ],
38
- },
39
- {
40
- type: 'prose',
41
- text: 'Grade the first runnable version, again after each source, doc, dependency, or asset change, and in full before every release. Grade the source, doc, copied file, and rendered app together; none of them is enough alone.',
42
- },
43
- {
44
- type: 'list',
45
- style: 'ordered',
46
- items: [
47
- 'Read every scoring rule in {@link generic:template-grading-rubric}.',
48
- 'Fix publication blockers first, then every reasonable deduction.',
49
- 'Repeat the full grade on the packed package in a clean app ({@link generic:test-template-in-app}).',
50
- 'To have an agent grade and improve the template, use {@link generic:grade-template-with-agent}.',
51
- ],
52
- },
53
- {
54
- type: 'prose',
55
- text: 'Keep each scorecard with its package revision and rubric version.',
56
- },
57
- ],
58
- slots: {
59
- guides: {
60
- title: 'Guides',
61
- accepts: {kinds: ['generic']},
62
- },
63
- },
64
- };
@@ -1,154 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file `astryx docs cli/integrations/templates/build-the-template/write-the-template-file`:
5
- * what gets copied, where the copied file lands, and the imports and
6
- * export a copied template needs.
7
- */
8
-
9
- /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
- export const docs = {
11
- type: 'generic',
12
- name: 'write-the-template-file',
13
- placement: {
14
- parent: 'namespace:build-the-template',
15
- slot: 'guides',
16
- order: 10,
17
- },
18
- title: 'Write the template file',
19
- category: 'guide',
20
- description:
21
- 'Astryx copies just this one file into an app, so write it to work on its own there: where it lands, what it can import, and what it exports.',
22
- sections: [
23
- {
24
- id: 'know-what-gets-copied',
25
- title: 'Know what gets copied',
26
- content: [
27
- {
28
- type: 'prose',
29
- text: '`astryx template` copies exactly one source file. It does not copy sibling helpers, stylesheets, fonts, icons, images, or media. Plan for that before you add supporting files.',
30
- },
31
- {
32
- type: 'table',
33
- headers: ['Template', 'Directory target', 'Explicit file target'],
34
- rows: [
35
- ['Page', 'Writes `<target>/page.tsx`', 'Writes the exact file path'],
36
- [
37
- 'Block',
38
- 'Writes `<target>/<source-basename>.tsx`',
39
- 'Writes the exact file path',
40
- ],
41
- ],
42
- },
43
- {
44
- type: 'code',
45
- lang: 'bash',
46
- code: `# Page: src/app/account/page.tsx
47
- npx astryx template acme-account src/app/account
48
-
49
- # Block: src/features/account/acme-stat-card.tsx
50
- npx astryx template acme-stat-card src/features/account
51
-
52
- # Exact destination for either kind
53
- npx astryx template acme-stat-card src/features/account/StatusCard.tsx`,
54
- },
55
- {
56
- type: 'prose',
57
- text: 'Astryx refuses to replace an existing file unless the caller passes `--overwrite` or `-f`.',
58
- },
59
- ],
60
- },
61
- {
62
- id: 'keep-edited-code-in-one-file',
63
- title: 'Keep edited code in one file',
64
- content: [
65
- {
66
- type: 'prose',
67
- text: 'Put every helper that the app is expected to edit in the template source. Small local components, example data, constants, and event handlers can live above or below the default component in the same file.',
68
- },
69
- {
70
- type: 'list',
71
- style: 'unordered',
72
- items: [
73
- 'Inline a helper when it is part of the editable starting point.',
74
- 'Move a helper into the integration package only when it should stay package-owned and update with the package.',
75
- 'Do not import `./helper`, `./styles`, or any other sibling file.',
76
- 'Do not create routes, configuration, or extra files at runtime. Give the app one explicit source file to own.',
77
- ],
78
- },
79
- ],
80
- },
81
- {
82
- id: 'use-imports-that-work',
83
- title: 'Use imports that work in the app',
84
- content: [
85
- {
86
- type: 'prose',
87
- text: 'After the copy, imports resolve from the app, not from the template directory. Every bare import must name a package the app installs, and every package path must be public.',
88
- },
89
- {
90
- type: 'code',
91
- lang: 'tsx',
92
- code: `import {Button} from '@astryxdesign/core/Button';
93
- import {Card} from '@astryxdesign/core/Card';
94
- import {HStack, VStack} from '@astryxdesign/core/Stack';
95
- import {Text} from '@astryxdesign/core/Text';
96
- import {AcmeStatusCard} from '@acme/astryx-widgets/components/AcmeStatusCard';
97
-
98
- const metrics = [
99
- {label: 'Healthy accounts', value: '1,248'},
100
- {label: 'Needs review', value: '37'},
101
- ];
102
-
103
- function MetricRow({label, value}: {label: string; value: string}) {
104
- return (
105
- <HStack justify="between">
106
- <Text>{label}</Text>
107
- <Text>{value}</Text>
108
- </HStack>
109
- );
110
- }
111
-
112
- export default function AcmeAccountSummary() {
113
- return (
114
- <Card>
115
- <VStack gap={4}>
116
- <AcmeStatusCard />
117
- {metrics.map(metric => <MetricRow key={metric.label} {...metric} />)}
118
- <Button label="Review accounts" />
119
- </VStack>
120
- </Card>
121
- );
122
- }`,
123
- },
124
- {
125
- type: 'list',
126
- style: 'unordered',
127
- items: [
128
- 'Import Astryx components from their public Core paths.',
129
- 'Import integration-owned components, helpers, icons, or styles only through paths the package exports ({@link generic:export-template-assets}).',
130
- 'Avoid adding another library when Astryx or platform APIs already provide the behavior.',
131
- ],
132
- },
133
- ],
134
- },
135
- {
136
- id: 'export-one-component',
137
- title: 'Export one component',
138
- content: [
139
- {
140
- type: 'prose',
141
- text: 'The source must default-export one React component. Named helpers inside the file are fine.',
142
- },
143
- {
144
- type: 'list',
145
- style: 'unordered',
146
- items: [
147
- 'Add `use client` as the first statement only when hooks, event handlers, or browser APIs need a client boundary.',
148
- 'Keep a static template server-compatible when it needs no client behavior.',
149
- ],
150
- },
151
- ],
152
- },
153
- ],
154
- };
@@ -1,13 +0,0 @@
1
- // @generated by scripts/sync-api-types.mjs from the JSDoc in authoring/**/*.mjs.
2
- // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
-
4
- /**
5
- * @file SchemaDoc for DiscoverSource, the function `astryx discover` calls to
6
- * learn which integrations a project could add.
7
- * @input The DiscoverSource type and the catalog types beside it (`type.ts`),
8
- * which `parse.mjs` validates.
9
- * @output The `discover-source` section of `astryx docs authoring`.
10
- * @position packages/cli/authoring/discover — schema documentation
11
- */
12
- /** @type {import('@astryxdesign/cli/authoring').SchemaDoc} */
13
- export const doc: import("@astryxdesign/cli/authoring").SchemaDoc;
@@ -1,138 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file SchemaDoc for DiscoverSource, the function `astryx discover` calls to
5
- * learn which integrations a project could add.
6
- * @input The DiscoverSource type and the catalog types beside it (`type.ts`),
7
- * which `parse.mjs` validates.
8
- * @output The `discover-source` section of `astryx docs authoring`.
9
- * @position packages/cli/authoring/discover — schema documentation
10
- */
11
-
12
- /** @type {import('@astryxdesign/cli/authoring').SchemaDoc} */
13
- export const doc = {
14
- type: 'schema',
15
- name: 'discover-source',
16
- displayName: 'DiscoverSource',
17
- namespace: 'authoring',
18
- description:
19
- 'A source for `astryx discover`: an async function that returns a catalog of packages a project could add, their versions, and what each version adds. Set it as `discover` in astryx.config, or export it as `discover` from an integration manifest. Discover calls every source, the project one first, and one that throws, runs past 30 seconds, or returns an invalid catalog never hides the others; discover then uses the last good answer it saved for that source. Discover only reads: it prints the command that adds a package and never runs it.',
20
- appliesTo:
21
- '`discover` in astryx.config.*, or the `discover` named export of astryx.integration.*',
22
- fields: [
23
- {
24
- name: 'context',
25
- type: 'DiscoverSourceContext',
26
- description: 'The one argument the source is called with.',
27
- required: true,
28
- fields: [
29
- {
30
- name: 'context.signal',
31
- type: 'AbortSignal',
32
- description: 'Aborted when the source runs past 30 seconds.',
33
- required: true,
34
- },
35
- {
36
- name: 'context.package',
37
- type: 'string',
38
- description:
39
- 'Set when discover shows one package: return that package with every version.',
40
- },
41
- {
42
- name: 'context.version',
43
- type: 'string',
44
- description:
45
- "With `package`: return that version's contributions. Without it, the latest release's.",
46
- },
47
- ],
48
- },
49
- {
50
- name: 'returns',
51
- type: 'Promise<DiscoverCatalog>',
52
- description:
53
- 'The catalog. Discover checks it, ignores fields and item kinds it does not know, and refuses any schemaVersion but 1.',
54
- required: true,
55
- fields: [
56
- {
57
- name: 'schemaVersion',
58
- type: '1',
59
- description: 'Version of the catalog shape.',
60
- required: true,
61
- },
62
- {
63
- name: 'source',
64
- type: '{name: string, generatedAt: string, complete: boolean}',
65
- description:
66
- 'Who answered, when the data was produced (ISO 8601), and false when the source knows its list is partial.',
67
- required: true,
68
- },
69
- {
70
- name: 'packages',
71
- type: 'DiscoverPackage[]',
72
- description:
73
- 'One entry per npm package. When two sources list the same package, the earlier source wins.',
74
- required: true,
75
- fields: [
76
- {
77
- name: 'packages[].package',
78
- type: 'string',
79
- description: 'The npm name.',
80
- required: true,
81
- },
82
- {
83
- name: 'packages[].integration',
84
- type: 'string',
85
- description:
86
- 'Shared by every npm name that publishes the same integration. Discover lists an integration once.',
87
- required: true,
88
- },
89
- {
90
- name: 'packages[].aliases',
91
- type: 'string[]',
92
- description:
93
- "The integration's other npm names. Discover never offers a package the project has under another name.",
94
- required: true,
95
- },
96
- {
97
- name: 'packages[].description',
98
- type: 'string',
99
- description: 'One line, for the list and search.',
100
- },
101
- {
102
- name: 'packages[].latest',
103
- type: 'string | null',
104
- description: 'The latest release. Null when there are only prereleases.',
105
- required: true,
106
- },
107
- {
108
- name: 'packages[].versions',
109
- type: 'DiscoverVersion[]',
110
- description:
111
- 'Every version, newest first: `{version, publishedAt, prerelease, status}`, where status is `ok` or why the version could not be read.',
112
- required: true,
113
- },
114
- {
115
- name: 'packages[].contributions',
116
- type: 'DiscoverContribution[]',
117
- description:
118
- "What the requested (else latest) version adds: `{kind, name, title?, summary?, keywords?}`, where kind is `component`, `template`, `doc`, `theme`, `codemod`, or `agent-doc` (a DiscoverKind) and name is the name the CLI uses for it.",
119
- required: true,
120
- },
121
- ],
122
- },
123
- ],
124
- },
125
- ],
126
- examples: [
127
- {
128
- label: 'A project source in astryx.config',
129
- code:
130
- 'export default {\n' +
131
- ' async discover({signal, package: name, version}) {\n' +
132
- ' const res = await fetch(catalogUrl(name, version), {signal});\n' +
133
- ' return res.json();\n' +
134
- ' },\n' +
135
- '};',
136
- },
137
- ],
138
- };