@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
@@ -1,165 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- import {describe, expect, it} from 'vitest';
4
- import {parseDoc, parseNamespace, parseReference} from '../../index.mjs';
5
-
6
- const namespaceDoc = {
7
- type: 'namespace',
8
- name: 'integrations',
9
- title: 'Author integrations',
10
- summary: 'Publish reusable Astryx packages.',
11
- aliases: ['cli-integrations'],
12
- placement: {parent: 'namespace:cli', slot: 'guides', order: 10},
13
- slots: {
14
- contributions: {
15
- title: 'What do you want to publish?',
16
- accepts: {kinds: ['namespace']},
17
- },
18
- providerGuides: {
19
- title: 'Provider guidance',
20
- accepts: {providers: 'configured', kinds: ['generic', 'schema']},
21
- },
22
- },
23
- adopts: [
24
- {
25
- source: {group: 'cli-api', kinds: ['function', 'schema', 'enum']},
26
- into: 'contributions',
27
- groupBy: 'kind',
28
- },
29
- ],
30
- blocks: [
31
- {
32
- type: 'workflow',
33
- title: 'Package lifecycle',
34
- steps: [
35
- {title: 'Add', references: ['command:integration-add']},
36
- {
37
- title: 'Validate',
38
- references: ['command:doctor-integration-validate'],
39
- },
40
- ],
41
- },
42
- {
43
- type: 'collection',
44
- source: {slot: 'contributions'},
45
- presentation: 'cards',
46
- },
47
- {
48
- type: 'reference',
49
- target: 'schema:integration',
50
- projection: {fields: ['components', 'docs']},
51
- },
52
- ],
53
- };
54
-
55
- describe('NamespaceDoc', () => {
56
- it('accepts the reviewed plain-object shape through both parsers', () => {
57
- expect(parseNamespace(namespaceDoc)).toEqual(namespaceDoc);
58
- expect(parseDoc(namespaceDoc)).toEqual(namespaceDoc);
59
- });
60
-
61
- it('reports stable nested field paths', () => {
62
- expect(() =>
63
- parseNamespace({
64
- ...namespaceDoc,
65
- blocks: [{type: 'workflow', steps: [{title: ''}]}],
66
- }),
67
- ).toThrow(/blocks\.0\.steps\.0\.title/u);
68
- });
69
-
70
- it.each(['choice', 'callout', 'checklist'])(
71
- 'rejects unsupported %s blocks',
72
- type => {
73
- expect(() => parseNamespace({...namespaceDoc, blocks: [{type}]})).toThrow(
74
- /blocks\.0\.type/u,
75
- );
76
- },
77
- );
78
-
79
- it('rejects misspelled fields instead of silently dropping them', () => {
80
- expect(() =>
81
- parseNamespace({...namespaceDoc, summmary: 'misspelled'}),
82
- ).toThrow(/summmary/u);
83
- });
84
-
85
- it('requires at least one declared slot', () => {
86
- expect(() => parseNamespace({...namespaceDoc, slots: {}})).toThrow(
87
- /at least one slot is required/u,
88
- );
89
- });
90
-
91
- it('rejects a collection that names an undeclared slot', () => {
92
- expect(() =>
93
- parseNamespace({
94
- ...namespaceDoc,
95
- blocks: [{type: 'collection', source: {slot: 'missing'}}],
96
- }),
97
- ).toThrow(/blocks\.0\.source\.slot.*declared slot/u);
98
- });
99
-
100
- it('rejects an adoption rule that names an undeclared slot', () => {
101
- expect(() =>
102
- parseNamespace({
103
- ...namespaceDoc,
104
- adopts: [{source: {group: 'cli-api'}, into: 'missing'}],
105
- }),
106
- ).toThrow(/adopts\.0\.into.*declared slot/u);
107
- });
108
-
109
- it('rejects an adoption rule whose generated kind is not accepted', () => {
110
- expect(() =>
111
- parseNamespace({
112
- ...namespaceDoc,
113
- adopts: [
114
- {
115
- source: {group: 'cli-api', kinds: ['command']},
116
- into: 'providerGuides',
117
- groupBy: 'kind',
118
- },
119
- ],
120
- }),
121
- ).toThrow(/does not accept adopted kind "namespace"/u);
122
-
123
- expect(() =>
124
- parseNamespace({
125
- ...namespaceDoc,
126
- adopts: [
127
- {
128
- source: {group: 'cli-api', kinds: ['command']},
129
- into: 'providerGuides',
130
- },
131
- ],
132
- }),
133
- ).toThrow(/does not accept adopted kind "command"/u);
134
- });
135
- });
136
-
137
- describe('semantic blocks in existing docs', () => {
138
- it('accepts workflow, collection, and reference in a ReferenceDoc section', () => {
139
- const parsed = parseReference({
140
- type: 'generic',
141
- name: 'publishing',
142
- title: 'Publishing',
143
- description: 'Publish an integration.',
144
- sections: [
145
- {
146
- id: 'start',
147
- title: 'Start',
148
- content: namespaceDoc.blocks,
149
- },
150
- ],
151
- });
152
- expect(parsed.sections[0].id).toBe('start');
153
- expect(parsed.sections[0].content.map(block => block.type)).toEqual([
154
- 'workflow',
155
- 'collection',
156
- 'reference',
157
- ]);
158
- });
159
-
160
- it('rejects an unknown stamped doc kind instead of treating it as legacy', () => {
161
- expect(() => parseDoc({type: 'choice', name: 'x', props: []})).toThrow(
162
- /unsupported type "choice"/u,
163
- );
164
- });
165
- });
@@ -1,71 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file Namespace doc types. A namespace owns navigation slots and a
5
- * renderer-neutral layout over already-discovered docs. It never scans files
6
- * or copies child documents.
7
- */
8
-
9
- import type {AuthoredDocGraphFields, AuthoredDocKind} from '../base/type.js';
10
- import type {ReferenceContentBlock} from '../reference/type.js';
11
-
12
- /** Which providers may contribute appearances to a namespace slot. */
13
- export type NamespaceProviderScope = 'same' | 'configured';
14
-
15
- /** Constraints declared by the namespace that owns a slot. */
16
- export interface NamespaceSlotAcceptance {
17
- /** Authored doc kinds accepted by this slot. */
18
- kinds: AuthoredDocKind[];
19
- /** Omit for the namespace provider; `configured` admits provider appearances. */
20
- providers?: NamespaceProviderScope;
21
- }
22
-
23
- /** One named placement and collection target owned by a NamespaceDoc. */
24
- export interface NamespaceSlot {
25
- /** Human-readable heading for children in this slot. */
26
- title: string;
27
- /** Which docs may be placed or shown in this slot. */
28
- accepts: NamespaceSlotAcceptance;
29
- }
30
-
31
- /** One logical source group that a namespace may adopt. */
32
- export interface NamespaceAdoptionSource {
33
- /** Provider-local discovery group, such as `cli-commands`. */
34
- group: string;
35
- /** Optional subset of authored kinds from the group. */
36
- kinds?: AuthoredDocKind[];
37
- }
38
-
39
- /**
40
- * Assigns otherwise-unplaced docs from one provider-local source group to a
41
- * child namespace. Discovery defines groups; this rule never scans a folder.
42
- */
43
- export interface NamespaceAdoptionRule {
44
- source: NamespaceAdoptionSource;
45
- /** Slot owned by this namespace that becomes the canonical destination. */
46
- into: string;
47
- /** Generate one child namespace per authored kind. */
48
- groupBy?: 'kind';
49
- }
50
-
51
- /**
52
- * An authored documentation namespace. Its ordered blocks control layout while
53
- * slots and adoption rules describe where already-discovered docs may appear.
54
- */
55
- export interface NamespaceDoc extends AuthoredDocGraphFields {
56
- type: 'namespace';
57
- /** Stable provider-local name. Navigation changes do not change this value. */
58
- name: string;
59
- /** Human-readable page title. */
60
- title: string;
61
- /** One-line summary shown in listings and search results. */
62
- summary: string;
63
- /** Search terms that are not already present in the title or summary. */
64
- keywords?: string[];
65
- /** Named child-placement and collection targets. */
66
- slots: Record<string, NamespaceSlot>;
67
- /** Optional source-adoption rules for otherwise-unplaced docs. */
68
- adopts?: NamespaceAdoptionRule[];
69
- /** Ordered renderer-neutral content and collection blocks. */
70
- blocks?: ReferenceContentBlock[];
71
- }
@@ -1,9 +0,0 @@
1
- // @generated by scripts/sync-api-types.mjs from the JSDoc in authoring/**/*.mjs.
2
- // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
-
4
- /**
5
- * @file SchemaDoc for provider, artifact, and immutable instance identity.
6
- * @position packages/cli/authoring/identity — identity documentation
7
- */
8
- /** @type {import('@astryxdesign/cli/authoring').SchemaDoc} */
9
- export const doc: import("@astryxdesign/cli/authoring").SchemaDoc;
@@ -1,61 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file SchemaDoc for provider, artifact, and immutable instance identity.
5
- * @position packages/cli/authoring/identity — identity documentation
6
- */
7
-
8
- /** @type {import('@astryxdesign/cli/authoring').SchemaDoc} */
9
- export const doc = {
10
- type: 'schema',
11
- name: 'provider-identity',
12
- displayName: 'Provider and artifact identity',
13
- namespace: 'authoring',
14
- description:
15
- 'Separates stable provider/artifact identity from package instances and runtime lifecycle state. providerId is in use today: an integration manifest may declare it, and Doctor and every command report two packages that claim one. The artifact, doc, instance, and compiler-input identities are defined for the docs graph, which is not built yet, and no command reads them.',
16
- appliesTo:
17
- 'Integration manifests and provider conflicts today; the docs graph once it ships',
18
- fields: [
19
- {
20
- name: 'ProviderId',
21
- type: 'string',
22
- description:
23
- 'Canonical logical provider ID. It defaults to the lowercase npm package name; Core uses the same model without publishing an integration manifest.',
24
- required: true,
25
- },
26
- {
27
- name: 'ArtifactId',
28
- type: 'string',
29
- description:
30
- 'Versioned serialization of provider ID, contribution kind, and stable artifact name. Every segment uses RFC 3986 escaping.',
31
- required: true,
32
- },
33
- {
34
- name: 'DocId',
35
- type: 'ArtifactId',
36
- description:
37
- 'Artifact ID restricted to one authored doc kind. Navigation changes do not change it.',
38
- required: true,
39
- },
40
- {
41
- name: 'ProviderInstance',
42
- type: '{ id; providerId; packageName; packageVersion; sourceDigest }',
43
- description:
44
- 'One immutable package version and source/content digest. Installed, configured, loaded, selected, and healthy state is a separate runtime overlay.',
45
- required: true,
46
- },
47
- {
48
- name: 'AuthoredDocEntry',
49
- type: '{ id; provider; kind; stableName; source; authored }',
50
- description:
51
- 'Normalized compiler input. Discovery supplies stableName independently from the authored display name, source paths remain package-relative, and provider provenance plus the authored snapshot are immutable.',
52
- required: true,
53
- },
54
- ],
55
- notes: [
56
- {
57
- type: 'prose',
58
- text: 'Provider package renames require an explicit mapping: a ProviderInstance may retain its stable providerId while packageName changes. Silent identity changes are not inferred.',
59
- },
60
- ],
61
- };
@@ -1,132 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file Stable provider, artifact, and authored-doc entry contracts.
5
- *
6
- * Logical IDs exclude installed/configured/loaded/healthy state. A concrete
7
- * provider instance adds package version and a content digest, while an
8
- * artifact ID stays stable across those instances.
9
- */
10
-
11
- import type {AuthoredDocKind} from '../doctypes/base/type.js';
12
- import type {CommandDoc} from '../doctypes/command/type.js';
13
- import type {ComponentDoc} from '../doctypes/component/type.js';
14
- import type {EnumDoc} from '../doctypes/enum/type.js';
15
- import type {FunctionDoc} from '../doctypes/function/type.js';
16
- import type {HookDoc} from '../doctypes/hook/type.js';
17
- import type {NamespaceDoc} from '../doctypes/namespace/type.js';
18
- import type {ReferenceDoc} from '../doctypes/reference/type.js';
19
- import type {SchemaDoc} from '../doctypes/schema/type.js';
20
- import type {TemplateDoc} from '../doctypes/template/type.js';
21
-
22
- declare const providerIdBrand: unique symbol;
23
- declare const artifactIdBrand: unique symbol;
24
- declare const docIdBrand: unique symbol;
25
- declare const providerInstanceIdBrand: unique symbol;
26
- declare const contentDigestBrand: unique symbol;
27
-
28
- /** Canonical provider identity. It defaults to the normalized npm package name. */
29
- export type ProviderId = string & {readonly [providerIdBrand]: true};
30
-
31
- /** Stable provider + contribution kind + artifact-name identity. */
32
- export type ArtifactId = string & {readonly [artifactIdBrand]: true};
33
-
34
- /** ArtifactId narrowed to an authored documentation kind. */
35
- export type DocId = ArtifactId & {readonly [docIdBrand]: true};
36
-
37
- /** Immutable provider version + source/content digest identity. */
38
- export type ProviderInstanceId = string & {
39
- readonly [providerInstanceIdBrand]: true;
40
- };
41
-
42
- /** Lowercase `sha256:<64 hex characters>` digest. */
43
- export type ContentDigest = string & {readonly [contentDigestBrand]: true};
44
-
45
- /** Every stable artifact kind owned by a provider. */
46
- export type ContributionKind =
47
- AuthoredDocKind | 'theme' | 'codemod' | 'agent-doc';
48
-
49
- /** Stable logical identity for one provider-owned artifact. */
50
- export interface ArtifactIdentity {
51
- readonly id: ArtifactId;
52
- readonly providerId: ProviderId;
53
- readonly kind: ContributionKind;
54
- readonly name: string;
55
- }
56
-
57
- /** One immutable package instance. Runtime lifecycle state does not belong here. */
58
- export interface ProviderInstance {
59
- readonly id: ProviderInstanceId;
60
- readonly providerId: ProviderId;
61
- readonly packageName: string;
62
- readonly packageVersion: string;
63
- readonly sourceDigest: ContentDigest;
64
- }
65
-
66
- /** Every authored value accepted by the documentation compiler boundary. */
67
- export type AuthoredDoc =
68
- | ComponentDoc
69
- | HookDoc
70
- | FunctionDoc
71
- | ReferenceDoc
72
- | TemplateDoc
73
- | SchemaDoc
74
- | CommandDoc
75
- | EnumDoc
76
- | NamespaceDoc;
77
-
78
- /** Provenance attached by discovery before compilation. */
79
- export interface AuthoredDocSource {
80
- /** Provider-local logical discovery group. */
81
- readonly group: string;
82
- /** Package-relative source path; excluded from compiled renderer data. */
83
- readonly path: string;
84
- /** Digest of the authored source bytes. */
85
- readonly digest: ContentDigest;
86
- }
87
-
88
- /** Authored kind that corresponds to one public document type. */
89
- export type AuthoredDocKindOf<TDoc extends AuthoredDoc> =
90
- TDoc extends ComponentDoc
91
- ? 'component'
92
- : TDoc extends HookDoc | FunctionDoc
93
- ? 'function'
94
- : TDoc extends ReferenceDoc
95
- ? 'generic'
96
- : TDoc extends TemplateDoc
97
- ? TDoc['type']
98
- : TDoc extends SchemaDoc
99
- ? 'schema'
100
- : TDoc extends CommandDoc
101
- ? 'command'
102
- : TDoc extends EnumDoc
103
- ? 'enum'
104
- : TDoc extends NamespaceDoc
105
- ? 'namespace'
106
- : never;
107
-
108
- type DeepReadonly<Value> = Value extends (...args: never[]) => unknown
109
- ? Value
110
- : Value extends readonly (infer Item)[]
111
- ? readonly DeepReadonly<Item>[]
112
- : Value extends object
113
- ? {readonly [Key in keyof Value]: DeepReadonly<Value[Key]>}
114
- : Value;
115
-
116
- /** Immutable authored-data snapshot stored in a compiler entry. */
117
- export type AuthoredDocSnapshot<TDoc extends AuthoredDoc = AuthoredDoc> =
118
- DeepReadonly<TDoc>;
119
-
120
- /**
121
- * One normalized compiler input. Stable identity is provider + authored kind +
122
- * stable name; provider version and source bytes remain explicit provenance.
123
- */
124
- export interface AuthoredDocEntry<TDoc extends AuthoredDoc = AuthoredDoc> {
125
- readonly id: DocId;
126
- readonly provider: ProviderInstance;
127
- readonly kind: AuthoredDocKindOf<TDoc>;
128
- /** Stable provider-local key used in the DocId; it need not equal a display name. */
129
- readonly stableName: string;
130
- readonly source: AuthoredDocSource;
131
- readonly authored: AuthoredDocSnapshot<TDoc>;
132
- }
@@ -1,69 +0,0 @@
1
- // @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
2
- // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
-
4
- /**
5
- * Every `*.doc.mjs` under `root`, relative and sorted.
6
- * @param {string} [root]
7
- * @returns {string[]}
8
- */
9
- export function discoverAuthoringSelfDocSources(root?: string): string[];
10
- /**
11
- * Import each self-doc. One that fails is reported, never thrown, so one bad
12
- * file cannot take the rest of the topic down with it.
13
- * @param {string[]} [sources]
14
- * @param {string} [root]
15
- * @returns {Promise<{loaded: {source: string, doc: any}[], failed: {source: string, error: string}[]}>}
16
- */
17
- export function loadAuthoringSelfDocs(sources?: string[], root?: string): Promise<{
18
- loaded: {
19
- source: string;
20
- doc: any;
21
- }[];
22
- failed: {
23
- source: string;
24
- error: string;
25
- }[];
26
- }>;
27
- /**
28
- * The `authoring` topic: one section per self-doc, in the order given.
29
- * @param {any[]} docs
30
- * @returns {import('../../authoring/doctypes/reference/type').ReferenceDoc}
31
- */
32
- export function buildAuthoringReferenceDoc(docs: any[]): import("../../authoring/doctypes/reference/type").ReferenceDoc;
33
- /**
34
- * The `authoring` topic from every self-doc that loads. One that fails is left
35
- * out here and reported by {@link auditAuthoringSelfDocs}.
36
- * @returns {Promise<import('../../authoring/doctypes/reference/type').ReferenceDoc>}
37
- */
38
- export function buildAuthoringTopic(): Promise<import("../../authoring/doctypes/reference/type").ReferenceDoc>;
39
- /**
40
- * What stands between a self-doc and a reader of `astryx docs authoring`.
41
- * @param {{root?: string, sources?: string[], budget?: number}} [options]
42
- * @returns {Promise<{
43
- * sections: number,
44
- * unreachable: string[],
45
- * failed: {source: string, error: string}[],
46
- * oversized: {key: string, title: string, bytes: number}[],
47
- * }>}
48
- */
49
- export function auditAuthoringSelfDocs({ root, sources, budget, }?: {
50
- root?: string;
51
- sources?: string[];
52
- budget?: number;
53
- }): Promise<{
54
- sections: number;
55
- unreachable: string[];
56
- failed: {
57
- source: string;
58
- error: string;
59
- }[];
60
- oversized: {
61
- key: string;
62
- title: string;
63
- bytes: number;
64
- }[];
65
- }>;
66
- /** The directory the self-docs live under. */
67
- export const AUTHORING_ROOT: string;
68
- /** Every authoring self-doc, relative to {@link AUTHORING_ROOT}, in reading order. */
69
- export const AUTHORING_SELF_DOCS: string[];