@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
@@ -13,7 +13,7 @@
13
13
  export function list({ cwd, category, detail, zh, lang, }?: {
14
14
  cwd?: string | undefined;
15
15
  category?: string | undefined;
16
- detail?: "names" | "compact" | "full" | "brief" | undefined;
16
+ detail?: "compact" | "full" | "names" | "brief" | undefined;
17
17
  zh?: boolean | undefined;
18
18
  lang?: string | null | undefined;
19
19
  }): Promise<import("../hook.type.mjs").HookListResponse>;
@@ -41,13 +41,22 @@ export function integrationFluff(discovered: Parameters<typeof findFluff>[0]): P
41
41
  */
42
42
  export function integrationStrayPointers(discovered: Parameters<typeof findStrayPointers>[0], integration?: any): Promise<import("./authoring-checks.type.mjs").StrayPointer[]>;
43
43
  /**
44
- * Each Astryx command a package's topics write with a package runner. A
44
+ * What each doc in one integration's docs replaces or extends, read against
45
+ * the CLI's docs and the package's own (see `packageDocTargets`); empty when
46
+ * the docs do not load, which other checks report.
47
+ * @param {any} integration a loaded integration
48
+ * @returns {Promise<import('../docs/_adapter.mjs').DocTarget[]>}
49
+ */
50
+ export function integrationDocTargets(integration: any): Promise<import("../docs/_adapter.mjs").DocTarget[]>;
51
+ /**
52
+ * The doc-syntax findings in a package's topics: commands written with a
53
+ * runner, for one package manager, or bare, and tokens that do not parse. A
45
54
  * package whose topics cannot be discovered has none here: the other checks
46
55
  * report topics that do not load.
47
56
  * @param {any} integration a loaded integration
48
57
  * @returns {Promise<import('../../foundation/discovery/runner-commands.mjs').RunnerCommand[]>}
49
58
  */
50
- export function integrationRunnerCommands(integration: any): Promise<import("../../foundation/discovery/runner-commands.mjs").RunnerCommand[]>;
59
+ export function integrationDocCommands(integration: any): Promise<import("../../foundation/discovery/runner-commands.mjs").RunnerCommand[]>;
51
60
  import { findCopiedPassages } from '../../foundation/discovery/copied-passages.mjs';
52
61
  import { findFluff } from '../../foundation/discovery/doc-fluff.mjs';
53
62
  import { findStrayPointers } from '../../foundation/discovery/stray-pointers.mjs';
@@ -16,10 +16,11 @@ import {
16
16
  integrationSourceForDoc,
17
17
  } from '../../foundation/discovery/component-discovery.mjs';
18
18
  import {discoverIntegrationDocs} from '../../foundation/discovery/docs-discovery.mjs';
19
+ import {packageDocTargets} from '../docs/_adapter.mjs';
19
20
  import {comparePropDocs} from '../../foundation/discovery/prop-drift.mjs';
20
21
  import {findCopiedPassages} from '../../foundation/discovery/copied-passages.mjs';
21
22
  import {findFluff} from '../../foundation/discovery/doc-fluff.mjs';
22
- import {findRunnerCommands} from '../../foundation/discovery/runner-commands.mjs';
23
+ import {findDocCommands} from '../../foundation/discovery/runner-commands.mjs';
23
24
  import {findStrayPointers} from '../../foundation/discovery/stray-pointers.mjs';
24
25
 
25
26
  /**
@@ -115,18 +116,43 @@ export async function integrationStrayPointers(discovered, integration) {
115
116
  }
116
117
 
117
118
  /**
118
- * Each Astryx command a package's topics write with a package runner. A
119
+ * What each doc in one integration's docs replaces or extends, read against
120
+ * the CLI's docs and the package's own (see `packageDocTargets`); empty when
121
+ * the docs do not load, which other checks report.
122
+ * @param {any} integration a loaded integration
123
+ * @returns {Promise<import('../docs/_adapter.mjs').DocTarget[]>}
124
+ */
125
+ export async function integrationDocTargets(integration) {
126
+ let discovered;
127
+ try {
128
+ discovered = await discoverIntegrationDocs(integration);
129
+ } catch {
130
+ return [];
131
+ }
132
+ // A doc that does not load is an issue already; its targets are not read.
133
+ if (discovered.errors.length > 0) return [];
134
+ try {
135
+ return await packageDocTargets(integration, discovered);
136
+ } catch {
137
+ // A package whose docs cannot form a tree is reported by the docs check.
138
+ return [];
139
+ }
140
+ }
141
+
142
+ /**
143
+ * The doc-syntax findings in a package's topics: commands written with a
144
+ * runner, for one package manager, or bare, and tokens that do not parse. A
119
145
  * package whose topics cannot be discovered has none here: the other checks
120
146
  * report topics that do not load.
121
147
  * @param {any} integration a loaded integration
122
148
  * @returns {Promise<import('../../foundation/discovery/runner-commands.mjs').RunnerCommand[]>}
123
149
  */
124
- export async function integrationRunnerCommands(integration) {
150
+ export async function integrationDocCommands(integration) {
125
151
  let discovered;
126
152
  try {
127
153
  discovered = await discoverIntegrationDocs(integration);
128
154
  } catch {
129
155
  return [];
130
156
  }
131
- return findRunnerCommands(discovered);
157
+ return findDocCommands(discovered);
132
158
  }
@@ -22,6 +22,7 @@ import path from 'node:path';
22
22
  import {getCliInvocation} from '../../foundation/env/package-manager.mjs';
23
23
  import {
24
24
  packageComponentLinkProblems,
25
+ packageDocTargets,
25
26
  packageDocsProblems,
26
27
  packageReferenceProblems,
27
28
  } from '../docs/_adapter.mjs';
@@ -38,8 +39,10 @@ import {
38
39
  integrationStrayPointers,
39
40
  } from './_adapter.mjs';
40
41
  import {
42
+ BUILTIN_DOCS_PACKAGE,
41
43
  discoverBuiltinTopics,
42
44
  discoverIntegrationDocs,
45
+ isGuideRoute,
43
46
  } from '../../foundation/discovery/docs-discovery.mjs';
44
47
  import {
45
48
  applyTemplateReplacements,
@@ -489,11 +492,14 @@ export async function integrationDocConflicts(pkg, options = {}) {
489
492
  });
490
493
  }
491
494
 
492
- // An extension never owns its own name. A replacement does, so it may only
493
- // reuse a Core name when that is the Core topic it explicitly replaces.
495
+ // An extension never owns its own name, and neither does a doc that
496
+ // replaces a guide by its route: readers open the route. A topic
497
+ // replacement does, so it may only reuse a Core name when that is the
498
+ // Core topic it explicitly replaces.
494
499
  if (
495
500
  sameNameCore != null &&
496
501
  record.extendsTopic == null &&
502
+ !isGuideRoute(record.replaces) &&
497
503
  replacedCore !== sameNameCore
498
504
  ) {
499
505
  findings.push({
@@ -507,6 +513,27 @@ export async function integrationDocConflicts(pkg, options = {}) {
507
513
  });
508
514
  }
509
515
  }
516
+ // A doc that replaces or extends one of the CLI's guides by its route is
517
+ // as intentional as one that names a Core topic.
518
+ if (errors.length === 0) {
519
+ for (const target of await packageDocTargets(
520
+ /** @type {{name: string}} */ (docsIntegration),
521
+ discovered,
522
+ )) {
523
+ if (target.kind !== 'guide' || target.owner !== BUILTIN_DOCS_PACKAGE) {
524
+ continue;
525
+ }
526
+ // A route the guide moved from names the guide at its route now.
527
+ const route = target.guide ?? target.target;
528
+ findings.push({
529
+ topic: target.topic,
530
+ severity: 'info',
531
+ relationship: target.relationship,
532
+ coreTopic: route,
533
+ message: `Intentional ${target.relationship === 'replaces' ? 'override' : 'extension'}: "${target.topic}" ${target.relationship} the CLI guide "${route}".`,
534
+ });
535
+ }
536
+ }
510
537
  findings.sort((a, b) =>
511
538
  `${a.topic}:${a.relationship}`.localeCompare(
512
539
  `${b.topic}:${b.relationship}`,
@@ -1401,7 +1401,7 @@ describe('validateIntegration runner-command notes', () => {
1401
1401
  line: 1,
1402
1402
  command: 'pnpm exec astryx doctor',
1403
1403
  });
1404
- expect(hit.message).toContain('Write `astryx doctor`');
1404
+ expect(hit.message).toContain('Write the token `{@command doctor}`');
1405
1405
  // A note only: no issue, so no exit changes on it.
1406
1406
  expect(
1407
1407
  data.issues.map((/** @type {any} */ issue) => issue.code),
@@ -1544,6 +1544,136 @@ describe('validateIntegration runner-command notes', () => {
1544
1544
  );
1545
1545
  });
1546
1546
 
1547
+ it('lists package-manager commands, bare commands and broken tokens with the token to write, all for the next minor', async () => {
1548
+ writeTopic(
1549
+ 'Add it with `npm install -D @acme/widgets`, run `astryx search acme`, then {@pm add x} and {@cmd docs}. Only npm: `npm pkg set name=x`.',
1550
+ );
1551
+
1552
+ const {data} = await validateIntegration(undefined, {cwd: tmpDir});
1553
+ const notes = (data.notes ?? []).filter(
1554
+ (/** @type {any} */ note) => note.code !== 'runner_command',
1555
+ );
1556
+
1557
+ expect(
1558
+ notes.map((/** @type {any} */ note) => [note.code, note.next]),
1559
+ ).toEqual([
1560
+ ['package_manager_command', true],
1561
+ ['plain_command', true],
1562
+ ['doc_token', true],
1563
+ ['doc_token', true],
1564
+ ['package_manager_command', true],
1565
+ // The fixture's install step, in its bash block.
1566
+ ['package_manager_command', true],
1567
+ ]);
1568
+ const messages = notes.map((/** @type {any} */ note) => note.message);
1569
+ expect(messages[0]).toContain('{@pm install @acme/widgets --dev}');
1570
+ expect(messages[1]).toContain('{@command search acme}');
1571
+ expect(messages[2]).toContain('{@pm}` starts with a verb');
1572
+ expect(messages[3]).toContain('Doc tokens are');
1573
+ expect(messages[4]).toContain(
1574
+ '{@pm-only npm "<why only npm>" pkg set name=x}',
1575
+ );
1576
+ expect(messages[5]).toContain('{@pm dlx @astryxdesign/cli init}');
1577
+ expect(data.issues.map((/** @type {any} */ issue) => issue.code)).toEqual(
1578
+ [],
1579
+ );
1580
+ });
1581
+
1582
+ it('reads a verb named alone as a mention, and TSDoc tags in a TypeScript sample as code', async () => {
1583
+ writeTopic(
1584
+ 'Scripts run with `npm run`, `pnpm dlx` fetches a package, and `npm i -g`, `yarn global add` and `npm pkg set` each take one.',
1585
+ );
1586
+ const file = path.join(tmpDir, 'docs', 'acme-setup.doc.mjs');
1587
+ fs.writeFileSync(
1588
+ file,
1589
+ fs.readFileSync(file, 'utf8').replace(
1590
+ /\{"type":"code"[^}]*\}/,
1591
+ JSON.stringify({
1592
+ type: 'code',
1593
+ lang: 'ts',
1594
+ code: '/** {@inheritDoc Base.render} */\nexport const x = 1;',
1595
+ }),
1596
+ ),
1597
+ );
1598
+
1599
+ const {data} = await validateIntegration(undefined, {cwd: tmpDir});
1600
+ expect(
1601
+ (data.notes ?? []).filter((/** @type {any} */ note) =>
1602
+ ['package_manager_command', 'doc_token'].includes(note.code),
1603
+ ),
1604
+ ).toEqual([]);
1605
+ });
1606
+
1607
+ it('lists a token that never closes, in prose and in any code block', async () => {
1608
+ writeTopic(
1609
+ 'Install with {@pm install @acme/widgets --dev before you start.',
1610
+ );
1611
+ const file = path.join(tmpDir, 'docs', 'acme-setup.doc.mjs');
1612
+ fs.writeFileSync(
1613
+ file,
1614
+ fs.readFileSync(file, 'utf8').replace(
1615
+ /\{"type":"code"[^}]*\}/,
1616
+ JSON.stringify({
1617
+ type: 'code',
1618
+ lang: 'tsx',
1619
+ code: '// {@pm install @acme/widgets --dev\nexport const x = 1;',
1620
+ }),
1621
+ ),
1622
+ );
1623
+
1624
+ const {data} = await validateIntegration(undefined, {cwd: tmpDir});
1625
+ const tokens = (data.notes ?? []).filter(
1626
+ (/** @type {any} */ note) => note.code === 'doc_token',
1627
+ );
1628
+ expect(tokens).toHaveLength(2);
1629
+ expect(tokens[0].message).toContain('never closes');
1630
+ });
1631
+
1632
+ it('lists a {@command} token that names no Astryx command', async () => {
1633
+ writeTopic('Run {@command dcotor} before you ship.');
1634
+
1635
+ const {data} = await validateIntegration(undefined, {cwd: tmpDir});
1636
+ const tokens = (data.notes ?? []).filter(
1637
+ (/** @type {any} */ note) => note.code === 'doc_token',
1638
+ );
1639
+ expect(tokens).toHaveLength(1);
1640
+ expect(tokens[0].message).toContain('`dcotor` is not an Astryx command');
1641
+ });
1642
+
1643
+ it('reads the command after leading global flags in a {@command} token', async () => {
1644
+ writeTopic(
1645
+ 'Read it as data with {@command --json component Button} or {@command --detail full docs acme}, not {@command --json dcotor}, {@command --json nosuch docs} or {@command --detail full nosuch}. Check the version with {@command --version}; {@command --json} alone names nothing.',
1646
+ );
1647
+ const {data} = await validateIntegration(undefined, {cwd: tmpDir});
1648
+ const tokens = (data.notes ?? []).filter(
1649
+ (/** @type {any} */ note) => note.code === 'doc_token',
1650
+ );
1651
+ expect(
1652
+ tokens.map(note => note.message.match(/`(\w+)` is not/)?.[1]),
1653
+ ).toEqual(['dcotor', 'nosuch', 'nosuch', undefined]);
1654
+ expect(tokens[3].message).toContain('names no Astryx command');
1655
+ });
1656
+
1657
+ it('lists nothing for a topic written in the doc syntax', async () => {
1658
+ writeTopic(
1659
+ 'Add it with {@pm install @acme/widgets --dev}, run {@command docs acme}, and {@pm-only npm "only npm has pkg" pkg set name=x}. Show the syntax: {@@pm install x}.',
1660
+ );
1661
+ // The fixture's bash block holds a scoped install step; write it as a token.
1662
+ const file = path.join(tmpDir, 'docs', 'acme-setup.doc.mjs');
1663
+ fs.writeFileSync(
1664
+ file,
1665
+ fs
1666
+ .readFileSync(file, 'utf8')
1667
+ .replace(
1668
+ 'npx @astryxdesign/cli init',
1669
+ '{@pm dlx @astryxdesign/cli init}',
1670
+ ),
1671
+ );
1672
+
1673
+ const {data} = await validateIntegration(undefined, {cwd: tmpDir});
1674
+ expect(data.notes ?? []).toEqual([]);
1675
+ });
1676
+
1547
1677
  it('lists nothing for bare commands and the scoped install step', async () => {
1548
1678
  writeTopic('Check it with `astryx doctor` first.');
1549
1679
 
@@ -60,13 +60,16 @@ export function integrationCheck(options?: IntegrationCheckOptions): Promise<Int
60
60
  * on its own, so two findings with one message stay two.
61
61
  * @param {IntegrationCheckResponse[]} responses validate first
62
62
  * @param {boolean} strict
63
+ * @param {boolean} [next] count validate's notes marked `next`, the findings
64
+ * the next minor release turns into warnings, as warnings now
63
65
  */
64
- export function combineChecks(responses: IntegrationCheckResponse[], strict: boolean): {
66
+ export function combineChecks(responses: IntegrationCheckResponse[], strict: boolean, next?: boolean): {
65
67
  checks: import("../integration-check.type.mjs").IntegrationCheckResult[];
66
68
  errors: number;
67
69
  warnings: number;
68
70
  skipped: string[];
69
71
  unchecked: number;
72
+ upcoming: number;
70
73
  failures: import("../integration-check.type.mjs").IntegrationCheckFailure[];
71
74
  failed: boolean;
72
75
  };
@@ -11,7 +11,10 @@
11
11
  * any warning and on any check, or comparison a check carries, that did not
12
12
  * run, so a package can gate its build on its docs staying in sync. `--strict`
13
13
  * adds no check: it reports the same warnings and skipped work again, as
14
- * errors in the checks' own issue format, and fails on them.
14
+ * errors in the checks' own issue format, and fails on them. `--next` counts
15
+ * the findings the next minor release turns into warnings (validate's notes
16
+ * marked `next`) as warnings now, so a package can fix them ahead of the
17
+ * release; every run reports how many there are.
15
18
  *
16
19
  * What fails it is a contract for the builds that run it: a new check, or a
17
20
  * new failure code, joins only in a minor release that names it.
@@ -236,7 +239,7 @@ export function summarizeCheck(response, context = {}) {
236
239
  * @returns {Promise<IntegrationCheckCommandResponse>}
237
240
  */
238
241
  export async function integrationCheck(options = {}) {
239
- const {cwd = process.cwd(), strict = false} = options;
242
+ const {cwd = process.cwd(), strict = false, next = false} = options;
240
243
  // One after another: each loads the package through the same discovery.
241
244
  /** @type {IntegrationCheckResponse[]} */
242
245
  const responses = [];
@@ -253,7 +256,8 @@ export async function integrationCheck(options = {}) {
253
256
  name: validation.data.name,
254
257
  version: validation.data.version,
255
258
  strict,
256
- ...combineChecks(responses, strict),
259
+ next,
260
+ ...combineChecks(responses, strict, next),
257
261
  },
258
262
  };
259
263
  }
@@ -265,8 +269,10 @@ export async function integrationCheck(options = {}) {
265
269
  * on its own, so two findings with one message stay two.
266
270
  * @param {IntegrationCheckResponse[]} responses validate first
267
271
  * @param {boolean} strict
272
+ * @param {boolean} [next] count validate's notes marked `next`, the findings
273
+ * the next minor release turns into warnings, as warnings now
268
274
  */
269
- export function combineChecks(responses, strict) {
275
+ export function combineChecks(responses, strict, next = false) {
270
276
  const [validation] = responses;
271
277
  // Only validate reports a missing package.json; the other checks read it
272
278
  // from there instead of each naming a missing manifest.
@@ -345,12 +351,36 @@ export function combineChecks(responses, strict) {
345
351
  if (strict) failures.push({check, severity: 'error', ...issue});
346
352
  }
347
353
  });
354
+ // The findings the next minor release turns into warnings: always counted,
355
+ // so the default run can say how many there are, and with `next` counted
356
+ // as warnings now.
357
+ const notes =
358
+ /** @type {{notes?: Array<{code: string, message: string, next?: boolean}>}} */ (
359
+ validation.data
360
+ ).notes ?? [];
361
+ const upcoming = notes.filter(note => note.next === true);
362
+ if (next) {
363
+ warnings += upcoming.length;
364
+ // validate's own row counts them too, so the summary shows what fails.
365
+ checks[0].warnings += upcoming.length;
366
+ if (strict) {
367
+ for (const note of upcoming) {
368
+ failures.push({
369
+ check: 'validate',
370
+ severity: 'error',
371
+ code: note.code,
372
+ message: note.message,
373
+ });
374
+ }
375
+ }
376
+ }
348
377
  return {
349
378
  checks,
350
379
  errors,
351
380
  warnings,
352
381
  skipped,
353
382
  unchecked,
383
+ upcoming: upcoming.length,
354
384
  failures,
355
385
  failed: checks.some(check => check.failed) || failures.length > 0,
356
386
  };
@@ -276,6 +276,55 @@ describe('combineChecks', () => {
276
276
  respond('integration.doc-conflicts', {}),
277
277
  ];
278
278
 
279
+ it('counts the findings the next minor release fails as upcoming, and fails on them only with strict and next', () => {
280
+ const withNotes = [
281
+ respond('integration.validate', {
282
+ notes: [
283
+ {
284
+ code: 'duplicate_component_doc',
285
+ message: 'Two docs. Fix: one.',
286
+ next: true,
287
+ },
288
+ {code: 'invalid_cli_command', message: 'Not a command.'},
289
+ ],
290
+ }),
291
+ respond('integration.component-conflicts', {}),
292
+ respond('integration.template-conflicts', {}),
293
+ respond('integration.doc-conflicts', {}),
294
+ ];
295
+ // The default run, strict included, fails on none: the next minor does.
296
+ for (const strict of [false, true]) {
297
+ expect(combineChecks(withNotes, strict)).toMatchObject({
298
+ upcoming: 1,
299
+ warnings: 0,
300
+ failures: [],
301
+ failed: false,
302
+ });
303
+ }
304
+ expect(combineChecks(withNotes, false, true)).toMatchObject({
305
+ upcoming: 1,
306
+ warnings: 1,
307
+ failures: [],
308
+ failed: false,
309
+ });
310
+ // validate's own summary row shows the note it now counts.
311
+ expect(combineChecks(withNotes, false, true).checks[0].warnings).toBe(1);
312
+ expect(combineChecks(withNotes, false).checks[0].warnings).toBe(0);
313
+ expect(combineChecks(withNotes, true, true)).toMatchObject({
314
+ upcoming: 1,
315
+ warnings: 1,
316
+ failures: [
317
+ {
318
+ check: 'validate',
319
+ severity: 'error',
320
+ code: 'duplicate_component_doc',
321
+ message: 'Two docs. Fix: one.',
322
+ },
323
+ ],
324
+ failed: true,
325
+ });
326
+ });
327
+
279
328
  it('counts a package-level issue once, and two findings with one message twice, naming each component', () => {
280
329
  const loose = combineChecks(responses, false);
281
330
  const strict = combineChecks(responses, true);
@@ -15,6 +15,12 @@ export type IntegrationCheckOptions = {
15
15
  * did not run, not only on errors.
16
16
  */
17
17
  strict?: boolean | undefined;
18
+ /**
19
+ * Also count each finding the next minor release
20
+ * turns into a warning (a note marked `next`) as a warning now, so `strict`
21
+ * fails on it.
22
+ */
23
+ next?: boolean | undefined;
18
24
  };
19
25
  /**
20
26
  * The checks `integrationCheck()` runs, in the order it runs them.
@@ -107,11 +113,13 @@ export type IntegrationCheckCommandResponse = {
107
113
  name: string | null;
108
114
  version: string | null;
109
115
  strict: boolean;
116
+ next: boolean;
110
117
  checks: IntegrationCheckResult[];
111
118
  errors: number;
112
119
  warnings: number;
113
120
  skipped: string[];
114
121
  unchecked: number;
122
+ upcoming: number;
115
123
  failures: IntegrationCheckFailure[];
116
124
  failed: boolean;
117
125
  };
@@ -11,6 +11,9 @@
11
11
  * current directory by default.
12
12
  * @property {boolean} [strict] Also fail on any warning and on any check that
13
13
  * did not run, not only on errors.
14
+ * @property {boolean} [next] Also count each finding the next minor release
15
+ * turns into a warning (a note marked `next`) as a warning now, so `strict`
16
+ * fails on it.
14
17
  */
15
18
 
16
19
  /**
@@ -78,7 +81,7 @@
78
81
  * @property {'integration.check'} type
79
82
  * `unchecked` counts the items the checks list as not compared, which never
80
83
  * fail it.
81
- * @property {{validated: boolean, name: string | null, version: string | null, strict: boolean, checks: IntegrationCheckResult[], errors: number, warnings: number, skipped: string[], unchecked: number, failures: IntegrationCheckFailure[], failed: boolean}} data
84
+ * @property {{validated: boolean, name: string | null, version: string | null, strict: boolean, next: boolean, checks: IntegrationCheckResult[], errors: number, warnings: number, skipped: string[], unchecked: number, upcoming: number, failures: IntegrationCheckFailure[], failed: boolean}} data
82
85
  */
83
86
 
84
87
  export {};
@@ -44,12 +44,19 @@ export const doc = {
44
44
  description:
45
45
  'Also fail on any warning and on any check that did not run, not only on errors. A malformed `cliCommand` is reported as a note (`invalid_cli_command`) in `data.notes` of the validate check, which fails nothing until a minor release names it.',
46
46
  },
47
+ {
48
+ name: 'options.next',
49
+ type: 'boolean',
50
+ default: 'false',
51
+ description:
52
+ "Also count the findings the next minor release turns into warnings, validate's notes marked `next`, as warnings now, so `strict` fails on them.",
53
+ },
47
54
  ],
48
55
  returns: [
49
56
  {
50
57
  type: 'integration.check',
51
58
  description:
52
- "`data.validated` (false when no integration manifest was found, so nothing was checked), `data.name` and `data.version` of the package, `data.strict`, and `data.checks`, one entry per check in the order they run (`validate`, `components`, `templates`, `docs`), each with `check`, `errors` (what makes that check's own subcommand exit 1), `warnings`, `skipped` (why work did not run), `failed` (whether that subcommand exits 1), and `response`, the envelope the check returns on its own. The totals are `data.errors`, `data.warnings`, and `data.skipped` (each reason prefixed with its check); an issue every check starts from, such as one about the manifest, counts once, and every other finding counts on its own. `data.unchecked` counts the items the checks list as not compared, which never fail it. With `strict`, `data.failures` lists each warning and each piece of skipped work once again as an error in the checks' own issue format ({check, severity: `error`, code, message, component, prop, fix, file, line}, each where it applies); it is empty without `strict`. `data.failed` decides the exit code.",
59
+ "`data.validated` (false when no integration manifest was found, so nothing was checked), `data.name` and `data.version` of the package, `data.strict`, `data.next`, and `data.checks`, one entry per check in the order they run (`validate`, `components`, `templates`, `docs`), each with `check`, `errors` (what makes that check's own subcommand exit 1), `warnings`, `skipped` (why work did not run), `failed` (whether that subcommand exits 1), and `response`, the envelope the check returns on its own. The totals are `data.errors`, `data.warnings`, and `data.skipped` (each reason prefixed with its check); an issue every check starts from, such as one about the manifest, counts once, and every other finding counts on its own. `data.unchecked` counts the items the checks list as not compared, which never fail it. `data.upcoming` counts the findings the next minor release turns into warnings (validate's notes marked `next`), and `data.next` says whether this run counted them as warnings now. With `strict`, `data.failures` lists each warning and each piece of skipped work once again as an error in the checks' own issue format ({check, severity: `error`, code, message, component, prop, fix, file, line}, each where it applies); it is empty without `strict`. `data.failed` decides the exit code.",
53
60
  },
54
61
  ],
55
62
  examples: [
@@ -19,7 +19,7 @@ export const doc = {
19
19
  "package's topics, or one of them and a Core topic other than the one it replaces. " +
20
20
  'Code and examples are not compared. `fluff` lists each padding phrase, with its file ' +
21
21
  'line, and each topic of 80 or more prose words in which fewer than half carry content. ' +
22
- '`strayPointers` lists each code span that is exactly `astryx docs <name>` for a doc that ' +
22
+ '`strayPointers` lists each code span that is exactly `{@command docs <name>}` for a doc that ' +
23
23
  "exists, in a topic's prose, description or summary or a component doc's text fields, " +
24
24
  'with the `{@link}` that replaces it. ' +
25
25
  'Each entry of these lists is also a warning (`copied_passage`, `doc_fluff`, `stray_doc_pointer`), so ' +
@@ -25,6 +25,7 @@ import * as os from 'node:os';
25
25
  import {fileURLToPath} from 'node:url';
26
26
  import {spawnSync} from 'node:child_process';
27
27
  import {assertWithin} from '../../foundation/fs/path-safety.mjs';
28
+ import {commandTokensIn} from '../../foundation/doc-compiler/doc-syntax.mjs';
28
29
  import {resolvePackageDir} from '../../foundation/integrations/integrations.mjs';
29
30
  import {
30
31
  literalThemeName,
@@ -37,6 +38,8 @@ import {
37
38
  keywordsCliProblem,
38
39
  replacesCliProblem,
39
40
  sectionIdsCliProblem,
41
+ docTokensCliProblem,
42
+ sectionPositionCliProblem,
40
43
  themesCliProblem,
41
44
  } from '../../foundation/integrations/cli-requirement.mjs';
42
45
  import {
@@ -230,7 +233,12 @@ export function parseNpmPackOutput(output) {
230
233
  throw new Error('npm pack returned a result without a files array.');
231
234
  }
232
235
  return {
233
- filename: info.filename,
236
+ // npm 8 names a scoped package's tarball `@scope/name-1.0.0.tgz` in its
237
+ // JSON but writes `scope-name-1.0.0.tgz`, as every later npm reports.
238
+ filename:
239
+ typeof info.filename === 'string' && /^@[^/]+\//.test(info.filename)
240
+ ? info.filename.slice(1).replace('/', '-')
241
+ : info.filename,
234
242
  fileCount: info.entryCount,
235
243
  size: info.size,
236
244
  unpackedSize: info.unpackedSize,
@@ -317,19 +325,50 @@ function extractTarball(tgzPath, extractDir) {
317
325
  }
318
326
  }
319
327
 
328
+ /**
329
+ * Whether any of these doc files writes a doc token (`{@command …}`, `{@pm …}`
330
+ * or `{@pm-only …}`; an escaped `{@@…}` is not one).
331
+ * @param {unknown[]} files
332
+ * @returns {boolean}
333
+ */
334
+ function writesDocTokens(files) {
335
+ return files.some(file => {
336
+ if (typeof file !== 'string') return false;
337
+ try {
338
+ return commandTokensIn(fs.readFileSync(file, 'utf8')).length > 0;
339
+ } catch {
340
+ return false;
341
+ }
342
+ });
343
+ }
344
+
320
345
  /**
321
346
  * Whether any of these doc files has a section that sets `id`.
322
347
  * @param {string[]} files
323
348
  * @returns {Promise<boolean>}
324
349
  */
325
350
  async function setsSectionIds(files) {
351
+ return setsSectionField(files, ['id']);
352
+ }
353
+
354
+ /**
355
+ * Whether any of these doc files has a section that sets one of `fields`.
356
+ * @param {string[]} files
357
+ * @param {string[]} fields
358
+ * @returns {Promise<boolean>}
359
+ */
360
+ async function setsSectionField(files, fields) {
326
361
  for (const file of files) {
327
362
  if (typeof file !== 'string') continue;
328
363
  const doc = /** @type {any} */ (
329
364
  await loadTopicModule(file).catch(() => null)
330
365
  );
331
366
  const sections = Array.isArray(doc?.sections) ? doc.sections : [];
332
- if (sections.some((/** @type {any} */ section) => section?.id != null)) {
367
+ if (
368
+ sections.some((/** @type {any} */ section) =>
369
+ fields.some(field => section?.[field] != null),
370
+ )
371
+ ) {
333
372
  return true;
334
373
  }
335
374
  }
@@ -1378,6 +1417,36 @@ export async function integrationPackCheck(options = {}) {
1378
1417
  issues.push(error('section_ids_need_cli', idProblem));
1379
1418
  }
1380
1419
  }
1420
+ // `before` and `after` need a newer CLI than any field above. Added in a
1421
+ // patch release, it warns and never fails the check (INV35).
1422
+ if (
1423
+ await setsSectionField(
1424
+ [
1425
+ ...records.map(record => record.path),
1426
+ ...guides.map(guide => /** @type {any} */ (guide.ref).topicFile),
1427
+ ],
1428
+ ['before', 'after'],
1429
+ )
1430
+ ) {
1431
+ const positionProblem = sectionPositionCliProblem(pkg);
1432
+ if (positionProblem != null) {
1433
+ issues.push(warning('section_position_needs_cli', positionProblem));
1434
+ }
1435
+ }
1436
+ // A doc token shows as written on a CLI before the one that renders
1437
+ // them. Added in a patch release, it warns and never fails (INV35).
1438
+ if (
1439
+ problem == null &&
1440
+ writesDocTokens([
1441
+ ...records.map(record => record.path),
1442
+ ...guides.map(guide => /** @type {any} */ (guide.ref).topicFile),
1443
+ ])
1444
+ ) {
1445
+ const tokenProblem = docTokensCliProblem(pkg);
1446
+ if (tokenProblem != null) {
1447
+ issues.push(warning('doc_tokens_need_cli', tokenProblem));
1448
+ }
1449
+ }
1381
1450
  }
1382
1451
  // A template that sets `replaces` (spec:AST-035) or `keywords` needs a CLI
1383
1452
  // that reads the field: an older CLI drops that template and can hide the