@astryxdesign/cli 0.7.2-canary.a7d26b7 → 0.7.2-canary.acfd1ff

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 (251) hide show
  1. package/README.md +74 -73
  2. package/api/build/help/help.mjs +1 -1
  3. package/api/discover/_adapter.d.mts +119 -12
  4. package/api/discover/_adapter.mjs +449 -10
  5. package/api/discover/_adapter.test.mjs +599 -17
  6. package/api/discover/_catalog-view.d.mts +16 -5
  7. package/api/discover/_catalog-view.mjs +32 -8
  8. package/api/discover/discover.d.mts +11 -0
  9. package/api/discover/discover.doc.mjs +7 -6
  10. package/api/discover/discover.mjs +107 -19
  11. package/api/discover/discover.type.d.mts +18 -7
  12. package/api/discover/discover.type.mjs +15 -7
  13. package/api/discover/list/list.d.mts +4 -3
  14. package/api/discover/list/list.mjs +17 -10
  15. package/api/docs/_adapter.d.mts +11 -0
  16. package/api/docs/_adapter.mjs +244 -1
  17. package/api/docs/integrationDocs.test.mjs +124 -0
  18. package/api/doctor/doctor.mjs +27 -3
  19. package/api/doctor/doctor.test.mjs +43 -0
  20. package/api/doctor/theme-checks.mjs +1 -1
  21. package/api/doctor/theme-checks.test.mjs +136 -0
  22. package/api/gap-report/gap-report.d.mts +3 -0
  23. package/api/gap-report/gap-report.doc.mjs +11 -3
  24. package/api/gap-report/gap-report.mjs +152 -48
  25. package/api/gap-report/gap-report.test.mjs +233 -0
  26. package/api/gap-report/gap-report.type.d.mts +41 -0
  27. package/api/gap-report/gap-report.type.mjs +18 -0
  28. package/api/index.d.mts +2 -0
  29. package/api/index.mjs +2 -0
  30. package/api/init/run/run.mjs +2 -2
  31. package/api/integration/_adapter.d.mts +32 -0
  32. package/api/integration/_adapter.mjs +80 -0
  33. package/api/integration/add-contribution.mjs +1 -1
  34. package/api/integration/add-contribution.test.mjs +4 -2
  35. package/api/integration/authoring-checks.mjs +44 -4
  36. package/api/integration/authoring-checks.test.mjs +515 -0
  37. package/api/integration/authoring-checks.type.d.mts +95 -0
  38. package/api/integration/authoring-checks.type.mjs +53 -2
  39. package/api/integration/check/check.d.mts +96 -0
  40. package/api/integration/check/check.mjs +357 -0
  41. package/api/integration/check/check.test.mjs +489 -0
  42. package/api/integration/integration-check.type.d.mts +118 -0
  43. package/api/integration/integration-check.type.mjs +84 -0
  44. package/api/integration/integrationCheck.doc.d.mts +10 -0
  45. package/api/integration/integrationCheck.doc.mjs +73 -0
  46. package/api/integration/integrationComponentConflicts.doc.mjs +43 -6
  47. package/api/integration/integrationDocConflicts.doc.mjs +19 -5
  48. package/api/integration/pack-check.mjs +292 -7
  49. package/api/integration/pack-check.test.mjs +367 -0
  50. package/api/integration/validate-integration-fixes.test.mjs +67 -0
  51. package/api/integration/validate-integration.mjs +8 -0
  52. package/api/integration/validate-integration.test.mjs +41 -0
  53. package/api/integration/validate-integration.type.d.mts +8 -0
  54. package/api/integration/validate-integration.type.mjs +12 -1
  55. package/api/integration/validateIntegration.doc.mjs +19 -3
  56. package/api/search/search.d.mts +72 -12
  57. package/api/search/search.domain-priority.test.mjs +108 -18
  58. package/api/search/search.integration-check.test.mjs +24 -0
  59. package/api/search/search.mjs +501 -37
  60. package/api/search/search.test.mjs +139 -0
  61. package/api/theme/build/build.family.test.mjs +54 -6
  62. package/api/theme/build/build.mjs +114 -17
  63. package/api/theme/themeBuild.doc.mjs +4 -4
  64. package/api/upgrade/_adapter.d.mts +40 -2
  65. package/api/upgrade/_adapter.mjs +117 -4
  66. package/api/upgrade/run/cli-behind-core.test.mjs +438 -0
  67. package/api/upgrade/run/run.mjs +30 -1
  68. package/api/upgrade/status/status.d.mts +21 -5
  69. package/api/upgrade/status/status.mjs +45 -8
  70. package/api/upgrade/upgrade.doc.mjs +5 -3
  71. package/api/upgrade/upgrade.type.d.mts +23 -0
  72. package/api/upgrade/upgrade.type.mjs +16 -1
  73. package/assets/codemods/runner.mjs +7 -1
  74. package/assets/discover/official-packages.json +367 -0
  75. package/assets/docs/README.md +10 -0
  76. package/assets/docs/author-a-theme.doc.mjs +3 -3
  77. package/assets/docs/browser-support.doc.mjs +1 -1
  78. package/assets/docs/getting-started.doc.mjs +3 -3
  79. package/assets/docs/styling-overview.doc.mjs +1 -1
  80. package/assets/docs/theme.doc.dense.mjs +1 -1
  81. package/assets/docs/theme.doc.mjs +2 -2
  82. package/assets/docs/theme.doc.zh.mjs +1 -1
  83. package/assets/docs/tree/add-a-component.doc.mjs +1 -1
  84. package/assets/docs/tree/add-a-theme.doc.mjs +1 -1
  85. package/assets/docs/tree/add-a-topic.doc.mjs +11 -8
  86. package/assets/docs/tree/agent-guidance.doc.mjs +2 -2
  87. package/assets/docs/tree/block-template.doc.mjs +8 -20
  88. package/assets/docs/tree/build-the-template.doc.mjs +1 -1
  89. package/assets/docs/tree/check-the-props.doc.mjs +196 -0
  90. package/assets/docs/tree/check-your-docs.doc.mjs +61 -7
  91. package/assets/docs/tree/checks.doc.mjs +25 -17
  92. package/assets/docs/tree/codemods.doc.mjs +4 -4
  93. package/assets/docs/tree/component-family.doc.mjs +3 -5
  94. package/assets/docs/tree/component-imports.doc.mjs +2 -2
  95. package/assets/docs/tree/components.doc.mjs +1 -1
  96. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +30 -21
  97. package/assets/docs/tree/define-the-theme.doc.mjs +6 -5
  98. package/assets/docs/tree/describe-the-component.doc.mjs +2 -2
  99. package/assets/docs/tree/docs.doc.mjs +3 -3
  100. package/assets/docs/tree/document-the-template.doc.mjs +1 -1
  101. package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
  102. package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
  103. package/assets/docs/tree/extend-or-replace.doc.mjs +6 -6
  104. package/assets/docs/tree/fonts-and-assets.doc.mjs +2 -2
  105. package/assets/docs/tree/generate-a-palette.doc.mjs +5 -3
  106. package/assets/docs/tree/grade-template-with-agent.doc.mjs +1 -1
  107. package/assets/docs/tree/integrations.doc.mjs +8 -0
  108. package/assets/docs/tree/layout-spacing.doc.mjs +2 -3
  109. package/assets/docs/tree/layout.doc.mjs +6 -6
  110. package/assets/docs/tree/links.doc.mjs +6 -5
  111. package/assets/docs/tree/migration-setup.doc.mjs +3 -2
  112. package/assets/docs/tree/migration-verification.doc.mjs +0 -1
  113. package/assets/docs/tree/migration.doc.mjs +0 -1
  114. package/assets/docs/tree/package-and-test.doc.mjs +1 -1
  115. package/assets/docs/tree/page-template.doc.mjs +4 -8
  116. package/assets/docs/tree/publishing.doc.mjs +4 -4
  117. package/assets/docs/tree/quick-start.doc.mjs +38 -22
  118. package/assets/docs/tree/replace-a-core-component.doc.mjs +4 -6
  119. package/assets/docs/tree/replace-a-core-template.doc.mjs +6 -8
  120. package/assets/docs/tree/sections-and-placement.doc.mjs +6 -8
  121. package/assets/docs/tree/see-it-in-an-app.doc.mjs +4 -2
  122. package/assets/docs/tree/short-and-findable.doc.mjs +6 -5
  123. package/assets/docs/tree/single-component.doc.mjs +14 -5
  124. package/assets/docs/tree/start-a-template.doc.mjs +3 -3
  125. package/assets/docs/tree/subcomponent.doc.mjs +6 -6
  126. package/assets/docs/tree/template-assets.doc.mjs +2 -2
  127. package/assets/docs/tree/template-doc-overview.doc.mjs +5 -16
  128. package/assets/docs/tree/template-fonts.doc.mjs +1 -1
  129. package/assets/docs/tree/template-icons.doc.mjs +1 -1
  130. package/assets/docs/tree/template-images-media.doc.mjs +1 -1
  131. package/assets/docs/tree/template-styles.doc.mjs +2 -2
  132. package/assets/docs/tree/templates.doc.mjs +1 -1
  133. package/assets/docs/tree/test-in-an-app.doc.mjs +3 -3
  134. package/assets/docs/tree/test-template-in-app.doc.mjs +1 -1
  135. package/assets/docs/tree/tokens-and-setup.doc.mjs +19 -15
  136. package/assets/docs/tree/troubleshooting.doc.mjs +8 -8
  137. package/assets/docs/tree/type-scale.doc.mjs +3 -3
  138. package/assets/docs/tree/upgrading.doc.mjs +4 -4
  139. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +3 -1
  140. package/assets/docs/tree/verify-packed-template.doc.mjs +1 -1
  141. package/assets/docs/tree/versioning.doc.mjs +6 -6
  142. package/assets/docs/tree/write-the-template-file.doc.mjs +4 -3
  143. package/assets/docs/use-a-theme.doc.mjs +2 -2
  144. package/assets/theme.template.ts +1 -1
  145. package/authoring/codemod/codemod.doc.mjs +7 -3
  146. package/authoring/config/config.doc.mjs +9 -6
  147. package/authoring/config/type.ts +4 -2
  148. package/authoring/discover/discover.doc.mjs +1 -1
  149. package/authoring/doctypes/base/graph-fields.doc.mjs +6 -4
  150. package/authoring/doctypes/command/command.doc.mjs +14 -12
  151. package/authoring/doctypes/component/component.doc.mjs +29 -26
  152. package/authoring/doctypes/component/type.ts +7 -5
  153. package/authoring/doctypes/enum/enum.doc.mjs +7 -4
  154. package/authoring/doctypes/function/function.doc.mjs +9 -8
  155. package/authoring/doctypes/hook/hook.doc.mjs +5 -4
  156. package/authoring/doctypes/namespace/namespace.doc.mjs +7 -6
  157. package/authoring/doctypes/reference/reference.doc.mjs +11 -10
  158. package/authoring/doctypes/schema/schema.doc.mjs +9 -9
  159. package/authoring/doctypes/template/integration-template.doc.d.mts +11 -0
  160. package/authoring/doctypes/template/integration-template.doc.mjs +49 -0
  161. package/authoring/doctypes/template/parse.d.mts +6 -2
  162. package/authoring/doctypes/template/parse.mjs +3 -1
  163. package/authoring/doctypes/template/template.doc.mjs +3 -3
  164. package/authoring/doctypes/template/type.ts +22 -0
  165. package/authoring/doctypes/theme/theme.doc.mjs +2 -2
  166. package/authoring/gap-report/gap-report.doc.mjs +2 -2
  167. package/authoring/identity/identity.doc.mjs +3 -3
  168. package/authoring/index.d.ts +1 -0
  169. package/authoring/integration/integration.doc.mjs +12 -4
  170. package/authoring/integration/parse.test.mjs +10 -0
  171. package/authoring/integration/schema.d.mts +2 -0
  172. package/authoring/integration/schema.mjs +1 -0
  173. package/authoring/integration/type.ts +4 -0
  174. package/clients/cli/commands/build-theme.batch-report.test.mjs +3 -1
  175. package/clients/cli/commands/build-theme.mjs +1 -1
  176. package/clients/cli/commands/build-theme.path-safety.test.mjs +155 -21
  177. package/clients/cli/commands/cli-postinstall.test.mjs +49 -1
  178. package/clients/cli/commands/discover.broken-integration.test.mjs +4 -1
  179. package/clients/cli/commands/discover.doc.mjs +1 -1
  180. package/clients/cli/commands/discover.mjs +144 -93
  181. package/clients/cli/commands/discover.no-source.test.mjs +447 -33
  182. package/clients/cli/commands/discover.sources.test.mjs +20 -1
  183. package/clients/cli/commands/doctor-integration-components.doc.mjs +17 -4
  184. package/clients/cli/commands/doctor-integration-docs.doc.mjs +18 -5
  185. package/clients/cli/commands/doctor-integration-validate.doc.mjs +13 -2
  186. package/clients/cli/commands/doctor-integration.test.mjs +837 -0
  187. package/clients/cli/commands/doctor.mjs +250 -3
  188. package/clients/cli/commands/gap-report.doc.mjs +14 -2
  189. package/clients/cli/commands/gap-report.mjs +24 -2
  190. package/clients/cli/commands/gap-report.test.mjs +79 -0
  191. package/clients/cli/commands/integration-check.doc.mjs +85 -0
  192. package/clients/cli/commands/integration-check.test.mjs +370 -0
  193. package/clients/cli/commands/integration.doc.mjs +6 -2
  194. package/clients/cli/commands/integration.mjs +106 -1
  195. package/clients/cli/commands/json-contract.test.mjs +5 -1
  196. package/clients/cli/commands/setup-nudge.test.mjs +79 -1
  197. package/clients/cli/commands/swizzle.mjs +5 -3
  198. package/clients/cli/commands/swizzle.routing.test.mjs +18 -1
  199. package/clients/cli/commands/text-json-parity.test.mjs +5 -0
  200. package/clients/cli/commands/theme-build.doc.mjs +2 -2
  201. package/clients/cli/commands/upgrade.doc.mjs +14 -0
  202. package/clients/cli/commands/upgrade.older-cli.test.mjs +160 -0
  203. package/clients/cli/index.mjs +30 -5
  204. package/foundation/agent-docs/agent-doc-state.d.mts +14 -0
  205. package/foundation/agent-docs/agent-doc-state.mjs +38 -0
  206. package/foundation/agent-docs/agent-docs.d.mts +2 -1
  207. package/foundation/agent-docs/agent-docs.mjs +8 -6
  208. package/foundation/config/project.mjs +82 -0
  209. package/foundation/discovery/authoring-self-docs.mjs +2 -1
  210. package/foundation/discovery/component-discovery.d.mts +18 -0
  211. package/foundation/discovery/component-discovery.mjs +2 -2
  212. package/foundation/discovery/copied-passages.d.mts +216 -0
  213. package/foundation/discovery/copied-passages.mjs +720 -0
  214. package/foundation/discovery/copied-passages.test.mjs +124 -0
  215. package/foundation/discovery/doc-fluff.d.mts +112 -0
  216. package/foundation/discovery/doc-fluff.mjs +328 -0
  217. package/foundation/discovery/doc-fluff.test.mjs +142 -0
  218. package/foundation/discovery/doc-types.d.mts +157 -0
  219. package/foundation/discovery/doc-types.mjs +1224 -0
  220. package/foundation/discovery/doc-types.test.mjs +700 -0
  221. package/foundation/discovery/docs-discovery.d.mts +88 -0
  222. package/foundation/discovery/docs-discovery.mjs +83 -2
  223. package/foundation/discovery/integration-doc-files.d.mts +22 -0
  224. package/foundation/discovery/integration-doc-files.mjs +231 -0
  225. package/foundation/discovery/integration-doc-files.test.mjs +246 -0
  226. package/foundation/discovery/project-typescript.d.mts +11 -2
  227. package/foundation/discovery/project-typescript.mjs +32 -4
  228. package/foundation/discovery/prop-drift.d.mts +278 -0
  229. package/foundation/discovery/prop-drift.mjs +2263 -0
  230. package/foundation/discovery/prop-drift.test.mjs +2272 -0
  231. package/foundation/discovery/type-match.d.mts +53 -0
  232. package/foundation/discovery/type-match.mjs +660 -0
  233. package/foundation/discovery/type-match.test.mjs +169 -0
  234. package/foundation/discovery/type-text.d.mts +68 -0
  235. package/foundation/discovery/type-text.mjs +658 -0
  236. package/foundation/discovery/type-text.test.mjs +196 -0
  237. package/foundation/doc-compiler/doc-loads.test.mjs +16 -2
  238. package/foundation/doc-compiler/links.d.mts +9 -5
  239. package/foundation/doc-compiler/links.mjs +4 -2
  240. package/foundation/env/package-manager.d.mts +32 -0
  241. package/foundation/env/package-manager.mjs +47 -0
  242. package/foundation/env/package-manager.test.mjs +194 -7
  243. package/foundation/fs/module-loader.d.mts +2 -1
  244. package/foundation/fs/module-loader.mjs +60 -4
  245. package/foundation/fs/module-loader.test.mjs +194 -0
  246. package/foundation/integrations/contribution-inventory.d.mts +11 -0
  247. package/foundation/integrations/contribution-inventory.mjs +50 -2
  248. package/foundation/integrations/validate-contributions.mjs +30 -1
  249. package/foundation/response/response-types.doc.mjs +14 -8
  250. package/package.json +11 -11
  251. package/scripts/postinstall.mjs +3 -3
@@ -21,6 +21,7 @@ export const docs = {
21
21
  'reset',
22
22
  'smoke test',
23
23
  'layer audit',
24
+ 'cascade layers',
24
25
  'Tailwind coexistence',
25
26
  ],
26
27
 
@@ -84,7 +85,7 @@ astryx component TextInput`,
84
85
  },
85
86
  {
86
87
  type: 'prose',
87
- text: 'For a shorter read to paste into an AI coding tool, add `--detail brief` (one line per section) or `--detail compact`. Use `--json` when building automated migration reports.',
88
+ text: 'For a shorter read to paste into an AI coding tool, see {@link generic:working-with-ai}. Use `--json` when building automated migration reports.',
88
89
  },
89
90
  {
90
91
  type: 'code',
@@ -129,7 +130,7 @@ export function AppRoot({children}: {children: React.ReactNode}) {
129
130
  },
130
131
  {
131
132
  type: 'prose',
132
- text: 'A layer\'s rank is set by the first stylesheet on the page that names it, so the global CSS file (or a `layers.css` holding only the `@layer` line) must be the first import in the root layout or app entry. Import it before any module that imports Astryx or theme CSS, including the `astryx-themes` module generated by `astryx theme add` and a root component like the `AppRoot` above that imports `theme.css`. If a theme stylesheet loads first, Tailwind preflight overrides Astryx base styles and theme overrides lose.',
133
+ text: 'Import the global CSS file first in the root layout or app entry, before anything that imports Astryx or theme CSS, including the `astryx-themes` module and a root component like the `AppRoot` above. Why the order matters, and what to do when it cannot come first, is in {@link generic:tailwind}.',
133
134
  },
134
135
  {
135
136
  type: 'code',
@@ -19,7 +19,6 @@ export const docs = {
19
19
  'verification',
20
20
  'checklist',
21
21
  'AI prompt',
22
- 'keyboard navigation',
23
22
  ],
24
23
 
25
24
  sections: [
@@ -19,7 +19,6 @@ export const docs = {
19
19
  'Tailwind',
20
20
  'shadcn',
21
21
  'Radix',
22
- 'cascade layers',
23
22
  'coexistence',
24
23
  ],
25
24
  slots: {
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/package-and-test`:
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/package-and-test`:
5
5
  * expose a template from its package and prove the copied result in an app.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/document-the-template/page-template`:
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/document-the-template/page-template`:
5
5
  * the page-only fields that help people find a page.
6
6
  */
7
7
 
@@ -31,7 +31,7 @@ export const docs = {
31
31
  type: 'code',
32
32
  lang: 'javascript',
33
33
  label: 'templates/acme-dashboard.doc.mjs',
34
- code: `/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
34
+ code: `/** @type {import('@astryxdesign/cli/authoring').IntegrationTemplateDoc} */
35
35
  export default {
36
36
  type: 'page',
37
37
  name: 'acme-dashboard',
@@ -49,12 +49,8 @@ export default {
49
49
  title: 'Help people find the page',
50
50
  content: [
51
51
  {
52
- type: 'reference',
53
- target: 'schema:template-doc',
54
- projection: {
55
- fields: ['category', 'scaffold'],
56
- },
57
- presentation: 'full',
52
+ type: 'prose',
53
+ text: 'Every field is in {@link schema:template-doc}.',
58
54
  },
59
55
  {
60
56
  type: 'list',
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/publishing`: publish an integration to
4
+ * @file `astryx docs cli/integrations/ship/publishing`: publish an integration to
5
5
  * npm, use release tags, and check the package before and after.
6
6
  */
7
7
 
@@ -14,7 +14,7 @@ export const docs = {
14
14
  category: 'guide',
15
15
  keywords: ['publish an integration', 'npm publish', 'release'],
16
16
  description:
17
- 'Publish your package to npm under the right release tag, and check it before and after.',
17
+ 'Publish your package to npm under the right release tag, checking it before and after.',
18
18
  sections: [
19
19
  {
20
20
  id: 'check-before-you-publish',
@@ -59,7 +59,7 @@ export const docs = {
59
59
  items: [
60
60
  'List only the roots you ship, and always `astryx.integration.mjs`. npm adds package.json, and a README and LICENSE when you have them.',
61
61
  'Each later `integration add` appends its root to the list.',
62
- '`integration verify` fails when a root is missing from the list: `Declared templates root "templates" has 0 of 2 expected files in the pack list. Add "templates" to "files" in package.json.`',
62
+ '`integration verify` fails when a root is missing from the list, and names the root to add to `files` (the message is in {@link generic:troubleshooting}).',
63
63
  ],
64
64
  },
65
65
  ],
@@ -79,7 +79,7 @@ export const docs = {
79
79
  },
80
80
  {
81
81
  type: 'prose',
82
- text: 'To let apps try a release first, publish it under `next`, then point `latest` at it when it is ready.',
82
+ text: 'To let apps try a release first, publish it under `next`, then point `latest` at it once ready.',
83
83
  },
84
84
  {
85
85
  type: 'code',
@@ -34,20 +34,22 @@ export const docs = {
34
34
  },
35
35
  {
36
36
  type: 'prose',
37
- text: 'An integration starts as a normal npm package. Make a folder for it, create a package.json inside that folder, give the package a name, then install the Astryx CLI and Core for development.',
37
+ text: 'An integration starts as a normal npm package. Make a folder for it, create a package.json inside that folder, give the package a name, make it an ES module, then install the Astryx CLI, Core, and TypeScript for development.',
38
38
  },
39
39
  {
40
40
  type: 'code',
41
41
  lang: 'bash',
42
- code: "mkdir acme-widgets && cd acme-widgets\nnpm init -y\nnpm pkg set name=@acme/astryx-widgets\nnpm pkg set 'exports={}' --json\nnpm install -D @astryxdesign/cli @astryxdesign/core",
42
+ code: "mkdir acme-widgets && cd acme-widgets\nnpm init -y\nnpm pkg set name=@acme/astryx-widgets type=module\nnpm pkg set 'exports={}' --json\nnpm install -D @astryxdesign/cli @astryxdesign/core typescript@6",
43
43
  },
44
44
  {
45
45
  type: 'list',
46
46
  style: 'unordered',
47
47
  items: [
48
+ 'Set `"type": "module"`: the `.js` files the CLI generates, such as a built theme, are ES modules, and Node fails to load them in a package marked `"type": "commonjs"`, which `npm init -y` writes on npm 11.',
48
49
  'Start with `"exports": {}`: each component and template you add then writes the public import that `integration verify` resolves.',
49
50
  'Run the CLI as `npx astryx`, which runs the `@astryxdesign/cli` you installed as a devDependency.',
50
51
  'Component commands read Core, so they need `@astryxdesign/core` installed.',
52
+ "The checks compare your docs with your code through TypeScript's JavaScript compiler API, which `typescript` 5.0 through 6 has. TypeScript 7 does not ship that API: on TypeScript 7, also install `@typescript/typescript6`, its TypeScript 6 API package, and the checks use it.",
51
53
  ],
52
54
  },
53
55
  {
@@ -86,6 +88,33 @@ export const docs = {
86
88
  type: 'prose',
87
89
  text: 'You now have an integration package with one exported component.',
88
90
  },
91
+ {
92
+ type: 'heading',
93
+ level: 3,
94
+ text: 'Check it in every build (required)',
95
+ },
96
+ {
97
+ type: 'prose',
98
+ text: "Run `integration check --strict` in every build ({@link generic:checks}): a doc, prop, template, or link that drifts from the code then fails your build, not your users' apps. Set it up now, as the `typecheck` script, and run it.",
99
+ },
100
+ {
101
+ type: 'code',
102
+ lang: 'bash',
103
+ code: 'npm pkg set scripts.typecheck="astryx integration check --strict"\nnpm run typecheck',
104
+ },
105
+ {
106
+ type: 'code',
107
+ lang: 'text',
108
+ code: '[ok] 0 errors, 0 warnings, 0 skipped. Every check passed.',
109
+ },
110
+ {
111
+ type: 'list',
112
+ style: 'unordered',
113
+ items: [
114
+ 'Run `typecheck` in CI and before every publish. When you add a `tsconfig.json`, put `tsc --noEmit && ` in front of the check so the same script checks your types.',
115
+ 'What each check covers, and what `--strict` adds: {@link generic:checks}.',
116
+ ],
117
+ },
89
118
  {
90
119
  type: 'heading',
91
120
  level: 3,
@@ -107,7 +136,7 @@ export const docs = {
107
136
  },
108
137
  {
109
138
  type: 'prose',
110
- text: '`integration verify` packs the package, unpacks it into a temporary app, and checks that the component resolves through its public import there. It publishes nothing and leaves no `.tgz` file, so `npm pack` writes `../acme-astryx-widgets-1.0.0.tgz` for the next step.',
139
+ text: '`integration verify` installs the packed package in a temporary app and confirms the component resolves through its public import there ({@link generic:checks}). It publishes nothing and leaves no `.tgz` file, so `npm pack` writes `../acme-astryx-widgets-1.0.0.tgz` for the next step.',
111
140
  },
112
141
  {
113
142
  type: 'heading',
@@ -172,19 +201,19 @@ export const docs = {
172
201
  ],
173
202
  [
174
203
  '`peerDependencies`',
175
- '`@astryxdesign/cli`; add `@astryxdesign/core` when your code imports it',
204
+ '`@astryxdesign/core` when your code imports it; `@astryxdesign/cli`, optional, when you ship a feature that needs a newer CLI ({@link generic:versioning})',
176
205
  'The app supplies these packages for your integration.',
177
206
  ],
178
207
  [
179
208
  '`devDependencies`',
180
- '`@astryxdesign/cli` and `@astryxdesign/core`',
181
- 'Lets you run the CLI and build components while working on the integration.',
209
+ '`@astryxdesign/cli`, `@astryxdesign/core`, and `typescript`',
210
+ 'Lets you run the CLI, build components, and run the checks while working on the integration.',
182
211
  ],
183
212
  ],
184
213
  },
185
214
  {
186
215
  type: 'prose',
187
- text: 'Peer ranges and releases are covered in {@link generic:versioning}; `files` and publishing in {@link generic:publishing}.',
216
+ text: 'Peer ranges and releases are covered in {@link generic:versioning}; `files` and publishing in {@link generic:publishing}. Add `"typecheck": "tsc --noEmit && astryx integration check --strict"` to `scripts` so each run checks your types and that your docs, props, and links still match the code. It needs `typescript` and a `tsconfig.json`; see {@link generic:checks}.',
188
217
  },
189
218
  ],
190
219
  },
@@ -226,21 +255,8 @@ export const docs = {
226
255
  text: 'The file tells the CLI where this package keeps its integration items. Edit it only when you want a custom root or another optional setting. Paths are relative to package.json, and later adds keep a custom path you already set.',
227
256
  },
228
257
  {
229
- type: 'reference',
230
- target: 'schema:integration',
231
- projection: {
232
- fields: [
233
- 'providerId',
234
- 'components',
235
- 'templates',
236
- 'codemods',
237
- 'docs',
238
- 'themes',
239
- 'agentDocs',
240
- 'issuesUrl',
241
- ],
242
- },
243
- presentation: 'full',
258
+ type: 'prose',
259
+ text: 'Every field is in {@link schema:integration}.',
244
260
  },
245
261
  {
246
262
  type: 'heading',
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/components/replace-a-core-component`:
4
+ * @file `astryx docs cli/integrations/building-blocks/components/replace-a-core-component`:
5
5
  * intentionally make an integration component the default for a Core identity.
6
6
  */
7
7
 
@@ -65,10 +65,8 @@ export default {
65
65
  };`,
66
66
  },
67
67
  {
68
- type: 'reference',
69
- target: 'schema:component-doc',
70
- projection: {fields: ['replaces']},
71
- presentation: 'full',
68
+ type: 'prose',
69
+ text: 'Every field is in {@link schema:component-doc}.',
72
70
  },
73
71
  {
74
72
  type: 'prose',
@@ -87,7 +85,7 @@ export default {
87
85
  type: 'list',
88
86
  style: 'unordered',
89
87
  items: [
90
- 'Any `@astryxdesign/cli` range that starts at that release or later turns it on, including the `>=0.7.0` that earlier `integration add theme` and `integration add doc --parent` wrote.',
88
+ 'Any `@astryxdesign/cli` range that starts at that release or later turns it on, including the `>=0.7.0` that `integration add doc --parent` wrote in published 0.6.4 and 0.6.5, and `integration add theme` in published 0.6.5.',
91
89
  'Without such a range, the component keeps its own name, the Core component stays selected (a component named like its target stays ambiguous by that bare name, as before), and `doctor integration components` warns with the range to add. Apps that load such a package see no change.',
92
90
  '`replaces` names the Core `ComponentDoc` identity, not its display label, import path, or a standalone hook.',
93
91
  'Your component may keep a distinct name or use the same name as the target. A distinct name remains directly addressable on older CLIs that ignore `replaces`.',
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/document-the-template/replace-a-core-template`:
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/document-the-template/replace-a-core-template`:
5
5
  * deliberately replace one Core template through template metadata.
6
6
  */
7
7
 
@@ -54,7 +54,7 @@ export const docs = {
54
54
  type: 'code',
55
55
  lang: 'javascript',
56
56
  label: 'templates/acme-app-shell.doc.mjs',
57
- code: `/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
57
+ code: `/** @type {import('@astryxdesign/cli/authoring').IntegrationTemplateDoc} */
58
58
  export default {
59
59
  type: 'page',
60
60
  name: 'acme-app-shell',
@@ -67,10 +67,8 @@ export default {
67
67
  };`,
68
68
  },
69
69
  {
70
- type: 'reference',
71
- target: 'schema:template-doc',
72
- projection: {fields: ['replaces']},
73
- presentation: 'full',
70
+ type: 'prose',
71
+ text: 'Every field is in {@link schema:template-doc}.',
74
72
  },
75
73
  {
76
74
  type: 'prose',
@@ -84,7 +82,7 @@ export default {
84
82
  content: [
85
83
  {
86
84
  type: 'prose',
87
- text: 'Declare the CLI floor from the field above as an optional peer ({@link generic:versioning}).',
85
+ text: 'Declare the CLI floor that `integration verify` names as an optional peer ({@link generic:versioning}).',
88
86
  },
89
87
  {
90
88
  type: 'code',
@@ -103,7 +101,7 @@ export default {
103
101
  },
104
102
  {
105
103
  type: 'prose',
106
- text: '`integration verify` reports `replaces_needs_cli` when that peer is missing or too old. Without it, an older CLI drops that template and hides your doc topics.',
104
+ text: '`integration verify` reports `replaces_needs_cli` when that peer is missing or too old. Without it, published 0.6.3 and earlier drop that template and hide your doc topics.',
107
105
  },
108
106
  ],
109
107
  },
@@ -1,9 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/docs/sections-and-placement`: give an
5
- * integration package its own section in the docs tree, place guides in it,
6
- * and fix a placement that fails.
4
+ * @file `astryx docs cli/integrations/building-blocks/docs/sections-and-placement`:
5
+ * give an integration package its own section in the docs tree, place guides
6
+ * in it, and fix a placement that fails.
7
7
  */
8
8
 
9
9
  /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
@@ -62,9 +62,7 @@ export const docs = {
62
62
  type: 'list',
63
63
  style: 'unordered',
64
64
  items: [
65
- "`parent` is `namespace:<name>`, a namespace that your own package ships. You cannot place a doc in the CLI's sections or in another package's.",
66
- "`slot` is a slot that the namespace declares for the doc's kind. You can leave it out when the namespace has only one slot.",
67
- '`order` is an integer that sorts the guides in the slot and sets their Previous and Next moves. Guides without one come last, by name.',
65
+ 'Every field is in {@link schema:authored-doc-graph-fields}.',
68
66
  'A placed guide opens only by its route, `acme/deploying`. Its bare name no longer opens it.',
69
67
  ],
70
68
  },
@@ -97,8 +95,8 @@ export const docs = {
97
95
  type: 'list',
98
96
  style: 'unordered',
99
97
  items: [
100
- 'A `parent` that your package does not ship, such as `namespace:cli`, "names no namespace".',
101
- 'A `slot` that the namespace does not declare "is not a slot of namespace"; the message lists the slots it does declare.',
98
+ 'A `parent` your package does not ship, such as `namespace:cli`, "names no namespace".',
99
+ 'A `slot` the namespace does not declare "is not a slot of namespace"; the message lists the declared slots.',
102
100
  'The check exits 1; see {@link generic:check-your-docs}.',
103
101
  ],
104
102
  },
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/components/see-it-in-an-app`: inspect an
4
+ * @file `astryx docs cli/integrations/building-blocks/components/see-it-in-an-app`: inspect an
5
5
  * integration component from an app that installs the package.
6
6
  */
7
7
 
@@ -33,7 +33,9 @@ npx astryx search carousel`,
33
33
  {
34
34
  type: 'code',
35
35
  lang: 'text',
36
- code: `# AcmeCarousel
36
+ code: `package: @acme/astryx-widgets
37
+
38
+ # AcmeCarousel
37
39
 
38
40
  Cycles through slides one at a time. Use it for a small set of related cards.
39
41
 
@@ -1,8 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/docs/short-and-findable`: keep each read
5
- * short, lead each section with its summary, and write docs that search finds.
4
+ * @file `astryx docs cli/integrations/building-blocks/docs/short-and-findable`:
5
+ * keep each read short, lead each section with its summary, and write docs
6
+ * that search finds.
6
7
  */
7
8
 
8
9
  /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
@@ -58,7 +59,7 @@ export const docs = {
58
59
  {
59
60
  type: 'code',
60
61
  lang: 'text',
61
- code: 'build-before-you-ship Build before you ship - Build the app, then upload the `dist` folder to your host.',
62
+ code: 'build-before-you-ship Build before you ship - Build the app, then upload the `dist` folder.',
62
63
  },
63
64
  ],
64
65
  },
@@ -68,14 +69,14 @@ export const docs = {
68
69
  content: [
69
70
  {
70
71
  type: 'prose',
71
- text: 'Search ranks a query that matches a whole title, or an identifier in backticks, above words in body text. Title each section with the task a reader searches for.',
72
+ text: 'In a topic with more than one section, search ranks a section whose title matches the query, or that names it in backticks, above words in body text. Title each section with the task a reader searches for.',
72
73
  },
73
74
  {
74
75
  type: 'list',
75
76
  style: 'unordered',
76
77
  items: [
77
78
  'Name the task in the words a reader types, such as "Deploy to production". Avoid titles such as "Overview" or "Details".',
78
- 'Write field names, file names, and error codes in backticks, such as `deployTarget`: search treats each one as a keyword.',
79
+ 'Write field names, file names, and error codes in backticks, such as `deployTarget`: in a topic with more than one section, search treats each one as a keyword.',
79
80
  'Other words in the summary and body match too, but rank below titles and identifiers. The summary shows under each hit, so make it answer the query.',
80
81
  ],
81
82
  },
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/components/describe-the-component/single-component`:
4
+ * @file `astryx docs cli/integrations/building-blocks/components/describe-the-component/single-component`:
5
5
  * write and maintain the default ComponentDoc for one public component.
6
6
  */
7
7
 
@@ -61,9 +61,8 @@ export default {
61
61
  ],
62
62
  },
63
63
  {
64
- type: 'reference',
65
- target: 'schema:component-doc',
66
- presentation: 'summary',
64
+ type: 'prose',
65
+ text: 'Every field is in {@link schema:component-doc}.',
67
66
  },
68
67
  ],
69
68
  },
@@ -87,6 +86,15 @@ export default {
87
86
  ],
88
87
  },`,
89
88
  },
89
+ {
90
+ type: 'prose',
91
+ text: "Set `keywords` to the words people search for: synonyms and the task the component does, such as `keywords: ['slider', 'slideshow', 'rotating cards']`. `astryx search` ranks a match on a component's name or keywords above one in its description, so without keywords a search for the component's task can list Core components first. Check with the words a person would type:",
92
+ },
93
+ {
94
+ type: 'code',
95
+ lang: 'bash',
96
+ code: 'npx astryx search "rotating cards" --type component',
97
+ },
90
98
  ],
91
99
  },
92
100
  {
@@ -122,6 +130,7 @@ export default {
122
130
  'Set `required: true` only when every caller must pass the prop.',
123
131
  'Write `default` exactly as the value should appear in documentation.',
124
132
  'Skip styling escape hatches such as `xstyle`, `className`, and `style`.',
133
+ '`npx astryx doctor integration components` lists a documented prop the code lacks, a public prop the doc misses, and a wrong `required`. See {@link generic:check-the-props}.',
125
134
  ],
126
135
  },
127
136
  ],
@@ -157,7 +166,7 @@ export default {
157
166
  {
158
167
  type: 'code',
159
168
  lang: 'bash',
160
- code: 'npx astryx component AcmeCarousel\nnpx astryx integration verify',
169
+ code: 'npx astryx component AcmeCarousel\nnpx astryx doctor integration components\nnpx astryx integration verify',
161
170
  },
162
171
  ],
163
172
  },
@@ -1,9 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/start-a-template`: what a
5
- * template is, why an integration shares one, whether it is a page or a
6
- * block, and how to add one.
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/start-a-template`:
5
+ * what a template is, why an integration shares one, whether it is a page or
6
+ * a block, and how to add one.
7
7
  */
8
8
 
9
9
  /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/components/describe-the-component/subcomponent`:
4
+ * @file `astryx docs cli/integrations/building-blocks/components/describe-the-component/subcomponent`:
5
5
  * give one member of a component family its own ComponentDoc.
6
6
  */
7
7
 
@@ -51,6 +51,7 @@ export default {
51
51
  type: 'component',
52
52
  name: 'AcmeDialog',
53
53
  displayName: 'Acme Dialog',
54
+ import: '@acme/astryx-widgets/components/AcmeDialog',
54
55
  usage: {description: 'Presents a focused task above the current page.'},
55
56
  components: [
56
57
  {
@@ -82,6 +83,7 @@ export default {
82
83
  type: 'component',
83
84
  name: 'AcmeDialogHeader',
84
85
  displayName: 'Acme Dialog Header',
86
+ import: '@acme/astryx-widgets/components/AcmeDialogHeader',
85
87
  subComponentOf: 'AcmeDialog',
86
88
  description: 'Labels an Acme Dialog and holds its close action.',
87
89
  props: [
@@ -95,10 +97,8 @@ export default {
95
97
  };`,
96
98
  },
97
99
  {
98
- type: 'reference',
99
- target: 'schema:component-doc',
100
- projection: {fields: ['subComponentOf', 'description', 'props']},
101
- presentation: 'full',
100
+ type: 'prose',
101
+ text: 'Every field is in {@link schema:component-doc}.',
102
102
  },
103
103
  {
104
104
  type: 'list',
@@ -106,7 +106,7 @@ export default {
106
106
  items: [
107
107
  '`subComponentOf` must exactly match the parent doc\'s `name`.',
108
108
  '`description` explains this member\'s role in the family. `usage` is optional; add it when the member needs guidance beyond that sentence.',
109
- 'The child inherits family fields such as `group`, `category`, `keywords`, `theming`, and `playground` unless it overrides them.',
109
+ 'The CLI does not copy family fields such as `group`, `category`, or `keywords` from the parent to the child. Set any the child needs in its own doc.',
110
110
  ],
111
111
  },
112
112
  ],
@@ -1,8 +1,8 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/template-assets`: make every
5
- * style, font, icon, and media dependency survive a template copy.
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/template-assets`:
5
+ * make every style, font, icon, and media dependency survive a template copy.
6
6
  */
7
7
 
8
8
  /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/document-the-template/template-doc-overview`:
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/document-the-template/template-doc-overview`:
5
5
  * the source and doc file pair, the fields every template doc shares, and how
6
6
  * to check what Astryx lists.
7
7
  */
@@ -54,22 +54,11 @@ export const docs = {
54
54
  content: [
55
55
  {
56
56
  type: 'prose',
57
- text: 'These fields apply to every page and block. The page, block, and replacement guides add the fields unique to each.',
57
+ text: 'The fields below apply to every page and block. The page, block, and replacement guides add the fields unique to each.',
58
58
  },
59
59
  {
60
- type: 'reference',
61
- target: 'schema:template-doc',
62
- projection: {
63
- fields: [
64
- 'type',
65
- 'name',
66
- 'displayName',
67
- 'description',
68
- 'keywords',
69
- 'isReady',
70
- ],
71
- },
72
- presentation: 'full',
60
+ type: 'prose',
61
+ text: 'Every field is in {@link schema:template-doc}.',
73
62
  },
74
63
  {
75
64
  type: 'list',
@@ -78,7 +67,7 @@ export const docs = {
78
67
  'Set `type` to the kind you chose in {@link generic:start-a-template}. It decides which other fields the doc accepts.',
79
68
  'The file name sets the template id ({@link generic:start-a-template}). Labels live in the doc: the terminal list prints `name`, and JSON listings print `displayName`. Changing either never changes the id.',
80
69
  'Write the description for someone choosing between templates. The Doc metadata category in {@link generic:template-grading-rubric} defines what a complete description covers.',
81
- "Name the ideas the template serves in `keywords`: the domains, tasks, and other names a builder might use for it, in lowercase, such as `['monitoring', 'uptime', 'on-call']` for a service-health dashboard. `astryx search` matches them as it matches the description, and `astryx build` ranks page templates on them, so the description can stay about the layout.",
70
+ "Name the ideas the template serves in `keywords`: the domains, tasks, and other names a builder might use for it, in lowercase, such as `['monitoring', 'uptime', 'on-call']` for a service-health dashboard. How search and build use them is in {@link generic:authoring}, so the description can stay about the layout.",
82
71
  'Add `isReady: false` as soon as you generate the doc, because a doc without `isReady` is listed as ready. Keep it until the template passes {@link generic:test-template-in-app} and the quality review.',
83
72
  ],
84
73
  },
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/build-the-template/template-assets/template-fonts`:
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/template-assets/template-fonts`:
5
5
  * use the app typeface by default, and ship every font file a template needs
6
6
  * when it must bring its own.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/build-the-template/template-assets/template-icons`:
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/template-assets/template-icons`:
5
5
  * render template icons through Astryx and ship custom product icons from the
6
6
  * package.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/build-the-template/template-assets/template-images-media`:
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/template-assets/template-images-media`:
5
5
  * keep template images and video working after the copy, or make them clear
6
6
  * placeholders.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/build-the-template/template-assets/template-styles`:
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/template-assets/template-styles`:
5
5
  * style a template with Astryx first, keep editable styles in the file, and
6
6
  * ship shared CSS from the package.
7
7
  */
@@ -85,7 +85,7 @@ const styles = stylex.create({
85
85
  },
86
86
  {
87
87
  type: 'prose',
88
- text: 'Then export that path and include the file in the package ({@link generic:export-template-assets}). In a TypeScript app, this import type-checks only when the app declares `*.css` modules.',
88
+ text: 'Then export that path and include the file in the package ({@link generic:export-template-assets}). TypeScript 6 and later check side-effect imports by default, so this import type-checks only when the app or its framework declares `*.css` modules.',
89
89
  },
90
90
  ],
91
91
  },