@astryxdesign/cli 0.7.2-canary.4787e3f → 0.7.2-canary.4a2f608

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 (247) 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 +341 -0
  50. package/api/integration/validate-integration.mjs +8 -0
  51. package/api/integration/validate-integration.test.mjs +11 -0
  52. package/api/integration/validate-integration.type.d.mts +8 -0
  53. package/api/integration/validate-integration.type.mjs +12 -1
  54. package/api/integration/validateIntegration.doc.mjs +19 -3
  55. package/api/search/search.d.mts +72 -12
  56. package/api/search/search.domain-priority.test.mjs +108 -18
  57. package/api/search/search.integration-check.test.mjs +24 -0
  58. package/api/search/search.mjs +501 -37
  59. package/api/search/search.test.mjs +139 -0
  60. package/api/theme/build/build.family.test.mjs +54 -6
  61. package/api/theme/build/build.mjs +114 -17
  62. package/api/theme/themeBuild.doc.mjs +4 -4
  63. package/api/upgrade/_adapter.d.mts +40 -2
  64. package/api/upgrade/_adapter.mjs +117 -4
  65. package/api/upgrade/run/cli-behind-core.test.mjs +438 -0
  66. package/api/upgrade/run/run.mjs +30 -1
  67. package/api/upgrade/status/status.d.mts +21 -5
  68. package/api/upgrade/status/status.mjs +45 -8
  69. package/api/upgrade/upgrade.doc.mjs +5 -3
  70. package/api/upgrade/upgrade.type.d.mts +23 -0
  71. package/api/upgrade/upgrade.type.mjs +16 -1
  72. package/assets/codemods/runner.mjs +7 -1
  73. package/assets/discover/official-packages.json +367 -0
  74. package/assets/docs/README.md +10 -0
  75. package/assets/docs/author-a-theme.doc.mjs +3 -3
  76. package/assets/docs/browser-support.doc.mjs +1 -1
  77. package/assets/docs/getting-started.doc.mjs +3 -3
  78. package/assets/docs/styling-overview.doc.mjs +1 -1
  79. package/assets/docs/theme.doc.dense.mjs +1 -1
  80. package/assets/docs/theme.doc.mjs +2 -2
  81. package/assets/docs/theme.doc.zh.mjs +1 -1
  82. package/assets/docs/tree/add-a-component.doc.mjs +1 -1
  83. package/assets/docs/tree/add-a-theme.doc.mjs +1 -1
  84. package/assets/docs/tree/add-a-topic.doc.mjs +11 -8
  85. package/assets/docs/tree/agent-guidance.doc.mjs +2 -2
  86. package/assets/docs/tree/block-template.doc.mjs +8 -20
  87. package/assets/docs/tree/build-the-template.doc.mjs +1 -1
  88. package/assets/docs/tree/check-the-props.doc.mjs +196 -0
  89. package/assets/docs/tree/check-your-docs.doc.mjs +61 -7
  90. package/assets/docs/tree/checks.doc.mjs +25 -17
  91. package/assets/docs/tree/codemods.doc.mjs +4 -4
  92. package/assets/docs/tree/component-family.doc.mjs +3 -5
  93. package/assets/docs/tree/component-imports.doc.mjs +2 -2
  94. package/assets/docs/tree/components.doc.mjs +1 -1
  95. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +30 -21
  96. package/assets/docs/tree/define-the-theme.doc.mjs +6 -5
  97. package/assets/docs/tree/describe-the-component.doc.mjs +2 -2
  98. package/assets/docs/tree/docs.doc.mjs +3 -3
  99. package/assets/docs/tree/document-the-template.doc.mjs +1 -1
  100. package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
  101. package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
  102. package/assets/docs/tree/extend-or-replace.doc.mjs +6 -6
  103. package/assets/docs/tree/fonts-and-assets.doc.mjs +2 -2
  104. package/assets/docs/tree/generate-a-palette.doc.mjs +5 -3
  105. package/assets/docs/tree/grade-template-with-agent.doc.mjs +1 -1
  106. package/assets/docs/tree/integrations.doc.mjs +8 -0
  107. package/assets/docs/tree/layout-spacing.doc.mjs +2 -3
  108. package/assets/docs/tree/layout.doc.mjs +6 -6
  109. package/assets/docs/tree/links.doc.mjs +6 -5
  110. package/assets/docs/tree/migration-setup.doc.mjs +3 -2
  111. package/assets/docs/tree/migration-verification.doc.mjs +0 -1
  112. package/assets/docs/tree/migration.doc.mjs +0 -1
  113. package/assets/docs/tree/package-and-test.doc.mjs +1 -1
  114. package/assets/docs/tree/page-template.doc.mjs +4 -8
  115. package/assets/docs/tree/publishing.doc.mjs +4 -4
  116. package/assets/docs/tree/quick-start.doc.mjs +38 -22
  117. package/assets/docs/tree/replace-a-core-component.doc.mjs +4 -6
  118. package/assets/docs/tree/replace-a-core-template.doc.mjs +6 -8
  119. package/assets/docs/tree/sections-and-placement.doc.mjs +6 -8
  120. package/assets/docs/tree/see-it-in-an-app.doc.mjs +4 -2
  121. package/assets/docs/tree/short-and-findable.doc.mjs +6 -5
  122. package/assets/docs/tree/single-component.doc.mjs +14 -5
  123. package/assets/docs/tree/start-a-template.doc.mjs +3 -3
  124. package/assets/docs/tree/subcomponent.doc.mjs +6 -6
  125. package/assets/docs/tree/template-assets.doc.mjs +2 -2
  126. package/assets/docs/tree/template-doc-overview.doc.mjs +5 -16
  127. package/assets/docs/tree/template-fonts.doc.mjs +1 -1
  128. package/assets/docs/tree/template-icons.doc.mjs +1 -1
  129. package/assets/docs/tree/template-images-media.doc.mjs +1 -1
  130. package/assets/docs/tree/template-styles.doc.mjs +2 -2
  131. package/assets/docs/tree/templates.doc.mjs +1 -1
  132. package/assets/docs/tree/test-in-an-app.doc.mjs +3 -3
  133. package/assets/docs/tree/test-template-in-app.doc.mjs +1 -1
  134. package/assets/docs/tree/tokens-and-setup.doc.mjs +19 -15
  135. package/assets/docs/tree/troubleshooting.doc.mjs +8 -8
  136. package/assets/docs/tree/type-scale.doc.mjs +3 -3
  137. package/assets/docs/tree/upgrading.doc.mjs +4 -4
  138. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +3 -1
  139. package/assets/docs/tree/verify-packed-template.doc.mjs +1 -1
  140. package/assets/docs/tree/versioning.doc.mjs +6 -6
  141. package/assets/docs/tree/write-the-template-file.doc.mjs +4 -3
  142. package/assets/docs/use-a-theme.doc.mjs +2 -2
  143. package/assets/theme.template.ts +1 -1
  144. package/authoring/codemod/codemod.doc.mjs +7 -3
  145. package/authoring/config/config.doc.mjs +9 -6
  146. package/authoring/config/type.ts +4 -2
  147. package/authoring/discover/discover.doc.mjs +1 -1
  148. package/authoring/doctypes/base/graph-fields.doc.mjs +6 -4
  149. package/authoring/doctypes/command/command.doc.mjs +14 -12
  150. package/authoring/doctypes/component/component.doc.mjs +29 -26
  151. package/authoring/doctypes/component/type.ts +7 -5
  152. package/authoring/doctypes/enum/enum.doc.mjs +7 -4
  153. package/authoring/doctypes/function/function.doc.mjs +9 -8
  154. package/authoring/doctypes/hook/hook.doc.mjs +5 -4
  155. package/authoring/doctypes/namespace/namespace.doc.mjs +7 -6
  156. package/authoring/doctypes/reference/reference.doc.mjs +11 -10
  157. package/authoring/doctypes/schema/schema.doc.mjs +9 -9
  158. package/authoring/doctypes/template/integration-template.doc.d.mts +11 -0
  159. package/authoring/doctypes/template/integration-template.doc.mjs +49 -0
  160. package/authoring/doctypes/template/parse.d.mts +6 -2
  161. package/authoring/doctypes/template/parse.mjs +3 -1
  162. package/authoring/doctypes/template/template.doc.mjs +3 -3
  163. package/authoring/doctypes/template/type.ts +22 -0
  164. package/authoring/doctypes/theme/theme.doc.mjs +2 -2
  165. package/authoring/gap-report/gap-report.doc.mjs +2 -2
  166. package/authoring/identity/identity.doc.mjs +3 -3
  167. package/authoring/index.d.ts +1 -0
  168. package/authoring/integration/integration.doc.mjs +12 -4
  169. package/authoring/integration/parse.test.mjs +10 -0
  170. package/authoring/integration/schema.d.mts +2 -0
  171. package/authoring/integration/schema.mjs +1 -0
  172. package/authoring/integration/type.ts +4 -0
  173. package/clients/cli/commands/build-theme.batch-report.test.mjs +3 -1
  174. package/clients/cli/commands/build-theme.mjs +1 -1
  175. package/clients/cli/commands/build-theme.path-safety.test.mjs +155 -21
  176. package/clients/cli/commands/cli-postinstall.test.mjs +49 -1
  177. package/clients/cli/commands/discover.broken-integration.test.mjs +4 -1
  178. package/clients/cli/commands/discover.doc.mjs +1 -1
  179. package/clients/cli/commands/discover.mjs +144 -93
  180. package/clients/cli/commands/discover.no-source.test.mjs +447 -33
  181. package/clients/cli/commands/discover.sources.test.mjs +20 -1
  182. package/clients/cli/commands/doctor-integration-components.doc.mjs +17 -4
  183. package/clients/cli/commands/doctor-integration-docs.doc.mjs +18 -5
  184. package/clients/cli/commands/doctor-integration-validate.doc.mjs +13 -2
  185. package/clients/cli/commands/doctor-integration.test.mjs +837 -0
  186. package/clients/cli/commands/doctor.mjs +250 -3
  187. package/clients/cli/commands/gap-report.doc.mjs +14 -2
  188. package/clients/cli/commands/gap-report.mjs +24 -2
  189. package/clients/cli/commands/gap-report.test.mjs +79 -0
  190. package/clients/cli/commands/integration-check.doc.mjs +85 -0
  191. package/clients/cli/commands/integration-check.test.mjs +370 -0
  192. package/clients/cli/commands/integration.doc.mjs +6 -2
  193. package/clients/cli/commands/integration.mjs +106 -1
  194. package/clients/cli/commands/json-contract.test.mjs +5 -1
  195. package/clients/cli/commands/setup-nudge.test.mjs +79 -1
  196. package/clients/cli/commands/swizzle.mjs +5 -3
  197. package/clients/cli/commands/swizzle.routing.test.mjs +18 -1
  198. package/clients/cli/commands/text-json-parity.test.mjs +5 -0
  199. package/clients/cli/commands/theme-build.doc.mjs +2 -2
  200. package/clients/cli/commands/upgrade.doc.mjs +14 -0
  201. package/clients/cli/commands/upgrade.older-cli.test.mjs +160 -0
  202. package/clients/cli/index.mjs +30 -5
  203. package/foundation/agent-docs/agent-doc-state.d.mts +14 -0
  204. package/foundation/agent-docs/agent-doc-state.mjs +38 -0
  205. package/foundation/agent-docs/agent-docs.d.mts +2 -1
  206. package/foundation/agent-docs/agent-docs.mjs +8 -6
  207. package/foundation/config/project.mjs +82 -0
  208. package/foundation/discovery/authoring-self-docs.mjs +2 -1
  209. package/foundation/discovery/component-discovery.d.mts +18 -0
  210. package/foundation/discovery/component-discovery.mjs +2 -2
  211. package/foundation/discovery/copied-passages.d.mts +216 -0
  212. package/foundation/discovery/copied-passages.mjs +720 -0
  213. package/foundation/discovery/copied-passages.test.mjs +124 -0
  214. package/foundation/discovery/doc-fluff.d.mts +112 -0
  215. package/foundation/discovery/doc-fluff.mjs +328 -0
  216. package/foundation/discovery/doc-fluff.test.mjs +142 -0
  217. package/foundation/discovery/doc-types.d.mts +157 -0
  218. package/foundation/discovery/doc-types.mjs +1224 -0
  219. package/foundation/discovery/doc-types.test.mjs +700 -0
  220. package/foundation/discovery/docs-discovery.d.mts +88 -0
  221. package/foundation/discovery/docs-discovery.mjs +83 -2
  222. package/foundation/discovery/integration-doc-files.d.mts +22 -0
  223. package/foundation/discovery/integration-doc-files.mjs +231 -0
  224. package/foundation/discovery/integration-doc-files.test.mjs +246 -0
  225. package/foundation/discovery/project-typescript.d.mts +11 -2
  226. package/foundation/discovery/project-typescript.mjs +32 -4
  227. package/foundation/discovery/prop-drift.d.mts +116 -3
  228. package/foundation/discovery/prop-drift.mjs +883 -41
  229. package/foundation/discovery/prop-drift.test.mjs +1738 -20
  230. package/foundation/discovery/type-match.d.mts +53 -0
  231. package/foundation/discovery/type-match.mjs +660 -0
  232. package/foundation/discovery/type-match.test.mjs +169 -0
  233. package/foundation/discovery/type-text.d.mts +68 -0
  234. package/foundation/discovery/type-text.mjs +658 -0
  235. package/foundation/discovery/type-text.test.mjs +196 -0
  236. package/foundation/doc-compiler/doc-loads.test.mjs +16 -2
  237. package/foundation/doc-compiler/links.d.mts +9 -5
  238. package/foundation/doc-compiler/links.mjs +4 -2
  239. package/foundation/env/package-manager.d.mts +32 -0
  240. package/foundation/env/package-manager.mjs +47 -0
  241. package/foundation/env/package-manager.test.mjs +194 -7
  242. package/foundation/fs/module-loader.d.mts +2 -1
  243. package/foundation/fs/module-loader.mjs +60 -4
  244. package/foundation/fs/module-loader.test.mjs +194 -0
  245. package/foundation/response/response-types.doc.mjs +14 -8
  246. package/package.json +11 -11
  247. package/scripts/postinstall.mjs +3 -3
@@ -51,6 +51,16 @@ The material is usually good; the finding is placement, not quality. It goes in
51
51
 
52
52
  Worked example: a responsive-and-interaction readiness rubric is grading criteria → **Component-Audit-Rubric**, or **Component-Lifecycle** if it is a promotion gate.
53
53
 
54
+ ## Imports in code samples
55
+
56
+ Import each Core export from the path `astryx component <Name>` prints: the
57
+ component's own entry when Core has one (`@astryxdesign/core/VStack`,
58
+ `@astryxdesign/core/Heading`), and `@astryxdesign/core/theme` for `Theme`,
59
+ `defineTheme` and the rest of the theme API. A reader copies one sample and then
60
+ reads `astryx component`, and two paths for one export read as two different
61
+ things. The no-build CDN page is the exception: its import map names only the
62
+ package root.
63
+
54
64
  ## Sections are read one at a time
55
65
 
56
66
  `astryx docs <topic> --index` lists a topic's sections, and readers then open
@@ -17,14 +17,14 @@ export const docs = {
17
17
  {type: 'prose', text: "Use an installed built theme as the base for ordinary customization. Import it into your source and pass it as `extends` to `defineTheme({extends: importedTheme, ...})`. Build the result, then add the local slug. Only eject when you need to own and maintain a full source fork."},
18
18
  {type: 'code', lang: 'bash', label: 'Add to use, eject to fork', code: 'astryx theme list\nastryx theme add stone\nastryx theme eject stone\nastryx theme build src/themes/stone/stoneTheme.ts\nastryx theme add stone'},
19
19
  {type: 'prose', text: "For an annotated map of the whole surface (every defineTheme field, the token families, and the component override syntax, each with the CLI command that prints its reference), run `astryx theme template`. It writes `theme.template.ts` into your project to read and copy from (`astryx init --features theme` writes it as part of project setup)."},
20
- {type: 'prose', text: 'To apply a theme you created, see {@link generic:use-a-theme}. To generate colors from seed values, see the Palette section below. Use `theme eject` only when you want an independent source fork that no longer receives the package owner\u2019s updates.'},
20
+ {type: 'prose', text: 'To apply a theme you created, see {@link generic:use-a-theme}. To generate colors from seed values, see the Palette section below. Before you eject a package theme instead, see when that fits in {@link generic:use-a-theme}.'},
21
21
  ],
22
22
  },
23
23
  {
24
24
  id: 'palette',
25
25
  title: 'Generate a palette',
26
26
  content: [
27
- {type: 'prose', text: 'A theme needs dozens of related colors for backgrounds, borders, text, and states, in both light and dark mode. Rather than pick each by hand, name a few seed colors and generate the rest.'},
27
+ {type: 'prose', text: 'Name a few seed colors and generate every shade a theme needs, light and dark; {@link generic:generate-a-palette} explains what a palette holds.'},
28
28
  {type: 'code', lang: 'json', label: 'Minimal palette config (palette.config.json)', code: '{"families": [{"id": "ocean", "seed": "#0074e2"}]}'},
29
29
  {type: 'code', lang: 'bash', label: 'Generate and preview', code: '# Print the palette without writing files\nastryx theme palette generate palette.config.json\n\n# Write palette + receipt, and open a visual preview\nastryx theme palette generate palette.config.json \\\n --out src/themes/ocean/tokens/ocean.palette.ts \\\n --preview preview.html'},
30
30
  {type: 'prose', text: "The command writes a `.ts` file exporting 21 shades (stops 0–100) for both light and dark, plus a `.receipt.json` to regenerate later. Point your theme's tokens at the palette, then run defineTheme (see below)."},
@@ -120,7 +120,7 @@ export const docs = {
120
120
  ['ocean.variants.d.ts', "(Optional) Module augmentations for custom component prop values"],
121
121
  ]},
122
122
  {type: 'prose', text: 'The `__built: true` flag tells Theme to skip runtime `<style>` injection; the CSS file handles it. Load the generated CSS wherever you load the module.'},
123
- {type: 'code', lang: 'tsx', label: 'Using a custom built theme', code: "import {Theme} from '@astryxdesign/core';\nimport {oceanTheme} from './themes/ocean';\nimport './themes/ocean.css';\n\n<Theme theme={oceanTheme}>\n <App />\n</Theme>"},
123
+ {type: 'code', lang: 'tsx', label: 'Using a custom built theme', code: "import {Theme} from '@astryxdesign/core/theme';\nimport {oceanTheme} from './themes/ocean';\nimport './themes/ocean.css';\n\n<Theme theme={oceanTheme}>\n <App />\n</Theme>"},
124
124
  {type: 'prose', text: "After upgrading Astryx, rerun `astryx theme build` for every custom prebuilt theme. Deploy the regenerated files together. The runtime intentionally trusts `__built: true` and will not repair stale CSS from an older build. The build also warns when the theme names font families it does not load. See {@link generic:font-setup} for the full recipe."},
125
125
  {type: 'prose', text: 'For the runtime vs built tradeoff, see the Runtime vs Built section of {@link generic:use-a-theme}.'},
126
126
  ],
@@ -149,7 +149,7 @@ export const docs = {
149
149
  type: 'list',
150
150
  style: 'ordered',
151
151
  items: [
152
- 'Polyfill anchor positioning. Load a CSS anchor positioning polyfill conditionally behind an `@supports` check so it costs nothing on Tier 1. This is the lowest-effort way to get correct positioning; note that polyfills may not cover every position-fallback feature.',
152
+ 'Polyfill anchor positioning. Load a CSS anchor positioning polyfill conditionally behind an `@supports` check so it costs nothing on Tier 1. This is the lowest-effort way to get correct positioning; polyfills may not cover every position-fallback feature.',
153
153
  'Provide a JS positioning fallback. Detect missing support with `CSS.supports("anchor-name", "--x")` and position layers with a measurement-based library (e.g. a floating-element positioner) when it returns false. More code, full control.',
154
154
  'Accept degraded positioning. Document for your users that on Tier 2 browsers, layered surfaces open correctly but may not sit next to their trigger. Cheapest, and often fine for internal tools on evergreen browsers.',
155
155
  ],
@@ -86,7 +86,7 @@ export const docs = {
86
86
  type: 'code',
87
87
  lang: 'tsx',
88
88
  label: 'App root',
89
- code: `import {Theme} from '@astryxdesign/core';
89
+ code: `import {Theme} from '@astryxdesign/core/theme';
90
90
  import {themes, defaultThemeSlug} from './astryx-themes';
91
91
 
92
92
  <Theme theme={themes[defaultThemeSlug]}><App /></Theme>`,
@@ -119,14 +119,14 @@ import {themes, defaultThemeSlug} from './astryx-themes';
119
119
  content: [
120
120
  {
121
121
  type: 'prose',
122
- text: 'Components are imported from per-category subpath entrypoints. This keeps bundles small and makes intent clear.',
122
+ text: 'Import each component from its own entry, the path `astryx component <Name>` prints. This keeps bundles small and makes intent clear.',
123
123
  },
124
124
  {
125
125
  type: 'code',
126
126
  lang: 'tsx',
127
127
  label: 'app/page.tsx',
128
128
  code: `import {Button} from '@astryxdesign/core/Button';
129
- import {VStack} from '@astryxdesign/core/Layout';
129
+ import {VStack} from '@astryxdesign/core/VStack';
130
130
 
131
131
  export default function Page() {
132
132
  return (
@@ -158,7 +158,7 @@ export const docs = {
158
158
  },
159
159
  {
160
160
  type: 'prose',
161
- text: 'If a swizzled component renders with no styles and no error, a missing compiler is almost always why. See the StyleX Build Setup section of {@link generic:tokens-and-setup} for bundler config examples.',
161
+ text: 'If a swizzled component fails at runtime with a `stylex.create` error, the app is missing a StyleX compiler: see the StyleX Build Setup section of {@link generic:tokens-and-setup}.',
162
162
  },
163
163
  ],
164
164
  },
@@ -9,7 +9,7 @@ export const docsDense = {
9
9
  section: 'Wrap your app in a theme',
10
10
  title: 'Quick start',
11
11
  content: [
12
- {type: 'prose', text: "Install a theme, wrap in `<Theme>` (`import {Theme} from '@astryxdesign/core'`). {@link generic:use-a-theme} for full guide."},
12
+ {type: 'prose', text: "Install a theme, wrap in `<Theme>` (`import {Theme} from '@astryxdesign/core/theme'`). {@link generic:use-a-theme} for full guide."},
13
13
  ],
14
14
  },
15
15
  {
@@ -23,7 +23,7 @@ export const docs = {
23
23
  type: 'code',
24
24
  lang: 'tsx',
25
25
  label: 'Wire the generated module once',
26
- code: "import {Theme} from '@astryxdesign/core';\nimport {themes, defaultThemeSlug} from './astryx-themes';\n\nfunction App() {\n return (\n <Theme theme={themes[defaultThemeSlug]}>\n <YourApp />\n </Theme>\n );\n}",
26
+ code: "import {Theme} from '@astryxdesign/core/theme';\nimport {themes, defaultThemeSlug} from './astryx-themes';\n\nfunction App() {\n return (\n <Theme theme={themes[defaultThemeSlug]}>\n <YourApp />\n </Theme>\n );\n}",
27
27
  },
28
28
  ],
29
29
  },
@@ -59,7 +59,7 @@ export const docs = {
59
59
  content: [
60
60
  {
61
61
  type: 'prose',
62
- text: "Use [light, dark] tuples in token values for automatic mode switching. Use mode='system' (default) on Theme to follow OS preference. Full guide: {@link generic:use-a-theme}.",
62
+ text: 'Light, dark, and system modes: {@link generic:use-a-theme}.',
63
63
  },
64
64
  {
65
65
  type: 'code',
@@ -11,7 +11,7 @@ export const docsZh = {
11
11
  content: [
12
12
  {
13
13
  type: 'prose',
14
- text: "安装主题包,用 `<Theme>`(`import {Theme} from '@astryxdesign/core'`)包裹应用,选择浅色或深色模式。完整指南——可用主题、集成主题、深色模式、嵌套主题和生产构建——请参阅 {@link generic:use-a-theme}。",
14
+ text: "安装主题包,用 `<Theme>`(`import {Theme} from '@astryxdesign/core/theme'`)包裹应用,选择浅色或深色模式。完整指南——可用主题、集成主题、深色模式、嵌套主题和生产构建——请参阅 {@link generic:use-a-theme}。",
15
15
  },
16
16
  ],
17
17
  },
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/components/add-a-component`: choose a
4
+ * @file `astryx docs cli/integrations/building-blocks/components/add-a-component`: choose a
5
5
  * component name and generate its first source and doc files.
6
6
  */
7
7
 
@@ -44,7 +44,7 @@ Declare theme root ./themes in astryx.integration.mjs.
44
44
  },
45
45
  {
46
46
  type: 'prose',
47
- text: "`oceanTheme.ts` exports `oceanTheme`, a `defineTheme` source. `oceanTheme.doc.mjs` describes it with `type: 'theme'`, `name`, `displayName`, `description`, and `maintained`; `theme list` shows its `name`, `description`, and `maintained`. The command also declares `./themes/ocean` and `./themes/ocean.css` package exports. Every descriptor field is in {@link generic:authoring}.",
47
+ text: '`oceanTheme.ts` exports `oceanTheme`, a `defineTheme` source, and `oceanTheme.doc.mjs` is the descriptor that `theme list` reads. The command also declares `./themes/ocean` and `./themes/ocean.css` package exports. Every field is in {@link schema:theme-doc}.',
48
48
  },
49
49
  {
50
50
  type: 'prose',
@@ -1,9 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/docs/add-a-topic`: add a doc topic to an
5
- * integration package, write its sections, and pick the doc kind for each
6
- * thing the package ships.
4
+ * @file `astryx docs cli/integrations/building-blocks/docs/add-a-topic`: add a
5
+ * doc topic to an integration package, write its sections, and pick the doc
6
+ * kind for each thing the package ships.
7
7
  */
8
8
 
9
9
  /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
@@ -40,7 +40,7 @@ export const docs = {
40
40
  items: [
41
41
  'Name the topic in lowercase kebab-case, such as `deploying`. Readers type the name as a command argument, so it holds only letters, digits, `_`, and `-`.',
42
42
  'Keep the name stable: readers and links find the topic by it.',
43
- 'Pick a name no Core topic uses. To take over or add to a Core topic, see {@link generic:extend-or-replace}.',
43
+ 'Pick a name that `astryx docs` does not already list: no Core topic, and no section such as `tokens` or `layout`. To take over or add to a Core topic, see {@link generic:extend-or-replace}.',
44
44
  ],
45
45
  },
46
46
  ],
@@ -59,13 +59,16 @@ export const docs = {
59
59
  label: 'docs/deploying.doc.mjs',
60
60
  code: "/** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */\nexport default {\n type: 'generic',\n name: 'deploying',\n title: 'Deploying',\n description: 'Ship an app built with Acme widgets.',\n sections: [{\n id: 'build-before-you-ship',\n title: 'Build before you ship',\n content: [\n {type: 'prose', text: 'Build the app, then upload the `dist` folder.'},\n {type: 'code', lang: 'bash', code: 'npm run build'},\n {type: 'list', style: 'unordered', items: ['Keep `dist` out of git.']},\n {type: 'table', headers: ['Variable', 'Value'], rows: [['`NODE_ENV`', '`production`']]},\n ],\n }],\n};",
61
61
  },
62
+ {
63
+ type: 'prose',
64
+ text: 'The sample sets a section `id`, so `package.json` needs the CLI peer `"@astryxdesign/cli": ">=0.6.4"`. Published 0.6.3 and earlier reject `id` and hide every doc topic your package ships, and `integration verify` fails without that peer; see {@link generic:versioning}.',
65
+ },
62
66
  {
63
67
  type: 'list',
64
68
  style: 'unordered',
65
69
  items: [
66
- 'Content blocks are `prose`, `code`, `list`, and `table`, as shown; `heading`, with a `level` from 3 to 6 and a `text`; and `token-ref`, which inlines a token table from another topic.',
67
- '`id` is optional: a stable key for the section. Without it, the key comes from the title. A stable CLI before 0.6.4 cannot read `id`; see {@link generic:versioning}.',
68
- 'Replace the `Overview` placeholder that `integration add` writes. Every field is in {@link generic:authoring}.',
70
+ 'Replace the `Overview` placeholder that `integration add` writes.',
71
+ 'Every field is in {@link schema:reference-doc}.',
69
72
  ],
70
73
  },
71
74
  ],
@@ -135,7 +138,7 @@ export const docs = {
135
138
  items: [
136
139
  'Readers open a topic by its `name`, not its file name. Name the file after the doc, `<name>.doc.mjs`, so each one is easy to find.',
137
140
  'A topic with no `placement` is a flat topic: the docs list shows it under Topics, and readers open it by its name.',
138
- 'To give your package its own section in the docs tree instead, see {@link generic:sections-and-placement}.',
141
+ 'For a section of your own in the docs tree, see {@link generic:sections-and-placement}.',
139
142
  ],
140
143
  },
141
144
  ],
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/agent-guidance`: add short lines of
4
+ * @file `astryx docs cli/integrations/building-blocks/configuration/agent-guidance`: add short lines of
5
5
  * guidance that apps put in front of their AI agents, within the limits.
6
6
  */
7
7
 
@@ -121,7 +121,7 @@ export default {
121
121
  lang: 'bash',
122
122
  code: `npx astryx init --features agents
123
123
  # Or: --from takes the Core version the app had before
124
- npx astryx upgrade --from 0.7.0 --apply`,
124
+ npx astryx upgrade --from <version> --apply`,
125
125
  },
126
126
  {
127
127
  type: 'code',
@@ -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/block-template`:
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/document-the-template/block-template`:
5
5
  * the block-only fields: component relationships and the preview shape.
6
6
  */
7
7
 
@@ -31,7 +31,7 @@ export const docs = {
31
31
  type: 'code',
32
32
  lang: 'javascript',
33
33
  label: 'templates/acme-stat-card.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: 'block',
37
37
  name: 'acme-stat-card',
@@ -54,18 +54,8 @@ export default {
54
54
  title: 'Choose the component relationship',
55
55
  content: [
56
56
  {
57
- type: 'reference',
58
- target: 'schema:template-doc',
59
- projection: {
60
- fields: [
61
- 'exampleFor',
62
- 'alsoExampleFor',
63
- 'alsoShowcaseFor',
64
- 'componentsUsed',
65
- 'isShowcase',
66
- ],
67
- },
68
- presentation: 'full',
57
+ type: 'prose',
58
+ text: 'Every field is in {@link schema:template-doc}.',
69
59
  },
70
60
  {
71
61
  type: 'prose',
@@ -75,7 +65,7 @@ export default {
75
65
  type: 'code',
76
66
  lang: 'javascript',
77
67
  label: 'templates/acme-status-card-showcase.doc.mjs',
78
- code: `/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
68
+ code: `/** @type {import('@astryxdesign/cli/authoring').IntegrationTemplateDoc} */
79
69
  export default {
80
70
  type: 'block',
81
71
  name: 'acme-status-card-showcase',
@@ -101,14 +91,12 @@ export default {
101
91
  title: 'Choose a useful preview',
102
92
  content: [
103
93
  {
104
- type: 'reference',
105
- target: 'schema:template-doc',
106
- projection: {fields: ['aspectRatio']},
107
- presentation: 'full',
94
+ type: 'prose',
95
+ text: 'Every field is in {@link schema:template-doc}.',
108
96
  },
109
97
  {
110
98
  type: 'prose',
111
- text: 'Start from the value for the closest shape below, render the block at that ratio, and adjust it until it neither clips nor leaves large empty space. These are starting points, not contract defaults.',
99
+ text: 'Set `aspectRatio` from the value for the closest shape below, render the block at that ratio, and adjust it until it neither clips nor leaves large empty space. These are starting points, not contract defaults.',
112
100
  },
113
101
  {
114
102
  type: 'table',
@@ -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`:
4
+ * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template`:
5
5
  * author portable template source and every asset that source needs.
6
6
  */
7
7
 
@@ -0,0 +1,196 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs cli/integrations/building-blocks/components/describe-the-component/check-the-props`:
5
+ * compare each component doc's props table with the component's TypeScript
6
+ * props, read each finding, and fix the doc or the code.
7
+ */
8
+
9
+ /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
+ export const docs = {
11
+ type: 'generic',
12
+ name: 'check-the-props',
13
+ placement: {
14
+ parent: 'namespace:describe-the-component',
15
+ slot: 'guides',
16
+ order: 50,
17
+ },
18
+ title: 'Check the props table',
19
+ category: 'guide',
20
+ keywords: [
21
+ 'props table',
22
+ 'documented props',
23
+ 'prop drift',
24
+ 'props not compared',
25
+ ],
26
+ description:
27
+ "Compare each props table with the component's TypeScript props, then fix the doc or the code.",
28
+ sections: [
29
+ {
30
+ id: 'run-the-props-check',
31
+ title: 'Run the props check',
32
+ content: [
33
+ {
34
+ type: 'prose',
35
+ text: "`doctor integration components` compares every props table in your component docs, hidden docs and every family entry included, with the props the component's TypeScript declares. Run it in your package after you change a component or its doc.",
36
+ },
37
+ {
38
+ type: 'code',
39
+ lang: 'bash',
40
+ code: 'npx astryx doctor integration components',
41
+ },
42
+ {
43
+ type: 'code',
44
+ lang: 'text',
45
+ code: `severity: [warn]
46
+ component: AcmeCarousel
47
+ prop: loop
48
+ kind: not_in_code
49
+ message: "loop" is documented, but AcmeCarousel's props have no "loop".
50
+ doc: components/AcmeCarousel.doc.mjs
51
+ source: components/AcmeCarousel.tsx
52
+ docType: boolean
53
+
54
+ 1 prop(s) differ between the docs and the code in 1 of 1 component(s) compared (TypeScript 6.0.3). These are warnings: update the doc, or the code if the doc is right.`,
55
+ },
56
+ {
57
+ type: 'list',
58
+ style: 'unordered',
59
+ items: [
60
+ "A doc's own `props` describe the export its `name` names. In a family doc, each entry describes its own export. A hook entry documents parameters and returns, so it is not compared.",
61
+ "It reads props with the `typescript` your package installs, and reads your package's `tsconfig.json` the way `tsc -p` does. It finds TypeScript the way the docs check does, TypeScript 7 included ({@link generic:check-your-docs}). Without a usable one it prints `[skip] Props not compared` and the reason.",
62
+ 'Findings are warnings and leave the exit code at 0. Read them before you publish. With `--json`, they are in `data.propDrift.findings`.',
63
+ ],
64
+ },
65
+ ],
66
+ },
67
+ {
68
+ id: 'fix-each-finding',
69
+ title: 'Fix each finding',
70
+ content: [
71
+ {
72
+ type: 'prose',
73
+ text: "Each finding's `kind` says what differs. Fix the doc, or the code if the doc is right.",
74
+ },
75
+ {
76
+ type: 'table',
77
+ headers: ['Kind', 'Means', 'Fix'],
78
+ rows: [
79
+ [
80
+ '`not_in_code`',
81
+ "The doc lists a prop the component's props do not have",
82
+ 'Remove it from the doc, or add it to the code. A name an index signature takes, such as `data-*`, counts as present',
83
+ ],
84
+ [
85
+ '`not_in_doc`',
86
+ "Your package declares a prop the doc does not list, or builds one with a mapped type, such as `Partial<Record<'sm' | 'md', string>>`",
87
+ 'Document it. Props from React, the DOM, or another package are never asked for, and neither are props whose keys another package defines (`keyof CSSProperties`, behind an alias or not), `className`, `style`, `xstyle`, `data-testid`, `ref`, `key`, or a prop whose JSDoc has `@internal`. A deprecated prop is still a prop: document it until you remove it. A prop a mapped type builds from keys the check cannot trace (a template literal, say) is listed under `[info] Props not checked for a doc entry` instead',
88
+ ],
89
+ [
90
+ '`required_mismatch`',
91
+ '`required` disagrees with the code',
92
+ 'Set `required: true` exactly when every caller must pass the prop. One your `defaultProps` fills counts as optional, as it is to JSX callers, and so does one only some members of a union require, since a caller can leave it out: say in its description which variants need it. An entry that names several props (`value / onChange`) makes the same claim about each: give them separate entries when they differ',
93
+ ],
94
+ [
95
+ '`type_mismatch`',
96
+ "The documented `type` differs from the code's, where both read exactly",
97
+ 'Copy the type from the source, or fix the code. The next section says which types are judged',
98
+ ],
99
+ ],
100
+ },
101
+ ],
102
+ },
103
+ {
104
+ id: 'write-types-the-check-can-judge',
105
+ title: 'Write types the check can judge',
106
+ content: [
107
+ {
108
+ type: 'prose',
109
+ text: 'For a prop your package declares, the check also compares the documented `type`, but only where both sides read exactly. It never guesses, so a type it cannot judge is listed, not reported. It needs TypeScript 4.8 or later: with an older one it prints `[skip] Prop types not judged` and judges none.',
110
+ },
111
+ {
112
+ type: 'code',
113
+ lang: 'text',
114
+ code: `severity: [warn]
115
+ component: AcmeCarousel
116
+ prop: interval
117
+ kind: type_mismatch
118
+ message: "interval" is documented as string, but the code declares number.
119
+ doc: components/AcmeCarousel.doc.mjs
120
+ source: components/AcmeCarousel.tsx
121
+ docType: string
122
+ codeType: number`,
123
+ },
124
+ {
125
+ type: 'list',
126
+ style: 'unordered',
127
+ items: [
128
+ "Write the type as the source writes it, such as `ReactNode[]` or `(index: number) => void`. Parameter names, member order, quotes and whitespace may differ. Text that writes `readonly` must match exactly, parameter names included; only whitespace may differ. `React.X` names React's own `X` where the prop is declared, so it matches a bare `X` only where that name is React's: `React.KeyboardEvent` is not the DOM's `KeyboardEvent`.",
129
+ "Name a type as the file that declares the prop names it, so an import renamed there (`Item as BaseItem`) is written as that file writes it. A field (`cfg.level`) takes its prop's file, even when the field's own type is declared in another file.",
130
+ 'A type written another way is judged only when both sides are built from exact parts: primitives such as `string` and `number`, string, number and boolean literals, string enum members, arrays and unions of these, and type names that stand for them. Union members may come in any order, and a member another covers adds nothing, as TypeScript passes it there: `undefined` beside `void`, or `string[]` beside `(string | number)[]`.',
131
+ 'A mutable array type matches a readonly one, because callers can pass it. A readonly one documented for a mutable array is a mismatch.',
132
+ "When a prop's variants give a field different types, as `{value: string} | {value: number}` does, document every variant's type (`string | number`). The types of only some variants are listed: the prop's variants give this field different types. With more than six variant types, any other type is listed too.",
133
+ "To name an alias and show its values, write `AcmeSize = 'sm' | 'md'` or `AcmeSize ('sm' | 'md')`. Both parts must match.",
134
+ "An optional prop's `undefined` is set aside on both sides. With `exactOptionalPropertyTypes`, the doc shows `undefined` exactly when the code declares it.",
135
+ 'Anything else, such as an object, a tuple, a generic with arguments, `keyof`, an intersection, or a mapped or conditional type written another way, is not compared.',
136
+ ],
137
+ },
138
+ {
139
+ type: 'prose',
140
+ text: "The check prints how many documented types it judged, then lists the rest by reason: not a form the check judges exactly, a field the prop's variants give different types, a standard prop, or a prop declared outside the package. With `--json`, they are in `data.propDrift.typesNotCompared`.",
141
+ },
142
+ {
143
+ type: 'code',
144
+ lang: 'text',
145
+ code: '[info] Documented prop types judged: 2; not compared: 0. A type is judged when the doc writes it the same as the source (exactly, if it contains `readonly`), or when both are primitives, literals, arrays and unions of those, or names for them.',
146
+ },
147
+ ],
148
+ },
149
+ {
150
+ id: 'when-a-component-is-not-compared',
151
+ title: 'When a component is not compared',
152
+ content: [
153
+ {
154
+ type: 'prose',
155
+ text: "When the check cannot read a component's props exactly, it lists the component under `[info] Props not compared`, with the reason, instead of reporting findings that might be wrong.",
156
+ },
157
+ {
158
+ type: 'code',
159
+ lang: 'text',
160
+ code: `[info] Props not compared for 1 documented component(s):
161
+
162
+ component: AcmeCarousel
163
+ doc: components/AcmeCarousel.doc.mjs
164
+ reason: AcmeCarousel depends on \`@acme/motion\` (imported in AcmeCarousel.tsx), which the compiler could not resolve, usually a dependency that is not installed. Install the package's dependencies and run this check again`,
165
+ },
166
+ {
167
+ type: 'table',
168
+ headers: ['Reason', 'Fix'],
169
+ rows: [
170
+ [
171
+ 'It depends on a package or file the compiler could not resolve',
172
+ "Install the package's dependencies, then run the check again",
173
+ ],
174
+ [
175
+ "It depends on a type the compiler can't work out",
176
+ 'Make the types compile with `npx tsc --noEmit`, then run the check again',
177
+ ],
178
+ [
179
+ "The package's TypeScript config has an error",
180
+ 'Fix `tsconfig.json` until `npx tsc -p .` reads it',
181
+ ],
182
+ ['Its props are typed `any`', 'Give the component a props type'],
183
+ [
184
+ 'Some prop names come from a type parameter',
185
+ 'Nothing to fix: a component that renders an element the caller picks takes props known only where it is used',
186
+ ],
187
+ [
188
+ "The file has no export named by the doc's `name`",
189
+ 'Change `name` or the export so they agree',
190
+ ],
191
+ ],
192
+ },
193
+ ],
194
+ },
195
+ ],
196
+ };
@@ -1,9 +1,9 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/docs/check-your-docs`: what each check
5
- * proves about an integration's docs: the docs check, the read size, and the
6
- * CLI peer.
4
+ * @file `astryx docs cli/integrations/building-blocks/docs/check-your-docs`:
5
+ * what each check proves about an integration's docs: the docs check, each
6
+ * doc's fields, the read size, and the CLI peer.
7
7
  */
8
8
 
9
9
  /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
@@ -13,7 +13,8 @@ export const docs = {
13
13
  placement: {parent: 'namespace:docs', slot: 'guides', order: 60},
14
14
  title: 'Check your docs',
15
15
  category: 'guide',
16
- description: 'Check the docs tree, links, overlaps, read size, and CLI peer.',
16
+ description:
17
+ 'Check the docs tree, links, overlaps, doc fields, read size, and CLI peer.',
17
18
  sections: [
18
19
  {
19
20
  id: 'run-the-docs-check',
@@ -21,7 +22,7 @@ export const docs = {
21
22
  content: [
22
23
  {
23
24
  type: 'prose',
24
- text: 'Run `doctor integration docs` in your package to check the docs tree, every link, and overlaps with Core topics. Pass a package name to check an installed package.',
25
+ text: 'Run `doctor integration docs` in your package to check the docs tree, every link, and overlaps with Core topics, and to list any passage two topics repeat. Pass a package name to check an installed package.',
25
26
  },
26
27
  {
27
28
  type: 'code',
@@ -31,7 +32,15 @@ export const docs = {
31
32
  {
32
33
  type: 'code',
33
34
  lang: 'text',
34
- code: 'Checking integration docs: @acme/astryx-widgets@1.0.0\n\n[ok] The docs tree and every link in these docs check out.\n\n[ok] No doc topics overlap with Core.',
35
+ code: 'Checking integration docs: @acme/astryx-widgets@1.0.0\n\n[ok] The docs tree and every link in these docs check out.\n\n[ok] No doc topics overlap with Core.\n[ok] No topic copies a passage from another.\n[ok] No filler phrases or low-density topics.',
36
+ },
37
+ {
38
+ type: 'prose',
39
+ text: 'Write each fact in one topic. When two of your topics, or one of yours and a Core topic, repeat 10 or more words of prose word for word, the check lists the pair as a `copied_passage` warning. It names the topic that keeps the text (a Core topic, or of your two the one the passage fits) and the line in the other where to put the link instead ({@link generic:links}). Code and examples are not compared, and a topic may carry the text of the Core topic it replaces. A run with fewer than 4 distinct content words (words other than function words such as \"the\", \"in\" or \"it\"), or one that three or more topics share (a series lead-in), is not listed. Each listed pair is also a warning (`copied_passage`): `doctor integration docs` still exits 0, and `integration check --strict` fails until you fix it.',
40
+ },
41
+ {
42
+ type: 'prose',
43
+ text: "Keep docs dense. The check lists, as a `doc_fluff` warning, each padding phrase in your prose, with its file line and what to write instead, and each topic of 80 or more prose words in which fewer than half the words carry content (words other than function words such as the, and, in), with its measured share and the floor of 0.5. `doctor integration docs` still exits 0, and `integration check --strict` fails until you cut it. Code, examples, and quoted text are not read. The phrases: `it\'s important to note`, `it is important to note`, `important to note that`, `it\'s worth noting`, `it is worth noting`, `worth noting that`, `it should be noted`, `please note`, `note that` (opening a sentence), `as mentioned above`, `as mentioned earlier`, `as mentioned before`, `as noted above`, `as you can see`, `needless to say`, `in order to`, `due to the fact that`, `for the purpose of`, `at this point in time`, `in other words`, `basically`, `essentially`, `obviously`.",
35
44
  },
36
45
  {
37
46
  type: 'prose',
@@ -45,7 +54,7 @@ export const docs = {
45
54
  content: [
46
55
  {
47
56
  type: 'prose',
48
- text: 'A doc that does not load, an accidental Core overlap, or a failed namespace or placement fails the check with exit code 1. A link that names no doc only warns, and the exit code stays 0.',
57
+ text: 'A doc that does not load, an accidental Core overlap, a `reference` block that names no doc, or a failed namespace or placement fails the check with exit code 1. A link that names no doc only warns, and the exit code stays 0.',
49
58
  },
50
59
  {
51
60
  type: 'table',
@@ -66,6 +75,11 @@ export const docs = {
66
75
  '`[fail]` `invalid_doc_graph`',
67
76
  '1',
68
77
  ],
78
+ [
79
+ 'A `reference` block whose target names no doc',
80
+ '`[fail]` `invalid_doc_reference`',
81
+ '1',
82
+ ],
69
83
  ['A link that names no doc', '`[warn]` `invalid_doc_graph`', '0'],
70
84
  [
71
85
  'A topic that sets `replaces` or `extends`',
@@ -80,6 +94,46 @@ export const docs = {
80
94
  },
81
95
  ],
82
96
  },
97
+ {
98
+ id: 'check-each-doc-against-its-type',
99
+ title: 'Check each doc against its type',
100
+ content: [
101
+ {
102
+ type: 'prose',
103
+ text: "`doctor integration validate` reads every doc your package ships against the type `@astryxdesign/cli/authoring` publishes for its kind, the way `tsc` would: a `hidden` doc and a second doc for one name too. Test fixtures under `__tests__` in the components or docs root, which those readers skip, are counted, not checked. It reports a field the type does not have (`unknown_field`), a missing required field (`missing_field`), and a value outside the field's type (`wrong_type`).",
104
+ },
105
+ {
106
+ type: 'code',
107
+ lang: 'bash',
108
+ code: 'npx astryx doctor integration validate',
109
+ },
110
+ {
111
+ type: 'code',
112
+ lang: 'text',
113
+ code: `Checking 1 doc(s) against the authoring types (TypeScript 6.0.3)
114
+
115
+ severity: [warn]
116
+ doc: components/AcmeCarousel.doc.mjs
117
+ line: 7
118
+ export: default
119
+ type: ComponentDoc
120
+ field: summary
121
+ problem: unknown_field
122
+ message: Object literal may only specify known properties, and 'summary' does not exist in type 'SingleComponentDoc'.
123
+ fix: Remove \`summary\`: SingleComponentDoc has no field \`summary\`.`,
124
+ },
125
+ {
126
+ type: 'list',
127
+ style: 'unordered',
128
+ items: [
129
+ "The folder decides the type: `ComponentDoc` in your components root, `IntegrationTemplateDoc` in your templates root, `ThemeDoc` in your themes root, and in your docs root the type the doc's `type` names. Keep the `@type` comment above each doc's export too, so your editor shows the same problems as you type.",
130
+ 'Every finding is a warning, so the exit code stays 0. With `--json`, they are in `data.docTypes.findings`.',
131
+ 'It uses the `typescript` your package installs. Where `typescript` is missing or has no JavaScript compiler API, as TypeScript 7 does, it uses `@typescript/typescript6`, the TypeScript 6 API package, if your package installs it. Without either, it prints `[skip] Docs not type-checked` and the reason.',
132
+ 'Every field of every doc type is in `astryx docs authoring`.',
133
+ ],
134
+ },
135
+ ],
136
+ },
83
137
  {
84
138
  id: 'check-read-size',
85
139
  title: 'Check read size',