@astryxdesign/cli 0.7.2-canary.ba80461 → 0.7.2-canary.bd72a5f
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 +72 -1
- package/api/component/_adapter.mjs +209 -7
- package/api/component/component.mjs +82 -15
- package/api/component/doc-links.test.mjs +386 -0
- 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/detail/doc/doc.mjs +9 -1
- 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 +74 -0
- package/api/docs/_adapter.mjs +550 -14
- package/api/docs/integration-tree.test.mjs +22 -0
- package/api/docs/integrationDocs.test.mjs +124 -0
- package/api/docs/list/list.mjs +12 -2
- 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 +45 -0
- package/api/integration/_adapter.mjs +112 -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 +108 -4
- package/api/integration/authoring-checks.test.mjs +808 -0
- package/api/integration/authoring-checks.type.d.mts +143 -0
- package/api/integration/authoring-checks.type.mjs +74 -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 +45 -6
- package/api/integration/integrationDocConflicts.doc.mjs +22 -5
- package/api/integration/pack-check.mjs +347 -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 +36 -3
- package/api/integration/validate-integration.test.mjs +88 -8
- 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 +603 -51
- 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 +201 -0
- package/assets/docs/tree/check-your-docs.doc.mjs +65 -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 +3 -3
- 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 +21 -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/hook/type.ts +4 -0
- 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 +18 -4
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +19 -5
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +13 -2
- package/clients/cli/commands/doctor-integration.test.mjs +884 -0
- package/clients/cli/commands/doctor.mjs +281 -5
- 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-authoring.test.mjs +46 -0
- package/clients/cli/commands/integration-check.doc.mjs +85 -0
- package/clients/cli/commands/integration-check.test.mjs +411 -0
- package/clients/cli/commands/integration.doc.mjs +6 -2
- package/clients/cli/commands/integration.mjs +116 -5
- 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-consistency.d.mts +34 -0
- package/foundation/discovery/doc-consistency.mjs +513 -0
- package/foundation/discovery/doc-consistency.test.mjs +347 -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 +1231 -0
- package/foundation/discovery/doc-types.test.mjs +744 -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 +297 -0
- package/foundation/discovery/prop-drift.mjs +2428 -0
- package/foundation/discovery/prop-drift.test.mjs +2337 -0
- package/foundation/discovery/stray-pointers.d.mts +52 -0
- package/foundation/discovery/stray-pointers.mjs +293 -0
- package/foundation/discovery/stray-pointers.test.mjs +86 -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 +26 -0
- package/foundation/doc-compiler/links.d.mts +41 -5
- package/foundation/doc-compiler/links.mjs +167 -28
- package/foundation/doc-compiler/links.test.mjs +97 -4
- package/foundation/doc-compiler/tree.mjs +30 -1
- package/foundation/doc-compiler/tree.test.mjs +7 -0
- 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/issue.ts +6 -0
- package/foundation/integrations/validate-contributions.mjs +30 -1
- package/foundation/response/response-types.doc.mjs +15 -9
- package/package.json +11 -11
- package/scripts/postinstall.mjs +3 -3
|
@@ -46,6 +46,7 @@ export const AUTHORING_SELF_DOCS = [
|
|
|
46
46
|
'doctypes/reference/reference.doc.mjs',
|
|
47
47
|
'doctypes/schema/schema.doc.mjs',
|
|
48
48
|
'doctypes/template/template.doc.mjs',
|
|
49
|
+
'doctypes/template/integration-template.doc.mjs',
|
|
49
50
|
'doctypes/theme/theme.doc.mjs',
|
|
50
51
|
];
|
|
51
52
|
|
|
@@ -192,7 +193,7 @@ export function buildAuthoringReferenceDoc(docs) {
|
|
|
192
193
|
title: 'Authoring Reference',
|
|
193
194
|
category: 'guide',
|
|
194
195
|
description:
|
|
195
|
-
'Every file an integration author writes, field by field: the integration manifest, astryx.config, codemods, identity, and each doc type.',
|
|
196
|
+
'Every file an integration author writes, field by field: the integration manifest, astryx.config, codemods, identity, and each doc type. The step-by-step guides are under `astryx docs cli/integrations`.',
|
|
196
197
|
sections: docs.map(selfDocSection),
|
|
197
198
|
});
|
|
198
199
|
}
|
|
@@ -115,19 +115,99 @@ export function discoverExternalComponentsGrouped(docsDir: string): Record<strin
|
|
|
115
115
|
* @returns {string | null}
|
|
116
116
|
*/
|
|
117
117
|
export function findExternalComponentDoc(docsDir: string, name: string): string | null;
|
|
118
|
+
/** @param {string} docPath */
|
|
119
|
+
export function docStem(docPath: string): string;
|
|
120
|
+
/**
|
|
121
|
+
* The `.tsx` file in `folder`, or below it, that declares `name`, taking files
|
|
122
|
+
* in path order: the source of a member whose import never reaches a `.tsx`
|
|
123
|
+
* file, as when the import names built output.
|
|
124
|
+
*
|
|
125
|
+
* @param {string} folder
|
|
126
|
+
* @param {string} name
|
|
127
|
+
* @returns {string | null}
|
|
128
|
+
*/
|
|
129
|
+
export function folderSourceFor(folder: string, name: string): string | null;
|
|
130
|
+
/**
|
|
131
|
+
* Each family doc under an integration's components root that names an
|
|
132
|
+
* import, with the file the import resolves to: null when it resolves to none,
|
|
133
|
+
* such as build output that does not exist yet.
|
|
134
|
+
*
|
|
135
|
+
* @param {{name: string, components?: string, issuesUrl?: string, __packageDir?: string, __packageExports?: Record<string, unknown>|null}} integration
|
|
136
|
+
* @returns {Array<{docPath: string, module: string | null}>}
|
|
137
|
+
*/
|
|
138
|
+
export function familyImports(integration: {
|
|
139
|
+
name: string;
|
|
140
|
+
components?: string;
|
|
141
|
+
issuesUrl?: string;
|
|
142
|
+
__packageDir?: string;
|
|
143
|
+
__packageExports?: Record<string, unknown> | null;
|
|
144
|
+
}): Array<{
|
|
145
|
+
docPath: string;
|
|
146
|
+
module: string | null;
|
|
147
|
+
}>;
|
|
148
|
+
/**
|
|
149
|
+
* Whether a discovered integration record is a member its family doc lists,
|
|
150
|
+
* decided from the files, not from whether the doc loads.
|
|
151
|
+
*
|
|
152
|
+
* @param {{name: string, docPath: string|null}} record
|
|
153
|
+
* @returns {boolean}
|
|
154
|
+
*/
|
|
155
|
+
export function isIntegrationMember(record: {
|
|
156
|
+
name: string;
|
|
157
|
+
docPath: string | null;
|
|
158
|
+
}): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* The entry a family doc gives a member that discovery lists under its own
|
|
161
|
+
* name, or null when the record is the doc's own component or the loaded doc
|
|
162
|
+
* has no entry for it.
|
|
163
|
+
*
|
|
164
|
+
* @param {any} doc the doc loaded from `record.docPath`
|
|
165
|
+
* @param {{name: string, docPath: string|null}} record
|
|
166
|
+
* @returns {any}
|
|
167
|
+
*/
|
|
168
|
+
export function integrationMemberEntry(doc: any, record: {
|
|
169
|
+
name: string;
|
|
170
|
+
docPath: string | null;
|
|
171
|
+
}): any;
|
|
172
|
+
/**
|
|
173
|
+
* Visit every component doc under an integration's components root, hidden
|
|
174
|
+
* ones included, in discovery order, with its stem.
|
|
175
|
+
* @param {string | undefined} componentsDir
|
|
176
|
+
* @param {(docPath: string, stem: string) => void} visit
|
|
177
|
+
*/
|
|
178
|
+
export function forEachIntegrationDoc(componentsDir: string | undefined, visit: (docPath: string, stem: string) => void): void;
|
|
179
|
+
/**
|
|
180
|
+
* Given an integration component doc path, return the sibling component source
|
|
181
|
+
* (`{Name}.tsx`) if one exists, else null.
|
|
182
|
+
*
|
|
183
|
+
* @param {string} docPath absolute path to a `{Name}.doc.{ts,mjs,js}` file
|
|
184
|
+
* @returns {string|null}
|
|
185
|
+
*/
|
|
186
|
+
export function integrationSourceForDoc(docPath: string): string | null;
|
|
118
187
|
/**
|
|
119
188
|
* Discover ownership records for the components contributed by a single loaded
|
|
120
189
|
* integration. Scans the integration's resolved `components` dir for same-stem
|
|
121
|
-
* doc files and records each with owner package + issuesUrl + sourcePath.
|
|
190
|
+
* doc files and records each with owner package + issuesUrl + sourcePath. A doc
|
|
191
|
+
* that names a differently named export of its file is recorded under that
|
|
192
|
+
* export, and each family member it lists, under the member's name, unless the
|
|
193
|
+
* name is taken: every doc's file name (a hidden doc's too), a Core name a doc
|
|
194
|
+
* in the package replaces, and a name an earlier doc records.
|
|
122
195
|
*
|
|
123
|
-
* @param {{name: string, components?: string, issuesUrl?: string}} integration
|
|
196
|
+
* @param {{name: string, components?: string, issuesUrl?: string, __packageDir?: string, __packageExports?: Record<string, unknown>|null}} integration
|
|
124
197
|
* a single entry from `loadedIntegrations` (lib/integrations.mjs)
|
|
198
|
+
* @param {{documentedNames?: boolean}} [options] `documentedNames: false`
|
|
199
|
+
* records each doc under its file name alone, without reading the names
|
|
200
|
+
* docs document: for a caller that needs only what each doc says
|
|
125
201
|
* @returns {Array<{name: string, package: string, docPath: string, sourcePath: string|null, issuesUrl: string|undefined, group: string|null}>}
|
|
126
202
|
*/
|
|
127
203
|
export function discoverIntegrationComponents(integration: {
|
|
128
204
|
name: string;
|
|
129
205
|
components?: string;
|
|
130
206
|
issuesUrl?: string;
|
|
207
|
+
__packageDir?: string;
|
|
208
|
+
__packageExports?: Record<string, unknown> | null;
|
|
209
|
+
}, { documentedNames }?: {
|
|
210
|
+
documentedNames?: boolean;
|
|
131
211
|
}): Array<{
|
|
132
212
|
name: string;
|
|
133
213
|
package: string;
|
|
@@ -141,11 +221,16 @@ export function discoverIntegrationComponents(integration: {
|
|
|
141
221
|
* Invalid metadata or a missing same-stem source removes only that component;
|
|
142
222
|
* callers can report the returned errors while retaining valid siblings. A
|
|
143
223
|
* component whose doc sets `replaces` carries the value as written; the
|
|
144
|
-
* component replacement resolver decides what it means.
|
|
224
|
+
* component replacement resolver decides what it means. A family member is
|
|
225
|
+
* read through its family's doc: it never carries the family's `replaces`, and
|
|
226
|
+
* a family doc that fails to load is reported once. A doc that fails to load
|
|
227
|
+
* is reported under its file name: what it says cannot be trusted.
|
|
145
228
|
*
|
|
146
229
|
* @param {{name: string, components?: string, issuesUrl?: string}} integration
|
|
230
|
+
* @param {{documentedNames?: boolean}} [options] as for
|
|
231
|
+
* {@link discoverIntegrationComponents}
|
|
147
232
|
* @returns {Promise<{
|
|
148
|
-
* components: Array<{name: string, package: string, docPath: string, sourcePath: string, issuesUrl: string|undefined, group: string|null, replaces?: unknown}>,
|
|
233
|
+
* components: Array<{name: string, package: string, docPath: string, sourcePath: string|null, issuesUrl: string|undefined, group: string|null, replaces?: unknown}>,
|
|
149
234
|
* discovered: Array<{name: string, package: string, docPath: string, sourcePath: string|null, issuesUrl: string|undefined, group: string|null}>,
|
|
150
235
|
* errors: Array<{name: string, message: string}>,
|
|
151
236
|
* }>}
|
|
@@ -154,12 +239,14 @@ export function discoverValidIntegrationComponents(integration: {
|
|
|
154
239
|
name: string;
|
|
155
240
|
components?: string;
|
|
156
241
|
issuesUrl?: string;
|
|
242
|
+
}, options?: {
|
|
243
|
+
documentedNames?: boolean;
|
|
157
244
|
}): Promise<{
|
|
158
245
|
components: Array<{
|
|
159
246
|
name: string;
|
|
160
247
|
package: string;
|
|
161
248
|
docPath: string;
|
|
162
|
-
sourcePath: string;
|
|
249
|
+
sourcePath: string | null;
|
|
163
250
|
issuesUrl: string | undefined;
|
|
164
251
|
group: string | null;
|
|
165
252
|
replaces?: unknown;
|
|
@@ -177,30 +264,103 @@ export function discoverValidIntegrationComponents(integration: {
|
|
|
177
264
|
message: string;
|
|
178
265
|
}>;
|
|
179
266
|
}>;
|
|
267
|
+
/**
|
|
268
|
+
* How an owner holds a component name, which the owner rule
|
|
269
|
+
* ({@link unscopedComponentOwners}) reads: `core` when Core documents it;
|
|
270
|
+
* `file` when an integration doc named after its file is recorded under it;
|
|
271
|
+
* `doc` when only a doc records it: an export name, a member, or the file name
|
|
272
|
+
* of a doc recorded under another export.
|
|
273
|
+
* @typedef {'core' | 'file' | 'doc'} NameHold
|
|
274
|
+
*/
|
|
275
|
+
/**
|
|
276
|
+
* How a discovered integration record holds its name.
|
|
277
|
+
* @param {{name: string, docPath: string|null}} record
|
|
278
|
+
* @returns {'file' | 'doc'}
|
|
279
|
+
*/
|
|
280
|
+
export function integrationRecordHold(record: {
|
|
281
|
+
name: string;
|
|
282
|
+
docPath: string | null;
|
|
283
|
+
}): "file" | "doc";
|
|
284
|
+
/**
|
|
285
|
+
* The integration component a name finds, as discovery records it, and its
|
|
286
|
+
* hold: the same-stem doc first, then a doc that records the name as an export
|
|
287
|
+
* or a member.
|
|
288
|
+
*
|
|
289
|
+
* @param {{name?: string, components?: string, __packageDir?: string, __packageExports?: Record<string, unknown>|null}} integration
|
|
290
|
+
* @param {string} name
|
|
291
|
+
* @returns {{docPath: string, sourcePath: string|null, hold: 'file' | 'doc'} | null}
|
|
292
|
+
*/
|
|
293
|
+
export function findIntegrationComponent(integration: {
|
|
294
|
+
name?: string;
|
|
295
|
+
components?: string;
|
|
296
|
+
__packageDir?: string;
|
|
297
|
+
__packageExports?: Record<string, unknown> | null;
|
|
298
|
+
}, name: string): {
|
|
299
|
+
docPath: string;
|
|
300
|
+
sourcePath: string | null;
|
|
301
|
+
hold: "file" | "doc";
|
|
302
|
+
} | null;
|
|
303
|
+
/**
|
|
304
|
+
* The name discovery records a component doc under: the export its `name`
|
|
305
|
+
* documents when the doc is recorded under it, else the doc's file name.
|
|
306
|
+
*
|
|
307
|
+
* @param {{name?: string, components?: string, __packageDir?: string, __packageExports?: Record<string, unknown>|null}} integration
|
|
308
|
+
* @param {string} docPath
|
|
309
|
+
* @returns {string}
|
|
310
|
+
*/
|
|
311
|
+
export function recordedDocName(integration: {
|
|
312
|
+
name?: string;
|
|
313
|
+
components?: string;
|
|
314
|
+
__packageDir?: string;
|
|
315
|
+
__packageExports?: Record<string, unknown> | null;
|
|
316
|
+
}, docPath: string): string;
|
|
180
317
|
/**
|
|
181
318
|
* Find an integration component's doc file by name within a loaded
|
|
182
319
|
* integration's resolved `components` dir. Honors the same-stem convention
|
|
183
|
-
* (`{Name}.doc.{ts,mjs,js}`), preferring `.ts` → `.mjs` → `.js
|
|
320
|
+
* (`{Name}.doc.{ts,mjs,js}`), preferring `.ts` → `.mjs` → `.js`, and finds a
|
|
321
|
+
* doc that records the component under another name: a differently named
|
|
322
|
+
* export of its file, or a member its family doc lists.
|
|
184
323
|
*
|
|
185
|
-
* @param {{components?: string}} integration
|
|
324
|
+
* @param {{name?: string, components?: string, __packageDir?: string, __packageExports?: Record<string, unknown>|null}} integration
|
|
186
325
|
* @param {string} name bare component name (no `XDS`/`Astryx` prefix)
|
|
187
326
|
* @returns {string|null}
|
|
188
327
|
*/
|
|
189
328
|
export function findIntegrationComponentDoc(integration: {
|
|
329
|
+
name?: string;
|
|
190
330
|
components?: string;
|
|
331
|
+
__packageDir?: string;
|
|
332
|
+
__packageExports?: Record<string, unknown> | null;
|
|
191
333
|
}, name: string): string | null;
|
|
192
334
|
/**
|
|
193
|
-
* Find an integration component's swizzleable source file
|
|
194
|
-
*
|
|
335
|
+
* Find an integration component's swizzleable source file by name within a
|
|
336
|
+
* loaded integration's resolved `components` dir: the same-stem `{Name}.tsx`
|
|
337
|
+
* of its doc, or, for a family member, the file that declares it. Returns null
|
|
195
338
|
* when the integration ships docs without source.
|
|
196
339
|
*
|
|
197
|
-
* @param {{components?: string}} integration
|
|
340
|
+
* @param {{name?: string, components?: string, __packageDir?: string, __packageExports?: Record<string, unknown>|null}} integration
|
|
198
341
|
* @param {string} name bare component name
|
|
199
342
|
* @returns {string|null}
|
|
200
343
|
*/
|
|
201
344
|
export function findIntegrationComponentSource(integration: {
|
|
345
|
+
name?: string;
|
|
202
346
|
components?: string;
|
|
347
|
+
__packageDir?: string;
|
|
348
|
+
__packageExports?: Record<string, unknown> | null;
|
|
203
349
|
}, name: string): string | null;
|
|
350
|
+
/**
|
|
351
|
+
* The owner rule: an owner that holds a name only because a doc records it
|
|
352
|
+
* (`hold: 'doc'`) yields to Core and to every file-named owner; `--package`
|
|
353
|
+
* still reaches it. Surfaces resolve a replacement first, then this rule, then
|
|
354
|
+
* which docs load.
|
|
355
|
+
*
|
|
356
|
+
* @template {{hold?: string}} T
|
|
357
|
+
* @param {T[]} owners each with its {@link NameHold}; an owner without one
|
|
358
|
+
* counts as Core's or file-named
|
|
359
|
+
* @returns {T[]}
|
|
360
|
+
*/
|
|
361
|
+
export function unscopedComponentOwners<T extends {
|
|
362
|
+
hold?: string;
|
|
363
|
+
}>(owners: T[]): T[];
|
|
204
364
|
/**
|
|
205
365
|
* Build a flat list of ownership records for ALL discoverable components —
|
|
206
366
|
* core (built-in) plus every loaded integration. This is the authoritative
|
|
@@ -229,3 +389,11 @@ export function discoverOwnedComponents(coreDir: string, loadedIntegrations?: Ar
|
|
|
229
389
|
}>;
|
|
230
390
|
/** The owner package name for built-in (core) components. */
|
|
231
391
|
export const CORE_PACKAGE: import("../../authoring/index.js").ProviderId;
|
|
392
|
+
/**
|
|
393
|
+
* How an owner holds a component name, which the owner rule
|
|
394
|
+
* ({@link unscopedComponentOwners}) reads: `core` when Core documents it;
|
|
395
|
+
* `file` when an integration doc named after its file is recorded under it;
|
|
396
|
+
* `doc` when only a doc records it: an export name, a member, or the file name
|
|
397
|
+
* of a doc recorded under another export.
|
|
398
|
+
*/
|
|
399
|
+
export type NameHold = "core" | "file" | "doc";
|