@astryxdesign/cli 0.6.4 → 0.6.5-canary.031021b
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/CHANGELOG.md +56 -0
- package/README.md +97 -90
- package/api/build/build.doc.mjs +6 -1
- package/api/build/build.test.mjs +22 -0
- package/api/build/kit/kit.mjs +44 -5
- package/api/component/_adapter.d.mts +25 -0
- package/api/component/_adapter.mjs +59 -5
- package/api/component/component.d.mts +6 -3
- package/api/component/component.doc.mjs +37 -17
- package/api/component/component.mjs +249 -9
- package/api/component/component.type.d.mts +25 -0
- package/api/component/component.type.mjs +44 -0
- package/api/discover/_adapter.d.mts +114 -6
- package/api/discover/_adapter.mjs +372 -17
- package/api/discover/_adapter.test.mjs +215 -0
- package/api/discover/_catalog-view.d.mts +115 -0
- package/api/discover/_catalog-view.mjs +203 -0
- package/api/discover/_catalog-view.test.mjs +128 -0
- package/api/discover/detail/detail.d.mts +18 -6
- package/api/discover/detail/detail.mjs +67 -13
- package/api/discover/detail/detail.test.mjs +85 -0
- package/api/discover/detail/item/item.d.mts +26 -0
- package/api/discover/detail/item/item.mjs +78 -0
- package/api/discover/detail/item/item.test.mjs +73 -0
- package/api/discover/discover.d.mts +3 -9
- package/api/discover/discover.doc.mjs +61 -18
- package/api/discover/discover.mjs +220 -36
- package/api/discover/discover.test.mjs +11 -2
- package/api/discover/discover.type.d.mts +147 -8
- package/api/discover/discover.type.mjs +102 -12
- package/api/discover/list/list.d.mts +20 -6
- package/api/discover/list/list.mjs +45 -12
- package/api/discover/list/list.test.mjs +46 -0
- package/api/discover/search/search.d.mts +18 -16
- package/api/discover/search/search.mjs +102 -56
- package/api/discover/search/search.test.mjs +144 -10
- package/api/docs/_adapter.d.mts +8 -3
- package/api/docs/_adapter.mjs +14 -6
- package/api/docs/docOverlays.test.mjs +27 -1
- package/api/docs/docs.doc.mjs +2 -2
- package/api/doctor/doctor.d.mts +8 -3
- package/api/doctor/doctor.doc.mjs +17 -8
- package/api/doctor/doctor.mjs +90 -9
- package/api/doctor/doctor.test.mjs +122 -10
- package/api/doctor/doctor.type.d.mts +1 -1
- package/api/doctor/doctor.type.mjs +1 -1
- package/api/gap-report/gap-report.doc.mjs +19 -10
- package/api/hook/hook.doc.mjs +6 -3
- package/api/index.d.mts +1 -0
- package/api/index.mjs +5 -3
- package/api/init/init.doc.mjs +17 -12
- package/api/integration/add-helpers.d.mts +5 -2
- package/api/integration/add-helpers.mjs +36 -9
- package/api/integration/add-theme.mjs +22 -1
- package/api/integration/add-theme.test.mjs +34 -0
- package/api/integration/authoring-checks.mjs +2 -2
- package/api/integration/integrationPackCheck.doc.mjs +3 -3
- package/api/integration/pack-check.lifecycle-output.test.mjs +107 -0
- package/api/integration/pack-check.mjs +82 -9
- package/api/integration/pack-check.test.mjs +90 -0
- package/api/integration/pack-check.type.mjs +1 -1
- package/api/json/assertResponse.doc.mjs +1 -1
- package/api/json/isError.doc.mjs +1 -1
- package/api/search/search.d.mts +27 -1
- package/api/search/search.doc.mjs +2 -2
- package/api/search/search.mjs +228 -16
- package/api/swizzle/swizzle.doc.mjs +7 -5
- package/api/template/copy/copy.mjs +1 -1
- package/api/template/copy/copy.test.mjs +9 -0
- package/api/template/template.doc.mjs +2 -1
- package/api/theme/add/add.mjs +17 -25
- package/api/theme/add/add.rollback.test.mjs +158 -0
- package/api/theme/add/add.staging.test.mjs +40 -23
- package/api/theme/build/build.family.test.mjs +7 -12
- package/api/theme/build/build.mjs +8 -18
- package/api/theme/build/build.rollback.test.mjs +148 -0
- package/api/theme/generateTonalPalette.doc.mjs +1 -2
- package/api/theme/listThemes.doc.mjs +1 -1
- package/api/theme/themeAdd.doc.mjs +9 -10
- package/api/theme/themeBuild.doc.mjs +13 -13
- package/api/theme/themeList.doc.mjs +1 -1
- package/api/theme/themeListAvailable.doc.mjs +2 -1
- package/api/theme/themePaletteGenerate.doc.mjs +15 -8
- package/api/theme/themeTargets.doc.mjs +3 -2
- package/api/theme/themeTemplate.doc.mjs +2 -1
- package/api/upgrade/run/files-changed.test.mjs +111 -0
- package/api/upgrade/run/run.mjs +5 -3
- package/api/upgrade/upgrade.doc.mjs +24 -22
- package/api/upgrade/upgrade.type.mjs +2 -2
- package/assets/codemods/__tests__/runner.test.mjs +3 -1
- package/assets/codemods/file-count.test.mjs +163 -0
- package/assets/codemods/integration-runner.mjs +3 -3
- package/assets/codemods/runner.mjs +5 -4
- package/assets/docs/README.md +4 -2
- package/assets/docs/browser-support.doc.mjs +11 -11
- package/assets/docs/color.doc.mjs +8 -2
- package/assets/docs/elevation.doc.mjs +6 -4
- package/assets/docs/getting-started.doc.mjs +5 -16
- package/assets/docs/icons.doc.mjs +2 -21
- package/assets/docs/illustrations.doc.mjs +7 -15
- package/assets/docs/internationalization.doc.mjs +7 -5
- package/assets/docs/layout.doc.dense.mjs +130 -82
- package/assets/docs/layout.doc.mjs +133 -77
- package/assets/docs/migration.doc.mjs +19 -21
- package/assets/docs/motion.doc.mjs +16 -3
- package/assets/docs/principles.doc.dense.mjs +5 -5
- package/assets/docs/principles.doc.mjs +8 -0
- package/assets/docs/principles.doc.zh.mjs +6 -6
- package/assets/docs/shape.doc.mjs +8 -3
- package/assets/docs/spacing.doc.mjs +7 -2
- package/assets/docs/styling-libraries.doc.mjs +6 -2
- package/assets/docs/styling.doc.mjs +19 -23
- package/assets/docs/theme.doc.dense.mjs +58 -18
- package/assets/docs/theme.doc.mjs +57 -47
- package/assets/docs/theme.doc.zh.mjs +9 -8
- package/assets/docs/tokens.doc.dense.mjs +2 -2
- package/assets/docs/tokens.doc.mjs +389 -8
- package/assets/docs/tokens.doc.zh.mjs +2 -2
- package/assets/docs/tree/add-a-component.doc.mjs +75 -0
- package/assets/docs/tree/add-a-theme.doc.mjs +85 -0
- package/assets/docs/tree/add-a-topic.doc.mjs +144 -0
- package/assets/docs/tree/agent-guidance.doc.mjs +138 -0
- package/assets/docs/tree/block-template.doc.mjs +130 -0
- package/assets/docs/tree/build-the-template.doc.mjs +28 -0
- package/assets/docs/tree/building-blocks.doc.mjs +46 -0
- package/assets/docs/tree/check-your-docs.doc.mjs +137 -0
- package/assets/docs/tree/checks.doc.mjs +119 -0
- package/assets/docs/tree/codemods.doc.mjs +147 -0
- package/assets/docs/tree/component-family.doc.mjs +113 -0
- package/assets/docs/tree/component-imports.doc.mjs +69 -0
- package/assets/docs/tree/component-lookups.doc.mjs +149 -0
- package/assets/docs/tree/components.doc.mjs +23 -0
- package/assets/docs/tree/configuration.doc.mjs +23 -0
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +182 -0
- package/assets/docs/tree/define-the-theme.doc.mjs +118 -0
- package/assets/docs/tree/describe-the-component.doc.mjs +57 -0
- package/assets/docs/tree/docs.doc.mjs +21 -0
- package/assets/docs/tree/document-the-template.doc.mjs +28 -0
- package/assets/docs/tree/document-the-theme.doc.mjs +68 -0
- package/assets/docs/tree/export-template-assets.doc.mjs +147 -0
- package/assets/docs/tree/extend-or-replace.doc.mjs +103 -0
- package/assets/docs/tree/fonts-and-assets.doc.mjs +106 -0
- package/assets/docs/tree/generate-a-palette.doc.mjs +66 -0
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +105 -0
- package/assets/docs/tree/help.doc.mjs +16 -0
- package/assets/docs/tree/integrations.doc.mjs +25 -451
- package/assets/docs/tree/links.doc.mjs +98 -0
- package/assets/docs/tree/package-and-test.doc.mjs +32 -0
- package/assets/docs/tree/page-template.doc.mjs +71 -0
- package/assets/docs/tree/publishing.doc.mjs +111 -0
- package/assets/docs/tree/quick-start.doc.mjs +272 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +104 -0
- package/assets/docs/tree/replace-a-core-template.doc.mjs +172 -0
- package/assets/docs/tree/sections-and-placement.doc.mjs +108 -0
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +59 -0
- package/assets/docs/tree/ship.doc.mjs +16 -0
- package/assets/docs/tree/short-and-findable.doc.mjs +108 -0
- package/assets/docs/tree/single-component.doc.mjs +165 -0
- package/assets/docs/tree/start-a-template.doc.mjs +143 -0
- package/assets/docs/tree/subcomponent.doc.mjs +115 -0
- package/assets/docs/tree/template-assets.doc.mjs +64 -0
- package/assets/docs/tree/template-doc-overview.doc.mjs +109 -0
- package/assets/docs/tree/template-fonts.doc.mjs +102 -0
- package/assets/docs/tree/template-grading-rubric.doc.mjs +452 -0
- package/assets/docs/tree/template-icons.doc.mjs +97 -0
- package/assets/docs/tree/template-images-media.doc.mjs +127 -0
- package/assets/docs/tree/template-styles.doc.mjs +93 -0
- package/assets/docs/tree/templates.doc.mjs +34 -0
- package/assets/docs/tree/test-in-an-app.doc.mjs +115 -0
- package/assets/docs/tree/test-template-in-app.doc.mjs +128 -0
- package/assets/docs/tree/themes.doc.mjs +39 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +149 -0
- package/assets/docs/tree/upgrading.doc.mjs +103 -0
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +51 -0
- package/assets/docs/tree/verify-packed-template.doc.mjs +77 -0
- package/assets/docs/tree/versioning.doc.mjs +161 -0
- package/assets/docs/tree/write-good-templates.doc.mjs +64 -0
- package/assets/docs/tree/write-the-template-file.doc.mjs +154 -0
- package/assets/docs/typography.doc.mjs +24 -4
- package/assets/docs/working-with-ai.doc.mjs +30 -22
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
- package/authoring/config/config.doc.mjs +9 -1
- package/authoring/config/parse.d.mts +2 -0
- package/authoring/config/parse.mjs +19 -0
- package/authoring/config/parse.test.mjs +8 -0
- package/authoring/config/type.ts +11 -0
- package/authoring/discover/discover.doc.d.mts +13 -0
- package/authoring/discover/discover.doc.mjs +138 -0
- package/authoring/discover/parse.d.mts +24 -0
- package/authoring/discover/parse.mjs +128 -0
- package/authoring/discover/parse.test.mjs +124 -0
- package/authoring/discover/type.ts +87 -0
- package/authoring/doctypes/_schema.d.mts +3 -2
- package/authoring/doctypes/_schema.mjs +6 -0
- package/authoring/doctypes/base/graph-fields.doc.mjs +3 -3
- package/authoring/doctypes/base/type.ts +4 -2
- package/authoring/doctypes/component/component.doc.mjs +6 -0
- package/authoring/doctypes/component/type.ts +8 -0
- package/authoring/doctypes/reference/reference.doc.mjs +7 -0
- package/authoring/doctypes/reference/type.ts +5 -0
- package/authoring/doctypes/schema/schema.doc.mjs +2 -2
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +2 -2
- package/authoring/index.d.mts +1 -0
- package/authoring/index.d.ts +10 -0
- package/authoring/index.mjs +1 -0
- package/authoring/integration/integration.doc.mjs +12 -10
- package/clients/cli/commands/component/index.mjs +152 -55
- package/clients/cli/commands/component-batch.test.mjs +341 -0
- package/clients/cli/commands/component-ownership.test.mjs +89 -0
- package/clients/cli/commands/component.doc.mjs +27 -9
- package/clients/cli/commands/discover.doc.mjs +53 -9
- package/clients/cli/commands/discover.mjs +393 -118
- package/clients/cli/commands/discover.sources.test.mjs +267 -0
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/docs.mjs +60 -17
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +3 -2
- package/clients/cli/commands/doctor-integration.test.mjs +53 -0
- package/clients/cli/commands/doctor.doc.mjs +3 -1
- package/clients/cli/commands/doctor.mjs +49 -5
- package/clients/cli/commands/gap-report.doc.mjs +10 -9
- package/clients/cli/commands/init.doc.mjs +9 -6
- package/clients/cli/commands/integration-add.doc.mjs +9 -9
- package/clients/cli/commands/integration-authoring.test.mjs +61 -10
- package/clients/cli/commands/integration-pack.doc.mjs +5 -9
- package/clients/cli/commands/integration-real-world.test.mjs +1 -1
- package/clients/cli/commands/integration-verify.doc.mjs +22 -0
- package/clients/cli/commands/integration.doc.mjs +4 -4
- package/clients/cli/commands/integration.mjs +74 -43
- package/clients/cli/commands/manifest.doc.mjs +1 -1
- package/clients/cli/commands/search.doc.mjs +10 -3
- package/clients/cli/commands/search.mjs +21 -2
- package/clients/cli/commands/search.test.mjs +21 -4
- package/clients/cli/commands/swizzle.doc.mjs +1 -1
- package/clients/cli/commands/template.doc.mjs +1 -1
- package/clients/cli/commands/text-json-parity.test.mjs +7 -1
- package/clients/cli/commands/theme-add.doc.mjs +1 -1
- package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
- package/clients/cli/commands/theme-palette.doc.mjs +1 -2
- package/clients/cli/commands/theme-targets.doc.mjs +2 -2
- package/clients/cli/commands/theme.doc.mjs +2 -1
- package/clients/cli/commands/upgrade.doc.mjs +62 -3
- package/clients/cli/index.mjs +28 -6
- package/clients/cli/lib/define-command.mjs +28 -4
- package/clients/cli/lib/define-command.test.mjs +54 -0
- package/clients/cli/lib/exit-codes.test.mjs +17 -1
- package/clients/cli/lib/json-shim.mjs +24 -14
- package/clients/cli/lib/manifest.mjs +18 -5
- package/clients/cli/lib/manifest.test.mjs +5 -2
- package/clients/cli/lib/parse-error-format.test.mjs +81 -0
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/discovery/authoring-self-docs.mjs +1 -0
- package/foundation/discovery/authoring-self-docs.test.mjs +6 -2
- package/foundation/discovery/cli-self-docs.mjs +16 -2
- package/foundation/discovery/cli-self-docs.test.mjs +20 -0
- package/foundation/discovery/docs-discovery.mjs +5 -1
- package/foundation/discovery/docs-discovery.test.mjs +21 -0
- package/foundation/discovery/docs-section-key.d.mts +1 -1
- package/foundation/discovery/docs-section-key.mjs +1 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +3 -2
- package/foundation/doc-compiler/inputs.test.mjs +0 -1
- package/foundation/doc-compiler/tree.d.mts +4 -0
- package/foundation/doc-compiler/tree.mjs +6 -1
- package/foundation/integrations/cli-requirement.d.mts +26 -6
- package/foundation/integrations/cli-requirement.mjs +46 -11
- package/foundation/integrations/cli-requirement.test.mjs +7 -2
- package/foundation/integrations/contribution-inventory.mjs +1 -1
- package/foundation/integrations/integrations.d.mts +14 -1
- package/foundation/integrations/integrations.mjs +41 -1
- package/foundation/integrations/integrations.test.mjs +31 -0
- package/foundation/response/batch.type.d.mts +33 -0
- package/foundation/response/batch.type.mjs +34 -0
- package/foundation/response/error-codes.doc.mjs +6 -8
- package/foundation/response/error-codes.test.mjs +30 -5
- package/foundation/response/response-types.doc.d.mts +4 -3
- package/foundation/response/response-types.doc.mjs +40 -10
- package/foundation/response/response-types.doc.test.mjs +23 -0
- package/foundation/response/response.doc.mjs +11 -10
- package/package.json +9 -9
- package/api/docs/docs.test.mjs +0 -243
- package/api/docs/integration-tree.test.mjs +0 -555
- package/api/docs/integrationDocs.test.mjs +0 -314
- package/api/search/search.test.mjs +0 -512
- package/assets/docs/tree/integrations.test.mjs +0 -62
- package/assets/docs/tree/writing-docs.doc.mjs +0 -286
- package/clients/cli/commands/docs.test.mjs +0 -294
- package/foundation/agent-docs/agent-docs.test.mjs +0 -1159
- package/foundation/doc-compiler/tree.test.mjs +0 -598
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* @file Programmatic API for the component command — DISPATCHER + BARREL.
|
|
5
5
|
*
|
|
6
6
|
* Returns the same typed envelope { type, data } that `astryx --json component`
|
|
7
|
-
* outputs. `component(name, opts)` parses
|
|
8
|
-
* subject
|
|
9
|
-
* (list · detail · detail.props/source/showcase/blocks)
|
|
10
|
-
*
|
|
7
|
+
* outputs. `component(name, opts)` parses one selector or an ordered selector
|
|
8
|
+
* list, resolves each subject through `_adapter`, and routes to the correct leaf
|
|
9
|
+
* (list · detail · detail.props/source/showcase/blocks). The CLI command handler
|
|
10
|
+
* is a thin wrapper around this function.
|
|
11
11
|
*
|
|
12
12
|
* Every leaf is also re-exported for direct scripting use.
|
|
13
13
|
*/
|
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
resolveUnscopedDoc,
|
|
27
27
|
loadComponentDoc,
|
|
28
28
|
scopeSubComponent,
|
|
29
|
+
ComponentAmbiguityError,
|
|
30
|
+
installedComponentPackageVersion,
|
|
29
31
|
} from './_adapter.mjs';
|
|
30
32
|
import {componentList} from './list/list.mjs';
|
|
31
33
|
import {componentDetail} from './detail/detail.mjs';
|
|
@@ -34,13 +36,199 @@ import {componentDetailSource} from './detail/source/source.mjs';
|
|
|
34
36
|
import {componentDetailShowcase} from './detail/showcase/showcase.mjs';
|
|
35
37
|
import {componentDetailBlocks} from './detail/blocks/blocks.mjs';
|
|
36
38
|
|
|
39
|
+
/** Maximum selectors accepted before any component resolution starts. */
|
|
40
|
+
export const COMPONENT_BATCH_SELECTOR_LIMIT = 100;
|
|
41
|
+
|
|
37
42
|
/** @type {ReadonlyArray<string>} */
|
|
38
43
|
const DETAIL_LEVELS = ['full', 'compact', 'brief'];
|
|
39
44
|
/** @type {ReadonlyArray<string>} */
|
|
40
45
|
const LANGS = ['en', 'zh', 'dense'];
|
|
46
|
+
/** @type {Set<string>} */
|
|
47
|
+
const NOT_FOUND_CODES = new Set([
|
|
48
|
+
ERROR_CODES.ERR_UNKNOWN_COMPONENT,
|
|
49
|
+
ERROR_CODES.ERR_UNKNOWN_PACKAGE,
|
|
50
|
+
ERROR_CODES.ERR_NOT_FOUND,
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Discover-compatible package target grammar. Versions belong to the package
|
|
55
|
+
* head, never the item after the package slash.
|
|
56
|
+
* @param {string} selector
|
|
57
|
+
* @returns {{scoped: boolean, name: string, version?: string, item?: string}}
|
|
58
|
+
*/
|
|
59
|
+
function splitSelector(selector) {
|
|
60
|
+
const scoped = selector.startsWith('@');
|
|
61
|
+
const firstSlash = selector.indexOf('/');
|
|
62
|
+
let head = selector;
|
|
63
|
+
/** @type {string | undefined} */
|
|
64
|
+
let rest;
|
|
65
|
+
const split = scoped
|
|
66
|
+
? firstSlash < 0
|
|
67
|
+
? -1
|
|
68
|
+
: selector.indexOf('/', firstSlash + 1)
|
|
69
|
+
: firstSlash;
|
|
70
|
+
if (split > 0) {
|
|
71
|
+
head = selector.slice(0, split);
|
|
72
|
+
rest = selector.slice(split + 1) || undefined;
|
|
73
|
+
}
|
|
74
|
+
const at = head.indexOf('@', 1);
|
|
75
|
+
return {
|
|
76
|
+
scoped,
|
|
77
|
+
name: at > 0 ? head.slice(0, at) : head,
|
|
78
|
+
...(at > 0 && head.slice(at + 1) ? {version: head.slice(at + 1)} : {}),
|
|
79
|
+
...(rest ? {item: rest} : {}),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Resolve one component selector into the existing single-component API inputs.
|
|
85
|
+
* @param {unknown} value
|
|
86
|
+
* @param {string|undefined} packageScope
|
|
87
|
+
* @returns {{selector: string, name: string, package?: string, version?: string}}
|
|
88
|
+
*/
|
|
89
|
+
function parseComponentSelector(value, packageScope) {
|
|
90
|
+
if (typeof value !== 'string' || value.length === 0) {
|
|
91
|
+
throw new AstryxError(
|
|
92
|
+
`Invalid component selector "${String(value)}"`,
|
|
93
|
+
undefined,
|
|
94
|
+
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
const target = splitSelector(value);
|
|
98
|
+
const packageShaped =
|
|
99
|
+
target.scoped || target.item != null || target.version != null;
|
|
100
|
+
if (!packageShaped) {
|
|
101
|
+
return {selector: value, name: target.name, package: packageScope};
|
|
102
|
+
}
|
|
103
|
+
if (!target.item) {
|
|
104
|
+
throw new AstryxError(
|
|
105
|
+
`Component selector "${value}" names a package but no component`,
|
|
106
|
+
undefined,
|
|
107
|
+
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
if (packageScope && packageScope !== target.name) {
|
|
111
|
+
throw new AstryxError(
|
|
112
|
+
`Component selector "${value}" conflicts with --package "${packageScope}"`,
|
|
113
|
+
undefined,
|
|
114
|
+
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
selector: value,
|
|
119
|
+
name: target.item,
|
|
120
|
+
package: target.name,
|
|
121
|
+
...(target.version ? {version: target.version} : {}),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* A version-qualified selector never falls through to another installed
|
|
127
|
+
* version. Its structured suggestion points at the command that can discover
|
|
128
|
+
* the requested package release.
|
|
129
|
+
* @param {{package?: string, version?: string}} target
|
|
130
|
+
* @param {string} coreDir
|
|
131
|
+
* @param {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]} loadedIntegrations
|
|
132
|
+
* @returns {void}
|
|
133
|
+
*/
|
|
134
|
+
function requireInstalledSelectorVersion(target, coreDir, loadedIntegrations) {
|
|
135
|
+
if (!target.version) return;
|
|
136
|
+
const packageName = /** @type {string} */ (target.package);
|
|
137
|
+
const installed = installedComponentPackageVersion(
|
|
138
|
+
coreDir,
|
|
139
|
+
loadedIntegrations,
|
|
140
|
+
packageName,
|
|
141
|
+
);
|
|
142
|
+
if (installed === target.version) return;
|
|
143
|
+
const exact = `${packageName}@${target.version}`;
|
|
144
|
+
throw new AstryxError(
|
|
145
|
+
`Package "${exact}" is not installed`,
|
|
146
|
+
[
|
|
147
|
+
{
|
|
148
|
+
name: `astryx discover ${exact}`,
|
|
149
|
+
reason: 'look up this package version',
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
ERROR_CODES.ERR_UNKNOWN_PACKAGE,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Turn a single-lookup failure into one complete batch row.
|
|
158
|
+
* @param {string} selector
|
|
159
|
+
* @param {unknown} error
|
|
160
|
+
* @returns {import('./component.type.mjs').ComponentBatchResult}
|
|
161
|
+
*/
|
|
162
|
+
function batchFailure(selector, error) {
|
|
163
|
+
const err =
|
|
164
|
+
error instanceof AstryxError
|
|
165
|
+
? error
|
|
166
|
+
: new AstryxError(
|
|
167
|
+
error instanceof Error ? error.message : String(error),
|
|
168
|
+
undefined,
|
|
169
|
+
ERROR_CODES.ERR_UNKNOWN,
|
|
170
|
+
);
|
|
171
|
+
if (err instanceof ComponentAmbiguityError) {
|
|
172
|
+
return {
|
|
173
|
+
selector,
|
|
174
|
+
status: 'ambiguous',
|
|
175
|
+
code: err.code,
|
|
176
|
+
error: err.message,
|
|
177
|
+
candidates: err.candidates,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
selector,
|
|
182
|
+
status: NOT_FOUND_CODES.has(err.code) ? 'not_found' : 'error',
|
|
183
|
+
code: err.code,
|
|
184
|
+
error: err.message,
|
|
185
|
+
...(err.suggestions ? {suggestions: err.suggestions} : {}),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
41
188
|
|
|
42
189
|
/**
|
|
43
|
-
* @param {
|
|
190
|
+
* @param {unknown[]} selectors
|
|
191
|
+
* @param {object} options
|
|
192
|
+
* @param {string} options.cwd
|
|
193
|
+
* @param {string} [options.package]
|
|
194
|
+
* @param {boolean} [options.props]
|
|
195
|
+
* @param {boolean} [options.source]
|
|
196
|
+
* @param {boolean} [options.showcase]
|
|
197
|
+
* @param {boolean} [options.blocks]
|
|
198
|
+
* @param {'full'|'compact'|'brief'} [options.detail]
|
|
199
|
+
* @param {string|null} [options.lang]
|
|
200
|
+
* @param {boolean} [options.zh]
|
|
201
|
+
* @param {boolean} [options.dense]
|
|
202
|
+
* @param {string} coreDir
|
|
203
|
+
* @returns {Promise<import('./component.type.mjs').ComponentBatchResponse>}
|
|
204
|
+
*/
|
|
205
|
+
async function componentBatch(selectors, options, coreDir) {
|
|
206
|
+
const loadedIntegrations = await loadIntegrationsSafely(options.cwd);
|
|
207
|
+
/** @type {import('./component.type.mjs').ComponentBatchResult[]} */
|
|
208
|
+
const results = [];
|
|
209
|
+
for (const value of selectors) {
|
|
210
|
+
const selector = typeof value === 'string' ? value : String(value);
|
|
211
|
+
try {
|
|
212
|
+
const target = parseComponentSelector(value, options.package);
|
|
213
|
+
requireInstalledSelectorVersion(target, coreDir, loadedIntegrations);
|
|
214
|
+
const result =
|
|
215
|
+
/** @type {import('./component.type.mjs').ComponentSingleResponse} */ (
|
|
216
|
+
await component(target.name, {
|
|
217
|
+
...options,
|
|
218
|
+
lang: options.lang ?? undefined,
|
|
219
|
+
package: target.package,
|
|
220
|
+
})
|
|
221
|
+
);
|
|
222
|
+
results.push({selector, status: 'found', result});
|
|
223
|
+
} catch (error) {
|
|
224
|
+
results.push(batchFailure(selector, error));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return {type: 'component.batch', data: {count: results.length, results}};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* @param {string|string[]} [name]
|
|
44
232
|
* @param {object} [options]
|
|
45
233
|
* @param {string} [options.cwd]
|
|
46
234
|
* @param {boolean} [options.list]
|
|
@@ -56,6 +244,7 @@ const LANGS = ['en', 'zh', 'dense'];
|
|
|
56
244
|
* @param {boolean} [options.dense]
|
|
57
245
|
* @returns {Promise<(
|
|
58
246
|
* import('./component.type.mjs').ComponentListResponse
|
|
247
|
+
* | import('./component.type.mjs').ComponentBatchResponse
|
|
59
248
|
* | import('./component.type.mjs').ComponentDetailResponse
|
|
60
249
|
* | import('./component.type.mjs').ComponentDetailPropsResponse
|
|
61
250
|
* | import('./component.type.mjs').ComponentDetailSourceResponse
|
|
@@ -79,11 +268,16 @@ export async function component(name, options = {}) {
|
|
|
79
268
|
dense = false,
|
|
80
269
|
} = options;
|
|
81
270
|
|
|
271
|
+
const selectorList = Array.isArray(name) ? name : null;
|
|
272
|
+
const noName = selectorList == null && !name;
|
|
273
|
+
|
|
82
274
|
// Default detail level mirrors the CLI (see commands/component/index.mjs):
|
|
83
275
|
// single-component views default to 'full', list-style views (--list,
|
|
84
276
|
// --category, or no name) default to 'brief' (scannable name lists).
|
|
85
|
-
//
|
|
86
|
-
|
|
277
|
+
// An explicit array remains a batch even when it is empty or a caller also
|
|
278
|
+
// passes a list-only option.
|
|
279
|
+
const isListView =
|
|
280
|
+
selectorList == null && (list || category != null || noName);
|
|
87
281
|
const detail = detailOption ?? (isListView ? 'brief' : 'full');
|
|
88
282
|
|
|
89
283
|
// Same accepted values and codes as the CLI's --detail and --lang, checked
|
|
@@ -103,6 +297,14 @@ export async function component(name, options = {}) {
|
|
|
103
297
|
);
|
|
104
298
|
}
|
|
105
299
|
|
|
300
|
+
if (selectorList && selectorList.length > COMPONENT_BATCH_SELECTOR_LIMIT) {
|
|
301
|
+
throw new AstryxError(
|
|
302
|
+
`Component batch accepts at most ${COMPONENT_BATCH_SELECTOR_LIMIT} selectors; received ${selectorList.length}`,
|
|
303
|
+
undefined,
|
|
304
|
+
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
|
|
106
308
|
const coreDir = requireCoreDir(cwd);
|
|
107
309
|
|
|
108
310
|
// A public API caller could pass a non-string category; the list leaf does
|
|
@@ -116,11 +318,46 @@ export async function component(name, options = {}) {
|
|
|
116
318
|
);
|
|
117
319
|
}
|
|
118
320
|
|
|
321
|
+
// ── Explicit batch selector list ─────────────────────────────────
|
|
322
|
+
// Array shape owns cardinality even if a caller also supplies a list-only
|
|
323
|
+
// option. The aggregate limit above is checked before core or integrations
|
|
324
|
+
// are resolved, so an oversized request can never emit a partial receipt.
|
|
325
|
+
if (selectorList) {
|
|
326
|
+
return componentBatch(
|
|
327
|
+
selectorList,
|
|
328
|
+
{
|
|
329
|
+
cwd,
|
|
330
|
+
package: packageScope,
|
|
331
|
+
props,
|
|
332
|
+
source,
|
|
333
|
+
showcase,
|
|
334
|
+
blocks,
|
|
335
|
+
detail,
|
|
336
|
+
lang,
|
|
337
|
+
zh,
|
|
338
|
+
dense,
|
|
339
|
+
},
|
|
340
|
+
coreDir,
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
|
|
119
344
|
// ── List mode ──────────────────────────────────────────────────
|
|
120
|
-
if (category || list ||
|
|
345
|
+
if (category || list || noName) {
|
|
121
346
|
return componentList(coreDir, {cwd, category, detail, zh, dense, lang});
|
|
122
347
|
}
|
|
123
348
|
|
|
349
|
+
if (typeof name === 'string') {
|
|
350
|
+
const target = parseComponentSelector(name, packageScope);
|
|
351
|
+
if (target.version) {
|
|
352
|
+
const loadedIntegrations = await loadIntegrationsSafely(cwd);
|
|
353
|
+
requireInstalledSelectorVersion(target, coreDir, loadedIntegrations);
|
|
354
|
+
}
|
|
355
|
+
if (target.name !== name || target.package !== packageScope) {
|
|
356
|
+
return component(target.name, {...options, package: target.package});
|
|
357
|
+
}
|
|
358
|
+
name = target.name;
|
|
359
|
+
}
|
|
360
|
+
|
|
124
361
|
// ── Single component ───────────────────────────────────────────
|
|
125
362
|
if (typeof name !== 'string') {
|
|
126
363
|
throw new AstryxError(
|
|
@@ -186,7 +423,10 @@ export async function component(name, options = {}) {
|
|
|
186
423
|
if (extDocPath) {
|
|
187
424
|
// Legacy packages ship docs, never source.
|
|
188
425
|
if (source) {
|
|
189
|
-
return componentDetailSource(dirName, null, {
|
|
426
|
+
return componentDetailSource(dirName, null, {
|
|
427
|
+
name,
|
|
428
|
+
notFoundInPackage: packageScope,
|
|
429
|
+
});
|
|
190
430
|
}
|
|
191
431
|
if (blocks) {
|
|
192
432
|
return componentDetailBlocks(dirName, cwd);
|
|
@@ -28,6 +28,31 @@ export type ComponentListData = ({
|
|
|
28
28
|
detail: "full";
|
|
29
29
|
components: Record<string, import("@astryxdesign/cli/authoring").ComponentDoc[]>;
|
|
30
30
|
});
|
|
31
|
+
/**
|
|
32
|
+
* `component(string[])` always returns this type, including empty and one-item
|
|
33
|
+
* arrays. The CLI returns it for two or more positional selectors.
|
|
34
|
+
*/
|
|
35
|
+
export type ComponentBatchResponse = import("../../foundation/response/batch.type.mjs").BatchResponse<"component.batch", ComponentSingleResponse, ComponentBatchCandidate>;
|
|
36
|
+
/**
|
|
37
|
+
* One installed component that makes an unqualified selector ambiguous.
|
|
38
|
+
* Keys match a component row in `discover.search` so a caller does not learn a
|
|
39
|
+
* second candidate shape.
|
|
40
|
+
*/
|
|
41
|
+
export type ComponentBatchCandidate = {
|
|
42
|
+
package: string;
|
|
43
|
+
component: string;
|
|
44
|
+
kind: "component";
|
|
45
|
+
installed: true;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The response a successful single selector would have returned.
|
|
49
|
+
*/
|
|
50
|
+
export type ComponentSingleResponse = (ComponentDetailResponse | ComponentDetailPropsResponse | ComponentDetailSourceResponse | ComponentDetailShowcaseResponse | ComponentDetailBlocksResponse);
|
|
51
|
+
/**
|
|
52
|
+
* One row per requested selector, in argument order. Duplicate selectors keep
|
|
53
|
+
* duplicate rows.
|
|
54
|
+
*/
|
|
55
|
+
export type ComponentBatchResult = import("../../foundation/response/batch.type.mjs").BatchRow<ComponentSingleResponse, ComponentBatchCandidate>;
|
|
31
56
|
/**
|
|
32
57
|
* A single entry in a `component.list` group at `detail: 'names'`. Pre-1.0 the
|
|
33
58
|
* list moved from bare strings to package-qualified objects so consumers can
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
* astryx --json component --category Form -> component.list (filtered)
|
|
19
19
|
* astryx --json component --list --detail compact -> component.list (data.detail='compact')
|
|
20
20
|
* astryx --json component --list --detail full -> component.list (data.detail='full')
|
|
21
|
+
* component([]) -> component.batch (data.count=0)
|
|
22
|
+
* component(['Button']) -> component.batch (data.count=1)
|
|
23
|
+
* astryx --json component Button Badge -> component.batch
|
|
21
24
|
* astryx --json component Button -> component.detail
|
|
22
25
|
* astryx --json component Button --props -> component.detail.props
|
|
23
26
|
* astryx --json component Button --source -> component.detail.source
|
|
@@ -49,6 +52,47 @@
|
|
|
49
52
|
* )} ComponentListData
|
|
50
53
|
*/
|
|
51
54
|
|
|
55
|
+
/**
|
|
56
|
+
* `component(string[])` always returns this type, including empty and one-item
|
|
57
|
+
* arrays. The CLI returns it for two or more positional selectors.
|
|
58
|
+
* @typedef {import('../../foundation/response/batch.type.mjs').BatchResponse<
|
|
59
|
+
* 'component.batch',
|
|
60
|
+
* ComponentSingleResponse,
|
|
61
|
+
* ComponentBatchCandidate
|
|
62
|
+
* >} ComponentBatchResponse
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* One installed component that makes an unqualified selector ambiguous.
|
|
67
|
+
* Keys match a component row in `discover.search` so a caller does not learn a
|
|
68
|
+
* second candidate shape.
|
|
69
|
+
* @typedef {object} ComponentBatchCandidate
|
|
70
|
+
* @property {string} package
|
|
71
|
+
* @property {string} component
|
|
72
|
+
* @property {'component'} kind
|
|
73
|
+
* @property {true} installed
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The response a successful single selector would have returned.
|
|
78
|
+
* @typedef {(
|
|
79
|
+
* | ComponentDetailResponse
|
|
80
|
+
* | ComponentDetailPropsResponse
|
|
81
|
+
* | ComponentDetailSourceResponse
|
|
82
|
+
* | ComponentDetailShowcaseResponse
|
|
83
|
+
* | ComponentDetailBlocksResponse
|
|
84
|
+
* )} ComponentSingleResponse
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* One row per requested selector, in argument order. Duplicate selectors keep
|
|
89
|
+
* duplicate rows.
|
|
90
|
+
* @typedef {import('../../foundation/response/batch.type.mjs').BatchRow<
|
|
91
|
+
* ComponentSingleResponse,
|
|
92
|
+
* ComponentBatchCandidate
|
|
93
|
+
* >} ComponentBatchResult
|
|
94
|
+
*/
|
|
95
|
+
|
|
52
96
|
/**
|
|
53
97
|
* A single entry in a `component.list` group at `detail: 'names'`. Pre-1.0 the
|
|
54
98
|
* list moved from bare strings to package-qualified objects so consumers can
|
|
@@ -12,20 +12,78 @@
|
|
|
12
12
|
* configured" (`false`) from "configured but nothing discovered" (`true`),
|
|
13
13
|
* which the list leaf surfaces as `meta`.
|
|
14
14
|
*
|
|
15
|
-
* @returns {Promise<{packages: ScannedPackage[], configured: boolean}>}
|
|
15
|
+
* @returns {Promise<{packages: ScannedPackage[], configured: boolean, project: Project}>}
|
|
16
16
|
*/
|
|
17
17
|
export function discoverPackages(): Promise<{
|
|
18
18
|
packages: ScannedPackage[];
|
|
19
19
|
configured: boolean;
|
|
20
|
+
project: Project;
|
|
20
21
|
}>;
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* Every integration the project loads, with what it adds. An integration with
|
|
24
|
+
* no components root is included with `components: []`; one that failed to
|
|
25
|
+
* load is left out (the integration-issues nudge and Doctor report it).
|
|
26
|
+
*
|
|
27
|
+
* @param {Project | undefined} project
|
|
28
|
+
* @param {ScannedPackage[]} scanned the packages {@link discoverPackages} found
|
|
29
|
+
* @returns {Promise<InstalledPackage[]>}
|
|
30
|
+
*/
|
|
31
|
+
export function describeInstalled(project: Project | undefined, scanned: ScannedPackage[]): Promise<InstalledPackage[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the project has any discover source: its own `discover` config field,
|
|
34
|
+
* or an integration's `discover` named export (valid or not).
|
|
35
|
+
* @param {Project | undefined} project
|
|
36
|
+
* @returns {boolean}
|
|
37
|
+
*/
|
|
38
|
+
export function hasSources(project: Project | undefined): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Package names the project's package.json declares in any dependency field.
|
|
41
|
+
* @param {Project | undefined} project
|
|
42
|
+
* @returns {Set<string>}
|
|
43
|
+
*/
|
|
44
|
+
export function declaredDependencies(project: Project | undefined): Set<string>;
|
|
45
|
+
/**
|
|
46
|
+
* The command that adds a package with the project's package manager. Discover
|
|
47
|
+
* only prints it; it never runs it.
|
|
48
|
+
* @param {Project | undefined} project
|
|
49
|
+
* @returns {(name: string, version?: string) => string}
|
|
50
|
+
*/
|
|
51
|
+
export function addCommand(project: Project | undefined): (name: string, version?: string) => string;
|
|
52
|
+
/**
|
|
53
|
+
* The per-user cache directory the saved copies live in, never inside a
|
|
54
|
+
* project. Standard platform locations only.
|
|
55
|
+
* @returns {string}
|
|
56
|
+
*/
|
|
57
|
+
export function defaultCacheDir(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Call every discover source — the project's `discover` first, then each
|
|
60
|
+
* integration's in load order — once per distinct function. A source that
|
|
61
|
+
* throws, times out, or returns an invalid catalog falls back to its saved copy;
|
|
62
|
+
* with none, it is reported and adds nothing. The others always count.
|
|
63
|
+
*
|
|
64
|
+
* @param {Project | undefined} project
|
|
65
|
+
* @param {{package?: string, version?: string}} [request] ask for one package,
|
|
66
|
+
* and optionally one version's contributions
|
|
67
|
+
* @param {{cacheDir?: string, timeoutMs?: number}} [options]
|
|
68
|
+
* @returns {Promise<CatalogResult>}
|
|
69
|
+
*/
|
|
70
|
+
export function callSources(project: Project | undefined, request?: {
|
|
71
|
+
package?: string;
|
|
72
|
+
version?: string;
|
|
73
|
+
}, options?: {
|
|
74
|
+
cacheDir?: string;
|
|
75
|
+
timeoutMs?: number;
|
|
76
|
+
}): Promise<CatalogResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Project a scanned or installed package into the discover list/detail entry
|
|
79
|
+
* shape. Shared by the list and detail leaves so the entry keys (and their
|
|
80
|
+
* order) stay in one place. A kind list appears only when it is not empty.
|
|
81
|
+
* @param {InstalledPackage & {latest?: string}} pkg
|
|
26
82
|
* @returns {import('./discover.type.mjs').DiscoverListEntry}
|
|
27
83
|
*/
|
|
28
|
-
export function toEntry(pkg:
|
|
84
|
+
export function toEntry(pkg: InstalledPackage & {
|
|
85
|
+
latest?: string;
|
|
86
|
+
}): import("./discover.type.mjs").DiscoverListEntry;
|
|
29
87
|
/**
|
|
30
88
|
* Locate a component's doc file within the given packages (case-insensitive).
|
|
31
89
|
* @param {ScannedPackage[]} packages
|
|
@@ -46,7 +104,56 @@ export function loadValidatedDoc(result: ComponentResolution, { lang, zh }: {
|
|
|
46
104
|
lang?: string | null;
|
|
47
105
|
zh?: boolean;
|
|
48
106
|
}): Promise<import("./discover.type.mjs").DiscoverDetailDocResponse["data"]>;
|
|
107
|
+
/** The list and detail entry fields for each item kind, in display order. */
|
|
108
|
+
export const KIND_FIELDS: readonly [readonly ["component", "components"], readonly ["template", "templates"], readonly ["doc", "docs"], readonly ["theme", "themes"], readonly ["codemod", "codemods"], readonly ["agent-doc", "agentDocs"]];
|
|
49
109
|
export type ScannedPackage = import("./_package-scanner.mjs").ScannedPackage;
|
|
110
|
+
export type DiscoverPackage = import("../../authoring/discover/type").DiscoverPackage;
|
|
111
|
+
export type DiscoverSource = import("../../authoring/discover/type").DiscoverSource;
|
|
112
|
+
/**
|
|
113
|
+
* An installed integration with what it adds, per kind. `components` is the
|
|
114
|
+
* scanned component list the discover leaves have always used.
|
|
115
|
+
*/
|
|
116
|
+
export type InstalledPackage = ScannedPackage & {
|
|
117
|
+
templates?: string[];
|
|
118
|
+
docs?: string[];
|
|
119
|
+
themes?: string[];
|
|
120
|
+
codemods?: string[];
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* What one source did on this run.
|
|
124
|
+
*/
|
|
125
|
+
export type SourceState = {
|
|
126
|
+
/**
|
|
127
|
+
* the source's own name, or where it came from when it
|
|
128
|
+
* gave none
|
|
129
|
+
*/
|
|
130
|
+
name: string;
|
|
131
|
+
/**
|
|
132
|
+
* `astryx.config`, or the integration that exports it
|
|
133
|
+
*/
|
|
134
|
+
from: string;
|
|
135
|
+
status: "fresh" | "saved" | "failed";
|
|
136
|
+
generatedAt?: string | undefined;
|
|
137
|
+
complete?: boolean | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* when the saved copy in use was written
|
|
140
|
+
*/
|
|
141
|
+
savedAt?: string | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* why the live call failed
|
|
144
|
+
*/
|
|
145
|
+
error?: string | undefined;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Everything every source returned, merged. When two sources list the same
|
|
149
|
+
* package, the earlier source's entry is kept.
|
|
150
|
+
*/
|
|
151
|
+
export type CatalogResult = {
|
|
152
|
+
sources: SourceState[];
|
|
153
|
+
packages: Array<DiscoverPackage & {
|
|
154
|
+
source: string;
|
|
155
|
+
}>;
|
|
156
|
+
};
|
|
50
157
|
/**
|
|
51
158
|
* A located component doc within a scanned package — the shape returned by
|
|
52
159
|
* {@link findComponent}, consumed by {@link loadValidatedDoc}.
|
|
@@ -56,3 +163,4 @@ export type ComponentResolution = {
|
|
|
56
163
|
docPath: string;
|
|
57
164
|
componentName: string;
|
|
58
165
|
};
|
|
166
|
+
import { Project } from '../../foundation/config/project.mjs';
|