@astryxdesign/cli 0.6.3-canary.f22695a → 0.6.3

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 (197) hide show
  1. package/README.md +1 -2
  2. package/api/build/build.type.d.mts +2 -2
  3. package/api/build/build.type.mjs +2 -2
  4. package/api/component/component.type.d.mts +6 -6
  5. package/api/component/component.type.mjs +19 -19
  6. package/api/discover/discover.type.d.mts +4 -4
  7. package/api/discover/discover.type.mjs +10 -10
  8. package/api/docs/_adapter.d.mts +24 -37
  9. package/api/docs/_adapter.mjs +83 -169
  10. package/api/docs/detail/detail.mjs +63 -14
  11. package/api/docs/detail/section/section.d.mts +1 -1
  12. package/api/docs/detail/section/section.mjs +20 -44
  13. package/api/docs/detail/section/section.test.mjs +0 -41
  14. package/api/docs/docs.d.mts +2 -7
  15. package/api/docs/docs.doc.mjs +10 -27
  16. package/api/docs/docs.mjs +9 -16
  17. package/api/docs/docs.test.mjs +0 -6
  18. package/api/docs/docs.type.d.mts +3 -40
  19. package/api/docs/docs.type.mjs +8 -36
  20. package/api/docs/integrationDocs.test.mjs +0 -106
  21. package/api/doctor/doctor.d.mts +0 -48
  22. package/api/doctor/doctor.mjs +0 -232
  23. package/api/doctor/doctor.test.mjs +0 -196
  24. package/api/hook/hook.type.d.mts +3 -3
  25. package/api/hook/hook.type.mjs +11 -11
  26. package/api/hook/list/list.d.mts +1 -1
  27. package/api/integration/add-contribution.mjs +3 -5
  28. package/api/integration/add-contribution.test.mjs +4 -4
  29. package/api/integration/integration-authoring.type.d.mts +1 -1
  30. package/api/integration/pack-check.mjs +7 -49
  31. package/api/integration/pack-check.test.mjs +0 -249
  32. package/api/search/search.d.mts +1 -1
  33. package/api/search/search.mjs +5 -5
  34. package/api/search/search.type.d.mts +2 -2
  35. package/api/search/search.type.mjs +1 -1
  36. package/api/swizzle/swizzle.type.d.mts +2 -2
  37. package/api/swizzle/swizzle.type.mjs +2 -2
  38. package/api/template/template.d.mts +1 -1
  39. package/api/template/template.type.d.mts +6 -6
  40. package/api/template/template.type.mjs +12 -12
  41. package/api/theme/build/build.mjs +6 -20
  42. package/api/theme/build/build.test.mjs +0 -127
  43. package/api/theme/palette/generate/generate.mjs +1 -1
  44. package/api/theme/palette/generate/generator.d.mts +13 -10
  45. package/api/theme/palette/generate/generator.mjs +3 -7
  46. package/api/theme/theme.type.d.mts +11 -170
  47. package/api/theme/theme.type.mjs +27 -94
  48. package/api/upgrade/_adapter.mjs +5 -71
  49. package/api/upgrade/upgrade.doc.mjs +3 -4
  50. package/api/upgrade/upgrade.type.d.mts +5 -5
  51. package/api/upgrade/upgrade.type.mjs +11 -11
  52. package/assets/codemods/integration-discovery.mjs +2 -40
  53. package/assets/codemods/integration-discovery.test.mjs +0 -58
  54. package/assets/codemods/transforms/v0.3.0/__tests__/unwrap-authoring-factories.test.mjs +5 -27
  55. package/assets/codemods/transforms/v0.3.0/unwrap-authoring-factories.mjs +5 -20
  56. package/assets/docs/README.md +0 -9
  57. package/assets/docs/cli-integrations.doc.mjs +15 -86
  58. package/assets/docs/styling-libraries.doc.mjs +1 -1
  59. package/assets/docs/working-with-ai.doc.mjs +1 -1
  60. package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.doc.mjs +3 -19
  61. package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +65 -383
  62. package/authoring/_shared/contract.ts +0 -22
  63. package/authoring/codemod/codemod.doc.mjs +1 -6
  64. package/authoring/codemod/parse.d.mts +8 -8
  65. package/authoring/codemod/parse.mjs +6 -8
  66. package/authoring/config/parse.d.mts +13 -13
  67. package/authoring/config/parse.mjs +8 -8
  68. package/authoring/config/type.ts +3 -3
  69. package/authoring/debug/parse.d.mts +5 -5
  70. package/authoring/debug/parse.mjs +3 -3
  71. package/authoring/doctypes/_schema.d.mts +23 -788
  72. package/authoring/doctypes/_schema.mjs +39 -492
  73. package/authoring/doctypes/base/type.ts +0 -40
  74. package/authoring/doctypes/command/command.doc.mjs +2 -3
  75. package/authoring/doctypes/command/parse.d.mts +2 -2
  76. package/authoring/doctypes/command/parse.mjs +1 -1
  77. package/authoring/doctypes/command/type.ts +2 -3
  78. package/authoring/doctypes/component/component.doc.mjs +3 -6
  79. package/authoring/doctypes/component/parse.d.mts +2 -2
  80. package/authoring/doctypes/component/parse.mjs +1 -1
  81. package/authoring/doctypes/component/type.ts +3 -4
  82. package/authoring/doctypes/enum/parse.d.mts +2 -2
  83. package/authoring/doctypes/enum/parse.mjs +1 -1
  84. package/authoring/doctypes/enum/type.ts +1 -3
  85. package/authoring/doctypes/function/function.doc.mjs +0 -4
  86. package/authoring/doctypes/function/parse.d.mts +2 -2
  87. package/authoring/doctypes/function/parse.mjs +1 -1
  88. package/authoring/doctypes/function/type.ts +2 -6
  89. package/authoring/doctypes/hook/hook.doc.mjs +0 -4
  90. package/authoring/doctypes/hook/parse.d.mts +2 -2
  91. package/authoring/doctypes/hook/parse.mjs +1 -1
  92. package/authoring/doctypes/hook/type.ts +2 -3
  93. package/authoring/doctypes/legacy.d.mts +6 -8
  94. package/authoring/doctypes/legacy.mjs +4 -5
  95. package/authoring/doctypes/parse.d.mts +18 -20
  96. package/authoring/doctypes/parse.mjs +10 -16
  97. package/authoring/doctypes/parse.test.mjs +3 -77
  98. package/authoring/doctypes/reference/parse.d.mts +2 -2
  99. package/authoring/doctypes/reference/parse.mjs +5 -8
  100. package/authoring/doctypes/reference/reference.doc.mjs +4 -17
  101. package/authoring/doctypes/reference/type.ts +5 -51
  102. package/authoring/doctypes/schema/parse.d.mts +2 -2
  103. package/authoring/doctypes/schema/parse.mjs +1 -1
  104. package/authoring/doctypes/schema/type.ts +2 -3
  105. package/authoring/doctypes/template/parse.d.mts +1 -92
  106. package/authoring/doctypes/template/parse.mjs +2 -36
  107. package/authoring/doctypes/template/parse.test.mjs +2 -8
  108. package/authoring/doctypes/template/template.doc.mjs +0 -4
  109. package/authoring/doctypes/template/type.ts +2 -5
  110. package/authoring/doctypes/types.ts +9 -10
  111. package/authoring/gap-report/parse.d.mts +10 -10
  112. package/authoring/gap-report/parse.mjs +6 -6
  113. package/authoring/gap-report/type.ts +1 -1
  114. package/authoring/index.d.mts +0 -1
  115. package/authoring/index.d.ts +17 -49
  116. package/authoring/index.mjs +0 -1
  117. package/authoring/integration/integration.doc.mjs +6 -13
  118. package/authoring/integration/parse.d.mts +2 -2
  119. package/authoring/integration/parse.mjs +1 -1
  120. package/authoring/integration/parse.test.mjs +1 -10
  121. package/authoring/integration/schema.d.mts +4 -6
  122. package/authoring/integration/schema.mjs +3 -9
  123. package/authoring/integration/type.ts +6 -23
  124. package/authoring/shadcn/receipt.d.mts +6 -6
  125. package/clients/cli/commands/docs.doc.mjs +3 -13
  126. package/clients/cli/commands/docs.mjs +21 -121
  127. package/clients/cli/commands/docs.test.mjs +0 -88
  128. package/clients/cli/commands/integration-authoring.test.mjs +9 -13
  129. package/clients/cli/commands/theme-palette-generate.doc.mjs +4 -8
  130. package/clients/cli/commands/upgrade.doc.mjs +2 -2
  131. package/clients/cli/formatters/index.mjs +1 -162
  132. package/clients/cli/formatters/index.test.mjs +0 -91
  133. package/clients/cli/lib/manifest.mjs +2 -7
  134. package/foundation/config/project.mjs +6 -21
  135. package/foundation/discovery/component-discovery.d.mts +1 -1
  136. package/foundation/discovery/component-discovery.mjs +1 -2
  137. package/foundation/discovery/docs-discovery.d.mts +4 -11
  138. package/foundation/discovery/docs-discovery.mjs +88 -208
  139. package/foundation/discovery/docs-discovery.test.mjs +13 -279
  140. package/foundation/discovery/template-adapter.mjs +1 -2
  141. package/foundation/integrations/autolink.mjs +5 -12
  142. package/foundation/integrations/integration-warnings.mjs +0 -6
  143. package/foundation/integrations/integrations.d.mts +2 -46
  144. package/foundation/integrations/integrations.mjs +8 -167
  145. package/foundation/integrations/integrations.test.mjs +1 -384
  146. package/foundation/integrations/validate-contributions.d.mts +0 -2
  147. package/foundation/integrations/validate-contributions.mjs +0 -10
  148. package/foundation/response/json-contract.test.mjs +17 -46
  149. package/foundation/response/response-types.doc.mjs +1 -6
  150. package/package.json +11 -9
  151. package/api/docs/compiled-topics.test.mjs +0 -78
  152. package/api/docs/index/index.d.mts +0 -18
  153. package/api/docs/index/index.mjs +0 -32
  154. package/api/docs/index/index.test.mjs +0 -62
  155. package/api/upgrade/project-context.test.mjs +0 -272
  156. package/assets/docs/authoring.doc.mjs +0 -14
  157. package/assets/templates/blocks/components/Timer/TimerFormats.doc.mjs +0 -14
  158. package/assets/templates/blocks/components/Timer/TimerFormats.tsx +0 -34
  159. package/assets/templates/blocks/components/Timer/TimerInline.doc.mjs +0 -14
  160. package/assets/templates/blocks/components/Timer/TimerInline.tsx +0 -14
  161. package/assets/templates/blocks/components/Timer/TimerShowcase.doc.mjs +0 -13
  162. package/assets/templates/blocks/components/Timer/TimerShowcase.tsx +0 -47
  163. package/assets/templates/blocks/components/Timer/TimerTypography.doc.mjs +0 -14
  164. package/assets/templates/blocks/components/Timer/TimerTypography.tsx +0 -31
  165. package/authoring/doctypes/base/graph-fields.doc.d.mts +0 -9
  166. package/authoring/doctypes/base/graph-fields.doc.mjs +0 -62
  167. package/authoring/doctypes/load-contract.test.mjs +0 -207
  168. package/authoring/doctypes/namespace/namespace.doc.d.mts +0 -9
  169. package/authoring/doctypes/namespace/namespace.doc.mjs +0 -132
  170. package/authoring/doctypes/namespace/parse.d.mts +0 -12
  171. package/authoring/doctypes/namespace/parse.mjs +0 -25
  172. package/authoring/doctypes/namespace/parse.test.mjs +0 -165
  173. package/authoring/doctypes/namespace/type.ts +0 -71
  174. package/authoring/identity/identity.doc.d.mts +0 -9
  175. package/authoring/identity/identity.doc.mjs +0 -61
  176. package/authoring/identity/type.ts +0 -132
  177. package/foundation/discovery/authoring-self-docs.d.mts +0 -69
  178. package/foundation/discovery/authoring-self-docs.mjs +0 -214
  179. package/foundation/discovery/authoring-self-docs.test.mjs +0 -154
  180. package/foundation/discovery/docs-output-budget.d.mts +0 -28
  181. package/foundation/discovery/docs-output-budget.mjs +0 -50
  182. package/foundation/discovery/docs-section-key.d.mts +0 -98
  183. package/foundation/discovery/docs-section-key.mjs +0 -221
  184. package/foundation/discovery/docs-section-key.test.mjs +0 -224
  185. package/foundation/doc-compiler/compile.d.mts +0 -162
  186. package/foundation/doc-compiler/compile.mjs +0 -262
  187. package/foundation/doc-compiler/doc-compiler.test.mjs +0 -687
  188. package/foundation/doc-compiler/ir.d.mts +0 -9
  189. package/foundation/doc-compiler/ir.mjs +0 -287
  190. package/foundation/doc-compiler/lenses.d.mts +0 -33
  191. package/foundation/doc-compiler/lenses.mjs +0 -127
  192. package/foundation/identity/provider-identity.d.mts +0 -90
  193. package/foundation/identity/provider-identity.mjs +0 -320
  194. package/foundation/identity/provider-identity.test.mjs +0 -254
  195. package/foundation/identity/providers.d.mts +0 -7
  196. package/foundation/identity/providers.mjs +0 -16
  197. package/foundation/integrations/provider-conflicts.test.mjs +0 -125
@@ -13,20 +13,18 @@ export const doc = {
13
13
  name: 'docs',
14
14
  displayName: 'docs()',
15
15
  summary:
16
- 'Read the reference docs: list every topic, one topic\'s sections, one section, or a whole topic.',
16
+ 'Read the reference docs: list every topic, one topic, or a single section of a topic.',
17
17
  description:
18
- 'No topic lists every reference-doc topic; a topic returns that full ' +
19
- 'ReferenceDoc; `index: true` returns the topic\'s section index instead ' +
20
- '(each section\'s key, title, and summary); a topic plus a section returns ' +
21
- 'that one section, found by its key, then its exact title, then a unique ' +
22
- 'part of its title (an ambiguous query is refused). Token-ref blocks are ' +
23
- 'inlined in every read. The topic set is the CLI\'s own docs plus the ' +
18
+ 'Routes on its arguments: no topic lists every reference-doc topic; a topic ' +
19
+ 'returns that full ReferenceDoc (with token-ref blocks inlined); a topic ' +
20
+ 'plus a section returns the first section whose title contains the ' +
21
+ '(case-insensitive) query. The topic set is the CLI\'s own docs plus the ' +
24
22
  'ones the project\'s configured integrations contribute, including any ' +
25
23
  'topic an integration replaces or extends, so it depends on the cwd. ' +
26
24
  'Overlay options select localized or dense variants.',
27
25
  importPath: '@astryxdesign/cli/api',
28
26
  signature:
29
- 'docs(topic?: string, section?: string, options?: DocsOptions): Promise<DocsListResponse | DocsIndexResponse | DocsDetailResponse | DocsDetailSectionResponse>',
27
+ 'docs(topic?: string, section?: string, options?: DocsOptions): Promise<DocsListResponse | DocsDetailResponse | DocsDetailSectionResponse>',
30
28
  keywords: [
31
29
  'docs',
32
30
  'documentation',
@@ -48,7 +46,7 @@ export const doc = {
48
46
  name: 'section',
49
47
  type: 'string',
50
48
  description:
51
- "Section to return: its key (from the topic's index), its title, or a unique part of its title (case-insensitive).",
49
+ 'Section within the topic to return; matches the first section title that contains this (case-insensitive).',
52
50
  },
53
51
  {
54
52
  name: 'options.lang',
@@ -65,12 +63,6 @@ export const doc = {
65
63
  type: 'boolean',
66
64
  description: 'Return the token-efficient dense doc variant.',
67
65
  },
68
- {
69
- name: 'options.index',
70
- type: 'boolean',
71
- description:
72
- "Return the topic's section index (each section's key, title, and summary) instead of the whole doc.",
73
- },
74
66
  {
75
67
  name: 'options.cwd',
76
68
  type: 'string',
@@ -89,15 +81,10 @@ export const doc = {
89
81
  description:
90
82
  "One topic's full ReferenceDoc, with token-ref blocks inlined.",
91
83
  },
92
- {
93
- type: 'docs.index',
94
- description:
95
- "One topic's section index (index: true): {name, title, description, sections: [{id, title, summary}]}.",
96
- },
97
84
  {
98
85
  type: 'docs.detail.section',
99
86
  description:
100
- 'One ReferenceSection of the topic, found by key or title, with token-ref blocks inlined.',
87
+ 'A single ReferenceSection of the topic: the first whose title contains the section query.',
101
88
  },
102
89
  ],
103
90
  throws: [
@@ -107,17 +94,13 @@ export const doc = {
107
94
  },
108
95
  {
109
96
  code: 'ERR_UNKNOWN_SECTION',
110
- when: 'a section is requested but is empty, matches no section, or matches more than one',
97
+ when: 'a section is requested but is empty or matches no section title in the topic',
111
98
  },
112
99
  ],
113
100
  examples: [
114
101
  {label: 'List topics', code: 'const r = await docs();'},
115
102
  {label: 'Load a topic', code: "await docs('principles');"},
116
- {
117
- label: "A topic's sections",
118
- code: "await docs('principles', undefined, {index: true});",
119
- },
120
- {label: 'One section by key', code: "await docs('tokens', 'spacing');"},
103
+ {label: 'One section', code: "await docs('tokens', 'spacing');"},
121
104
  ],
122
105
  command: 'docs',
123
106
  related: ['search', 'component', 'hook', 'template'],
package/api/docs/docs.mjs CHANGED
@@ -3,27 +3,24 @@
3
3
  /**
4
4
  * @file Programmatic API for the docs command.
5
5
  *
6
- * Dispatcher + barrel. `docs()` routes by argument shape into one of four
6
+ * Dispatcher + barrel. `docs()` routes by argument shape into one of three
7
7
  * leaves, each projecting into a single { type, data } envelope:
8
8
  *
9
- * docs() -> list -> docs.list
10
- * docs(topic) -> detail -> docs.detail
11
- * docs(topic, undefined, {index: true}) -> index -> docs.index
12
- * docs(topic, section) -> section -> docs.detail.section
9
+ * docs() -> list -> docs.list
10
+ * docs(topic) -> detail -> docs.detail
11
+ * docs(topic, section) -> section -> docs.detail.section
13
12
  *
14
- * A topic read returns the whole doc, as it always has. The index is how a
15
- * reader works progressively instead: list the topic's sections, then read one
16
- * by its key. The leaves live in list/, index/, detail/, and detail/section/;
17
- * the discovery, overlay loading, and topic resolution they share sit in
18
- * _adapter.mjs.
13
+ * The leaves live in list/, detail/, and detail/section/; the discovery,
14
+ * overlay loading, and topic resolution they share sit in _adapter.mjs. This
15
+ * module keeps the same `docs` export (and re-exports the leaves) so
16
+ * api/index.mjs and the CLI consumer import from here unchanged.
19
17
  */
20
18
 
21
19
  import {list} from './list/list.mjs';
22
- import {index} from './index/index.mjs';
23
20
  import {detail} from './detail/detail.mjs';
24
21
  import {section as sectionLeaf} from './detail/section/section.mjs';
25
22
 
26
- export {list, index, detail, sectionLeaf as section};
23
+ export {list, detail, sectionLeaf as section};
27
24
 
28
25
  /**
29
26
  * @param {string} [topic]
@@ -32,12 +29,9 @@ export {list, index, detail, sectionLeaf as section};
32
29
  * @param {string} [options.lang]
33
30
  * @param {boolean} [options.zh]
34
31
  * @param {boolean} [options.dense]
35
- * @param {boolean} [options.index] return the topic's section index instead of
36
- * the whole doc
37
32
  * @param {string} [options.cwd]
38
33
  * @returns {Promise<
39
34
  * import('./docs.type.mjs').DocsListResponse |
40
- * import('./docs.type.mjs').DocsIndexResponse |
41
35
  * import('./docs.type.mjs').DocsDetailResponse |
42
36
  * import('./docs.type.mjs').DocsDetailSectionResponse
43
37
  * >}
@@ -45,6 +39,5 @@ export {list, index, detail, sectionLeaf as section};
45
39
  export async function docs(topic, section, options = {}) {
46
40
  if (!topic) return list(options);
47
41
  if (section) return sectionLeaf(topic, section, options);
48
- if (options.index) return index(topic, options);
49
42
  return detail(topic, options);
50
43
  }
@@ -33,12 +33,6 @@ describe('docs() dispatcher routing', () => {
33
33
  expect(r.type).toBe('docs.detail');
34
34
  }, SLOW);
35
35
 
36
- it('topic + index -> docs.index', async () => {
37
- const {data} = await docs();
38
- const r = await docs(data[0].topic, undefined, {index: true});
39
- expect(r.type).toBe('docs.index');
40
- }, SLOW);
41
-
42
36
  it('topic + section -> docs.detail.section', async () => {
43
37
  const {data} = await docs();
44
38
  let routed = null;
@@ -2,7 +2,7 @@
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
4
  /**
5
- * astryx --json docs
5
+ * xds --json docs
6
6
  */
7
7
  export type DocsListResponse = {
8
8
  type: "docs.list";
@@ -23,46 +23,14 @@ export type DocsListEntry = {
23
23
  replaces?: string | undefined;
24
24
  };
25
25
  /**
26
- * astryx --json docs <topic> --index
27
- */
28
- export type DocsIndexResponse = {
29
- type: "docs.index";
30
- data: DocsIndex;
31
- };
32
- /**
33
- * astryx --json docs <topic>
26
+ * xds --json docs <topic>
34
27
  */
35
28
  export type DocsDetailResponse = {
36
29
  type: "docs.detail";
37
30
  data: import("@astryxdesign/cli/authoring").ReferenceDoc;
38
31
  };
39
32
  /**
40
- * The section index of one topic: what the topic is, and the key each section
41
- * is read by.
42
- */
43
- export type DocsIndex = {
44
- /**
45
- * the topic
46
- */
47
- name: string;
48
- title: string;
49
- description: string;
50
- sections: DocsIndexSection[];
51
- };
52
- export type DocsIndexSection = {
53
- /**
54
- * stable key; pass it as the section argument
55
- */
56
- id: string;
57
- title: string;
58
- /**
59
- * the section's first line of text, at most 240
60
- * characters
61
- */
62
- summary: string;
63
- };
64
- /**
65
- * astryx --json docs <topic> <section>
33
+ * xds --json docs <topic> <section>
66
34
  */
67
35
  export type DocsDetailSectionResponse = {
68
36
  type: "docs.detail.section";
@@ -75,11 +43,6 @@ export type DocsOptions = {
75
43
  lang?: string | undefined;
76
44
  zh?: boolean | undefined;
77
45
  dense?: boolean | undefined;
78
- /**
79
- * return a topic's section index instead of its
80
- * whole doc
81
- */
82
- index?: boolean | undefined;
83
46
  /**
84
47
  * project directory whose configured integrations
85
48
  * contribute topics; defaults to process.cwd()
@@ -4,17 +4,16 @@
4
4
  * @file Colocated types for the `docs` command — source of truth for the docs
5
5
  * command JSON responses. `types/docs.d.ts` re-exports these.
6
6
  *
7
- * Invocation -> type discriminator
7
+ * Invocation -> type discriminator
8
8
  * ------------------------------------------------------------
9
- * astryx --json docs -> docs.list
10
- * astryx --json docs <topic> -> docs.detail
11
- * astryx --json docs <topic> --index -> docs.index
12
- * astryx --json docs <topic> <section> -> docs.detail.section
13
- * (unknown topic/section) -> CLIError
9
+ * xds --json docs -> docs.list
10
+ * xds --json docs <topic> -> docs.detail
11
+ * xds --json docs <topic> <section> -> docs.detail.section
12
+ * (unknown topic/section) -> CLIError
14
13
  */
15
14
 
16
15
  /**
17
- * astryx --json docs
16
+ * xds --json docs
18
17
  * @typedef {object} DocsListResponse
19
18
  * @property {'docs.list'} type
20
19
  * @property {DocsListEntry[]} data
@@ -31,39 +30,14 @@
31
30
  */
32
31
 
33
32
  /**
34
- * astryx --json docs <topic> --index
35
- * @typedef {object} DocsIndexResponse
36
- * @property {'docs.index'} type
37
- * @property {DocsIndex} data
38
- */
39
-
40
- /**
41
- * astryx --json docs <topic>
33
+ * xds --json docs <topic>
42
34
  * @typedef {object} DocsDetailResponse
43
35
  * @property {'docs.detail'} type
44
36
  * @property {import('@astryxdesign/cli/authoring').ReferenceDoc} data
45
37
  */
46
38
 
47
39
  /**
48
- * The section index of one topic: what the topic is, and the key each section
49
- * is read by.
50
- * @typedef {object} DocsIndex
51
- * @property {string} name the topic
52
- * @property {string} title
53
- * @property {string} description
54
- * @property {DocsIndexSection[]} sections
55
- */
56
-
57
- /**
58
- * @typedef {object} DocsIndexSection
59
- * @property {string} id stable key; pass it as the section argument
60
- * @property {string} title
61
- * @property {string} summary the section's first line of text, at most 240
62
- * characters
63
- */
64
-
65
- /**
66
- * astryx --json docs <topic> <section>
40
+ * xds --json docs <topic> <section>
67
41
  * @typedef {object} DocsDetailSectionResponse
68
42
  * @property {'docs.detail.section'} type
69
43
  * @property {import('@astryxdesign/cli/authoring').ReferenceSection} data
@@ -75,8 +49,6 @@
75
49
  * @property {string} [lang]
76
50
  * @property {boolean} [zh]
77
51
  * @property {boolean} [dense]
78
- * @property {boolean} [index] return a topic's section index instead of its
79
- * whole doc
80
52
  * @property {string} [cwd] project directory whose configured integrations
81
53
  * contribute topics; defaults to process.cwd()
82
54
  */
@@ -177,112 +177,6 @@ describe('integration-contributed topics', () => {
177
177
  expect(extended.data.sections.length).toBe(builtin.data.sections.length + 1);
178
178
  }, SLOW);
179
179
 
180
- it('migrates a real built-in section to a stable ID without duplicating it', async () => {
181
- const builtin = await docs('theme');
182
- // Readers see a key on every section; the migration case is one whose
183
- // source authors no id.
184
- const {docs: authored} = await import('../../assets/docs/theme.doc.mjs');
185
- const target = authored.sections.find(section => section.id == null);
186
- expect(target).toBeDefined();
187
- scaffold({
188
- 'theme-internal.doc.mjs': topic({
189
- name: 'theme-internal',
190
- extends: 'theme',
191
- sections: [
192
- {
193
- id: 'acme-theme-setup',
194
- title: target.title,
195
- content: [{type: 'prose', text: 'Use the Acme theme.'}],
196
- },
197
- ],
198
- }),
199
- });
200
-
201
- const extended = await docs('theme', undefined, {cwd: tmpDir});
202
- expect(extended.data.sections).toHaveLength(builtin.data.sections.length);
203
- const matches = extended.data.sections.filter(
204
- section => section.title === target.title,
205
- );
206
- expect(matches).toEqual([
207
- expect.objectContaining({
208
- id: 'acme-theme-setup',
209
- content: [{type: 'prose', text: 'Use the Acme theme.'}],
210
- }),
211
- ]);
212
- }, SLOW);
213
-
214
- it('replaces a real built-in section by the key its index shows', async () => {
215
- const index = await docs('theme', undefined, {index: true});
216
- const target = index.data.sections[0];
217
- scaffold({
218
- 'theme-internal.doc.mjs': topic({
219
- name: 'theme-internal',
220
- extends: 'theme',
221
- sections: [
222
- {
223
- id: target.id,
224
- title: `${target.title} with Acme`,
225
- content: [{type: 'prose', text: 'Acme first.'}],
226
- },
227
- ],
228
- }),
229
- });
230
-
231
- const extended = await docs('theme', undefined, {cwd: tmpDir});
232
- expect(extended.data.sections).toHaveLength(index.data.sections.length);
233
- expect(extended.data.sections.filter(s => s.id === target.id)).toEqual([
234
- expect.objectContaining({content: [{type: 'prose', text: 'Acme first.'}]}),
235
- ]);
236
- const read = await docs('theme', target.id, {cwd: tmpDir});
237
- expect(read.data.title).toBe(`${target.title} with Acme`);
238
- }, SLOW);
239
-
240
- it.each(['zh', 'dense'])(
241
- 'replaces translated real sections by their authored titles under --%s',
242
- async lang => {
243
- const english = await docs('theme');
244
- const englishTitles = english.data.sections.map(section => section.title);
245
- expect(englishTitles).toEqual(
246
- expect.arrayContaining(['Quick Start', 'Theme Props']),
247
- );
248
- scaffold({
249
- 'theme-internal.doc.mjs': topic({
250
- name: 'theme-internal',
251
- extends: 'theme',
252
- sections: [
253
- {
254
- id: 'acme-quick-start',
255
- title: 'Quick Start',
256
- content: [{type: 'prose', text: 'Acme quick start.'}],
257
- },
258
- {
259
- title: 'Theme Props',
260
- content: [{type: 'prose', text: 'Acme props.'}],
261
- },
262
- ],
263
- }),
264
- });
265
-
266
- const base = await docs('theme', undefined, {lang});
267
- expect(base.data.sections.map(section => section.title)).not.toEqual(
268
- englishTitles,
269
- );
270
- const extended = await docs('theme', undefined, {cwd: tmpDir, lang});
271
- expect(extended.data.sections).toHaveLength(base.data.sections.length);
272
- expect(
273
- extended.data.sections.filter(
274
- section => section.id === 'acme-quick-start',
275
- ),
276
- ).toHaveLength(1);
277
- expect(
278
- extended.data.sections.filter(
279
- section => section.content[0]?.text === 'Acme props.',
280
- ),
281
- ).toHaveLength(1);
282
- },
283
- SLOW,
284
- );
285
-
286
180
  it('offers the contributed topics as suggestions on an unknown one', async () => {
287
181
  scaffold({'deploying.doc.mjs': topic()});
288
182
  await expect(docs('nope-not-a-topic', undefined, {cwd: tmpDir})).rejects.toBeInstanceOf(
@@ -84,36 +84,6 @@ export function checkPeerDeps(ctx: DoctorContext): DoctorCheck;
84
84
  * @returns {DoctorCheck}
85
85
  */
86
86
  export function checkPackageManager(ctx: DoctorContext): DoctorCheck;
87
- /**
88
- * Check 6b — every contributing integration owns its provider identity.
89
- *
90
- * Artifact and document IDs are provider-scoped, so a package that claims a
91
- * provider ID an earlier-loaded package already holds is loaded inert: its
92
- * components, templates, themes, docs, and codemods are withdrawn while the
93
- * earlier package keeps contributing. That can be a deliberate transition
94
- * (a renamed package installed beside its predecessor), so it warns rather
95
- * than fails, but it is never allowed to happen quietly.
96
- *
97
- * @param {DoctorContext} ctx
98
- * @returns {DoctorCheck}
99
- */
100
- export function checkProviderIdentity(ctx: DoctorContext): DoctorCheck;
101
- /**
102
- * Every authoring self-doc is reachable from `astryx docs authoring`, loads,
103
- * and fits in one read. The audit is imported here, inside the try, so a
104
- * malformed self-doc is reported rather than taking Doctor down.
105
- * @param {DoctorContext} [_ctx]
106
- * @returns {Promise<DoctorCheck>}
107
- */
108
- export function checkAuthoringDocs(_ctx?: DoctorContext): Promise<DoctorCheck>;
109
- /**
110
- * Every topic reads progressively, in every language it ships: it loads, its
111
- * section index and each of its sections fit in one read, and no contributed
112
- * doc is invalid.
113
- * @param {DoctorContext | Partial<DoctorContext>} ctx
114
- * @returns {Promise<DoctorCheck>}
115
- */
116
- export function checkDocsProgressiveDisclosure(ctx: DoctorContext | Partial<DoctorContext>): Promise<DoctorCheck>;
117
87
  /**
118
88
  * Run all diagnostic checks and return a structured report.
119
89
  *
@@ -199,27 +169,9 @@ export type DoctorContext = {
199
169
  * read at all.
200
170
  */
201
171
  integrations?: import("../../foundation/integrations/integrations.mjs").LoadedIntegration[] | null | undefined;
202
- /**
203
- * - The topics a docs read sees.
204
- */
205
- docsCatalog?: DocsCatalog | null | undefined;
206
- /**
207
- * `invalid_doc` issues from the project's contributed docs.
208
- */
209
- docsCatalogIssues?: {
210
- package?: string;
211
- code: string;
212
- message: string;
213
- }[] | undefined;
214
- /**
215
- * - Why the project's docs catalog
216
- * could not be built, when it could not.
217
- */
218
- docsCatalogError?: string | null | undefined;
219
172
  /**
220
173
  * - Error thrown while resolving the config
221
174
  * path (e.g. multiple config files present), surfaced by checkConfig as a FAIL.
222
175
  */
223
176
  configError?: Error | null | undefined;
224
177
  };
225
- import { DocsCatalog } from '../../foundation/discovery/docs-discovery.mjs';