@astryxdesign/cli 0.7.3 → 0.7.4-canary.1a552f2

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 (244) hide show
  1. package/README.md +63 -63
  2. package/api/component/_adapter.mjs +4 -3
  3. package/api/component/component.mjs +13 -6
  4. package/api/component/doc-links.test.mjs +33 -0
  5. package/api/discover/_adapter.mjs +22 -10
  6. package/api/discover/_catalog-view.d.mts +2 -0
  7. package/api/discover/_catalog-view.mjs +1 -0
  8. package/api/discover/_catalog-view.test.mjs +1 -0
  9. package/api/discover/detail/detail.mjs +1 -0
  10. package/api/discover/detail/detail.test.mjs +3 -0
  11. package/api/discover/detail/doc/doc.mjs +5 -1
  12. package/api/discover/detail/doc/doc.test.mjs +1 -0
  13. package/api/discover/detail/item/item.mjs +2 -0
  14. package/api/discover/detail/item/item.test.mjs +2 -0
  15. package/api/discover/discover.doc.mjs +4 -4
  16. package/api/discover/discover.type.d.mts +20 -0
  17. package/api/discover/discover.type.mjs +5 -0
  18. package/api/discover/list/list.test.mjs +2 -0
  19. package/api/discover/search/search.d.mts +3 -2
  20. package/api/discover/search/search.mjs +26 -7
  21. package/api/discover/search/search.test.mjs +67 -0
  22. package/api/docs/_adapter.d.mts +80 -0
  23. package/api/docs/_adapter.mjs +261 -11
  24. package/api/docs/detail/detail.mjs +8 -0
  25. package/api/docs/docOverlays.test.mjs +2 -1
  26. package/api/docs/docs.d.mts +16 -6
  27. package/api/docs/docs.doc.mjs +1 -1
  28. package/api/docs/docs.mjs +55 -6
  29. package/api/docs/docs.type.d.mts +28 -2
  30. package/api/docs/docs.type.mjs +13 -3
  31. package/api/docs/guide-route-targets.test.mjs +1002 -0
  32. package/api/docs/index/index.mjs +9 -0
  33. package/api/docs/integration-tree.test.mjs +22 -0
  34. package/api/docs/integrationDocs.test.mjs +85 -0
  35. package/api/docs/list/list.mjs +7 -1
  36. package/api/docs/node/node.mjs +9 -1
  37. package/api/docs/reference-blocks.test.mjs +1 -1
  38. package/api/doctor/_adapter.d.mts +40 -0
  39. package/api/doctor/_adapter.mjs +171 -1
  40. package/api/doctor/built-checks.d.mts +85 -0
  41. package/api/doctor/built-checks.mjs +837 -0
  42. package/api/doctor/built-checks.test.mjs +531 -0
  43. package/api/doctor/doctor.d.mts +6 -5
  44. package/api/doctor/doctor.doc.mjs +11 -1
  45. package/api/doctor/doctor.mjs +18 -3
  46. package/api/doctor/doctor.type.d.mts +6 -0
  47. package/api/doctor/doctor.type.mjs +3 -0
  48. package/api/hook/list/list.d.mts +1 -1
  49. package/api/integration/_adapter.d.mts +11 -2
  50. package/api/integration/_adapter.mjs +30 -4
  51. package/api/integration/authoring-checks.mjs +29 -2
  52. package/api/integration/authoring-checks.test.mjs +131 -1
  53. package/api/integration/check/check.d.mts +4 -1
  54. package/api/integration/check/check.mjs +34 -4
  55. package/api/integration/check/check.test.mjs +49 -0
  56. package/api/integration/integration-check.type.d.mts +8 -0
  57. package/api/integration/integration-check.type.mjs +4 -1
  58. package/api/integration/integrationCheck.doc.mjs +8 -1
  59. package/api/integration/integrationDocConflicts.doc.mjs +1 -1
  60. package/api/integration/pack-check.mjs +71 -2
  61. package/api/integration/pack-check.test.mjs +77 -0
  62. package/api/integration/validate-integration-case-disk.test.mjs +2 -0
  63. package/api/integration/validate-integration-gaps.test.mjs +7 -4
  64. package/api/integration/validate-integration.mjs +96 -14
  65. package/api/integration/validate-integration.type.d.mts +10 -4
  66. package/api/integration/validate-integration.type.mjs +10 -5
  67. package/api/integration/validateIntegration.doc.mjs +1 -1
  68. package/api/search/_candidate-score.d.mts +3 -2
  69. package/api/search/_candidate-score.mjs +66 -3
  70. package/api/search/_gather-docs.mjs +12 -2
  71. package/api/search/_priority.mjs +2 -1
  72. package/api/search/_score.d.mts +2 -1
  73. package/api/search/_score.mjs +2 -2
  74. package/api/search/search.doc.mjs +1 -1
  75. package/api/search/search.family-members.test.mjs +124 -0
  76. package/api/search/search.mjs +28 -0
  77. package/api/theme/palette/generate/generate.d.mts +8 -0
  78. package/api/theme/palette/generate/generate.mjs +38 -11
  79. package/api/theme/palette/generate/generate.test.mjs +83 -4
  80. package/api/theme/palette/generate/generator.d.mts +6 -0
  81. package/api/theme/palette/generate/generator.mjs +6 -0
  82. package/api/theme/theme.type.d.mts +12 -1
  83. package/api/theme/theme.type.mjs +7 -1
  84. package/api/theme/themeBuild.doc.mjs +1 -1
  85. package/api/theme/themeList.doc.mjs +1 -1
  86. package/api/theme/themePaletteGenerate.doc.mjs +1 -1
  87. package/api/theme/themeTargets.doc.mjs +1 -1
  88. package/assets/discover/official-packages.json +16 -0
  89. package/assets/docs/author-a-theme.doc.mjs +15 -15
  90. package/assets/docs/browser-support.doc.mjs +1 -1
  91. package/assets/docs/getting-started.doc.mjs +16 -16
  92. package/assets/docs/is-my-code-good.doc.mjs +6 -6
  93. package/assets/docs/styling-overview.doc.mjs +5 -5
  94. package/assets/docs/theme.doc.mjs +5 -5
  95. package/assets/docs/tree/add-a-component.doc.mjs +1 -1
  96. package/assets/docs/tree/add-a-theme.doc.mjs +2 -2
  97. package/assets/docs/tree/add-a-topic.doc.mjs +6 -6
  98. package/assets/docs/tree/agent-guidance.doc.mjs +5 -5
  99. package/assets/docs/tree/authoring.doc.mjs +2 -2
  100. package/assets/docs/tree/block-template.doc.mjs +1 -1
  101. package/assets/docs/tree/check-the-props.doc.mjs +3 -3
  102. package/assets/docs/tree/check-your-docs.doc.mjs +6 -6
  103. package/assets/docs/tree/checks.doc.mjs +11 -11
  104. package/assets/docs/tree/ci-and-containers.doc.mjs +1 -1
  105. package/assets/docs/tree/cli-command.doc.mjs +6 -6
  106. package/assets/docs/tree/codemods.doc.mjs +7 -7
  107. package/assets/docs/tree/component-family.doc.mjs +1 -1
  108. package/assets/docs/tree/component-imports.doc.mjs +2 -2
  109. package/assets/docs/tree/component-lookups.doc.mjs +6 -5
  110. package/assets/docs/tree/computer-agent-guide.doc.mjs +7 -7
  111. package/assets/docs/tree/computer-integrations.doc.mjs +5 -5
  112. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +3 -3
  113. package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
  114. package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
  115. package/assets/docs/tree/doc-syntax.doc.mjs +219 -0
  116. package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
  117. package/assets/docs/tree/extend-or-replace.doc.mjs +39 -7
  118. package/assets/docs/tree/font-setup.doc.mjs +1 -1
  119. package/assets/docs/tree/generate-a-palette.doc.mjs +1 -1
  120. package/assets/docs/tree/global-integrations.doc.mjs +11 -11
  121. package/assets/docs/tree/global.doc.mjs +2 -2
  122. package/assets/docs/tree/host-entry.doc.mjs +1 -1
  123. package/assets/docs/tree/install-once.doc.mjs +4 -4
  124. package/assets/docs/tree/layout.doc.mjs +1 -1
  125. package/assets/docs/tree/links.doc.mjs +2 -2
  126. package/assets/docs/tree/migration-setup.doc.mjs +15 -15
  127. package/assets/docs/tree/migration.doc.mjs +2 -1
  128. package/assets/docs/tree/other-libraries.doc.mjs +1 -1
  129. package/assets/docs/tree/page-template.doc.mjs +2 -2
  130. package/assets/docs/tree/problems.doc.mjs +8 -8
  131. package/assets/docs/tree/project-global-or-both.doc.mjs +2 -2
  132. package/assets/docs/tree/publishing.doc.mjs +7 -7
  133. package/assets/docs/tree/quick-start.doc.mjs +9 -9
  134. package/assets/docs/tree/reference.doc.mjs +2 -2
  135. package/assets/docs/tree/replace-a-core-component.doc.mjs +1 -1
  136. package/assets/docs/tree/replace-a-core-template.doc.mjs +4 -4
  137. package/assets/docs/tree/scaffold.doc.mjs +1 -1
  138. package/assets/docs/tree/sections-and-placement.doc.mjs +3 -3
  139. package/assets/docs/tree/see-it-in-an-app.doc.mjs +3 -3
  140. package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
  141. package/assets/docs/tree/single-component.doc.mjs +4 -4
  142. package/assets/docs/tree/start-a-template.doc.mjs +5 -5
  143. package/assets/docs/tree/styling-advanced.doc.mjs +1 -1
  144. package/assets/docs/tree/styling-libraries.doc.mjs +2 -1
  145. package/assets/docs/tree/styling.doc.mjs +1 -1
  146. package/assets/docs/tree/tailwind.doc.mjs +1 -1
  147. package/assets/docs/tree/test-in-an-app.doc.mjs +5 -5
  148. package/assets/docs/tree/test-template-in-app.doc.mjs +6 -6
  149. package/assets/docs/tree/tokens-and-setup.doc.mjs +1 -1
  150. package/assets/docs/tree/troubleshooting.doc.mjs +24 -20
  151. package/assets/docs/tree/uninstall.doc.mjs +2 -2
  152. package/assets/docs/tree/updates.doc.mjs +1 -1
  153. package/assets/docs/tree/upgrading.doc.mjs +3 -3
  154. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +1 -1
  155. package/assets/docs/tree/verify-packed-template.doc.mjs +3 -3
  156. package/assets/docs/tree/versioning.doc.mjs +4 -4
  157. package/assets/docs/tree/who-answers.doc.mjs +4 -4
  158. package/assets/docs/tree/write-the-template-file.doc.mjs +4 -4
  159. package/assets/docs/use-a-theme.doc.mjs +10 -10
  160. package/assets/docs/use-integrations.doc.mjs +1 -1
  161. package/assets/docs/working-with-ai.doc.mjs +15 -15
  162. package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.doc.mjs +1 -1
  163. package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjs +1 -1
  164. package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +54 -0
  165. package/assets/templates/themes/butter/butterPalettes.generated.receipt.json +1499 -0
  166. package/assets/templates/themes/butter/butterPalettes.generated.ts +550 -0
  167. package/assets/templates/themes/butter/butterTheme.ts +274 -234
  168. package/assets/templates/themes/butter/palette.config.json +484 -0
  169. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +41 -0
  170. package/assets/templates/themes/gothic/gothicPalettes.generated.receipt.json +979 -0
  171. package/assets/templates/themes/gothic/gothicPalettes.generated.ts +271 -0
  172. package/assets/templates/themes/gothic/gothicTheme.ts +130 -160
  173. package/assets/templates/themes/gothic/palette.config.json +371 -0
  174. package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +51 -0
  175. package/assets/templates/themes/matcha/matchaPalettes.generated.receipt.json +1502 -0
  176. package/assets/templates/themes/matcha/matchaPalettes.generated.ts +501 -0
  177. package/assets/templates/themes/matcha/matchaPalettes.ts +21 -0
  178. package/assets/templates/themes/matcha/matchaTheme.ts +164 -103
  179. package/assets/templates/themes/matcha/palette.config.json +448 -0
  180. package/assets/templates/themes/stone/palette.config.json +262 -0
  181. package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +51 -0
  182. package/assets/templates/themes/stone/stonePalettes.generated.receipt.json +840 -0
  183. package/assets/templates/themes/stone/stonePalettes.generated.ts +501 -0
  184. package/assets/templates/themes/stone/stoneTheme.ts +190 -207
  185. package/assets/templates/themes/y2k/palette.config.json +166 -0
  186. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +54 -0
  187. package/assets/templates/themes/y2k/y2kPalettes.generated.receipt.json +872 -0
  188. package/assets/templates/themes/y2k/y2kPalettes.generated.ts +550 -0
  189. package/assets/templates/themes/y2k/y2kPalettes.ts +257 -0
  190. package/assets/templates/themes/y2k/y2kTheme.ts +164 -391
  191. package/authoring/codemod/codemod.doc.mjs +1 -1
  192. package/authoring/config/config.doc.mjs +4 -4
  193. package/authoring/debug/parse.d.mts +1 -1
  194. package/authoring/discover/discover.doc.mjs +1 -1
  195. package/authoring/doctypes/_schema.d.mts +4 -0
  196. package/authoring/doctypes/_schema.mjs +4 -0
  197. package/authoring/doctypes/reference/type.ts +14 -2
  198. package/authoring/gap-report/gap-report.doc.mjs +1 -1
  199. package/authoring/integration/integration.doc.mjs +6 -6
  200. package/clients/cli/commands/discover.mjs +1 -1
  201. package/clients/cli/commands/discover.sources.test.mjs +6 -0
  202. package/clients/cli/commands/docs.doc.mjs +1 -1
  203. package/clients/cli/commands/docs.mjs +27 -2
  204. package/clients/cli/commands/docs.test.mjs +1 -1
  205. package/clients/cli/commands/doctor-integration-docs.doc.mjs +1 -1
  206. package/clients/cli/commands/doctor.doc.mjs +13 -1
  207. package/clients/cli/commands/doctor.mjs +25 -9
  208. package/clients/cli/commands/integration-check.doc.mjs +11 -0
  209. package/clients/cli/commands/integration-check.test.mjs +36 -3
  210. package/clients/cli/commands/integration-pack.doc.mjs +1 -1
  211. package/clients/cli/commands/integration-verify.doc.mjs +1 -1
  212. package/clients/cli/commands/integration.mjs +15 -3
  213. package/clients/cli/commands/theme-targets.doc.mjs +1 -1
  214. package/clients/cli/commands/upgrade.doc.mjs +2 -2
  215. package/clients/cli/lib/define-command.mjs +5 -3
  216. package/foundation/agent-docs/agent-docs.d.mts +14 -2
  217. package/foundation/agent-docs/agent-docs.mjs +65 -4
  218. package/foundation/agent-docs/agent-docs.test.mjs +107 -0
  219. package/foundation/discovery/docs-discovery.d.mts +93 -2
  220. package/foundation/discovery/docs-discovery.mjs +237 -8
  221. package/foundation/discovery/runner-allowlist.d.mts +2 -0
  222. package/foundation/discovery/runner-allowlist.mjs +4 -0
  223. package/foundation/discovery/runner-commands.d.mts +29 -13
  224. package/foundation/discovery/runner-commands.mjs +253 -17
  225. package/foundation/discovery/stray-pointers.mjs +11 -5
  226. package/foundation/discovery/stray-pointers.test.mjs +6 -0
  227. package/foundation/doc-compiler/compile.mjs +8 -1
  228. package/foundation/doc-compiler/doc-loads.test.mjs +3 -0
  229. package/foundation/doc-compiler/doc-syntax.d.mts +194 -0
  230. package/foundation/doc-compiler/doc-syntax.mjs +739 -0
  231. package/foundation/doc-compiler/doc-syntax.test.mjs +383 -0
  232. package/foundation/doc-compiler/links.d.mts +13 -16
  233. package/foundation/doc-compiler/links.mjs +40 -7
  234. package/foundation/doc-compiler/tree.d.mts +5 -0
  235. package/foundation/doc-compiler/tree.mjs +9 -0
  236. package/foundation/env/package-manager.d.mts +18 -0
  237. package/foundation/env/package-manager.mjs +40 -0
  238. package/foundation/integrations/cli-requirement.d.mts +29 -0
  239. package/foundation/integrations/cli-requirement.mjs +47 -0
  240. package/foundation/integrations/cli-requirement.test.mjs +23 -2
  241. package/foundation/response/error-codes.test.mjs +9 -0
  242. package/foundation/response/response-types.doc.mjs +11 -11
  243. package/foundation/response/response-types.doc.test.mjs +29 -0
  244. package/package.json +9 -9
@@ -29,37 +29,37 @@ export const docs = {
29
29
  headers: ['Command', 'Proves', 'Exits 1 when', 'Only warns when'],
30
30
  rows: [
31
31
  [
32
- '`astryx doctor integration validate`',
33
- 'The manifest loads, each root holds contributions the CLI can read, and each doc matches its authoring type. Notes, which fail nothing, list a malformed `cliCommand` and each command a topic writes with a package runner (`runner_command`)',
32
+ '`{@command doctor integration validate}`',
33
+ 'The manifest loads, each root holds contributions the CLI can read, and each doc matches its authoring type. Notes list a malformed `cliCommand` (`invalid_cli_command`) and, for each topic, a command written with a package runner (`runner_command`), bare (`plain_command`) or for one package manager (`package_manager_command`), and a token that does not parse (`doc_token`; see {@link generic:doc-syntax}). Notes fail nothing by default; `integration check --strict --next` fails on the ones marked `next`, and the next minor release counts them',
34
34
  'A declared root is missing (`missing_root`), a contribution does not load (`invalid_doc`, `invalid_component`, `invalid_theme`), or two templates in the package replace one Core id (`ambiguous_template_replacement`)',
35
35
  "The manifest has a key this CLI does not know (`unknown_manifest_key`), or a doc field does not match the doc's authoring type: a field the type does not have, a missing required field, or a value outside the field's type. It also warns on what no reader can serve: a prop listed twice (`duplicate_prop`), a `propDescriptions` key that names no documented prop (`unknown_translated_prop`), a section with no content (`empty_section`), two sections of a topic with one key (`duplicate_section_key`), or a `.doc.zh.mjs` or `.doc.dense.mjs` overlay beside no topic file (`orphan_doc_overlay`). Since 0.7.3 it also lists, from source and without failing, what the package tells apps to import that they cannot: a component's import (the doc's `import`, or the one the CLI derives) or a template's public import whose subpath package.json `exports` does not declare (`component_import_not_exported`, `template_import_not_exported`) or that names another package (`component_import_other_package`); an example that imports an undeclared subpath (`example_import_not_exported`); a template that imports a path outside the templates root (`template_import_outside_root`) or a path its package or Core does not export (`template_private_import`). It lists the same way a component's import whose module does not export the component (`component_import_missing_name`), an example or a template that imports a name its package does not export (`example_import_missing_name`, `template_import_missing_name`), and a template source with no default export (`template_no_default_export`). Each is a note, printed with its fix, that fails `--strict` from the next minor; an import it cannot judge, such as an `exports` target not built yet or a deep path into a `dist/` not built yet, is listed under `publicImports` as not checked. It checks docs with your installed `typescript`, or, where that is missing or has no JavaScript compiler API (TypeScript 7), with an installed `@typescript/typescript6`; without either, it prints `[skip] Docs not type-checked`. With no `astryx.integration.mjs` it prints a hint and exits 0",
36
36
  ],
37
37
  [
38
- '`astryx doctor integration components`',
38
+ '`{@command doctor integration components}`',
39
39
  "No component name clashes with a Core component, each `replaces` names one Core component, and each component doc's props match the component's TypeScript props",
40
40
  'Core is not installed (`core_not_found`). In a package that declares the CLI range that turns replacement on, a `replaces` target is missing (`missing_component_replacement_target`) or invalid (`invalid_component_replacement`), or two components replace one Core component (`ambiguous_component_replacement`)',
41
41
  'A name clashes with Core, a component sets `replaces` in a package without that range (`inactive_component_replacement`, plus any missing, invalid, or duplicate `replaces` reported as a warning), or a documented prop differs from the code: it is missing there (`not_in_code`), the doc omits a prop the package declares (`not_in_doc`), or its `required` (`required_mismatch`), type (`type_mismatch`), or literal `default` (`default_mismatch`) disagrees, or a `{@link}` in a component doc names no doc (`invalid_doc_graph`). It reads props with your installed `typescript`; without it, it prints `[skip] Props not compared`',
42
42
  ],
43
43
  [
44
- '`astryx doctor integration templates`',
44
+ '`{@command doctor integration templates}`',
45
45
  'Each `replaces` names a Core template of the same type',
46
46
  'A `replaces` target is missing (`missing_template_replacement_target`) or of the other type (`invalid_template_replacement`), or two templates replace one id (`ambiguous_template_replacement`)',
47
47
  'A template id matches a Core id without `replaces`',
48
48
  ],
49
49
  [
50
- '`astryx doctor integration docs`',
50
+ '`{@command doctor integration docs}`',
51
51
  'Your docs tree, every link, topic names against Core, passages two topics repeat word for word, padding phrases and low-density topics, and written pointers to docs',
52
52
  'A topic takes a Core topic name without `replaces` or `extends`, a doc is invalid (`invalid_doc`), or a namespace or placement fails, which hides the doc (`invalid_doc_graph`)',
53
- 'A link names no doc (`invalid_doc_graph`), two topics repeat a passage word for word (`copied_passage`), prose pads with a listed phrase or falls under the density floor (`doc_fluff`), or prose, a description or summary, or the text of a component doc writes `astryx docs <name>` where a link would be checked (`stray_doc_pointer`)',
53
+ 'A link names no doc (`invalid_doc_graph`), two topics repeat a passage word for word (`copied_passage`), prose pads with a listed phrase or falls under the density floor (`doc_fluff`), or prose, a description or summary, or the text of a component doc writes `{@command docs <name>}` where a link would be checked (`stray_doc_pointer`)',
54
54
  ],
55
55
  [
56
- '`astryx integration check`',
56
+ '`{@command integration check}`',
57
57
  'Everything the four `doctor integration` checks prove, in one command, for your build',
58
58
  'Any of the four would exit 1 on its own. With `--strict`, also any warning, and any check that did not run, such as a package with no `astryx.integration.*`',
59
59
  'Anything the four warn about, unless you pass `--strict`',
60
60
  ],
61
61
  [
62
- '`astryx integration verify`',
62
+ '`{@command integration verify}`',
63
63
  'The packed package holds every file, shows the same contributions, resolves every public import, and declares the CLI it needs',
64
64
  'Anything `validate` fails on, no manifest, a file left out of the `.tgz` file, an import that does not resolve, or a missing CLI peer',
65
65
  'Anything `validate` warns about, or a component sets `replaces` and the package does not declare the CLI range that turns it on (`component_replaces_needs_cli`)',
@@ -68,7 +68,7 @@ export const docs = {
68
68
  },
69
69
  {
70
70
  type: 'prose',
71
- text: 'Pass a package name, such as `astryx doctor integration validate @acme/astryx-widgets`, to check an installed copy from an app instead. To fix a props finding, see {@link generic:check-the-props}.',
71
+ text: 'Pass a package name, such as `{@command doctor integration validate @acme/astryx-widgets}`, to check an installed copy from an app instead. To fix a props finding, see {@link generic:check-the-props}.',
72
72
  },
73
73
  ],
74
74
  },
@@ -93,7 +93,7 @@ export const docs = {
93
93
  '`--strict` also exits 1 on any warning and on any check that did not run. Without it, warnings keep exit code 0: use that while you fix the warnings a package already has.',
94
94
  'Its exit codes and JSON are a contract for your build: a new check, or a new failure code, joins only in a minor release that names it in the release notes. A patch can still ship a Core component, template, or CLI topic whose name conflicts with one of yours.',
95
95
  '`integration verify` runs `validate` but none of the other three: a Core name clash, a `replaces` that names no Core template, a topic that takes a Core name, or a hidden guide still passes it. Run both before you publish: `astryx integration check --strict && astryx integration verify`.',
96
- 'Bare `astryx doctor` in the package also warns about a doc section over 32 KB, which no check above measures.',
96
+ 'Bare `{@command doctor}` in the package also warns about a doc section over 32 KB, which no check above measures.',
97
97
  ],
98
98
  },
99
99
  ],
@@ -110,7 +110,7 @@ export const docs = {
110
110
  type: 'list',
111
111
  style: 'ordered',
112
112
  items: [
113
- 'It runs `npm pack` the way `npm publish` would, including your `prepack` script.',
113
+ 'It runs `{@pm-only npm "the tarball the registry receives" pack}` the way `{@pm-only npm "npm is the client the registry publishes from" publish}` would, including your `prepack` script.',
114
114
  'It checks that every contribution file is in the `.tgz` file. A root missing from `files` fails with `Add "templates" to "files" in package.json.`',
115
115
  'It lists the components, templates, themes, docs, and codemods the temporary app sees, and compares them with your source.',
116
116
  "It resolves each component's `import`, and each template's public import, the way Node does, and checks that the module exports the component under the name its doc documents, or a default export for a template. A type-only export does not count.",
@@ -83,7 +83,7 @@ export const docs = {
83
83
  content: [
84
84
  {
85
85
  type: 'prose',
86
- text: 'Some agent machines keep the home folder across restarts but not system folders. A global install there disappears on restart while the agent guide in the home folder stays, so agents are told to run a global astryx command that is gone; the guide says to run the command that installed the CLI, such as `npm i -g @astryxdesign/cli`, when that command is not found, and `astryx doctor` names the same step. To keep the CLI across restarts, install it into a folder in your home and put its `bin` folder on your PATH, as for a permission error ({@link generic:install-once}), or run that command when the machine starts.',
86
+ text: 'Some agent machines keep the home folder across restarts but not system folders. A global install there disappears on restart while the agent guide in the home folder stays, so agents are told to run a global astryx command that is gone; the guide says to run the command that installed the CLI, such as `{@pm install @astryxdesign/cli --global}`, when that command is not found, and `astryx doctor` names the same step. To keep the CLI across restarts, install it into a folder in your home and put its `bin` folder on your PATH, as for a permission error ({@link generic:install-once}), or run that command when the machine starts.',
87
87
  },
88
88
  ],
89
89
  },
@@ -29,7 +29,7 @@ export const docs = {
29
29
  content: [
30
30
  {
31
31
  type: 'prose',
32
- text: "The CLI ends most answers with the next command to run: a hint, an error fix, a Doctor fix, or a doc example. By default each one starts with a command that reaches the release that answered: what the app's package manager runs, such as `pnpm exec astryx` or `yarn astryx`, when the app's own CLI answered, and otherwise the CLI package pinned to that release, such as `npx @astryxdesign/cli@0.7.2`.",
32
+ text: "The CLI ends most answers with the next command to run: a hint, an error fix, a Doctor fix, or a doc example. By default each one starts with a command that reaches the release that answered: what the app's package manager runs, such as `pnpm exec astryx` or `yarn astryx`, when the app's own CLI answered, and otherwise the CLI package pinned to that release, such as `{@pm dlx @astryxdesign/cli@0.7.2}`.",
33
33
  },
34
34
  {
35
35
  type: 'prose',
@@ -79,7 +79,7 @@ export default {
79
79
  items: [
80
80
  'The `cliCommand` of the packages the app loads, when they name one command.',
81
81
  'The command a host tool names when it runs the CLI for the app. Nothing in a plain project names one.',
82
- "A command that reaches the release that answered: what the app's package manager runs when the app's own CLI answered, such as `pnpm exec astryx` or `yarn astryx`; `astryx` outside a project when the CLI installed for the computer answered; otherwise the CLI package pinned to that release, such as `npx @astryxdesign/cli@0.7.2` (see {@link generic:who-answers}).",
82
+ "A command that reaches the release that answered: what the app's package manager runs when the app's own CLI answered, such as `pnpm exec astryx` or `yarn astryx`; `astryx` outside a project when the CLI installed for the computer answered; otherwise the CLI package pinned to that release, such as `{@pm dlx @astryxdesign/cli@0.7.2}` (see {@link generic:who-answers}).",
83
83
  ],
84
84
  },
85
85
  {
@@ -94,7 +94,7 @@ export default {
94
94
  content: [
95
95
  {
96
96
  type: 'prose',
97
- text: "If two packages an app loads set different commands, the CLI uses neither: it prints commands with what the app's package manager runs, even when a host tool named a command. `astryx doctor` warns in its `cli-command` check and names both packages:",
97
+ text: "If two packages an app loads set different commands, the CLI uses neither: it prints commands with what the app's package manager runs, even when a host tool named a command. `{@command doctor}` warns in its `cli-command` check and names both packages:",
98
98
  },
99
99
  {
100
100
  type: 'code',
@@ -115,16 +115,16 @@ message: Loaded integrations declare different CLI commands: @acme/astryx-widget
115
115
  content: [
116
116
  {
117
117
  type: 'prose',
118
- text: 'An invalid value is ignored, and the rest of your manifest still loads. `astryx doctor integration validate` reports it as `invalid_cli_command`. A valid `cliCommand` is one line of plain text without spaces at either end, at most 120 characters.',
118
+ text: 'An invalid value is ignored, and the rest of your manifest still loads. `{@command doctor integration validate}` reports it as `invalid_cli_command`. A valid `cliCommand` is one line of plain text without spaces at either end, at most 120 characters.',
119
119
  },
120
120
  {
121
121
  type: 'prose',
122
- text: "In an app that installs your package, `astryx doctor` passes its `cli-command` check and names your package as the one that set the command. A CLI released before this field reports `cliCommand` as an unknown key and prints the package manager's command.",
122
+ text: "In an app that installs your package, `{@command doctor}` passes its `cli-command` check and names your package as the one that set the command. A CLI released before this field reports `cliCommand` as an unknown key and prints the package manager's command.",
123
123
  },
124
124
  {
125
125
  type: 'code',
126
126
  lang: 'bash',
127
- code: 'astryx doctor integration validate\n# In an app that installs the package\nastryx doctor',
127
+ code: '{@command doctor integration validate}\n# In an app that installs the package\n{@command doctor}',
128
128
  },
129
129
  ],
130
130
  },
@@ -14,7 +14,7 @@ export const docs = {
14
14
  category: 'guide',
15
15
  keywords: ['breaking change', 'migrate apps', 'integration codemod'],
16
16
  description:
17
- 'Ship codemods that `astryx upgrade` runs to migrate app code, and know which of them an app runs.',
17
+ 'Ship codemods that `{@command upgrade}` runs to migrate app code, and know which of them an app runs.',
18
18
  sections: [
19
19
  {
20
20
  id: 'add-a-codemod',
@@ -22,12 +22,12 @@ export const docs = {
22
22
  content: [
23
23
  {
24
24
  type: 'prose',
25
- text: '`integration add codemod` writes a codemod into a folder named after a version. Apps run it with `astryx upgrade` to migrate their code.',
25
+ text: '`integration add codemod` writes a codemod into a folder named after a version. Apps run it with `{@command upgrade}` to migrate their code.',
26
26
  },
27
27
  {
28
28
  type: 'code',
29
29
  lang: 'bash',
30
- code: 'astryx integration add codemod rename-delay --to 0.7.0',
30
+ code: '{@command integration add codemod rename-delay --to 0.7.0}',
31
31
  },
32
32
  {
33
33
  type: 'code',
@@ -92,7 +92,7 @@ export default {
92
92
  content: [
93
93
  {
94
94
  type: 'prose',
95
- text: "Two rules decide whether an app's `astryx upgrade` runs your codemods: the app's Core versions, and whether the app names your package.",
95
+ text: "Two rules decide whether an app's `{@command upgrade}` runs your codemods: the app's Core versions, and whether the app names your package.",
96
96
  },
97
97
  {
98
98
  type: 'list',
@@ -110,15 +110,15 @@ export default {
110
110
  content: [
111
111
  {
112
112
  type: 'prose',
113
- text: 'An app previews codemods with `astryx upgrade` and writes the changes with `--apply`. Without `--apply`, nothing on disk changes.',
113
+ text: 'An app previews codemods with `{@command upgrade}` and writes the changes with `--apply`. Without `--apply`, nothing on disk changes.',
114
114
  },
115
115
  {
116
116
  type: 'code',
117
117
  lang: 'bash',
118
118
  code: `# Preview each codemod and the files it would change
119
- astryx upgrade --from 0.6.3 --integration @acme/astryx-widgets
119
+ {@command upgrade --from 0.6.3 --integration @acme/astryx-widgets}
120
120
  # Write the changes
121
- astryx upgrade --from 0.6.3 --integration @acme/astryx-widgets --apply`,
121
+ {@command upgrade --from 0.6.3 --integration @acme/astryx-widgets --apply}`,
122
122
  },
123
123
  {
124
124
  type: 'code',
@@ -93,7 +93,7 @@ export default {
93
93
  },
94
94
  {
95
95
  type: 'prose',
96
- text: "The public module named by `import` must export every component or hook named by a full entry. Apps then list, search and open each component in the family by its own name. A full entry the module does not export is not listed, and `integration verify` does not report it: check the family with `astryx component --list`. When `import` names output your pack lifecycle builds (such as `dist`), the members are listed once that output exists, and `integration verify` compares them as they are listed after the pack builds it.",
96
+ text: 'The public module named by `import` must export every component or hook named by a full entry. Apps then list, search and open each component in the family by its own name. A full entry the module does not export is not listed, and `integration verify` does not report it: check the family with `{@command component --list}`. When `import` names output your pack lifecycle builds (such as `dist`), the members are listed once that output exists, and `integration verify` compares them as they are listed after the pack builds it.',
97
97
  },
98
98
  {
99
99
  type: 'prose',
@@ -41,7 +41,7 @@ export const docs = {
41
41
  },
42
42
  {
43
43
  type: 'prose',
44
- text: "The file name still opens the doc. A name that Core or another doc's file already has stays theirs, and so does a Core name your package replaces: with `Badge.doc.mjs` naming `AcmeBadge`, `astryx component Badge` opens Core's `Badge`, and `--package` with your package name reaches yours.",
44
+ text: "The file name still opens the doc. A name that Core or another doc's file already has stays theirs, and so does a Core name your package replaces: with `Badge.doc.mjs` naming `AcmeBadge`, `{@command component Badge}` opens Core's `Badge`, and `--package` with your package name reaches yours.",
45
45
  },
46
46
  ],
47
47
  },
@@ -56,7 +56,7 @@ export const docs = {
56
56
  {
57
57
  type: 'code',
58
58
  lang: 'bash',
59
- code: 'astryx integration verify',
59
+ code: '{@command integration verify}',
60
60
  },
61
61
  {
62
62
  type: 'list',
@@ -10,8 +10,9 @@ export const docs = {
10
10
  type: 'generic',
11
11
  name: 'component-lookups',
12
12
  placement: {parent: 'namespace:cli', slot: 'guides', order: 5},
13
- title: 'Looking up components',
13
+ title: 'Component lookups',
14
14
  category: 'guide',
15
+ keywords: ['look up', 'looking up components', 'lookup', 'batch'],
15
16
  description:
16
17
  'Look up one or several exact component identities, choose a focused projection, and handle complete batch receipts.',
17
18
  sections: [
@@ -22,13 +23,13 @@ export const docs = {
22
23
  content: [
23
24
  {
24
25
  type: 'prose',
25
- text: '`astryx component` accepts exact selectors as a variadic positional argument. With no selector it browses the catalog. With one selector it keeps the normal single-component response. With two or more it prints one complete ordered batch receipt.',
26
+ text: '`{@command component}` accepts exact selectors as a variadic positional argument. With no selector it browses the catalog. With one selector it keeps the normal single-component response. With two or more it prints one complete ordered batch receipt.',
26
27
  },
27
28
  {
28
29
  type: 'code',
29
30
  lang: 'bash',
30
31
  label: 'Several component docs',
31
- code: 'astryx component Button Badge Text\nastryx --json component Button Badge Text',
32
+ code: '{@command component Button Badge Text}\nastryx --json component Button Badge Text',
32
33
  },
33
34
  {
34
35
  type: 'prose',
@@ -46,7 +47,7 @@ export const docs = {
46
47
  type: 'code',
47
48
  lang: 'bash',
48
49
  label: 'Focused batch lookups',
49
- code: 'astryx --json component Button Card --props\nastryx component Button Card --source\nastryx component Button Card --showcase\nastryx component Button Card --blocks\nastryx component Button Card --detail compact\nastryx component Button Card --lang dense\nastryx component Button Card --package @astryxdesign/core',
50
+ code: 'astryx --json component Button Card --props\n{@command component Button Card --source}\n{@command component Button Card --showcase}\n{@command component Button Card --blocks}\n{@command component Button Card --detail compact}\n{@command component Button Card --lang dense}\n{@command component Button Card --package @astryxdesign/core}',
50
51
  },
51
52
  ],
52
53
  },
@@ -75,7 +76,7 @@ export const docs = {
75
76
  },
76
77
  {
77
78
  type: 'prose',
78
- text: '`astryx discover` remains free-text package discovery. Its words form one query; they are not component batch selectors.',
79
+ text: '`{@command discover}` remains free-text package discovery. Its words form one query; they are not component batch selectors.',
79
80
  },
80
81
  ],
81
82
  },
@@ -32,7 +32,7 @@ export const docs = {
32
32
  'link skills',
33
33
  ],
34
34
  description:
35
- 'Your global install keeps one short Astryx skill in your home folder and links it into the folders agent tools read, so agents anywhere know Astryx is there. `astryx init --user` writes it now or turns it off.',
35
+ 'Your global install keeps one short Astryx skill in your home folder and links it into the folders agent tools read, so agents anywhere know Astryx is there. `{@command init --user}` writes it now or turns it off.',
36
36
  sections: [
37
37
  {
38
38
  id: 'what',
@@ -40,7 +40,7 @@ export const docs = {
40
40
  content: [
41
41
  {
42
42
  type: 'prose',
43
- text: "A project's agent docs reach only agents working in that project. Your global install also keeps one skill file, `~/.agents/skills/astryx/SKILL.md`, which most coding agents read. It tells agents that Astryx is on this computer, when it is relevant (building or changing UI), and to start with `astryx search`. It names no version, so it never goes stale. Inside a project, the project's own agent docs come first.",
43
+ text: "A project's agent docs reach only agents working in that project. Your global install also keeps one skill file, `~/.agents/skills/astryx/SKILL.md`, which most coding agents read. It tells agents that Astryx is on this computer, when it is relevant (building or changing UI), and to start with `{@command search}`. It names no version, so it never goes stale. Inside a project, the project's own agent docs come first.",
44
44
  },
45
45
  {
46
46
  type: 'prose',
@@ -83,7 +83,7 @@ export const docs = {
83
83
  },
84
84
  {
85
85
  type: 'prose',
86
- text: "Astryx never replaces anything it did not create at one of these folders, and never writes a folder another tool manages; `astryx doctor` names any it skipped, and any link whose skill folder is missing, as in a container that mounts only one agent's folder.",
86
+ text: "Astryx never replaces anything it did not create at one of these folders, and never writes a folder another tool manages; `{@command doctor}` names any it skipped, and any link whose skill folder is missing, as in a container that mounts only one agent's folder.",
87
87
  },
88
88
  ],
89
89
  },
@@ -95,7 +95,7 @@ export const docs = {
95
95
  type: 'list',
96
96
  style: 'unordered',
97
97
  items: [
98
- "Cloud and background agents read only the repository, so the project's own agent docs, the block `astryx init` writes into AGENTS.md or CLAUDE.md, are what reach them.",
98
+ "Cloud and background agents read only the repository, so the project's own agent docs, the block `{@command init}` writes into AGENTS.md or CLAUDE.md, are what reach them.",
99
99
  'Apps that take an uploaded skill: upload `~/.agents/skills/astryx/SKILL.md`, or a zip of its folder.',
100
100
  ],
101
101
  },
@@ -132,16 +132,16 @@ export const docs = {
132
132
  {
133
133
  type: 'code',
134
134
  lang: 'bash',
135
- code: 'astryx init --user\nastryx init --user --remove-agents',
135
+ code: '{@command init --user}\n{@command init --user --remove-agents}',
136
136
  },
137
137
  {
138
138
  type: 'list',
139
139
  style: 'unordered',
140
140
  items: [
141
141
  '`init --user` writes the file and the links now.',
142
- '`--remove-agents` removes the file and every link Astryx made, and turns it off until you run `astryx init --user` again.',
142
+ '`--remove-agents` removes the file and every link Astryx made, and turns it off until you run `{@command init --user}` again.',
143
143
  'A file you edited is never overwritten or removed; delete it to get the current text.',
144
- 'Outside a project, `astryx doctor` says whether the skill is there, current, edited, or turned off, and where it is linked.',
144
+ 'Outside a project, `{@command doctor}` says whether the skill is there, current, edited, or turned off, and where it is linked.',
145
145
  ],
146
146
  },
147
147
  ],
@@ -37,7 +37,7 @@ export const docs = {
37
37
  {
38
38
  type: 'code',
39
39
  lang: 'bash',
40
- code: 'npm i -g @astryxdesign/cli @acme/widgets\n# or: pnpm add -g · yarn global add · bun add -g',
40
+ code: '{@pm install @astryxdesign/cli @acme/widgets --global}',
41
41
  },
42
42
  {
43
43
  type: 'prose',
@@ -51,7 +51,7 @@ export const docs = {
51
51
  content: [
52
52
  {
53
53
  type: 'prose',
54
- text: 'In a folder outside any project, Astryx loads each integration installed next to your global install the way a project loads its own: its components, templates, docs, themes, and discover source show up, and a command name it declares starts the commands Astryx prints. One whose `@astryxdesign/core` or `@astryxdesign/cli` peer range leaves out your global version is skipped, and `astryx doctor` says why.',
54
+ text: 'In a folder outside any project, Astryx loads each integration installed next to your global install the way a project loads its own: its components, templates, docs, themes, and discover source show up, and a command name it declares starts the commands Astryx prints. One whose `@astryxdesign/core` or `@astryxdesign/cli` peer range leaves out your global version is skipped, and `{@command doctor}` says why.',
55
55
  },
56
56
  ],
57
57
  },
@@ -61,7 +61,7 @@ export const docs = {
61
61
  content: [
62
62
  {
63
63
  type: 'prose',
64
- text: "A project's answers must match what it installs: a component from a package it does not install would not build. So inside a project, an integration installed only globally adds nothing. `astryx discover` lists it among the packages the project could add, with the project's install command, when it supports the project's version and loads. When the project installs the same integration, the project's copy is the one used.",
64
+ text: "A project's answers must match what it installs: a component from a package it does not install would not build. So inside a project, an integration installed only globally adds nothing. `{@command discover}` lists it among the packages the project could add, with the project's install command, when it supports the project's version and loads. When the project installs the same integration, the project's copy is the one used.",
65
65
  },
66
66
  ],
67
67
  },
@@ -73,8 +73,8 @@ export const docs = {
73
73
  type: 'list',
74
74
  style: 'unordered',
75
75
  items: [
76
- 'Outside a project, `astryx doctor` lists the global integrations it uses and warns about each it skips.',
77
- 'Inside a project, `astryx doctor` and `astryx discover` list the ones the project could add.',
76
+ 'Outside a project, `{@command doctor}` lists the global integrations it uses and warns about each it skips.',
77
+ 'Inside a project, `{@command doctor}` and `{@command discover}` list the ones the project could add.',
78
78
  ],
79
79
  },
80
80
  ],
@@ -85,7 +85,7 @@ export default {
85
85
  content: [
86
86
  {
87
87
  type: 'prose',
88
- text: 'Export a `gapReport` handler, and `astryx gap-report` in an app sends it each gap report, such as a missing component or variant. The handler files the report and returns a receipt.',
88
+ text: 'Export a `gapReport` handler, and `{@command gap-report}` in an app sends it each gap report, such as a missing component or variant. The handler files the report and returns a receipt.',
89
89
  },
90
90
  {
91
91
  type: 'code',
@@ -127,7 +127,7 @@ export const gapReport = {
127
127
  {
128
128
  type: 'code',
129
129
  lang: 'bash',
130
- code: "astryx gap-report AcmeCarousel --category missing_variant --reason 'Need a vertical layout'",
130
+ code: "{@command gap-report AcmeCarousel --category missing_variant --reason 'Need a vertical layout'}",
131
131
  },
132
132
  {
133
133
  type: 'code',
@@ -173,7 +173,7 @@ message: Rerun with --confirm-public to file this report.`,
173
173
  content: [
174
174
  {
175
175
  type: 'prose',
176
- text: 'When an app loads packages naming their own `issuesUrl`, a report can go to the default (the handlers, or the fallback above) or to one of those packages. `astryx gap-report --list-categories` and the receipt of a report filed without `--to` list every destination, with a line telling the agent to ask the person.',
176
+ text: 'When an app loads packages naming their own `issuesUrl`, a report can go to the default (the handlers, or the fallback above) or to one of those packages. `{@command gap-report --list-categories}` and the receipt of a report filed without `--to` list every destination, with a line telling the agent to ask the person.',
177
177
  },
178
178
  {
179
179
  type: 'list',
@@ -45,7 +45,7 @@ export const oceanTheme = defineTheme({
45
45
  },
46
46
  {
47
47
  type: 'prose',
48
- text: 'Local imports must stay inside the theme folder. One that leaves it, such as `../../shared/colors`, fails with `invalid_theme`, and every theme in the package disappears from `theme list`. `astryx theme template` writes a file that explains every `defineTheme` field. For the full token set and component theming, read {@link generic:author-a-theme}.',
48
+ text: 'Local imports must stay inside the theme folder. One that leaves it, such as `../../shared/colors`, fails with `invalid_theme`, and every theme in the package disappears from `theme list`. `{@command theme template}` writes a file that explains every `defineTheme` field. For the full token set and component theming, read {@link generic:author-a-theme}.',
49
49
  },
50
50
  ],
51
51
  },
@@ -51,7 +51,7 @@ export const docs = {
51
51
  {
52
52
  type: 'code',
53
53
  lang: 'bash',
54
- code: 'astryx component AcmeCarousel',
54
+ code: '{@command component AcmeCarousel}',
55
55
  },
56
56
  ],
57
57
  };
@@ -0,0 +1,219 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs authoring/building-blocks/docs/doc-syntax`: the
5
+ * tokens a doc writes for what the CLI shows each reader differently: a link,
6
+ * an Astryx command, a package-manager step, and a step only one package
7
+ * manager can do.
8
+ */
9
+
10
+ /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
11
+ export const docs = {
12
+ type: 'generic',
13
+ name: 'doc-syntax',
14
+ placement: {parent: 'namespace:docs', slot: 'guides', order: 15},
15
+ title: 'Doc syntax',
16
+ category: 'guide',
17
+ description:
18
+ 'The tokens a doc writes for links, Astryx commands and package-manager steps, which the CLI shows each reader in their own package manager.',
19
+ keywords: [
20
+ 'doc syntax',
21
+ 'tokens',
22
+ 'package manager',
23
+ 'npm',
24
+ 'pnpm',
25
+ 'yarn',
26
+ 'bun',
27
+ 'install command',
28
+ 'pm token',
29
+ 'command token',
30
+ ],
31
+ sections: [
32
+ {
33
+ id: 'the-tokens',
34
+ title: 'The tokens',
35
+ content: [
36
+ {
37
+ type: 'prose',
38
+ text: 'A doc never names a package manager or a runner: readers use npm, pnpm, Yarn or Bun, and run the CLI through their own. Write a token instead, and the CLI shows each reader the command they run. Tokens work in prose, list items, table cells and code blocks.',
39
+ },
40
+ {
41
+ type: 'table',
42
+ headers: ['Write', 'For', 'A pnpm reader sees'],
43
+ rows: [
44
+ [
45
+ '`{@@link generic:deploying}`',
46
+ 'another doc',
47
+ 'the command that opens that doc',
48
+ ],
49
+ [
50
+ '`{@@command docs theme}`',
51
+ 'an Astryx command',
52
+ '`pnpm exec astryx docs theme`',
53
+ ],
54
+ [
55
+ '`{@@pm install @acme/widgets --dev}`',
56
+ 'a package-manager step',
57
+ '`pnpm add -D @acme/widgets`',
58
+ ],
59
+ [
60
+ '`{@@pm-only npm "why" pkg set name=x}`',
61
+ 'a step only one package manager can do',
62
+ '`npm pkg set name=x` (only with npm: why)',
63
+ ],
64
+ [
65
+ '`{@@@pm install x}`',
66
+ 'a token shown as written',
67
+ '`{@@pm install x}`',
68
+ ],
69
+ ],
70
+ },
71
+ {
72
+ type: 'prose',
73
+ text: 'In prose a token prints as a code span; in a code span or code block it prints as the command alone. `--json` carries the same commands, a `{@@command}` token as the bare command that starts with astryx, which a reader that shows the doc prefixes itself.',
74
+ },
75
+ ],
76
+ },
77
+ {
78
+ id: 'package-manager-steps',
79
+ title: 'Package-manager steps',
80
+ content: [
81
+ {
82
+ type: 'prose',
83
+ text: "A `{@@pm}` token is a verb, its names, and the flags it takes. Each row below runs the same way in every package manager; the CLI writes the reader's own.",
84
+ },
85
+ {
86
+ type: 'table',
87
+ headers: ['Token', 'npm', 'pnpm', 'Yarn', 'Bun'],
88
+ rows: [
89
+ [
90
+ '`{@@pm install}`',
91
+ '`npm install`',
92
+ '`pnpm install`',
93
+ '`yarn install`',
94
+ '`bun install`',
95
+ ],
96
+ [
97
+ '`{@@pm install x}`',
98
+ '`npm install x`',
99
+ '`pnpm add x`',
100
+ '`yarn add x`',
101
+ '`bun add x`',
102
+ ],
103
+ [
104
+ '`{@@pm install x --dev}`',
105
+ '`npm install -D x`',
106
+ '`pnpm add -D x`',
107
+ '`yarn add -D x`',
108
+ '`bun add -d x`',
109
+ ],
110
+ [
111
+ '`{@@pm install x --global}`',
112
+ '`npm install -g x`',
113
+ '`pnpm add -g x`',
114
+ '`yarn global add x` (Yarn 1); npm on Yarn 2 and newer',
115
+ '`bun add -g x`',
116
+ ],
117
+ [
118
+ '`{@@pm remove x}`',
119
+ '`npm uninstall x`',
120
+ '`pnpm remove x`',
121
+ '`yarn remove x`',
122
+ '`bun remove x`',
123
+ ],
124
+ [
125
+ '`{@@pm update x --latest}`',
126
+ '`npm install x@latest`',
127
+ '`pnpm update --latest x`',
128
+ '`yarn up x`',
129
+ '`bun update --latest x`',
130
+ ],
131
+ [
132
+ '`{@@pm run build --watch}`',
133
+ '`npm run build -- --watch`',
134
+ '`pnpm run build --watch`',
135
+ '`yarn run build --watch`',
136
+ '`bun run build --watch`',
137
+ ],
138
+ [
139
+ '`{@@pm exec tsc}`',
140
+ '`npx tsc`',
141
+ '`pnpm exec tsc`',
142
+ '`yarn run tsc`',
143
+ '`bunx tsc`',
144
+ ],
145
+ [
146
+ '`{@@pm dlx @astryxdesign/cli init}`',
147
+ '`npx @astryxdesign/cli init`',
148
+ '`pnpm dlx @astryxdesign/cli init`',
149
+ '`yarn dlx …` (`npx` on Yarn 1)',
150
+ '`bunx @astryxdesign/cli init`',
151
+ ],
152
+ [
153
+ '`{@@pm create vite}`',
154
+ '`npm create vite`',
155
+ '`pnpm create vite`',
156
+ '`yarn create vite`',
157
+ '`bun create vite`',
158
+ ],
159
+ ],
160
+ },
161
+ {
162
+ type: 'list',
163
+ style: 'unordered',
164
+ items: [
165
+ 'Flags: `--dev` and `--exact` with `install`, `--global` with `install` and `remove`, `--latest` with `update`. `--exact` takes one version, never a range: only npm pins a range.',
166
+ 'Everything after the name of a script (`run`), a binary (`exec`) or a package (`dlx`, `create`) is passed to it as written.',
167
+ '`{@@pm install x --global}` on pnpm needs `pnpm setup` once per computer.',
168
+ ],
169
+ },
170
+ ],
171
+ },
172
+ {
173
+ id: 'one-package-manager',
174
+ title: 'A step only one package manager can do',
175
+ content: [
176
+ {
177
+ type: 'prose',
178
+ text: 'Some commands exist in one package manager only, such as `npm pkg set` or `pnpm setup`. Write `{@@pm-only <manager> "<reason>" <command>}`: the manager is one of npm, pnpm, yarn, yarn-classic or bun, and the reason, in double quotes, is shown to readers beside the command. Use it only when no `{@@pm}` step does the same: doctor names a one-manager step that every package manager can run, with the `{@@pm}` token to write.',
179
+ },
180
+ ],
181
+ },
182
+ {
183
+ id: 'what-doctor-checks',
184
+ title: 'What doctor checks',
185
+ content: [
186
+ {
187
+ type: 'prose',
188
+ text: '`doctor integration validate`, and so `integration check`, lists each of these as a note with its file, line and the token to write. A note fails nothing today; the next minor release turns them into warnings, so `integration check --strict --next` fails on them now. Run it to fix them ahead.',
189
+ },
190
+ {
191
+ type: 'table',
192
+ headers: ['Note', 'When'],
193
+ rows: [
194
+ [
195
+ '`package_manager_command`',
196
+ 'a code span or shell line written for one package manager, such as `npm install -D x`',
197
+ ],
198
+ [
199
+ '`runner_command`',
200
+ 'an Astryx command written with a runner, such as `pnpm exec astryx docs`',
201
+ ],
202
+ [
203
+ '`plain_command`',
204
+ 'an Astryx command written bare, where `{@@command docs}` checks that the command exists',
205
+ ],
206
+ [
207
+ '`doc_token`',
208
+ 'a token that does not parse, or a name that is not a doc token',
209
+ ],
210
+ ],
211
+ },
212
+ {
213
+ type: 'prose',
214
+ text: "In global mode: outside a project, a `{@@command}` token prints the way your global install prints every command, and a `{@@pm}` step prints for npm unless the CLI detects another package manager. In a project, the project's own runner and package manager decide. See {@link namespace:global}.",
215
+ },
216
+ ],
217
+ },
218
+ ],
219
+ };