@astryxdesign/cli 0.7.2-canary.ebcc404 → 0.7.2-canary.f8f7cf1
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.
- package/README.md +9 -8
- package/api/build/help/help.mjs +1 -1
- package/api/component/_adapter.d.mts +14 -0
- package/api/component/_adapter.mjs +48 -0
- package/api/component/component.mjs +10 -2
- package/api/component/integration-export-name.test.mjs +233 -8
- package/api/docs/_adapter.d.mts +11 -0
- package/api/docs/_adapter.mjs +244 -1
- package/api/docs/integrationDocs.test.mjs +124 -0
- package/api/doctor/theme-checks.mjs +1 -1
- package/api/gap-report/gap-report.mjs +2 -1
- package/api/index.d.mts +2 -0
- package/api/index.mjs +2 -0
- package/api/init/run/run.mjs +2 -2
- package/api/integration/_adapter.d.mts +12 -0
- package/api/integration/_adapter.mjs +54 -0
- package/api/integration/add-contribution.component-names.test.mjs +66 -0
- package/api/integration/add-contribution.mjs +8 -4
- package/api/integration/add-contribution.test.mjs +4 -2
- package/api/integration/authoring-checks.mjs +11 -2
- package/api/integration/authoring-checks.test.mjs +39 -0
- package/api/integration/authoring-checks.type.d.mts +9 -0
- package/api/integration/authoring-checks.type.mjs +14 -1
- package/api/integration/check/check.d.mts +96 -0
- package/api/integration/check/check.mjs +357 -0
- package/api/integration/check/check.test.mjs +489 -0
- package/api/integration/integration-check.type.d.mts +118 -0
- package/api/integration/integration-check.type.mjs +84 -0
- package/api/integration/integrationCheck.doc.d.mts +10 -0
- package/api/integration/integrationCheck.doc.mjs +73 -0
- package/api/integration/integrationComponentConflicts.doc.mjs +36 -5
- package/api/integration/pack-check.mjs +48 -3
- package/api/integration/pack-check.test.mjs +247 -0
- package/api/integration/validate-integration.mjs +8 -0
- package/api/integration/validate-integration.test.mjs +11 -0
- package/api/integration/validate-integration.type.d.mts +8 -0
- package/api/integration/validate-integration.type.mjs +12 -1
- package/api/integration/validateIntegration.doc.mjs +17 -3
- package/api/search/search.integration-check.test.mjs +24 -0
- package/api/search/search.mjs +20 -8
- package/api/theme/build/build.family.test.mjs +54 -6
- package/api/theme/build/build.mjs +114 -17
- package/api/theme/themeBuild.doc.mjs +4 -4
- package/assets/docs/README.md +10 -0
- package/assets/docs/author-a-theme.doc.mjs +1 -1
- package/assets/docs/getting-started.doc.mjs +3 -3
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/theme.doc.zh.mjs +1 -1
- package/assets/docs/tree/add-a-component.doc.mjs +10 -0
- package/assets/docs/tree/block-template.doc.mjs +2 -2
- package/assets/docs/tree/check-the-props.doc.mjs +196 -0
- package/assets/docs/tree/check-your-docs.doc.mjs +44 -3
- package/assets/docs/tree/checks.doc.mjs +21 -13
- package/assets/docs/tree/component-family.doc.mjs +5 -1
- package/assets/docs/tree/component-imports.doc.mjs +1 -1
- package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
- package/assets/docs/tree/links.doc.mjs +2 -2
- package/assets/docs/tree/page-template.doc.mjs +1 -1
- package/assets/docs/tree/quick-start.doc.mjs +1 -1
- package/assets/docs/tree/replace-a-core-template.doc.mjs +1 -1
- package/assets/docs/tree/single-component.doc.mjs +3 -2
- package/assets/docs/tree/troubleshooting.doc.mjs +9 -1
- package/assets/docs/tree/type-scale.doc.mjs +3 -3
- package/assets/docs/tree/versioning.doc.mjs +1 -0
- package/assets/docs/tree/write-the-template-file.doc.mjs +2 -1
- package/assets/docs/use-a-theme.doc.mjs +2 -2
- package/assets/theme.template.ts +1 -1
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/template/integration-template.doc.d.mts +11 -0
- package/authoring/doctypes/template/integration-template.doc.mjs +49 -0
- package/authoring/doctypes/template/parse.d.mts +6 -2
- package/authoring/doctypes/template/parse.mjs +3 -1
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +22 -0
- package/authoring/index.d.ts +1 -0
- package/authoring/integration/integration.doc.mjs +8 -1
- package/authoring/integration/parse.test.mjs +10 -0
- package/authoring/integration/schema.d.mts +2 -0
- package/authoring/integration/schema.mjs +1 -0
- package/authoring/integration/type.ts +4 -0
- package/clients/cli/commands/build-theme.batch-report.test.mjs +3 -1
- package/clients/cli/commands/build-theme.mjs +1 -1
- package/clients/cli/commands/build-theme.path-safety.test.mjs +155 -21
- package/clients/cli/commands/doctor-integration-components.doc.mjs +15 -4
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +11 -2
- package/clients/cli/commands/doctor-integration.test.mjs +837 -0
- package/clients/cli/commands/doctor.mjs +190 -0
- package/clients/cli/commands/integration-check.doc.mjs +85 -0
- package/clients/cli/commands/integration-check.test.mjs +267 -0
- package/clients/cli/commands/integration.doc.mjs +6 -2
- package/clients/cli/commands/integration.mjs +107 -1
- package/clients/cli/commands/text-json-parity.test.mjs +5 -0
- package/clients/cli/commands/theme-build.doc.mjs +2 -2
- package/clients/cli/index.mjs +1 -0
- package/foundation/config/project.mjs +82 -0
- package/foundation/discovery/authoring-self-docs.mjs +1 -0
- package/foundation/discovery/component-discovery.d.mts +108 -17
- package/foundation/discovery/component-discovery.export-names.test.mjs +469 -2
- package/foundation/discovery/component-discovery.mjs +380 -47
- package/foundation/discovery/component-replacement.test.mjs +20 -0
- package/foundation/discovery/doc-types.d.mts +157 -0
- package/foundation/discovery/doc-types.mjs +1224 -0
- package/foundation/discovery/doc-types.test.mjs +652 -0
- package/foundation/discovery/docs-discovery.d.mts +81 -0
- package/foundation/discovery/docs-discovery.mjs +57 -0
- package/foundation/discovery/integration-doc-files.d.mts +22 -0
- package/foundation/discovery/integration-doc-files.mjs +231 -0
- package/foundation/discovery/integration-doc-files.test.mjs +246 -0
- package/foundation/discovery/module-exports.d.mts +6 -0
- package/foundation/discovery/module-exports.mjs +15 -2
- package/foundation/discovery/package-tsconfig.d.mts +14 -0
- package/foundation/discovery/package-tsconfig.mjs +228 -0
- package/foundation/discovery/package-tsconfig.test.mjs +210 -0
- package/foundation/discovery/project-typescript.d.mts +23 -0
- package/foundation/discovery/project-typescript.mjs +61 -0
- package/foundation/discovery/prop-drift.d.mts +278 -0
- package/foundation/discovery/prop-drift.mjs +2263 -0
- package/foundation/discovery/prop-drift.test.mjs +2219 -0
- package/foundation/discovery/type-match.d.mts +53 -0
- package/foundation/discovery/type-match.mjs +660 -0
- package/foundation/discovery/type-match.test.mjs +169 -0
- package/foundation/discovery/type-text.d.mts +68 -0
- package/foundation/discovery/type-text.mjs +658 -0
- package/foundation/discovery/type-text.test.mjs +196 -0
- package/foundation/discovery/unresolved-references.d.mts +62 -0
- package/foundation/discovery/unresolved-references.mjs +790 -0
- package/foundation/discovery/unresolved-references.test.mjs +567 -0
- package/foundation/doc-compiler/doc-loads.test.mjs +6 -0
- package/foundation/doc-compiler/links.d.mts +9 -5
- package/foundation/doc-compiler/links.mjs +4 -2
- package/foundation/integrations/contribution-inventory.mjs +6 -1
- package/foundation/response/response-types.doc.mjs +7 -2
- package/package.json +9 -9
|
@@ -0,0 +1,278 @@
|
|
|
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
|
+
* Compare each documented prop table with the TypeScript props of the export
|
|
6
|
+
* it describes.
|
|
7
|
+
* @param {PropDriftTable[]} tables
|
|
8
|
+
* @param {{packageDir: string, resolveFrom: Array<string | null | undefined>}} options
|
|
9
|
+
* @returns {PropDriftReport}
|
|
10
|
+
*/
|
|
11
|
+
export function comparePropTables(tables: PropDriftTable[], options: {
|
|
12
|
+
packageDir: string;
|
|
13
|
+
resolveFrom: Array<string | null | undefined>;
|
|
14
|
+
}): PropDriftReport;
|
|
15
|
+
/**
|
|
16
|
+
* Compare documented props with each component's TypeScript props: find each
|
|
17
|
+
* doc's prop tables, then compare them (`comparePropTables`).
|
|
18
|
+
* @param {PropDriftComponent[]} components
|
|
19
|
+
* @param {{packageDir: string, resolveFrom: Array<string | null | undefined>, loadDoc?: (docPath: string) => Promise<any>}} options
|
|
20
|
+
* @returns {Promise<PropDriftReport>}
|
|
21
|
+
*/
|
|
22
|
+
export function comparePropDocs(components: PropDriftComponent[], options: {
|
|
23
|
+
packageDir: string;
|
|
24
|
+
resolveFrom: Array<string | null | undefined>;
|
|
25
|
+
loadDoc?: (docPath: string) => Promise<any>;
|
|
26
|
+
}): Promise<PropDriftReport>;
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {'not_in_code' | 'not_in_doc' | 'required_mismatch' | 'type_mismatch'} PropDriftKind
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {object} PropDriftFinding
|
|
32
|
+
* @property {string} component the documented component (export) name
|
|
33
|
+
* @property {string} prop
|
|
34
|
+
* @property {PropDriftKind} kind
|
|
35
|
+
* @property {'warning'} severity
|
|
36
|
+
* @property {string} message
|
|
37
|
+
* @property {string} doc the doc file, relative to the package root
|
|
38
|
+
* @property {string} source the source file, relative to the package root
|
|
39
|
+
* @property {string} [docType] the documented type, as written
|
|
40
|
+
* @property {string} [codeType] the type as the source declares it
|
|
41
|
+
* @property {boolean} [docRequired]
|
|
42
|
+
* @property {boolean} [codeRequired]
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* @typedef {object} PropDriftUnchecked
|
|
46
|
+
* @property {string} component
|
|
47
|
+
* @property {string} doc the doc file, relative to the package root
|
|
48
|
+
* @property {string} reason why its props could not be read
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* @typedef {object} PropDriftTypesNotCompared
|
|
52
|
+
* @property {string} component
|
|
53
|
+
* @property {string} doc the doc file, relative to the package root
|
|
54
|
+
* @property {string} reason why: not a form the check judges exactly, a
|
|
55
|
+
* field the prop's variants give different types, a standard prop
|
|
56
|
+
* (`className`, `style`, …), or a prop declared outside the package
|
|
57
|
+
* @property {string[]} props documented props whose types were not compared
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* @typedef {object} PropDriftReport
|
|
61
|
+
* @property {'checked' | 'skipped'} status `skipped` means nothing was
|
|
62
|
+
* compared, and `reason` says why
|
|
63
|
+
* @property {string} [reason]
|
|
64
|
+
* @property {string} [typescript] the version of the compiler that read the props
|
|
65
|
+
* @property {number} components how many documented prop tables were compared
|
|
66
|
+
* @property {number} typesCompared how many documented prop types were judged
|
|
67
|
+
* @property {string} [typesSkipped] why no prop type was judged
|
|
68
|
+
* @property {PropDriftFinding[]} findings
|
|
69
|
+
* @property {PropDriftUnchecked[]} unchecked documented components whose props
|
|
70
|
+
* could not be read from the source
|
|
71
|
+
* @property {Array<PropDriftUnchecked & {props: string[]}>} [propsNotChecked]
|
|
72
|
+
* props a mapped type builds from keys the check can't trace, which a doc
|
|
73
|
+
* leaving out draws no warning for
|
|
74
|
+
* @property {PropDriftTypesNotCompared[]} typesNotCompared every other
|
|
75
|
+
* documented prop type, grouped by why it was not judged
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* @typedef {object} PropDriftTable
|
|
79
|
+
* @property {string} doc the doc file, relative to the package root
|
|
80
|
+
* @property {string} name the export the table documents
|
|
81
|
+
* @property {any[]} props the table's entries
|
|
82
|
+
* @property {string[]} sources the files that may hold the export, in order
|
|
83
|
+
*/
|
|
84
|
+
/**
|
|
85
|
+
* @typedef {object} PropDriftComponent
|
|
86
|
+
* @property {string} name
|
|
87
|
+
* @property {string} docPath absolute path to the component's `.doc.*` file
|
|
88
|
+
* @property {string | null} sourcePath absolute path to its same-stem
|
|
89
|
+
* source, or null when no file in the package declares it (a family member
|
|
90
|
+
* only another folder or built output defines)
|
|
91
|
+
*/
|
|
92
|
+
/**
|
|
93
|
+
* Props a doc never needs to list: the internal and styling props the
|
|
94
|
+
* `ComponentPropDoc` authoring guidance says to skip, `ref`, which Core's
|
|
95
|
+
* docs also leave out, and `key`, which React keeps for itself.
|
|
96
|
+
*/
|
|
97
|
+
export const PROPS_NOT_DOCUMENTED: readonly string[];
|
|
98
|
+
/** The line both surfaces print when the compiler is missing. */
|
|
99
|
+
export const TYPESCRIPT_MISSING_REASON: "TypeScript is not installed in this project, so documented props were not compared with the code. Install typescript and run this check again.";
|
|
100
|
+
export type CodeProp = {
|
|
101
|
+
name: string;
|
|
102
|
+
/**
|
|
103
|
+
* whether every caller must pass it: false
|
|
104
|
+
* when a member of the props type, an overload, or the package's
|
|
105
|
+
* `defaultProps` lets a caller leave it out
|
|
106
|
+
*/
|
|
107
|
+
required: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* declared in the package's own source, or built
|
|
110
|
+
* from keys it writes
|
|
111
|
+
*/
|
|
112
|
+
own: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* built from keys the check can't trace
|
|
115
|
+
*/
|
|
116
|
+
untraced?: boolean | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* its declaration carries an internal JSDoc tag
|
|
119
|
+
*/
|
|
120
|
+
skipTagged: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* the type as written, per own declaration
|
|
123
|
+
*/
|
|
124
|
+
declared: string[];
|
|
125
|
+
/**
|
|
126
|
+
* the compiler's renderings, computed on demand
|
|
127
|
+
*/
|
|
128
|
+
renderings: () => string[][];
|
|
129
|
+
/**
|
|
130
|
+
* the prop's type in each member of the props type
|
|
131
|
+
*/
|
|
132
|
+
types: () => any[];
|
|
133
|
+
/**
|
|
134
|
+
* one member declares it more than once (an
|
|
135
|
+
* intersection), so no one declaration's text is its type
|
|
136
|
+
*/
|
|
137
|
+
intersected: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* the type an index signature gives
|
|
140
|
+
* the name in each member that lacks the prop; null when two signatures
|
|
141
|
+
* in one member take it
|
|
142
|
+
*/
|
|
143
|
+
indexed: () => any[] | null;
|
|
144
|
+
/**
|
|
145
|
+
* where names in the prop's type resolve
|
|
146
|
+
*/
|
|
147
|
+
location: any;
|
|
148
|
+
};
|
|
149
|
+
export type PropDriftKind = "not_in_code" | "not_in_doc" | "required_mismatch" | "type_mismatch";
|
|
150
|
+
export type PropDriftFinding = {
|
|
151
|
+
/**
|
|
152
|
+
* the documented component (export) name
|
|
153
|
+
*/
|
|
154
|
+
component: string;
|
|
155
|
+
prop: string;
|
|
156
|
+
kind: PropDriftKind;
|
|
157
|
+
severity: "warning";
|
|
158
|
+
message: string;
|
|
159
|
+
/**
|
|
160
|
+
* the doc file, relative to the package root
|
|
161
|
+
*/
|
|
162
|
+
doc: string;
|
|
163
|
+
/**
|
|
164
|
+
* the source file, relative to the package root
|
|
165
|
+
*/
|
|
166
|
+
source: string;
|
|
167
|
+
/**
|
|
168
|
+
* the documented type, as written
|
|
169
|
+
*/
|
|
170
|
+
docType?: string | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* the type as the source declares it
|
|
173
|
+
*/
|
|
174
|
+
codeType?: string | undefined;
|
|
175
|
+
docRequired?: boolean | undefined;
|
|
176
|
+
codeRequired?: boolean | undefined;
|
|
177
|
+
};
|
|
178
|
+
export type PropDriftUnchecked = {
|
|
179
|
+
component: string;
|
|
180
|
+
/**
|
|
181
|
+
* the doc file, relative to the package root
|
|
182
|
+
*/
|
|
183
|
+
doc: string;
|
|
184
|
+
/**
|
|
185
|
+
* why its props could not be read
|
|
186
|
+
*/
|
|
187
|
+
reason: string;
|
|
188
|
+
};
|
|
189
|
+
export type PropDriftTypesNotCompared = {
|
|
190
|
+
component: string;
|
|
191
|
+
/**
|
|
192
|
+
* the doc file, relative to the package root
|
|
193
|
+
*/
|
|
194
|
+
doc: string;
|
|
195
|
+
/**
|
|
196
|
+
* why: not a form the check judges exactly, a
|
|
197
|
+
* field the prop's variants give different types, a standard prop
|
|
198
|
+
* (`className`, `style`, …), or a prop declared outside the package
|
|
199
|
+
*/
|
|
200
|
+
reason: string;
|
|
201
|
+
/**
|
|
202
|
+
* documented props whose types were not compared
|
|
203
|
+
*/
|
|
204
|
+
props: string[];
|
|
205
|
+
};
|
|
206
|
+
export type PropDriftReport = {
|
|
207
|
+
/**
|
|
208
|
+
* `skipped` means nothing was
|
|
209
|
+
* compared, and `reason` says why
|
|
210
|
+
*/
|
|
211
|
+
status: "checked" | "skipped";
|
|
212
|
+
reason?: string | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* the version of the compiler that read the props
|
|
215
|
+
*/
|
|
216
|
+
typescript?: string | undefined;
|
|
217
|
+
/**
|
|
218
|
+
* how many documented prop tables were compared
|
|
219
|
+
*/
|
|
220
|
+
components: number;
|
|
221
|
+
/**
|
|
222
|
+
* how many documented prop types were judged
|
|
223
|
+
*/
|
|
224
|
+
typesCompared: number;
|
|
225
|
+
/**
|
|
226
|
+
* why no prop type was judged
|
|
227
|
+
*/
|
|
228
|
+
typesSkipped?: string | undefined;
|
|
229
|
+
findings: PropDriftFinding[];
|
|
230
|
+
/**
|
|
231
|
+
* documented components whose props
|
|
232
|
+
* could not be read from the source
|
|
233
|
+
*/
|
|
234
|
+
unchecked: PropDriftUnchecked[];
|
|
235
|
+
/**
|
|
236
|
+
* props a mapped type builds from keys the check can't trace, which a doc
|
|
237
|
+
* leaving out draws no warning for
|
|
238
|
+
*/
|
|
239
|
+
propsNotChecked?: (PropDriftUnchecked & {
|
|
240
|
+
props: string[];
|
|
241
|
+
})[] | undefined;
|
|
242
|
+
/**
|
|
243
|
+
* every other
|
|
244
|
+
* documented prop type, grouped by why it was not judged
|
|
245
|
+
*/
|
|
246
|
+
typesNotCompared: PropDriftTypesNotCompared[];
|
|
247
|
+
};
|
|
248
|
+
export type PropDriftTable = {
|
|
249
|
+
/**
|
|
250
|
+
* the doc file, relative to the package root
|
|
251
|
+
*/
|
|
252
|
+
doc: string;
|
|
253
|
+
/**
|
|
254
|
+
* the export the table documents
|
|
255
|
+
*/
|
|
256
|
+
name: string;
|
|
257
|
+
/**
|
|
258
|
+
* the table's entries
|
|
259
|
+
*/
|
|
260
|
+
props: any[];
|
|
261
|
+
/**
|
|
262
|
+
* the files that may hold the export, in order
|
|
263
|
+
*/
|
|
264
|
+
sources: string[];
|
|
265
|
+
};
|
|
266
|
+
export type PropDriftComponent = {
|
|
267
|
+
name: string;
|
|
268
|
+
/**
|
|
269
|
+
* absolute path to the component's `.doc.*` file
|
|
270
|
+
*/
|
|
271
|
+
docPath: string;
|
|
272
|
+
/**
|
|
273
|
+
* absolute path to its same-stem
|
|
274
|
+
* source, or null when no file in the package declares it (a family member
|
|
275
|
+
* only another folder or built output defines)
|
|
276
|
+
*/
|
|
277
|
+
sourcePath: string | null;
|
|
278
|
+
};
|