@astryxdesign/cli 0.7.2-canary.ab79547 → 0.7.2-canary.acfd1ff
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 +74 -73
- package/api/build/help/help.mjs +1 -1
- package/api/component/_adapter.d.mts +41 -1
- package/api/component/_adapter.mjs +93 -7
- package/api/component/component.mjs +22 -5
- package/api/component/integration-export-name.test.mjs +644 -0
- package/api/discover/_adapter.d.mts +119 -12
- package/api/discover/_adapter.mjs +449 -10
- package/api/discover/_adapter.test.mjs +599 -17
- package/api/discover/_catalog-view.d.mts +16 -5
- package/api/discover/_catalog-view.mjs +32 -8
- package/api/discover/discover.d.mts +11 -0
- package/api/discover/discover.doc.mjs +7 -6
- package/api/discover/discover.mjs +107 -19
- package/api/discover/discover.type.d.mts +18 -7
- package/api/discover/discover.type.mjs +15 -7
- package/api/discover/list/list.d.mts +4 -3
- package/api/discover/list/list.mjs +17 -10
- 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/doctor.mjs +27 -3
- package/api/doctor/doctor.test.mjs +43 -0
- package/api/doctor/theme-checks.mjs +1 -1
- package/api/doctor/theme-checks.test.mjs +136 -0
- package/api/gap-report/gap-report.d.mts +3 -0
- package/api/gap-report/gap-report.doc.mjs +11 -3
- package/api/gap-report/gap-report.mjs +219 -52
- package/api/gap-report/gap-report.test.mjs +233 -0
- package/api/gap-report/gap-report.type.d.mts +41 -0
- package/api/gap-report/gap-report.type.mjs +18 -0
- 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 +32 -0
- package/api/integration/_adapter.mjs +80 -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 +44 -4
- package/api/integration/authoring-checks.test.mjs +515 -0
- package/api/integration/authoring-checks.type.d.mts +95 -0
- package/api/integration/authoring-checks.type.mjs +53 -2
- 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 +43 -6
- package/api/integration/integrationDocConflicts.doc.mjs +19 -5
- package/api/integration/pack-check.mjs +343 -104
- package/api/integration/pack-check.test.mjs +726 -0
- package/api/integration/validate-integration-fixes.test.mjs +67 -0
- package/api/integration/validate-integration.mjs +8 -0
- package/api/integration/validate-integration.test.mjs +41 -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 +19 -3
- package/api/search/search.d.mts +81 -12
- package/api/search/search.domain-priority.test.mjs +108 -18
- package/api/search/search.integration-check.test.mjs +24 -0
- package/api/search/search.mjs +601 -50
- package/api/search/search.test.mjs +139 -0
- package/api/swizzle/copy/copy.mjs +28 -14
- 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/api/upgrade/_adapter.d.mts +40 -2
- package/api/upgrade/_adapter.mjs +117 -4
- package/api/upgrade/run/cli-behind-core.test.mjs +438 -0
- package/api/upgrade/run/run.mjs +30 -1
- package/api/upgrade/status/status.d.mts +21 -5
- package/api/upgrade/status/status.mjs +45 -8
- package/api/upgrade/upgrade.doc.mjs +5 -3
- package/api/upgrade/upgrade.type.d.mts +23 -0
- package/api/upgrade/upgrade.type.mjs +16 -1
- package/assets/codemods/runner.mjs +7 -1
- package/assets/discover/official-packages.json +367 -0
- package/assets/docs/README.md +10 -0
- package/assets/docs/author-a-theme.doc.mjs +3 -3
- package/assets/docs/browser-support.doc.mjs +1 -1
- package/assets/docs/getting-started.doc.mjs +3 -3
- package/assets/docs/styling-overview.doc.mjs +1 -1
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +2 -2
- package/assets/docs/theme.doc.zh.mjs +1 -1
- package/assets/docs/tree/add-a-component.doc.mjs +11 -1
- package/assets/docs/tree/add-a-theme.doc.mjs +1 -1
- package/assets/docs/tree/add-a-topic.doc.mjs +11 -8
- package/assets/docs/tree/agent-guidance.doc.mjs +2 -2
- package/assets/docs/tree/block-template.doc.mjs +8 -20
- package/assets/docs/tree/build-the-template.doc.mjs +1 -1
- package/assets/docs/tree/check-the-props.doc.mjs +196 -0
- package/assets/docs/tree/check-your-docs.doc.mjs +61 -7
- package/assets/docs/tree/checks.doc.mjs +26 -18
- package/assets/docs/tree/codemods.doc.mjs +4 -4
- package/assets/docs/tree/component-family.doc.mjs +8 -6
- package/assets/docs/tree/component-imports.doc.mjs +10 -2
- package/assets/docs/tree/components.doc.mjs +1 -1
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +30 -21
- package/assets/docs/tree/define-the-theme.doc.mjs +6 -5
- package/assets/docs/tree/describe-the-component.doc.mjs +2 -2
- package/assets/docs/tree/docs.doc.mjs +3 -3
- package/assets/docs/tree/document-the-template.doc.mjs +1 -1
- package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
- package/assets/docs/tree/extend-or-replace.doc.mjs +6 -6
- package/assets/docs/tree/fonts-and-assets.doc.mjs +2 -2
- package/assets/docs/tree/generate-a-palette.doc.mjs +5 -3
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +1 -1
- package/assets/docs/tree/integrations.doc.mjs +8 -0
- package/assets/docs/tree/layout-spacing.doc.mjs +2 -3
- package/assets/docs/tree/layout.doc.mjs +6 -6
- package/assets/docs/tree/links.doc.mjs +6 -5
- package/assets/docs/tree/migration-setup.doc.mjs +3 -2
- package/assets/docs/tree/migration-verification.doc.mjs +0 -1
- package/assets/docs/tree/migration.doc.mjs +0 -1
- package/assets/docs/tree/package-and-test.doc.mjs +1 -1
- package/assets/docs/tree/page-template.doc.mjs +4 -8
- package/assets/docs/tree/publishing.doc.mjs +4 -4
- package/assets/docs/tree/quick-start.doc.mjs +38 -22
- package/assets/docs/tree/replace-a-core-component.doc.mjs +4 -6
- package/assets/docs/tree/replace-a-core-template.doc.mjs +6 -8
- package/assets/docs/tree/sections-and-placement.doc.mjs +6 -8
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +4 -2
- package/assets/docs/tree/short-and-findable.doc.mjs +6 -5
- package/assets/docs/tree/single-component.doc.mjs +15 -6
- package/assets/docs/tree/start-a-template.doc.mjs +3 -3
- package/assets/docs/tree/subcomponent.doc.mjs +6 -6
- package/assets/docs/tree/template-assets.doc.mjs +2 -2
- package/assets/docs/tree/template-doc-overview.doc.mjs +5 -16
- package/assets/docs/tree/template-fonts.doc.mjs +1 -1
- package/assets/docs/tree/template-icons.doc.mjs +1 -1
- package/assets/docs/tree/template-images-media.doc.mjs +1 -1
- package/assets/docs/tree/template-styles.doc.mjs +2 -2
- package/assets/docs/tree/templates.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +3 -3
- package/assets/docs/tree/test-template-in-app.doc.mjs +1 -1
- package/assets/docs/tree/tokens-and-setup.doc.mjs +19 -15
- package/assets/docs/tree/troubleshooting.doc.mjs +16 -8
- package/assets/docs/tree/type-scale.doc.mjs +3 -3
- package/assets/docs/tree/upgrading.doc.mjs +4 -4
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +3 -1
- package/assets/docs/tree/verify-packed-template.doc.mjs +1 -1
- package/assets/docs/tree/versioning.doc.mjs +7 -6
- package/assets/docs/tree/write-the-template-file.doc.mjs +4 -3
- package/assets/docs/use-a-theme.doc.mjs +2 -2
- package/assets/theme.template.ts +1 -1
- package/authoring/codemod/codemod.doc.mjs +7 -3
- package/authoring/config/config.doc.mjs +9 -6
- package/authoring/config/type.ts +4 -2
- package/authoring/discover/discover.doc.mjs +1 -1
- package/authoring/doctypes/base/graph-fields.doc.mjs +6 -4
- package/authoring/doctypes/command/command.doc.mjs +14 -12
- package/authoring/doctypes/component/component.doc.mjs +30 -27
- package/authoring/doctypes/component/type.ts +13 -8
- package/authoring/doctypes/enum/enum.doc.mjs +7 -4
- package/authoring/doctypes/function/function.doc.mjs +9 -8
- package/authoring/doctypes/hook/hook.doc.mjs +5 -4
- package/authoring/doctypes/namespace/namespace.doc.mjs +7 -6
- package/authoring/doctypes/reference/reference.doc.mjs +11 -10
- package/authoring/doctypes/schema/schema.doc.mjs +9 -9
- 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 +3 -3
- package/authoring/doctypes/template/type.ts +22 -0
- package/authoring/doctypes/theme/theme.doc.mjs +2 -2
- package/authoring/gap-report/gap-report.doc.mjs +2 -2
- package/authoring/identity/identity.doc.mjs +3 -3
- package/authoring/index.d.ts +1 -0
- package/authoring/integration/integration.doc.mjs +12 -4
- 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/cli-postinstall.test.mjs +49 -1
- package/clients/cli/commands/discover.broken-integration.test.mjs +4 -1
- package/clients/cli/commands/discover.doc.mjs +1 -1
- package/clients/cli/commands/discover.mjs +144 -93
- package/clients/cli/commands/discover.no-source.test.mjs +447 -33
- package/clients/cli/commands/discover.sources.test.mjs +20 -1
- package/clients/cli/commands/doctor-integration-components.doc.mjs +17 -4
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +18 -5
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +13 -2
- package/clients/cli/commands/doctor-integration.test.mjs +837 -0
- package/clients/cli/commands/doctor.mjs +250 -3
- package/clients/cli/commands/gap-report.doc.mjs +14 -2
- package/clients/cli/commands/gap-report.mjs +24 -2
- package/clients/cli/commands/gap-report.test.mjs +79 -0
- package/clients/cli/commands/integration-check.doc.mjs +85 -0
- package/clients/cli/commands/integration-check.test.mjs +370 -0
- package/clients/cli/commands/integration.doc.mjs +6 -2
- package/clients/cli/commands/integration.mjs +106 -1
- package/clients/cli/commands/json-contract.test.mjs +5 -1
- package/clients/cli/commands/setup-nudge.test.mjs +79 -1
- package/clients/cli/commands/swizzle.mjs +5 -3
- package/clients/cli/commands/swizzle.routing.test.mjs +18 -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/commands/upgrade.doc.mjs +14 -0
- package/clients/cli/commands/upgrade.older-cli.test.mjs +160 -0
- package/clients/cli/index.mjs +30 -5
- package/foundation/agent-docs/agent-doc-state.d.mts +14 -0
- package/foundation/agent-docs/agent-doc-state.mjs +38 -0
- package/foundation/agent-docs/agent-docs.d.mts +2 -1
- package/foundation/agent-docs/agent-docs.mjs +8 -6
- package/foundation/config/project.mjs +82 -0
- package/foundation/discovery/authoring-self-docs.mjs +2 -1
- package/foundation/discovery/component-discovery.d.mts +178 -10
- package/foundation/discovery/component-discovery.export-names.test.mjs +760 -0
- package/foundation/discovery/component-discovery.mjs +659 -62
- package/foundation/discovery/component-replacement.mjs +18 -0
- package/foundation/discovery/component-replacement.test.mjs +40 -0
- package/foundation/discovery/copied-passages.d.mts +216 -0
- package/foundation/discovery/copied-passages.mjs +720 -0
- package/foundation/discovery/copied-passages.test.mjs +124 -0
- package/foundation/discovery/doc-fluff.d.mts +112 -0
- package/foundation/discovery/doc-fluff.mjs +328 -0
- package/foundation/discovery/doc-fluff.test.mjs +142 -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 +700 -0
- package/foundation/discovery/docs-discovery.d.mts +88 -0
- package/foundation/discovery/docs-discovery.mjs +83 -2
- 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 +27 -0
- package/foundation/discovery/module-exports.mjs +356 -31
- package/foundation/discovery/module-exports.test.mjs +172 -0
- 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 +32 -0
- package/foundation/discovery/project-typescript.mjs +89 -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 +2272 -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 +18 -0
- package/foundation/doc-compiler/links.d.mts +9 -5
- package/foundation/doc-compiler/links.mjs +4 -2
- package/foundation/env/package-manager.d.mts +32 -0
- package/foundation/env/package-manager.mjs +47 -0
- package/foundation/env/package-manager.test.mjs +194 -7
- package/foundation/fs/module-loader.d.mts +2 -1
- package/foundation/fs/module-loader.mjs +60 -4
- package/foundation/fs/module-loader.test.mjs +194 -0
- package/foundation/integrations/contribution-inventory.d.mts +11 -0
- package/foundation/integrations/contribution-inventory.mjs +56 -3
- package/foundation/integrations/validate-contributions.mjs +30 -1
- package/foundation/response/response-types.doc.mjs +14 -8
- package/package.json +11 -11
- package/scripts/postinstall.mjs +3 -3
|
@@ -35,10 +35,42 @@ export type GapReportOptions = {
|
|
|
35
35
|
* Return the category vocabulary without routing or writing.
|
|
36
36
|
*/
|
|
37
37
|
listCategories?: boolean | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* A destination the person chose: a loaded integration
|
|
40
|
+
* whose manifest names an issues URL. The report goes only there.
|
|
41
|
+
*/
|
|
42
|
+
to?: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Where a report can go. The default entry (`to: null`) is the configured
|
|
46
|
+
* handlers, or with none the owning package's issues URL.
|
|
47
|
+
*/
|
|
48
|
+
export type GapReportDestination = {
|
|
49
|
+
/**
|
|
50
|
+
* The value to pass as `to`; null for the default.
|
|
51
|
+
*/
|
|
52
|
+
to: string | null;
|
|
53
|
+
/**
|
|
54
|
+
* Whether this is the default destination.
|
|
55
|
+
*/
|
|
56
|
+
default: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The integration's issues URL; null for the
|
|
59
|
+
* default.
|
|
60
|
+
*/
|
|
61
|
+
issuesUrl: string | null;
|
|
38
62
|
};
|
|
39
63
|
export type GapReportCategoriesResponse = {
|
|
40
64
|
type: "gap-report.categories";
|
|
41
65
|
data: GapReportCategoryEntry[];
|
|
66
|
+
/**
|
|
67
|
+
* Present when a destination besides the default exists: every destination,
|
|
68
|
+
* and the line telling an agent to ask the person.
|
|
69
|
+
*/
|
|
70
|
+
meta?: {
|
|
71
|
+
destinations: GapReportDestination[];
|
|
72
|
+
ask: string;
|
|
73
|
+
} | undefined;
|
|
42
74
|
};
|
|
43
75
|
export type GapReportAggregateStatus = "filed" | "partial" | "failed" | "routed_only" | "consent_required" | "skipped";
|
|
44
76
|
export type GapReportDeliveryStatus = "filed" | "routed_only" | "skipped" | "failed" | "consent_required";
|
|
@@ -81,6 +113,15 @@ export type GapReportReceipt = {
|
|
|
81
113
|
* Count of handlers that routed only.
|
|
82
114
|
*/
|
|
83
115
|
routedOnlyCount: number;
|
|
116
|
+
/**
|
|
117
|
+
* For a run without `to`,
|
|
118
|
+
* when a destination besides the default exists: every destination.
|
|
119
|
+
*/
|
|
120
|
+
destinations?: GapReportDestination[] | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* With `destinations`: ask the person where to file.
|
|
123
|
+
*/
|
|
124
|
+
ask?: string | undefined;
|
|
84
125
|
};
|
|
85
126
|
export type GapReportReceiptResponse = {
|
|
86
127
|
type: "gap-report.file";
|
|
@@ -23,12 +23,27 @@
|
|
|
23
23
|
* @property {string} [package] Explicit owner package for ambiguous routes.
|
|
24
24
|
* @property {boolean} [confirmPublic] Explicit consent for public handlers or GitHub issue creation.
|
|
25
25
|
* @property {boolean} [listCategories] Return the category vocabulary without routing or writing.
|
|
26
|
+
* @property {string} [to] A destination the person chose: a loaded integration
|
|
27
|
+
* whose manifest names an issues URL. The report goes only there.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Where a report can go. The default entry (`to: null`) is the configured
|
|
32
|
+
* handlers, or with none the owning package's issues URL.
|
|
33
|
+
* @typedef {object} GapReportDestination
|
|
34
|
+
* @property {string|null} to The value to pass as `to`; null for the default.
|
|
35
|
+
* @property {boolean} default Whether this is the default destination.
|
|
36
|
+
* @property {string|null} issuesUrl The integration's issues URL; null for the
|
|
37
|
+
* default.
|
|
26
38
|
*/
|
|
27
39
|
|
|
28
40
|
/**
|
|
29
41
|
* @typedef {object} GapReportCategoriesResponse
|
|
30
42
|
* @property {'gap-report.categories'} type
|
|
31
43
|
* @property {GapReportCategoryEntry[]} data
|
|
44
|
+
* @property {{destinations: GapReportDestination[], ask: string}} [meta]
|
|
45
|
+
* Present when a destination besides the default exists: every destination,
|
|
46
|
+
* and the line telling an agent to ask the person.
|
|
32
47
|
*/
|
|
33
48
|
|
|
34
49
|
/**
|
|
@@ -58,6 +73,9 @@
|
|
|
58
73
|
* @property {GapReportDelivery[]} deliveries Ordered handler outcomes.
|
|
59
74
|
* @property {number} filedCount Count of handlers that filed the report.
|
|
60
75
|
* @property {number} routedOnlyCount Count of handlers that routed only.
|
|
76
|
+
* @property {GapReportDestination[]} [destinations] For a run without `to`,
|
|
77
|
+
* when a destination besides the default exists: every destination.
|
|
78
|
+
* @property {string} [ask] With `destinations`: ask the person where to file.
|
|
61
79
|
*/
|
|
62
80
|
|
|
63
81
|
/**
|
package/api/index.d.mts
CHANGED
|
@@ -16,6 +16,7 @@ export { init } from "./init/init.mjs";
|
|
|
16
16
|
export { doctor } from "./doctor/doctor.mjs";
|
|
17
17
|
export { integrationAddTheme } from "./integration/add-theme.mjs";
|
|
18
18
|
export { integrationPackCheck } from "./integration/pack-check.mjs";
|
|
19
|
+
export { integrationCheck } from "./integration/check/check.mjs";
|
|
19
20
|
export { AstryxError } from "./error.mjs";
|
|
20
21
|
export { logger } from "./logger.mjs";
|
|
21
22
|
export * from "../foundation/response/batch.type.mjs";
|
|
@@ -37,6 +38,7 @@ export * from "./integration/integration-authoring.type.mjs";
|
|
|
37
38
|
export * from "./integration/pack-check.type.mjs";
|
|
38
39
|
export * from "./integration/validate-integration.type.mjs";
|
|
39
40
|
export * from "./integration/authoring-checks.type.mjs";
|
|
41
|
+
export * from "./integration/integration-check.type.mjs";
|
|
40
42
|
export type Logger = import("./logger.mjs").Logger;
|
|
41
43
|
export { themeBuild, themeAdd, themeRemove, themeUse, themeEject, themeTemplate, themeList, themeListAvailable, themeListCopySources, themeTargets, themePaletteGenerate, generateTonalPalette, listThemes } from "./theme/theme.mjs";
|
|
42
44
|
export { integrationAdd, integrationAddAgentDoc, integrationAddCodemod, integrationAddComponent, integrationAddDoc, integrationAddTemplate } from "./integration/add-contribution.mjs";
|
package/api/index.mjs
CHANGED
|
@@ -67,6 +67,7 @@ export {
|
|
|
67
67
|
integrationComponentConflicts,
|
|
68
68
|
integrationDocConflicts,
|
|
69
69
|
} from './integration/authoring-checks.mjs';
|
|
70
|
+
export {integrationCheck} from './integration/check/check.mjs';
|
|
70
71
|
export {AstryxError} from './error.mjs';
|
|
71
72
|
// The one shared logger: the `logger` instance side-effecting commands write
|
|
72
73
|
// through, plus its generated `Logger` type. Part of the public surface so an
|
|
@@ -100,3 +101,4 @@ export * from './integration/integration-authoring.type.mjs';
|
|
|
100
101
|
export * from './integration/pack-check.type.mjs';
|
|
101
102
|
export * from './integration/validate-integration.type.mjs';
|
|
102
103
|
export * from './integration/authoring-checks.type.mjs';
|
|
104
|
+
export * from './integration/integration-check.type.mjs';
|
package/api/init/run/run.mjs
CHANGED
|
@@ -50,11 +50,11 @@ export function getNextSteps(invocation) {
|
|
|
50
50
|
` (run \`${invocation} doctor\` to verify)`,
|
|
51
51
|
" 2. Import base styles: import '@astryxdesign/core/reset.css'",
|
|
52
52
|
" and import '@astryxdesign/core/astryx.css'",
|
|
53
|
-
" 3. Import components: import { Button } from '@astryxdesign/core'",
|
|
53
|
+
" 3. Import components: import { Button } from '@astryxdesign/core/Button'",
|
|
54
54
|
' 4. Add and wire a theme:',
|
|
55
55
|
' npm install @astryxdesign/theme-neutral',
|
|
56
56
|
` ${invocation} theme add neutral`,
|
|
57
|
-
" import { Theme } from '@astryxdesign/core'",
|
|
57
|
+
" import { Theme } from '@astryxdesign/core/theme'",
|
|
58
58
|
" import { themes, defaultThemeSlug } from './astryx-themes'",
|
|
59
59
|
' <Theme theme={themes[defaultThemeSlug]}>...</Theme>',
|
|
60
60
|
` Extend an imported theme to customize it. Run \`${invocation} theme eject <slug>\` only to fork source.`,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Each component doc's props compared with the component's TypeScript props,
|
|
6
|
+
* read with the project's own compiler (spec:AST-039 FR12). Without one, the
|
|
7
|
+
* report says the comparison was skipped.
|
|
8
|
+
* @param {any} integration a loaded integration
|
|
9
|
+
* @param {string} cwd
|
|
10
|
+
* @returns {Promise<import('../../foundation/discovery/prop-drift.mjs').PropDriftReport>}
|
|
11
|
+
*/
|
|
12
|
+
export function integrationPropDrift(integration: any, cwd: string): Promise<import("../../foundation/discovery/prop-drift.mjs").PropDriftReport>;
|
|
13
|
+
/**
|
|
14
|
+
* The passages two of a package's topics, or one of them and a Core topic,
|
|
15
|
+
* repeat word for word (architecture:cli-surface DEC-8). Reads the package's
|
|
16
|
+
* topics and Core's guides.
|
|
17
|
+
*
|
|
18
|
+
* @param {Parameters<typeof findCopiedPassages>[0]} discovered the package's
|
|
19
|
+
* docs, as discoverIntegrationDocs returns them
|
|
20
|
+
*/
|
|
21
|
+
export function integrationCopiedPassages(discovered: Parameters<typeof findCopiedPassages>[0]): Promise<import("./authoring-checks.type.mjs").CopiedPassage[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Padding phrases and low-density topics in a package's prose
|
|
24
|
+
* (architecture:cli-surface DEC-8). Reads the package's topics, and Core's
|
|
25
|
+
* guides for the density median a finding names.
|
|
26
|
+
*
|
|
27
|
+
* @param {Parameters<typeof findFluff>[0]} discovered the package's docs, as
|
|
28
|
+
* discoverIntegrationDocs returns them
|
|
29
|
+
*/
|
|
30
|
+
export function integrationFluff(discovered: Parameters<typeof findFluff>[0]): Promise<import("./authoring-checks.type.mjs").DocFluff[]>;
|
|
31
|
+
import { findCopiedPassages } from '../../foundation/discovery/copied-passages.mjs';
|
|
32
|
+
import { findFluff } from '../../foundation/discovery/doc-fluff.mjs';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The integration subject's access to the environment (INV21): reading
|
|
5
|
+
* one package's component docs and sources with the project's own TypeScript.
|
|
6
|
+
*
|
|
7
|
+
* @input a loaded integration and the directory the command runs in
|
|
8
|
+
* @output the reports the integration checks attach to their results
|
|
9
|
+
* @position api/integration (internal; not exported from ./api)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
discoverValidIntegrationComponents,
|
|
14
|
+
forEachIntegrationDoc,
|
|
15
|
+
integrationSourceForDoc,
|
|
16
|
+
} from '../../foundation/discovery/component-discovery.mjs';
|
|
17
|
+
import {comparePropDocs} from '../../foundation/discovery/prop-drift.mjs';
|
|
18
|
+
import {findCopiedPassages} from '../../foundation/discovery/copied-passages.mjs';
|
|
19
|
+
import {findFluff} from '../../foundation/discovery/doc-fluff.mjs';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Each component doc's props compared with the component's TypeScript props,
|
|
23
|
+
* read with the project's own compiler (spec:AST-039 FR12). Without one, the
|
|
24
|
+
* report says the comparison was skipped.
|
|
25
|
+
* @param {any} integration a loaded integration
|
|
26
|
+
* @param {string} cwd
|
|
27
|
+
* @returns {Promise<import('../../foundation/discovery/prop-drift.mjs').PropDriftReport>}
|
|
28
|
+
*/
|
|
29
|
+
export async function integrationPropDrift(integration, cwd) {
|
|
30
|
+
const packageDir = /** @type {{__packageDir?: string}} */ (integration)
|
|
31
|
+
.__packageDir;
|
|
32
|
+
const {components} = await discoverValidIntegrationComponents(integration);
|
|
33
|
+
// Every doc the package ships has its prop tables compared or listed as not
|
|
34
|
+
// compared. A doc discovery leaves out (a hidden one, a second doc for one
|
|
35
|
+
// name, or one whose source or own file doesn't load) gets a record under
|
|
36
|
+
// its file name.
|
|
37
|
+
const recorded = new Set(components.map(c => c.docPath));
|
|
38
|
+
/** @type {typeof components} */
|
|
39
|
+
const left = [];
|
|
40
|
+
forEachIntegrationDoc(integration?.components, (docPath, stem) => {
|
|
41
|
+
if (recorded.has(docPath)) return;
|
|
42
|
+
recorded.add(docPath);
|
|
43
|
+
left.push({
|
|
44
|
+
name: stem,
|
|
45
|
+
package: integration.name,
|
|
46
|
+
docPath,
|
|
47
|
+
sourcePath: integrationSourceForDoc(docPath),
|
|
48
|
+
issuesUrl: integration.issuesUrl,
|
|
49
|
+
group: null,
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
return comparePropDocs([...components, ...left], {
|
|
53
|
+
packageDir: packageDir ?? cwd,
|
|
54
|
+
resolveFrom: [cwd, packageDir],
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The passages two of a package's topics, or one of them and a Core topic,
|
|
60
|
+
* repeat word for word (architecture:cli-surface DEC-8). Reads the package's
|
|
61
|
+
* topics and Core's guides.
|
|
62
|
+
*
|
|
63
|
+
* @param {Parameters<typeof findCopiedPassages>[0]} discovered the package's
|
|
64
|
+
* docs, as discoverIntegrationDocs returns them
|
|
65
|
+
*/
|
|
66
|
+
export function integrationCopiedPassages(discovered) {
|
|
67
|
+
return findCopiedPassages(discovered);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Padding phrases and low-density topics in a package's prose
|
|
72
|
+
* (architecture:cli-surface DEC-8). Reads the package's topics, and Core's
|
|
73
|
+
* guides for the density median a finding names.
|
|
74
|
+
*
|
|
75
|
+
* @param {Parameters<typeof findFluff>[0]} discovered the package's docs, as
|
|
76
|
+
* discoverIntegrationDocs returns them
|
|
77
|
+
*/
|
|
78
|
+
export function integrationFluff(discovered) {
|
|
79
|
+
return findFluff(discovered);
|
|
80
|
+
}
|
|
@@ -98,6 +98,72 @@ describe('integrationAddComponent name collisions', () => {
|
|
|
98
98
|
expect(snapshot()).toEqual(before);
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
+
it('adds a name a family doc lists but the module it imports does not export', async () => {
|
|
102
|
+
fs.writeFileSync(
|
|
103
|
+
path.join(tmpDir, 'package.json'),
|
|
104
|
+
`${JSON.stringify({name: '@acme/widgets', version: '1.0.0', files: ['dist'], exports: {'./tabs': './components/tabs/index.ts'}}, null, 2)}\n`,
|
|
105
|
+
);
|
|
106
|
+
const tabs = path.join(tmpDir, 'components', 'tabs');
|
|
107
|
+
fs.mkdirSync(tabs, {recursive: true});
|
|
108
|
+
fs.writeFileSync(
|
|
109
|
+
path.join(tabs, 'AcmeTabs.doc.mjs'),
|
|
110
|
+
"export default {type: 'component', name: 'AcmeTabs', import: '@acme/widgets/tabs', description: 'x', components: [{name: 'AcmeTabExtra', description: 'x'}]};\n",
|
|
111
|
+
);
|
|
112
|
+
fs.writeFileSync(
|
|
113
|
+
path.join(tabs, 'AcmeTabs.tsx'),
|
|
114
|
+
'export function AcmeTabs() { return null; }\nexport function AcmeTabExtra() { return null; }\n',
|
|
115
|
+
);
|
|
116
|
+
fs.writeFileSync(
|
|
117
|
+
path.join(tabs, 'index.ts'),
|
|
118
|
+
"export {AcmeTabs} from './AcmeTabs';\n",
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const result = await integrationAdd('component', 'AcmeTabExtra', {
|
|
122
|
+
cwd: tmpDir,
|
|
123
|
+
dryRun: true,
|
|
124
|
+
});
|
|
125
|
+
expect(result.data.files).toContain('components/AcmeTabExtra.doc.mjs');
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('refuses a member a family exports through built output', async () => {
|
|
129
|
+
fs.writeFileSync(
|
|
130
|
+
path.join(tmpDir, 'package.json'),
|
|
131
|
+
`${JSON.stringify({name: '@acme/widgets', version: '1.0.0', files: ['dist'], exports: {'./tabs': './dist/tabs/index.js'}}, null, 2)}\n`,
|
|
132
|
+
);
|
|
133
|
+
const tabs = path.join(tmpDir, 'components', 'tabs');
|
|
134
|
+
fs.mkdirSync(tabs, {recursive: true});
|
|
135
|
+
fs.writeFileSync(
|
|
136
|
+
path.join(tabs, 'AcmeTabs.doc.mjs'),
|
|
137
|
+
"export default {type: 'component', name: 'AcmeTabs', import: '@acme/widgets/tabs', description: 'x', components: [{name: 'AcmeTab', description: 'x'}]};\n",
|
|
138
|
+
);
|
|
139
|
+
fs.writeFileSync(
|
|
140
|
+
path.join(tabs, 'AcmeTabs.tsx'),
|
|
141
|
+
'export function AcmeTabs() { return null; }\n',
|
|
142
|
+
);
|
|
143
|
+
fs.writeFileSync(
|
|
144
|
+
path.join(tabs, 'AcmeTab.tsx'),
|
|
145
|
+
'export function AcmeTab() { return null; }\n',
|
|
146
|
+
);
|
|
147
|
+
const dist = path.join(tmpDir, 'dist', 'tabs');
|
|
148
|
+
fs.mkdirSync(dist, {recursive: true});
|
|
149
|
+
fs.writeFileSync(
|
|
150
|
+
path.join(dist, 'index.js'),
|
|
151
|
+
"export {AcmeTabs} from './tabs.js';\nexport {AcmeTab} from './tab.js';\n",
|
|
152
|
+
);
|
|
153
|
+
fs.writeFileSync(
|
|
154
|
+
path.join(dist, 'tabs.js'),
|
|
155
|
+
'export function AcmeTabs() { return null; }\n',
|
|
156
|
+
);
|
|
157
|
+
fs.writeFileSync(
|
|
158
|
+
path.join(dist, 'tab.js'),
|
|
159
|
+
'export function AcmeTab() { return null; }\n',
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
await expect(
|
|
163
|
+
integrationAdd('component', 'AcmeTab', {cwd: tmpDir, dryRun: true}),
|
|
164
|
+
).rejects.toThrow('Refusing to add component "AcmeTab"');
|
|
165
|
+
});
|
|
166
|
+
|
|
101
167
|
it('still adds a component whose name is free', async () => {
|
|
102
168
|
writeAuthoredComponent('components/AcmeWidget/AcmeWidget.doc.mjs');
|
|
103
169
|
|
|
@@ -264,9 +264,13 @@ async function addComponent(name, options) {
|
|
|
264
264
|
ERROR_CODES.ERR_FILE_EXISTS,
|
|
265
265
|
);
|
|
266
266
|
}
|
|
267
|
-
//
|
|
268
|
-
//
|
|
269
|
-
|
|
267
|
+
// A second doc under a name discovery already records, by a doc's file name
|
|
268
|
+
// anywhere under the root or by a name a doc documents, would shadow one of
|
|
269
|
+
// the two.
|
|
270
|
+
const existingDoc = findIntegrationComponentDoc(
|
|
271
|
+
{name: owner, components: root, __packageDir: packageDir},
|
|
272
|
+
name,
|
|
273
|
+
);
|
|
270
274
|
if (existingDoc != null) {
|
|
271
275
|
throw new AstryxError(
|
|
272
276
|
`Refusing to add component "${name}": ${projectPath(path.relative(packageDir, existingDoc))} already defines it.`,
|
|
@@ -691,7 +695,7 @@ async function addTemplate(name, options) {
|
|
|
691
695
|
const sourcePath = projectPath(path.relative(packageDir, sourceFile));
|
|
692
696
|
const extensionlessPath = sourcePath.replace(/\.tsx?$/u, '');
|
|
693
697
|
const blockFields = templateType === 'block' ? '\n aspectRatio: 1,' : '';
|
|
694
|
-
const specContents = `/** @type {import('@astryxdesign/cli/authoring').
|
|
698
|
+
const specContents = `/** @type {import('@astryxdesign/cli/authoring').IntegrationTemplateDoc} */\nexport default {\n type: '${templateType}',\n name: '${name}',\n displayName: '${kebabToTitle(name)}',\n description: '${kebabToTitle(name)} template.',${blockFields}\n};\n`;
|
|
695
699
|
const sourceContents = `export default function ${pascalName}() {\n return <div>${kebabToTitle(name)}</div>;\n}\n`;
|
|
696
700
|
|
|
697
701
|
/** @type {import('./add-helpers.mjs').WritePlan[]} */
|
|
@@ -536,7 +536,9 @@ describe('integrationAdd template', () => {
|
|
|
536
536
|
path.join(tmpDir, 'templates/my-widget.doc.mjs'),
|
|
537
537
|
'utf-8',
|
|
538
538
|
);
|
|
539
|
-
expect(spec).toContain(
|
|
539
|
+
expect(spec).toContain(
|
|
540
|
+
"@astryxdesign/cli/authoring').IntegrationTemplateDoc",
|
|
541
|
+
);
|
|
540
542
|
expect(spec).toContain("type: 'page'");
|
|
541
543
|
expect(spec).toContain("name: 'my-widget'");
|
|
542
544
|
|
|
@@ -830,7 +832,7 @@ describe('typed descriptor conformance', () => {
|
|
|
830
832
|
for (const [relativePath, type] of [
|
|
831
833
|
['components/MyWidget.doc.mjs', 'ComponentDoc'],
|
|
832
834
|
['docs/my-guide.doc.mjs', 'ReferenceDoc'],
|
|
833
|
-
['templates/my-page.doc.mjs', '
|
|
835
|
+
['templates/my-page.doc.mjs', 'IntegrationTemplateDoc'],
|
|
834
836
|
['themes/ocean/oceanTheme.doc.mjs', 'ThemeDoc'],
|
|
835
837
|
]) {
|
|
836
838
|
const source = fs.readFileSync(path.join(tmpDir, relativePath), 'utf-8');
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file Integration authoring diagnostics against the built-in Core catalog.
|
|
5
5
|
*
|
|
6
|
+
* The components check also compares each component doc's props with the
|
|
7
|
+
* component's TypeScript props (foundation/discovery/prop-drift.mjs); those
|
|
8
|
+
* findings are warnings under `propDrift`.
|
|
9
|
+
*
|
|
6
10
|
* Templates may intentionally replace Core identities; undeclared same-id
|
|
7
11
|
* overlaps stay fail-closed and require package selection. The CLI package
|
|
8
12
|
* version gates replacement-specific fields so 0.6.x keeps its released shape.
|
|
@@ -25,6 +29,11 @@ import {
|
|
|
25
29
|
discoverOwnedComponents,
|
|
26
30
|
} from '../../foundation/discovery/component-discovery.mjs';
|
|
27
31
|
import {loadComponentReplacements} from '../component/_adapter.mjs';
|
|
32
|
+
import {
|
|
33
|
+
integrationCopiedPassages,
|
|
34
|
+
integrationFluff,
|
|
35
|
+
integrationPropDrift,
|
|
36
|
+
} from './_adapter.mjs';
|
|
28
37
|
import {
|
|
29
38
|
discoverBuiltinTopics,
|
|
30
39
|
discoverIntegrationDocs,
|
|
@@ -242,6 +251,10 @@ export async function integrationComponentConflicts(pkg, options = {}) {
|
|
|
242
251
|
};
|
|
243
252
|
}
|
|
244
253
|
|
|
254
|
+
// Each documented prop against the component's TypeScript props, read with
|
|
255
|
+
// the project's own compiler; without one the report says it was skipped.
|
|
256
|
+
const propDrift = await integrationPropDrift(resolved.integration, cwd);
|
|
257
|
+
|
|
245
258
|
const coreDir = findCoreDir(cwd);
|
|
246
259
|
if (!coreDir) {
|
|
247
260
|
issues.push({
|
|
@@ -252,7 +265,7 @@ export async function integrationComponentConflicts(pkg, options = {}) {
|
|
|
252
265
|
});
|
|
253
266
|
return {
|
|
254
267
|
type: 'integration.component-conflicts',
|
|
255
|
-
data: {validated, name, version, conflicts: [], issues},
|
|
268
|
+
data: {validated, name, version, conflicts: [], issues, propDrift},
|
|
256
269
|
};
|
|
257
270
|
}
|
|
258
271
|
|
|
@@ -296,7 +309,7 @@ export async function integrationComponentConflicts(pkg, options = {}) {
|
|
|
296
309
|
|
|
297
310
|
return {
|
|
298
311
|
type: 'integration.component-conflicts',
|
|
299
|
-
data: {validated, name, version, conflicts, issues},
|
|
312
|
+
data: {validated, name, version, conflicts, issues, propDrift},
|
|
300
313
|
};
|
|
301
314
|
}
|
|
302
315
|
|
|
@@ -314,10 +327,22 @@ export async function integrationDocConflicts(pkg, options = {}) {
|
|
|
314
327
|
const version = resolved.found ? (resolved.version ?? null) : null;
|
|
315
328
|
const issues = [...resolved.issues];
|
|
316
329
|
|
|
330
|
+
/** @type {import('./authoring-checks.type.mjs').CopiedPassage[]} */
|
|
331
|
+
const copiedPassages = [];
|
|
332
|
+
/** @type {import('./authoring-checks.type.mjs').DocFluff[]} */
|
|
333
|
+
const fluff = [];
|
|
317
334
|
if (!resolved.integration?.docs || name == null) {
|
|
318
335
|
return {
|
|
319
336
|
type: 'integration.doc-conflicts',
|
|
320
|
-
data: {
|
|
337
|
+
data: {
|
|
338
|
+
validated,
|
|
339
|
+
name,
|
|
340
|
+
version,
|
|
341
|
+
findings: [],
|
|
342
|
+
copiedPassages,
|
|
343
|
+
fluff,
|
|
344
|
+
issues,
|
|
345
|
+
},
|
|
321
346
|
};
|
|
322
347
|
}
|
|
323
348
|
|
|
@@ -407,10 +432,25 @@ export async function integrationDocConflicts(pkg, options = {}) {
|
|
|
407
432
|
)) {
|
|
408
433
|
issues.push({code: 'invalid_doc_reference', severity: 'error', message});
|
|
409
434
|
}
|
|
435
|
+
|
|
436
|
+
// One fact has one owner: a passage two topics repeat goes stale in one
|
|
437
|
+
// of them. Each is listed and is a warning (architecture:cli-surface
|
|
438
|
+
// DEC-8), so `integration check --strict` fails until it is fixed;
|
|
439
|
+
// `doctor integration docs` keeps its exit code, as it fails on errors.
|
|
440
|
+
copiedPassages.push(...(await integrationCopiedPassages(discovered)));
|
|
441
|
+
for (const {message} of copiedPassages) {
|
|
442
|
+
issues.push({code: 'copied_passage', severity: 'warning', message});
|
|
443
|
+
}
|
|
444
|
+
// Docs should be dense: padding phrases and mostly-glue topics, listed
|
|
445
|
+
// and warned about the same way (DEC-8).
|
|
446
|
+
fluff.push(...(await integrationFluff(discovered)));
|
|
447
|
+
for (const {message} of fluff) {
|
|
448
|
+
issues.push({code: 'doc_fluff', severity: 'warning', message});
|
|
449
|
+
}
|
|
410
450
|
}
|
|
411
451
|
|
|
412
452
|
return {
|
|
413
453
|
type: 'integration.doc-conflicts',
|
|
414
|
-
data: {validated, name, version, findings, issues},
|
|
454
|
+
data: {validated, name, version, findings, copiedPassages, fluff, issues},
|
|
415
455
|
};
|
|
416
456
|
}
|