@astryxdesign/cli 0.7.4-canary.3f6ea7d → 0.7.4-canary.626f01e

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 (200) 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/docs/_adapter.d.mts +80 -0
  6. package/api/docs/_adapter.mjs +261 -11
  7. package/api/docs/detail/detail.mjs +8 -0
  8. package/api/docs/docOverlays.test.mjs +2 -1
  9. package/api/docs/docs.d.mts +16 -6
  10. package/api/docs/docs.doc.mjs +1 -1
  11. package/api/docs/docs.mjs +55 -6
  12. package/api/docs/docs.type.d.mts +28 -2
  13. package/api/docs/docs.type.mjs +13 -3
  14. package/api/docs/guide-route-targets.test.mjs +1002 -0
  15. package/api/docs/index/index.mjs +9 -0
  16. package/api/docs/integration-tree.test.mjs +22 -0
  17. package/api/docs/integrationDocs.test.mjs +85 -0
  18. package/api/docs/list/list.mjs +7 -1
  19. package/api/docs/node/node.mjs +9 -1
  20. package/api/docs/reference-blocks.test.mjs +1 -1
  21. package/api/doctor/built-checks.mjs +43 -13
  22. package/api/doctor/built-checks.test.mjs +29 -0
  23. package/api/doctor/doctor.doc.mjs +2 -2
  24. package/api/hook/list/list.d.mts +1 -1
  25. package/api/integration/_adapter.d.mts +11 -2
  26. package/api/integration/_adapter.mjs +30 -4
  27. package/api/integration/authoring-checks.mjs +29 -2
  28. package/api/integration/authoring-checks.test.mjs +131 -1
  29. package/api/integration/check/check.d.mts +4 -1
  30. package/api/integration/check/check.mjs +34 -4
  31. package/api/integration/check/check.test.mjs +49 -0
  32. package/api/integration/integration-check.type.d.mts +8 -0
  33. package/api/integration/integration-check.type.mjs +4 -1
  34. package/api/integration/integrationCheck.doc.mjs +8 -1
  35. package/api/integration/integrationDocConflicts.doc.mjs +1 -1
  36. package/api/integration/pack-check.mjs +65 -1
  37. package/api/integration/pack-check.test.mjs +63 -0
  38. package/api/integration/validate-integration-case-disk.test.mjs +2 -0
  39. package/api/integration/validate-integration-gaps.test.mjs +7 -4
  40. package/api/integration/validate-integration.mjs +96 -14
  41. package/api/integration/validate-integration.type.d.mts +10 -4
  42. package/api/integration/validate-integration.type.mjs +10 -5
  43. package/api/integration/validateIntegration.doc.mjs +1 -1
  44. package/api/search/_candidate-score.d.mts +9 -3
  45. package/api/search/_candidate-score.mjs +90 -3
  46. package/api/search/_gather-components.mjs +48 -1
  47. package/api/search/_gather-docs.mjs +12 -2
  48. package/api/search/_lexical.d.mts +12 -0
  49. package/api/search/_lexical.mjs +3 -0
  50. package/api/search/_priority.mjs +5 -2
  51. package/api/search/_score.d.mts +2 -1
  52. package/api/search/_score.mjs +4 -3
  53. package/api/search/search.doc.mjs +1 -1
  54. package/api/search/search.family-members.test.mjs +124 -0
  55. package/api/search/search.family-word.test.mjs +146 -0
  56. package/api/search/search.mjs +28 -0
  57. package/api/theme/themeBuild.doc.mjs +1 -1
  58. package/api/theme/themeList.doc.mjs +1 -1
  59. package/api/theme/themeTargets.doc.mjs +1 -1
  60. package/assets/discover/official-packages.json +16 -0
  61. package/assets/docs/author-a-theme.doc.mjs +15 -15
  62. package/assets/docs/browser-support.doc.mjs +1 -1
  63. package/assets/docs/getting-started.doc.mjs +16 -16
  64. package/assets/docs/is-my-code-good.doc.mjs +6 -6
  65. package/assets/docs/styling-overview.doc.mjs +5 -5
  66. package/assets/docs/theme.doc.mjs +5 -5
  67. package/assets/docs/tree/add-a-component.doc.mjs +1 -1
  68. package/assets/docs/tree/add-a-theme.doc.mjs +2 -2
  69. package/assets/docs/tree/add-a-topic.doc.mjs +6 -6
  70. package/assets/docs/tree/agent-guidance.doc.mjs +5 -5
  71. package/assets/docs/tree/authoring.doc.mjs +2 -2
  72. package/assets/docs/tree/block-template.doc.mjs +1 -1
  73. package/assets/docs/tree/check-the-props.doc.mjs +3 -3
  74. package/assets/docs/tree/check-your-docs.doc.mjs +6 -6
  75. package/assets/docs/tree/checks.doc.mjs +11 -11
  76. package/assets/docs/tree/ci-and-containers.doc.mjs +1 -1
  77. package/assets/docs/tree/cli-command.doc.mjs +6 -6
  78. package/assets/docs/tree/codemods.doc.mjs +7 -7
  79. package/assets/docs/tree/component-family.doc.mjs +1 -1
  80. package/assets/docs/tree/component-imports.doc.mjs +2 -2
  81. package/assets/docs/tree/component-lookups.doc.mjs +6 -5
  82. package/assets/docs/tree/computer-agent-guide.doc.mjs +7 -7
  83. package/assets/docs/tree/computer-integrations.doc.mjs +5 -5
  84. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +3 -3
  85. package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
  86. package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
  87. package/assets/docs/tree/doc-syntax.doc.mjs +219 -0
  88. package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
  89. package/assets/docs/tree/extend-or-replace.doc.mjs +39 -7
  90. package/assets/docs/tree/font-setup.doc.mjs +1 -1
  91. package/assets/docs/tree/generate-a-palette.doc.mjs +1 -1
  92. package/assets/docs/tree/global-integrations.doc.mjs +11 -11
  93. package/assets/docs/tree/global.doc.mjs +2 -2
  94. package/assets/docs/tree/host-entry.doc.mjs +1 -1
  95. package/assets/docs/tree/install-once.doc.mjs +4 -4
  96. package/assets/docs/tree/layout.doc.mjs +1 -1
  97. package/assets/docs/tree/links.doc.mjs +2 -2
  98. package/assets/docs/tree/migration-setup.doc.mjs +15 -15
  99. package/assets/docs/tree/migration.doc.mjs +2 -1
  100. package/assets/docs/tree/other-libraries.doc.mjs +1 -1
  101. package/assets/docs/tree/page-template.doc.mjs +2 -2
  102. package/assets/docs/tree/problems.doc.mjs +8 -8
  103. package/assets/docs/tree/project-global-or-both.doc.mjs +2 -2
  104. package/assets/docs/tree/publishing.doc.mjs +7 -7
  105. package/assets/docs/tree/quick-start.doc.mjs +9 -9
  106. package/assets/docs/tree/reference.doc.mjs +2 -2
  107. package/assets/docs/tree/replace-a-core-component.doc.mjs +1 -1
  108. package/assets/docs/tree/replace-a-core-template.doc.mjs +4 -4
  109. package/assets/docs/tree/scaffold.doc.mjs +1 -1
  110. package/assets/docs/tree/sections-and-placement.doc.mjs +3 -3
  111. package/assets/docs/tree/see-it-in-an-app.doc.mjs +3 -3
  112. package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
  113. package/assets/docs/tree/single-component.doc.mjs +4 -4
  114. package/assets/docs/tree/start-a-template.doc.mjs +5 -5
  115. package/assets/docs/tree/styling-advanced.doc.mjs +1 -1
  116. package/assets/docs/tree/styling-libraries.doc.mjs +2 -1
  117. package/assets/docs/tree/styling.doc.mjs +1 -1
  118. package/assets/docs/tree/tailwind.doc.mjs +1 -1
  119. package/assets/docs/tree/test-in-an-app.doc.mjs +5 -5
  120. package/assets/docs/tree/test-template-in-app.doc.mjs +6 -6
  121. package/assets/docs/tree/tokens-and-setup.doc.mjs +1 -1
  122. package/assets/docs/tree/troubleshooting.doc.mjs +24 -20
  123. package/assets/docs/tree/uninstall.doc.mjs +2 -2
  124. package/assets/docs/tree/updates.doc.mjs +1 -1
  125. package/assets/docs/tree/upgrading.doc.mjs +3 -3
  126. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +1 -1
  127. package/assets/docs/tree/verify-packed-template.doc.mjs +3 -3
  128. package/assets/docs/tree/versioning.doc.mjs +4 -4
  129. package/assets/docs/tree/who-answers.doc.mjs +4 -4
  130. package/assets/docs/tree/write-the-template-file.doc.mjs +4 -4
  131. package/assets/docs/use-a-theme.doc.mjs +10 -10
  132. package/assets/docs/use-integrations.doc.mjs +1 -1
  133. package/assets/docs/working-with-ai.doc.mjs +15 -15
  134. package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +54 -0
  135. package/assets/templates/themes/butter/butterPalettes.generated.receipt.json +1499 -0
  136. package/assets/templates/themes/butter/butterPalettes.generated.ts +550 -0
  137. package/assets/templates/themes/butter/butterTheme.ts +274 -234
  138. package/assets/templates/themes/butter/palette.config.json +484 -0
  139. package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +51 -0
  140. package/assets/templates/themes/matcha/matchaPalettes.generated.receipt.json +1502 -0
  141. package/assets/templates/themes/matcha/matchaPalettes.generated.ts +501 -0
  142. package/assets/templates/themes/matcha/matchaPalettes.ts +21 -0
  143. package/assets/templates/themes/matcha/matchaTheme.ts +164 -103
  144. package/assets/templates/themes/matcha/palette.config.json +448 -0
  145. package/assets/templates/themes/y2k/palette.config.json +166 -0
  146. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +54 -0
  147. package/assets/templates/themes/y2k/y2kPalettes.generated.receipt.json +872 -0
  148. package/assets/templates/themes/y2k/y2kPalettes.generated.ts +550 -0
  149. package/assets/templates/themes/y2k/y2kPalettes.ts +257 -0
  150. package/assets/templates/themes/y2k/y2kTheme.ts +164 -391
  151. package/authoring/codemod/codemod.doc.mjs +1 -1
  152. package/authoring/config/config.doc.mjs +4 -4
  153. package/authoring/debug/parse.d.mts +1 -1
  154. package/authoring/discover/discover.doc.mjs +1 -1
  155. package/authoring/doctypes/_schema.d.mts +4 -0
  156. package/authoring/doctypes/_schema.mjs +4 -0
  157. package/authoring/doctypes/reference/type.ts +14 -2
  158. package/authoring/gap-report/gap-report.doc.mjs +1 -1
  159. package/authoring/integration/integration.doc.mjs +6 -6
  160. package/clients/cli/commands/docs.doc.mjs +1 -1
  161. package/clients/cli/commands/docs.mjs +27 -2
  162. package/clients/cli/commands/docs.test.mjs +1 -1
  163. package/clients/cli/commands/doctor-integration-docs.doc.mjs +1 -1
  164. package/clients/cli/commands/doctor.doc.mjs +1 -1
  165. package/clients/cli/commands/doctor.mjs +2 -1
  166. package/clients/cli/commands/integration-check.doc.mjs +11 -0
  167. package/clients/cli/commands/integration-check.test.mjs +36 -3
  168. package/clients/cli/commands/integration-pack.doc.mjs +1 -1
  169. package/clients/cli/commands/integration-verify.doc.mjs +1 -1
  170. package/clients/cli/commands/integration.mjs +15 -3
  171. package/clients/cli/commands/theme-targets.doc.mjs +1 -1
  172. package/clients/cli/commands/upgrade.doc.mjs +2 -2
  173. package/clients/cli/lib/define-command.mjs +5 -3
  174. package/foundation/agent-docs/agent-docs.d.mts +14 -2
  175. package/foundation/agent-docs/agent-docs.mjs +65 -4
  176. package/foundation/agent-docs/agent-docs.test.mjs +107 -0
  177. package/foundation/discovery/docs-discovery.d.mts +93 -2
  178. package/foundation/discovery/docs-discovery.mjs +237 -8
  179. package/foundation/discovery/runner-allowlist.d.mts +2 -0
  180. package/foundation/discovery/runner-allowlist.mjs +4 -0
  181. package/foundation/discovery/runner-commands.d.mts +29 -13
  182. package/foundation/discovery/runner-commands.mjs +253 -17
  183. package/foundation/discovery/stray-pointers.mjs +11 -5
  184. package/foundation/discovery/stray-pointers.test.mjs +6 -0
  185. package/foundation/doc-compiler/compile.mjs +8 -1
  186. package/foundation/doc-compiler/doc-loads.test.mjs +3 -0
  187. package/foundation/doc-compiler/doc-syntax.d.mts +194 -0
  188. package/foundation/doc-compiler/doc-syntax.mjs +739 -0
  189. package/foundation/doc-compiler/doc-syntax.test.mjs +383 -0
  190. package/foundation/doc-compiler/links.d.mts +13 -16
  191. package/foundation/doc-compiler/links.mjs +40 -7
  192. package/foundation/doc-compiler/tree.d.mts +5 -0
  193. package/foundation/doc-compiler/tree.mjs +9 -0
  194. package/foundation/env/package-manager.d.mts +18 -0
  195. package/foundation/env/package-manager.mjs +40 -0
  196. package/foundation/integrations/cli-requirement.d.mts +29 -0
  197. package/foundation/integrations/cli-requirement.mjs +47 -0
  198. package/foundation/integrations/cli-requirement.test.mjs +23 -2
  199. package/foundation/response/response-types.doc.mjs +6 -6
  200. package/package.json +9 -9
@@ -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
+ };
@@ -106,7 +106,7 @@ export const docs = {
106
106
  items: [
107
107
  '`integration add` appends the manifest and templates directory when a `files` list already exists. Add the other directories yourself.',
108
108
  'If `package.json` sets `sideEffects`, include CSS in it, as above, so bundlers keep side-effect stylesheet imports.',
109
- 'Run `npm pack --dry-run` and read the real file list instead of reasoning from the workspace.',
109
+ 'Run `{@pm-only npm "the tarball the registry receives" pack --dry-run}` and read the real file list instead of reasoning from the workspace.',
110
110
  ],
111
111
  },
112
112
  ],
@@ -2,8 +2,9 @@
2
2
 
3
3
  /**
4
4
  * @file `astryx docs authoring/building-blocks/docs/extend-or-replace`:
5
- * take over an existing topic with `replaces`, merge sections into one with
6
- * `extends`, and check overlaps with Core topics.
5
+ * take over an existing topic or guide with `replaces`, merge sections into
6
+ * one with `extends` (placing each with `before` or `after`), and check
7
+ * overlaps with Core topics.
7
8
  */
8
9
 
9
10
  /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
@@ -13,7 +14,7 @@ export const docs = {
13
14
  placement: {parent: 'namespace:docs', slot: 'guides', order: 40},
14
15
  title: 'Extend or replace a topic',
15
16
  category: 'guide',
16
- description: 'Take over a topic, or merge sections into it.',
17
+ description: 'Take over a topic or guide, or merge sections into it.',
17
18
  sections: [
18
19
  {
19
20
  id: 'replace-a-topic',
@@ -26,7 +27,7 @@ export const docs = {
26
27
  {
27
28
  type: 'code',
28
29
  lang: 'bash',
29
- code: 'astryx integration add doc acme-getting-started --replaces getting-started\n# The old name now opens your topic\nastryx docs getting-started',
30
+ code: '{@command integration add doc acme-getting-started --replaces getting-started}\n# The old name now opens your topic\n{@command docs getting-started}',
30
31
  },
31
32
  {
32
33
  type: 'code',
@@ -51,7 +52,7 @@ export const docs = {
51
52
  {
52
53
  type: 'code',
53
54
  lang: 'bash',
54
- code: 'astryx integration add doc acme-theming --extends theme\nastryx docs theme --index',
55
+ code: '{@command integration add doc acme-theming --extends theme}\n{@command docs theme --index}',
55
56
  },
56
57
  {
57
58
  type: 'code',
@@ -63,7 +64,8 @@ export const docs = {
63
64
  type: 'list',
64
65
  style: 'unordered',
65
66
  items: [
66
- "Read the base topic's keys with `--index`, and give a section that replaces one that key as its `id`. A section without an `id` matches only a base section with exactly its title, or one whose `id` is the key its title makes, so `Integration Themes` is added beside a base `Integration themes` that has no `id`.",
67
+ "Read the base topic's keys with `--index`, and give a section that replaces one that key as its `id`. A section that replaces one keeps its place. A section without an `id` matches only a base section with exactly its title, or one whose `id` is the key its title makes, so `Integration Themes` is added beside a base `Integration themes` that has no `id`.",
68
+ "Set `before` or `after` to a base section's key to add a new section there instead of at the end. A key that names no section adds it at the end, and `astryx doctor integration validate` lists a note. An older CLI rejects these fields, so declare an `@astryxdesign/cli` peer range that starts at the release that reads them; `astryx integration verify` warns without it.",
67
69
  "The topic keeps the base's title and description, and readers open it by the base's name.",
68
70
  'Replace the `Overview` placeholder that `integration add` writes, or it is added to the base topic.',
69
71
  "Extend a topic to correct or add to it. A copy made with `replaces` stops getting the owner's fixes.",
@@ -71,6 +73,36 @@ export const docs = {
71
73
  },
72
74
  ],
73
75
  },
76
+ {
77
+ id: 'replace-or-extend-a-cli-guide',
78
+ title: 'Replace or extend a CLI guide',
79
+ content: [
80
+ {
81
+ type: 'prose',
82
+ text: "A guide in the CLI's docs tree has a route rather than a topic name. Set `replaces` or `extends` to that route to change the guide for every app that installs your package: say what differs for your users on the page agents already read.",
83
+ },
84
+ {
85
+ type: 'code',
86
+ lang: 'javascript',
87
+ label: 'docs/acme-quick-start.doc.mjs',
88
+ code: "export default {\n type: 'generic',\n name: 'acme-quick-start',\n extends: 'authoring/quick-start',\n title: 'Acme quick start',\n description: 'What differs when you build integrations at Acme.',\n sections: [\n {id: 'use-the-acme-registry', title: 'Use the Acme registry', before: 'fill-in-package-json', content: [/* ... */]},\n ],\n};",
89
+ },
90
+ {
91
+ type: 'list',
92
+ style: 'unordered',
93
+ items: [
94
+ 'Your doc stays a flat topic: do not give it a `placement`. Readers open the guide by its route, never by your `name`.',
95
+ 'With `replaces`, readers of the route get your doc, under your package. With `extends`, each section you add or replace names your package.',
96
+ 'A name that holds no topic or guide, such as a namespace, changes nothing; `astryx doctor integration validate` lists it as a note, with the guides below a namespace.',
97
+ ],
98
+ },
99
+ {
100
+ type: 'code',
101
+ lang: 'bash',
102
+ code: '# Every guide route, by namespace\nastryx docs authoring --depth all\nastryx docs cli --depth all\n# The keys to place sections by\nastryx docs authoring/quick-start --index',
103
+ },
104
+ ],
105
+ },
74
106
  {
75
107
  id: 'check-overlaps-with-core-topics',
76
108
  title: 'Check overlaps with Core topics',
@@ -82,7 +114,7 @@ export const docs = {
82
114
  {
83
115
  type: 'code',
84
116
  lang: 'bash',
85
- code: 'astryx doctor integration docs',
117
+ code: '{@command doctor integration docs}',
86
118
  },
87
119
  {
88
120
  type: 'code',
@@ -60,7 +60,7 @@ export const docs = {
60
60
  content: [
61
61
  {
62
62
  type: 'prose',
63
- text: 'Astryx never loads font files. defineTheme and the built CSS only set font-family: naming a webfont (Fraunces, JetBrains Mono, and so on) makes every browser look for it, and quietly fall back when the app has not loaded it. `astryx theme build` warns when a theme names families that are neither CSS generics nor common system fonts and prints the snippet to add; loading the font is always the app\'s job.',
63
+ text: "Astryx never loads font files. defineTheme and the built CSS only set font-family: naming a webfont (Fraunces, JetBrains Mono, and so on) makes every browser look for it, and quietly fall back when the app has not loaded it. `{@command theme build}` warns when a theme names families that are neither CSS generics nor common system fonts and prints the snippet to add; loading the font is always the app's job.",
64
64
  },
65
65
  {
66
66
  type: 'code',
@@ -40,7 +40,7 @@ export const docs = {
40
40
  type: 'code',
41
41
  lang: 'bash',
42
42
  code: `# Print the palette without writing files
43
- astryx theme palette generate themes/ocean/palette.config.json
43
+ {@command theme palette generate themes/ocean/palette.config.json}
44
44
  # Write the palette and its receipt
45
45
  astryx theme palette generate themes/ocean/palette.config.json \\
46
46
  --out themes/ocean/tokens/ocean.palette.ts`,
@@ -37,11 +37,11 @@ export const docs = {
37
37
  content: [
38
38
  {
39
39
  type: 'prose',
40
- text: 'Your `@astryxdesign/core` (and, if you use it, `@astryxdesign/cli`) `peerDependencies` ranges must include the version of the CLI installed globally. If they do not, Astryx skips your package outside projects, and `astryx doctor` warns and names the range.',
40
+ text: 'Your `@astryxdesign/core` (and, if you use it, `@astryxdesign/cli`) `peerDependencies` ranges must include the version of the CLI installed globally. If they do not, Astryx skips your package outside projects, and `{@command doctor}` warns and names the range.',
41
41
  },
42
42
  {
43
43
  type: 'prose',
44
- text: "Inside a project that does not install your package, `astryx discover` offers it, with the command that adds it to that project, once your peer range admits the project's release.",
44
+ text: "Inside a project that does not install your package, `{@command discover}` offers it, with the command that adds it to that project, once your peer range admits the project's release.",
45
45
  },
46
46
  ],
47
47
  },
@@ -54,8 +54,8 @@ export const docs = {
54
54
  style: 'unordered',
55
55
  items: [
56
56
  "Installed in an app: it works in that app, as always, whichever `astryx` the person runs, because the app's version of Astryx answers there.",
57
- 'Installed next to the global install (`npm i -g @astryxdesign/cli your-package`), or in the same folder as the CLI by a tool that installs them together: it works in every folder outside a project. People and agents there see its components, templates, docs, themes, codemods, and discover source.',
58
- "Installed only globally, inside an app that does not install it: it adds nothing there. When it supports the app's version and loads, `astryx discover` lists it as one the app could add, with the app's install command.",
57
+ 'Installed next to the global install (`{@pm install @astryxdesign/cli your-package --global}`), or in the same folder as the CLI by a tool that installs them together: it works in every folder outside a project. People and agents there see its components, templates, docs, themes, codemods, and discover source.',
58
+ "Installed only globally, inside an app that does not install it: it adds nothing there. When it supports the app's version and loads, `{@command discover}` lists it as one the app could add, with the app's install command.",
59
59
  "Installed both ways: the app's copy is the one used in that app. In your own package folder, your working copy is used.",
60
60
  ],
61
61
  },
@@ -73,7 +73,7 @@ export const docs = {
73
73
  type: 'list',
74
74
  style: 'unordered',
75
75
  items: [
76
- 'Declare the `@astryxdesign/core` (and, if you use it, `@astryxdesign/cli`) `peerDependencies` range your package really supports. Outside a project, Astryx skips your package when that range leaves out the global version, and `astryx doctor` says why: too narrow, and global users lose it after an upgrade; too wide, and it loads against a Core it may not build with.',
76
+ 'Declare the `@astryxdesign/core` (and, if you use it, `@astryxdesign/cli`) `peerDependencies` range your package really supports. Outside a project, Astryx skips your package when that range leaves out the global version, and `{@command doctor}` says why: too narrow, and global users lose it after an upgrade; too wide, and it loads against a Core it may not build with.',
77
77
  'Keep imports in your docs and templates to packages an app installs with yours, since outside a project there is no app to check them against.',
78
78
  "If you set `cliCommand`, know that outside a project it starts every command Astryx prints, and that two global integrations naming different commands cancel out, falling back to `astryx` ({@link generic:cli-command}). Inside an app, only the app's integrations count.",
79
79
  'Try it globally before you publish, with the steps below.',
@@ -92,21 +92,21 @@ export const docs = {
92
92
  {
93
93
  type: 'code',
94
94
  lang: 'bash',
95
- code: 'npm pack\nnpm i -g @astryxdesign/cli ./your-package-1.0.0.tgz\nmkdir -p /tmp/try-global && cd /tmp/try-global\nastryx discover\nastryx docs\nastryx doctor',
95
+ code: '{@pm-only npm "the tarball the registry receives" pack}\n{@pm install @astryxdesign/cli ./your-package-1.0.0.tgz --global}\nmkdir -p /tmp/try-global && cd /tmp/try-global\n{@command discover}\n{@command docs}\n{@command doctor}',
96
96
  },
97
97
  {
98
98
  type: 'list',
99
99
  style: 'unordered',
100
100
  items: [
101
- '`astryx discover` lists your package as installed, with what it adds.',
102
- '`astryx docs` lists your topics, and `astryx search <one of your component names>` finds them.',
103
- "`astryx doctor`'s `computer-integrations` check lists your package as used, with no warning.",
104
- "In an app that does not install it, `astryx discover` lists it as one the app could add, with the app's install command, and none of its components or docs show up.",
101
+ '`{@command discover}` lists your package as installed, with what it adds.',
102
+ '`{@command docs}` lists your topics, and `{@command search <one of your component names>}` finds them.',
103
+ "`{@command doctor}`'s `computer-integrations` check lists your package as used, with no warning.",
104
+ "In an app that does not install it, `{@command discover}` lists it as one the app could add, with the app's install command, and none of its components or docs show up.",
105
105
  ],
106
106
  },
107
107
  {
108
108
  type: 'prose',
109
- text: 'Remove it again with `npm uninstall -g your-package`.',
109
+ text: 'Remove it again with `{@pm remove your-package --global}`.',
110
110
  },
111
111
  ],
112
112
  },
@@ -42,7 +42,7 @@ export const docs = {
42
42
  {
43
43
  type: 'code',
44
44
  lang: 'bash',
45
- code: 'npm i -g @astryxdesign/cli',
45
+ code: '{@pm install @astryxdesign/cli --global}',
46
46
  },
47
47
  {
48
48
  type: 'heading',
@@ -73,7 +73,7 @@ export const docs = {
73
73
  ],
74
74
  ['Outside any project', 'Your global version.'],
75
75
  [
76
- 'Commands for your computer, such as `astryx init --user`',
76
+ 'Commands for your computer, such as `{@command init --user}`',
77
77
  'Your global version, in any folder.',
78
78
  ],
79
79
  ],
@@ -82,7 +82,7 @@ export const docs = {
82
82
  [
83
83
  '`discoverSources`',
84
84
  'none',
85
- "Your own discover sources. `astryx discover` reports each as the host's.",
85
+ "Your own discover sources. `{@command discover}` reports each as the host's.",
86
86
  ],
87
87
  ],
88
88
  },
@@ -44,11 +44,11 @@ export const docs = {
44
44
  {
45
45
  type: 'code',
46
46
  lang: 'bash',
47
- code: 'npm i -g @astryxdesign/cli\n# or: pnpm add -g @astryxdesign/cli · yarn global add @astryxdesign/cli · bun add -g @astryxdesign/cli · volta install @astryxdesign/cli',
47
+ code: '{@pm install @astryxdesign/cli --global}\n# with Volta: volta install @astryxdesign/cli',
48
48
  },
49
49
  {
50
50
  type: 'prose',
51
- text: "Keep the CLI installed in each project too: that pins its version for teammates and CI ({@link generic:project-global-or-both}). Inside a project, whichever astryx command you type, the project's version answers. Outside a project, your global install answers with its own version, and a version you name, such as `npx @astryxdesign/cli@0.7.0`, answers as exactly that version.",
51
+ text: "Keep the CLI installed in each project too: that pins its version for teammates and CI ({@link generic:project-global-or-both}). Inside a project, whichever astryx command you type, the project's version answers. Outside a project, your global install answers with its own version, and a version you name, such as `{@pm dlx @astryxdesign/cli@0.7.0}`, answers as exactly that version.",
52
52
  },
53
53
  ],
54
54
  },
@@ -63,7 +63,7 @@ export const docs = {
63
63
  {
64
64
  type: 'code',
65
65
  lang: 'bash',
66
- code: 'npm config set prefix ~/.npm-global\nexport PATH="$HOME/.npm-global/bin:$PATH"\nnpm i -g @astryxdesign/cli',
66
+ code: '{@pm-only npm "moves the npm global folder" config set prefix ~/.npm-global}\nexport PATH="$HOME/.npm-global/bin:$PATH"\n{@pm-only npm "installs into the npm global folder above" i -g @astryxdesign/cli}',
67
67
  },
68
68
  {
69
69
  type: 'prose',
@@ -87,7 +87,7 @@ export const docs = {
87
87
  content: [
88
88
  {
89
89
  type: 'prose',
90
- text: "Your global install answers offline in a project with only Core, and so does any project that installs its own CLI. Outside a project, commands that read components, such as `astryx component Button`, need your global version's Core: after any command you run online, your global install downloads it once into the cache in the background, so they work offline from then on (not in CI, where nothing downloads by itself: {@link generic:ci-and-containers}; and not on Windows, where the first component command downloads it). Only a project whose own CLI cannot start needs a version installed or cached; when it is neither and cannot be fetched, your global install answers with a one-line warning, and Astryx waits 2 minutes before trying to download it again (10 minutes after a second failure in a row). {@link generic:problems} has the exact message.",
90
+ text: "Your global install answers offline in a project with only Core, and so does any project that installs its own CLI. Outside a project, commands that read components, such as `{@command component Button}`, need your global version's Core: after any command you run online, your global install downloads it once into the cache in the background, so they work offline from then on (not in CI, where nothing downloads by itself: {@link generic:ci-and-containers}; and not on Windows, where the first component command downloads it). Only a project whose own CLI cannot start needs a version installed or cached; when it is neither and cannot be fetched, your global install answers with a one-line warning, and Astryx waits 2 minutes before trying to download it again (10 minutes after a second failure in a row). {@link generic:problems} has the exact message.",
91
91
  },
92
92
  ],
93
93
  },
@@ -46,7 +46,7 @@ export const docs = {
46
46
  },
47
47
  {
48
48
  type: 'prose',
49
- text: 'This guide decides layout, not component APIs. Run `astryx build "<idea>"` to start from the closest template for your app type, and `astryx component <Name>` for a component\'s props.',
49
+ text: 'This guide decides layout, not component APIs. Run `{@command build "<idea>"}` to start from the closest template for your app type, and `{@command component <Name>}` for a component\'s props.',
50
50
  },
51
51
  ],
52
52
  slots: {