@astryxdesign/cli 0.7.3-canary.31e06f4 → 0.7.3-canary.641d08e

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 (122) hide show
  1. package/README.md +68 -68
  2. package/api/component/doc-links.test.mjs +2 -2
  3. package/api/docs/_adapter.d.mts +2 -2
  4. package/api/docs/_adapter.mjs +61 -18
  5. package/api/docs/docs-homes.test.mjs +127 -0
  6. package/api/docs/docs.doc.mjs +3 -3
  7. package/api/docs/docs.test.mjs +28 -18
  8. package/api/docs/integration-tree.test.mjs +20 -20
  9. package/api/docs/integrationDocs.test.mjs +1 -1
  10. package/api/docs/namespace-section.test.mjs +6 -6
  11. package/api/docs/reference-blocks.test.mjs +2 -2
  12. package/api/doctor/doctor.mjs +16 -12
  13. package/api/doctor/doctor.test.mjs +9 -9
  14. package/api/integration/_adapter.d.mts +8 -0
  15. package/api/integration/_adapter.mjs +21 -1
  16. package/api/integration/authoring-checks.test.mjs +220 -0
  17. package/api/integration/validate-integration.mjs +24 -0
  18. package/api/integration/validate-integration.type.d.mts +2 -1
  19. package/api/integration/validate-integration.type.mjs +2 -1
  20. package/api/integration/validateIntegration.doc.mjs +1 -1
  21. package/api/search/_candidate-score.mjs +1 -1
  22. package/api/search/_entries.mjs +57 -1
  23. package/api/search/_gather-docs.mjs +3 -3
  24. package/api/search/search.doc.mjs +1 -1
  25. package/api/search/search.test.mjs +14 -14
  26. package/assets/docs/author-a-theme.doc.mjs +2 -2
  27. package/assets/docs/tree/add-a-component.doc.mjs +1 -1
  28. package/assets/docs/tree/add-a-theme.doc.mjs +1 -1
  29. package/assets/docs/tree/add-a-topic.doc.mjs +2 -2
  30. package/assets/docs/tree/agent-guidance.doc.mjs +1 -1
  31. package/assets/docs/tree/{integrations.doc.mjs → authoring.doc.mjs} +15 -6
  32. package/assets/docs/tree/block-template.doc.mjs +1 -1
  33. package/assets/docs/tree/build-the-template.doc.mjs +1 -1
  34. package/assets/docs/tree/building-blocks.doc.mjs +2 -2
  35. package/assets/docs/tree/check-the-props.doc.mjs +1 -1
  36. package/assets/docs/tree/check-your-docs.doc.mjs +2 -2
  37. package/assets/docs/tree/checks.doc.mjs +2 -2
  38. package/assets/docs/tree/cli-command.doc.mjs +1 -1
  39. package/assets/docs/tree/cli.doc.mjs +1 -1
  40. package/assets/docs/tree/codemods.doc.mjs +1 -1
  41. package/assets/docs/tree/component-family.doc.mjs +1 -1
  42. package/assets/docs/tree/component-imports.doc.mjs +1 -1
  43. package/assets/docs/tree/components.doc.mjs +1 -1
  44. package/assets/docs/tree/configuration.doc.mjs +1 -1
  45. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +1 -1
  46. package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
  47. package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
  48. package/assets/docs/tree/docs.doc.mjs +1 -1
  49. package/assets/docs/tree/document-the-template.doc.mjs +1 -1
  50. package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
  51. package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
  52. package/assets/docs/tree/extend-or-replace.doc.mjs +1 -1
  53. package/assets/docs/{authoring.doc.mjs → tree/field-reference.doc.mjs} +4 -3
  54. package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
  55. package/assets/docs/tree/generate-a-palette.doc.mjs +1 -1
  56. package/assets/docs/tree/global-integrations.doc.mjs +2 -2
  57. package/assets/docs/tree/grade-template-with-agent.doc.mjs +4 -4
  58. package/assets/docs/tree/help.doc.mjs +2 -2
  59. package/assets/docs/tree/links.doc.mjs +1 -1
  60. package/assets/docs/tree/package-and-test.doc.mjs +1 -1
  61. package/assets/docs/tree/page-template.doc.mjs +1 -1
  62. package/assets/docs/tree/publishing.doc.mjs +1 -1
  63. package/assets/docs/tree/quick-start.doc.mjs +1 -1
  64. package/assets/docs/tree/replace-a-core-component.doc.mjs +1 -1
  65. package/assets/docs/tree/replace-a-core-template.doc.mjs +1 -1
  66. package/assets/docs/tree/sections-and-placement.doc.mjs +1 -1
  67. package/assets/docs/tree/see-it-in-an-app.doc.mjs +1 -1
  68. package/assets/docs/tree/ship.doc.mjs +2 -2
  69. package/assets/docs/tree/short-and-findable.doc.mjs +1 -1
  70. package/assets/docs/tree/single-component.doc.mjs +1 -1
  71. package/assets/docs/tree/start-a-template.doc.mjs +1 -1
  72. package/assets/docs/tree/subcomponent.doc.mjs +1 -1
  73. package/assets/docs/tree/template-assets.doc.mjs +1 -1
  74. package/assets/docs/tree/template-doc-overview.doc.mjs +2 -2
  75. package/assets/docs/tree/template-fonts.doc.mjs +1 -1
  76. package/assets/docs/tree/template-grading-rubric.doc.mjs +1 -1
  77. package/assets/docs/tree/template-icons.doc.mjs +1 -1
  78. package/assets/docs/tree/template-images-media.doc.mjs +1 -1
  79. package/assets/docs/tree/template-styles.doc.mjs +1 -1
  80. package/assets/docs/tree/templates.doc.mjs +1 -1
  81. package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
  82. package/assets/docs/tree/test-template-in-app.doc.mjs +1 -1
  83. package/assets/docs/tree/themes.doc.mjs +1 -1
  84. package/assets/docs/tree/troubleshooting.doc.mjs +1 -1
  85. package/assets/docs/tree/upgrading.doc.mjs +1 -1
  86. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +1 -1
  87. package/assets/docs/tree/verify-packed-template.doc.mjs +1 -1
  88. package/assets/docs/tree/versioning.doc.mjs +1 -1
  89. package/assets/docs/tree/write-good-templates.doc.mjs +1 -1
  90. package/assets/docs/tree/write-the-template-file.doc.mjs +1 -1
  91. package/authoring/doctypes/schema/schema.doc.mjs +1 -1
  92. package/authoring/integration/integration.doc.mjs +1 -1
  93. package/authoring/integration/type.ts +1 -1
  94. package/clients/cli/commands/docs.doc.mjs +2 -2
  95. package/clients/cli/commands/docs.mjs +1 -1
  96. package/clients/cli/commands/docs.test.mjs +14 -14
  97. package/clients/cli/commands/integration-check.test.mjs +48 -0
  98. package/clients/cli/commands/integration.doc.mjs +1 -1
  99. package/foundation/agent-docs/agent-docs.mjs +2 -1
  100. package/foundation/agent-docs/agent-docs.test.mjs +5 -4
  101. package/foundation/discovery/authoring-self-docs.d.mts +7 -0
  102. package/foundation/discovery/authoring-self-docs.mjs +16 -4
  103. package/foundation/discovery/authoring-self-docs.test.mjs +15 -3
  104. package/foundation/discovery/authoring-surface.d.mts +1 -1
  105. package/foundation/discovery/authoring-surface.mjs +2 -2
  106. package/foundation/discovery/authoring-surface.test.mjs +1 -1
  107. package/foundation/discovery/cli-self-docs.d.mts +2 -1
  108. package/foundation/discovery/cli-self-docs.mjs +4 -3
  109. package/foundation/discovery/cli-self-docs.test.mjs +2 -2
  110. package/foundation/discovery/runner-allowlist.d.mts +2 -4
  111. package/foundation/discovery/runner-allowlist.mjs +2 -4
  112. package/foundation/discovery/runner-commands.d.mts +77 -0
  113. package/foundation/discovery/runner-commands.mjs +293 -0
  114. package/foundation/discovery/runner-commands.test.mjs +128 -0
  115. package/foundation/discovery/stray-pointers.test.mjs +1 -1
  116. package/foundation/doc-compiler/doc-loads.test.mjs +4 -0
  117. package/foundation/doc-compiler/split-topic-keywords.test.mjs +3 -2
  118. package/foundation/doc-compiler/tree.d.mts +32 -6
  119. package/foundation/doc-compiler/tree.mjs +77 -43
  120. package/foundation/doc-compiler/tree.test.mjs +7 -7
  121. package/foundation/response/response-types.doc.mjs +1 -1
  122. package/package.json +9 -9
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/docs/sections-and-placement`:
4
+ * @file `astryx docs authoring/building-blocks/docs/sections-and-placement`:
5
5
  * give an integration package its own section in the docs tree, place guides
6
6
  * in it, and fix a placement that fails.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/components/see-it-in-an-app`: inspect an
4
+ * @file `astryx docs authoring/building-blocks/components/see-it-in-an-app`: inspect an
5
5
  * integration component from an app that installs the package.
6
6
  */
7
7
 
@@ -1,12 +1,12 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- /** @file astryx docs cli/integrations/ship — test, publish, and upgrade. */
3
+ /** @file astryx docs authoring/ship — test, publish, and upgrade. */
4
4
 
5
5
  /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
6
6
  export const docs = {
7
7
  type: 'namespace',
8
8
  name: 'ship',
9
- placement: {parent: 'namespace:integrations', slot: 'guides', order: 30},
9
+ placement: {parent: 'namespace:authoring', slot: 'guides', order: 30},
10
10
  title: 'Ship',
11
11
  summary: 'Test, publish, and upgrade your package.',
12
12
  keywords: ['ship', 'publish', 'release', 'upgrade'],
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/docs/short-and-findable`:
4
+ * @file `astryx docs authoring/building-blocks/docs/short-and-findable`:
5
5
  * keep each read short, lead each section with its summary, and write docs
6
6
  * that search finds.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/components/describe-the-component/single-component`:
4
+ * @file `astryx docs authoring/building-blocks/components/describe-the-component/single-component`:
5
5
  * write and maintain the default ComponentDoc for one public component.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/start-a-template`:
4
+ * @file `astryx docs authoring/building-blocks/templates/start-a-template`:
5
5
  * what a template is, why an integration shares one, whether it is a page or
6
6
  * a block, and how to add one.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/components/describe-the-component/subcomponent`:
4
+ * @file `astryx docs authoring/building-blocks/components/describe-the-component/subcomponent`:
5
5
  * give one member of a component family its own ComponentDoc.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/template-assets`:
4
+ * @file `astryx docs authoring/building-blocks/templates/build-the-template/template-assets`:
5
5
  * make every style, font, icon, and media dependency survive a template copy.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/document-the-template/template-doc-overview`:
4
+ * @file `astryx docs authoring/building-blocks/templates/document-the-template/template-doc-overview`:
5
5
  * the source and doc file pair, the fields every template doc shares, and how
6
6
  * to check what Astryx lists.
7
7
  */
@@ -67,7 +67,7 @@ export const docs = {
67
67
  'Set `type` to the kind you chose in {@link generic:start-a-template}. It decides which other fields the doc accepts.',
68
68
  'The file name sets the template id ({@link generic:start-a-template}). Labels live in the doc: the terminal list prints `name`, and JSON listings print `displayName`. Changing either never changes the id.',
69
69
  'Write the description for someone choosing between templates. The Doc metadata category in {@link generic:template-grading-rubric} defines what a complete description covers.',
70
- "Name the ideas the template serves in `keywords`: the domains, tasks, and other names a builder might use for it, in lowercase, such as `['monitoring', 'uptime', 'on-call']` for a service-health dashboard. How search and build use them is in {@link generic:authoring}, so the description can stay about the layout.",
70
+ "Name the ideas the template serves in `keywords`: the domains, tasks, and other names a builder might use for it, in lowercase, such as `['monitoring', 'uptime', 'on-call']` for a service-health dashboard. How search and build use them is in {@link generic:field-reference}, so the description can stay about the layout.",
71
71
  'Add `isReady: false` as soon as you generate the doc, because a doc without `isReady` is listed as ready. Keep it until the template passes {@link generic:test-template-in-app} and the quality review.',
72
72
  ],
73
73
  },
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/template-assets/template-fonts`:
4
+ * @file `astryx docs authoring/building-blocks/templates/build-the-template/template-assets/template-fonts`:
5
5
  * use the app typeface by default, and ship every font file a template needs
6
6
  * when it must bring its own.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/templates/template-grading-rubric`:
4
+ * @file `astryx docs authoring/templates/template-grading-rubric`:
5
5
  * complete scoring rules for page and block template quality.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/template-assets/template-icons`:
4
+ * @file `astryx docs authoring/building-blocks/templates/build-the-template/template-assets/template-icons`:
5
5
  * render template icons through Astryx and ship custom product icons from the
6
6
  * package.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/template-assets/template-images-media`:
4
+ * @file `astryx docs authoring/building-blocks/templates/build-the-template/template-assets/template-images-media`:
5
5
  * keep template images and video working after the copy, or make them clear
6
6
  * placeholders.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/template-assets/template-styles`:
4
+ * @file `astryx docs authoring/building-blocks/templates/build-the-template/template-assets/template-styles`:
5
5
  * style a template with Astryx first, keep editable styles in the file, and
6
6
  * ship shared CSS from the package.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates`: guides for adding,
4
+ * @file `astryx docs authoring/building-blocks/templates`: guides for adding,
5
5
  * documenting, packaging, and testing templates in an integration package.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/ship/test-in-an-app`: install the packed
4
+ * @file `astryx docs authoring/ship/test-in-an-app`: install the packed
5
5
  * package in an app and run the commands its users run.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/package-and-test/test-template-in-app`:
4
+ * @file `astryx docs authoring/building-blocks/templates/build-the-template/package-and-test/test-template-in-app`:
5
5
  * copy the packed template into a clean app, build it, and render it the way
6
6
  * apps will.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/themes`: author a theme
4
+ * @file `astryx docs authoring/building-blocks/themes`: author a theme
5
5
  * in an integration; apps install, apply, and extend it like any theme.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/help/troubleshooting`: the messages the CLI
4
+ * @file `astryx docs authoring/help/troubleshooting`: the messages the CLI
5
5
  * prints while you build, verify, and install an integration, and the fix
6
6
  * for each.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/ship/upgrading`: update an integration
4
+ * @file `astryx docs authoring/ship/upgrading`: update an integration
5
5
  * package for each Astryx release, and the command apps run to upgrade with
6
6
  * it.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/themes/use-a-theme-in-an-app`:
4
+ * @file `astryx docs authoring/building-blocks/themes/use-a-theme-in-an-app`:
5
5
  * an app installs the integration and applies or extends the theme, like any theme.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/package-and-test/verify-packed-template`:
4
+ * @file `astryx docs authoring/building-blocks/templates/build-the-template/package-and-test/verify-packed-template`:
5
5
  * what `integration verify` checks for templates, and what it leaves to the
6
6
  * app test.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/ship/versioning`: version an integration
4
+ * @file `astryx docs authoring/ship/versioning`: version an integration
5
5
  * package, know which changes break apps, declare peer ranges, keep apps on
6
6
  * older CLIs working, and match codemod folders to versions.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/write-good-templates`:
4
+ * @file `astryx docs authoring/building-blocks/templates/write-good-templates`:
5
5
  * what makes a template good, the rubric that scores it, and grading with an agent.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/write-the-template-file`:
4
+ * @file `astryx docs authoring/building-blocks/templates/build-the-template/write-the-template-file`:
5
5
  * what gets copied, where the copied file lands, and the imports and
6
6
  * export a copied template needs.
7
7
  */
@@ -49,7 +49,7 @@ export const doc = {
49
49
  name: 'namespace',
50
50
  type: 'string',
51
51
  description:
52
- "The group that reads this doc: 'authoring' for a file an author writes (a section of {@link generic:authoring}), or 'cli/api' for a shape the CLI returns (the docs tree adopts it by kind, as the leaf `cli/api/schemas/<name>`). Every schema doc the CLI ships declares one, and `astryx doctor` fails on one that is missing or that nothing reads.",
52
+ "The group that reads this doc: 'authoring' for a file an author writes (a section of {@link generic:field-reference}), or 'cli/api' for a shape the CLI returns (the docs tree adopts it by kind, as the leaf `cli/api/schemas/<name>`). Every schema doc the CLI ships declares one, and `astryx doctor` fails on one that is missing or that nothing reads.",
53
53
  },
54
54
  {
55
55
  name: 'aliases',
@@ -131,7 +131,7 @@ export const doc = {
131
131
  },
132
132
  {
133
133
  type: 'prose',
134
- text: "Set `cliCommand` only when your users run the CLI with a command other than their package manager's, such as `acme astryx`. The CLI picks the command it prints in this order: the `cliCommand` of the loaded integrations when they name one command, then the command a host tool names, then the package manager's. Two different `cliCommand` values cancel out, and `astryx doctor` warns in its `cli-command` check. See `astryx docs cli/integrations/building-blocks/configuration/cli-command`.",
134
+ text: "Set `cliCommand` only when your users run the CLI with a command other than their package manager's, such as `acme astryx`. The CLI picks the command it prints in this order: the `cliCommand` of the loaded integrations when they name one command, then the command a host tool names, then the package manager's. Two different `cliCommand` values cancel out, and `astryx doctor` warns in its `cli-command` check. See `astryx docs authoring/building-blocks/configuration/cli-command`.",
135
135
  },
136
136
  {
137
137
  type: 'prose',
@@ -11,7 +11,7 @@
11
11
  * The manifest module may also carry `debug` and `gapReport` NAMED exports.
12
12
  * They are not fields here on purpose: a CLI released before a given manifest
13
13
  * field existed could reject it and lose every contribution, while an unknown
14
- * named export is simply not read. See `astryx docs cli/integrations`.
14
+ * named export is simply not read. See `astryx docs authoring`.
15
15
  */
16
16
  export interface AstryxIntegration {
17
17
  /** Stable logical provider ID. Omit to use package.json#name. Set this only
@@ -58,10 +58,10 @@ export const doc = {
58
58
  {label: 'Every CLI doc, one line each', cli: 'astryx docs cli --depth all'},
59
59
  {
60
60
  label: 'The integration guides as one read',
61
- cli: 'astryx docs cli/integrations --depth all --detail full',
61
+ cli: 'astryx docs authoring --depth all --detail full',
62
62
  },
63
63
  {label: 'One API function', cli: 'astryx docs cli/api/functions/search'},
64
- {label: 'A whole guide', cli: 'astryx docs cli/integrations/quick-start --full'},
64
+ {label: 'A whole guide', cli: 'astryx docs authoring/quick-start --full'},
65
65
  ],
66
66
  outsideProject: 'same',
67
67
  exitCodes: [
@@ -535,7 +535,7 @@ function emitNode(node, detail, run) {
535
535
  text(
536
536
  [
537
537
  // A child's route is its parent's route and its name, except a flat
538
- // topic in the Unorganized level, which keeps its own name.
538
+ // topic in a topic level, which keeps its own name.
539
539
  node.slots.every(slot =>
540
540
  slot.children.every(child => child.route.startsWith(`${node.route}/`)),
541
541
  )
@@ -227,7 +227,7 @@ describe('the docs tree, one level at a time', () => {
227
227
  it('wraps namespace summaries without discarding searchable words', async () => {
228
228
  const {status, stdout} = await runCli([
229
229
  'docs',
230
- 'cli/integrations/building-blocks/templates',
230
+ 'authoring/building-blocks/templates',
231
231
  ]);
232
232
  expect(status).toBe(0);
233
233
  expect(stdout).toMatch(/^start-a-template +Help others build apps faster/m);
@@ -274,8 +274,8 @@ describe('the docs tree, one level at a time', () => {
274
274
  }, SLOW);
275
275
 
276
276
  it('reads the integration guides by their routes, and not by the old name', async () => {
277
- // cli/integrations is a namespace: one level, its guides by slot.
278
- const level = await runCli(['docs', 'cli/integrations']);
277
+ // authoring is a namespace: one level, its guides by slot.
278
+ const level = await runCli(['docs', 'authoring']);
279
279
  expect(level.status).toBe(0);
280
280
  expect(level.stdout).toMatch(
281
281
  /^quick-start +Create a new integration package/m,
@@ -283,42 +283,42 @@ describe('the docs tree, one level at a time', () => {
283
283
  expect(level.stdout).toMatch(/^building-blocks +/m);
284
284
  const guide = await runCli([
285
285
  'docs',
286
- 'cli/integrations/building-blocks/codemods',
286
+ 'authoring/building-blocks/codemods',
287
287
  '--index',
288
288
  ]);
289
289
  expect(guide.status).toBe(0);
290
290
  expect(guide.stdout).toMatch(
291
- /Read one section: .*docs cli\/integrations\/building-blocks\/codemods <section>/,
291
+ /Read one section: .*docs authoring\/building-blocks\/codemods <section>/,
292
292
  );
293
293
  // A bare read is one level too: the sections, and how to read it all.
294
294
  const bare = await runCli([
295
295
  'docs',
296
- 'cli/integrations/building-blocks/codemods',
296
+ 'authoring/building-blocks/codemods',
297
297
  ]);
298
298
  expect(bare.status).toBe(0);
299
299
  expect(bare.stdout).toBe(guide.stdout);
300
300
  expect(bare.stdout).toMatch(
301
- /Read everything: +.*docs cli\/integrations\/building-blocks\/codemods --full$/m,
301
+ /Read everything: +.*docs authoring\/building-blocks\/codemods --full$/m,
302
302
  );
303
303
  const one = await runCli([
304
304
  'docs',
305
- 'cli/integrations/building-blocks/codemods',
305
+ 'authoring/building-blocks/codemods',
306
306
  'which-codemods-run',
307
307
  ]);
308
308
  expect(one.status).toBe(0);
309
309
  expect(one.stdout).toMatch(/^## Choose when a codemod runs$/m);
310
310
  expect(one.stdout).toMatch(
311
- /^Up: .*docs cli\/integrations\/building-blocks\/codemods --index$/m,
311
+ /^Up: .*docs authoring\/building-blocks\/codemods --index$/m,
312
312
  );
313
313
  expect(one.stdout).toMatch(
314
- /^Previous: .*docs cli\/integrations\/building-blocks\/codemods write-the-transform$/m,
314
+ /^Previous: .*docs authoring\/building-blocks\/codemods write-the-transform$/m,
315
315
  );
316
316
  expect(one.stdout).toMatch(
317
- /^Next: .*docs cli\/integrations\/building-blocks\/codemods run-codemods-in-an-app$/m,
317
+ /^Next: .*docs authoring\/building-blocks\/codemods run-codemods-in-an-app$/m,
318
318
  );
319
319
  const full = await runCli([
320
320
  'docs',
321
- 'cli/integrations/building-blocks/codemods',
321
+ 'authoring/building-blocks/codemods',
322
322
  '--full',
323
323
  ]);
324
324
  expect(full.status).toBe(0);
@@ -343,11 +343,11 @@ describe('the docs tree, one level at a time', () => {
343
343
  type: 'docs.detail.section',
344
344
  data: {id: 'side-panels', title: 'Side panels'},
345
345
  });
346
- const missing = await runCli(['docs', 'cli', 'zzzz-nope', '--json']);
346
+ const missing = await runCli(['docs', 'authoring', 'zzzz-nope', '--json']);
347
347
  expect(missing.status).toBe(1);
348
348
  const error = JSON.parse(missing.stdout);
349
349
  expect(error).toMatchObject({code: 'ERR_UNKNOWN_SECTION'});
350
- expect(error.suggestions.map(s => s.name)).toContain('cli/integrations/quick-start');
350
+ expect(error.suggestions.map(s => s.name)).toContain('authoring/quick-start');
351
351
  }, SLOW);
352
352
  });
353
353
 
@@ -439,3 +439,51 @@ describe('a stray doc pointer', () => {
439
439
  expect(strict.stdout).toContain('stray_doc_pointer');
440
440
  });
441
441
  });
442
+ describe('a command written with a runner', () => {
443
+ it('is a note in doctor integration validate, and integration check --strict still passes', async () => {
444
+ fs.writeFileSync(
445
+ path.join(tmpDir, 'package.json'),
446
+ JSON.stringify({name: '@acme/widgets', version: '1.2.3'}),
447
+ );
448
+ fs.writeFileSync(
449
+ path.join(tmpDir, 'astryx.integration.mjs'),
450
+ `export default {docs: './docs'};\n`,
451
+ );
452
+ fs.mkdirSync(path.join(tmpDir, 'docs'));
453
+ const doc = {
454
+ type: 'generic',
455
+ name: 'acme-setup',
456
+ title: 'Fixture',
457
+ description: 'Fixture topic.',
458
+ sections: [
459
+ {
460
+ title: 'Overview',
461
+ content: [{type: 'code', lang: 'bash', code: 'npx astryx doctor'}],
462
+ },
463
+ ],
464
+ };
465
+ fs.writeFileSync(
466
+ path.join(tmpDir, 'docs', 'acme-setup.doc.mjs'),
467
+ `export default ${JSON.stringify(doc)};\n`,
468
+ );
469
+
470
+ const doctor = await runCli(['doctor', 'integration', 'validate'], tmpDir);
471
+ expect(doctor.status).toBe(0);
472
+ expect(doctor.stdout).toContain(
473
+ 'note (runner_command): docs/acme-setup.doc.mjs:',
474
+ );
475
+ expect(doctor.stdout).toContain('Write `astryx doctor`');
476
+
477
+ const strict = await runCli(
478
+ ['--json', 'integration', 'check', '--strict'],
479
+ tmpDir,
480
+ );
481
+ expect(strict.status).toBe(0);
482
+ const validate = JSON.parse(strict.stdout).data.checks.find(
483
+ (/** @type {any} */ each) => each.check === 'validate',
484
+ ).response.data;
485
+ expect(validate.notes.map((/** @type {any} */ note) => note.code)).toEqual([
486
+ 'runner_command',
487
+ ]);
488
+ });
489
+ });
@@ -8,7 +8,7 @@ export const doc = {
8
8
  namespace: 'cli/commands',
9
9
  summary: 'Author and verify an Astryx integration package',
10
10
  description:
11
- 'Add contributions to your package, check them on every build with `integration check --strict`, then check the packed package the way an app receives it. The guides start at {@link namespace:integrations}.',
11
+ 'Add contributions to your package, check them on every build with `integration check --strict`, then check the packed package the way an app receives it. The guides start at {@link namespace:authoring}.',
12
12
  subcommands: ['add', 'check', 'verify', 'pack'],
13
13
  examples: [
14
14
  {
@@ -824,7 +824,8 @@ export function generateCompressedIndex(
824
824
  const suffix = resolvedTopics.length > shown.length ? ' …' : '';
825
825
  lines.push(` docs <topic> ${shown.join(', ')}${suffix} (\`astryx docs\` lists all)`);
826
826
  }
827
- lines.push(' docs cli commands, API reference, integration authoring');
827
+ lines.push(' docs cli commands and API reference');
828
+ lines.push(' docs authoring build an integration package, and every field it holds');
828
829
  lines.push(' upgrade --from <old version> --apply run after a dependency bump');
829
830
  const appendCount = agentDocs.reduce(
830
831
  (count, contribution) => count + contribution.append.length,
@@ -209,12 +209,13 @@ describe('generateCompressedIndex', () => {
209
209
  expect(line).toContain('astryx docs');
210
210
  });
211
211
 
212
- it('points to the CLI docs tree on a line of its own', () => {
213
- // The integration guide lives in the docs tree now (cli/integrations), so
214
- // the topic line no longer names it; the tree's entry point does.
212
+ it('points to the CLI docs and the authoring docs on lines of their own', () => {
213
+ // The integration guides live under `authoring` in the docs tree, so the
214
+ // topic line does not name them; the tree's entry points do.
215
215
  const block = generateCompressedIndex('1.0.0');
216
+ expect(block).toContain(' docs cli commands and API reference');
216
217
  expect(block).toContain(
217
- ' docs cli commands, API reference, integration authoring',
218
+ ' docs authoring build an integration package, and every field it holds',
218
219
  );
219
220
  expect(topicLine(block)).not.toContain('cli-integrations');
220
221
  });
@@ -83,5 +83,12 @@ export function auditAuthoringSelfDocs({ root, sources, budget, }?: {
83
83
  }>;
84
84
  /** The directory the self-docs live under. */
85
85
  export const AUTHORING_ROOT: string;
86
+ /** The guide that holds every authoring schema, one section each. */
87
+ export const AUTHORING_REFERENCE_NAME: "field-reference";
88
+ /**
89
+ * Its route. `astryx docs authoring <name>` reads one of its sections through
90
+ * the authoring namespace (spec:AST-046 FR6).
91
+ */
92
+ export const AUTHORING_REFERENCE_ROUTE: "authoring/field-reference";
86
93
  /** Every authoring self-doc, relative to {@link AUTHORING_ROOT}, in reading order. */
87
94
  export const AUTHORING_SELF_DOCS: string[];
@@ -9,7 +9,7 @@
9
9
  * `authoring` reference topic with one section per self-doc, and an audit
10
10
  * naming any self-doc the topic cannot reach, any that fails to load, and any
11
11
  * section over the docs output budget.
12
- * @position Read by assets/docs/authoring.doc.mjs (the topic) and by Doctor
12
+ * @position Read by assets/docs/tree/field-reference.doc.mjs (the guide) and by Doctor
13
13
  * (the audit). Lives in foundation because authoring/ holds only contracts.
14
14
  * A new `*.doc.mjs` under authoring/ must be added to the list, or Doctor and
15
15
  * the self-doc tests fail.
@@ -27,6 +27,15 @@ import {
27
27
  /** The directory the self-docs live under. */
28
28
  export const AUTHORING_ROOT = path.join(CLI_ROOT, 'authoring');
29
29
 
30
+ /** The guide that holds every authoring schema, one section each. */
31
+ export const AUTHORING_REFERENCE_NAME = 'field-reference';
32
+
33
+ /**
34
+ * Its route. `astryx docs authoring <name>` reads one of its sections through
35
+ * the authoring namespace (spec:AST-046 FR6).
36
+ */
37
+ export const AUTHORING_REFERENCE_ROUTE = `authoring/${AUTHORING_REFERENCE_NAME}`;
38
+
30
39
  /** Every authoring self-doc, relative to {@link AUTHORING_ROOT}, in reading order. */
31
40
  export const AUTHORING_SELF_DOCS = [
32
41
  'integration/integration.doc.mjs',
@@ -189,11 +198,14 @@ export function selfDocSection(doc) {
189
198
  */
190
199
  export function buildAuthoringReferenceDoc(docs) {
191
200
  return /** @type {any} */ ({
192
- name: 'authoring',
193
- title: 'Authoring Reference',
201
+ type: 'generic',
202
+ name: AUTHORING_REFERENCE_NAME,
203
+ placement: {parent: 'namespace:authoring', slot: 'reference', order: 10},
204
+ title: 'Field reference',
194
205
  category: 'guide',
206
+ keywords: ['authoring reference', 'field reference', 'every field'],
195
207
  description:
196
- 'Every file an integration author writes, field by field: the integration manifest, astryx.config, codemods, identity, and each doc type. The step-by-step guides are under `astryx docs cli/integrations`.',
208
+ 'Every file an integration author writes, field by field: the integration manifest, astryx.config, codemods, identity, and each doc type. The guides that use them are the rest of {@link namespace:authoring}.',
197
209
  sections: docs.map(selfDocSection),
198
210
  });
199
211
  }
@@ -38,20 +38,32 @@ describe('authoring self-docs', () => {
38
38
  });
39
39
  });
40
40
 
41
- it('builds a valid topic with one section per self-doc', async () => {
42
- const topic = await buildAuthoringTopic();
41
+ it('builds a valid guide with one section per self-doc, placed under authoring', async () => {
42
+ const {placement, ...topic} = await buildAuthoringTopic();
43
43
  expect(problemsInTopic(topic)).toEqual([]);
44
44
  expect(topic.sections).toHaveLength(AUTHORING_SELF_DOCS.length);
45
+ expect(placement).toEqual({
46
+ parent: 'namespace:authoring',
47
+ slot: 'reference',
48
+ order: 10,
49
+ });
45
50
  });
46
51
 
47
52
  it(
48
53
  'is readable progressively through the docs API',
49
54
  async () => {
50
- const index = await docs('authoring', undefined, {index: true});
55
+ const index = await docs('authoring/field-reference', undefined, {
56
+ index: true,
57
+ });
51
58
  expect(index.type).toBe('docs.index');
52
59
  expect(index.data.sections.map(s => s.id)).toContain('integration');
60
+ // The namespace answers a section read from the field reference, as
61
+ // `astryx docs authoring <name>` always has.
53
62
  const section = await docs('authoring', 'integration');
54
63
  expect(section.data.title).toBe('Astryx Integration');
64
+ expect(
65
+ (await docs('authoring/field-reference', 'integration')).data,
66
+ ).toEqual(section.data);
55
67
  expect(section.data.content.some(block => block.type === 'table')).toBe(
56
68
  true,
57
69
  );
@@ -30,7 +30,7 @@ export function tracePublicAuthoringTypes(root?: string): {
30
30
  * document something public: a public type declared beside it, and, when its
31
31
  * title is the name of a type declared beside it, that type.
32
32
  * @param {{root?: string, sources?: string[], topicKeys?: Set<string> | null}} [options]
33
- * `topicKeys` are the keys `astryx docs authoring --index` lists; null skips
33
+ * `topicKeys` are the keys `astryx docs authoring/field-reference --index` lists; null skips
34
34
  * that comparison.
35
35
  * @returns {Promise<{
36
36
  * types: number,