@astryxdesign/cli 0.6.6 → 0.6.7
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 +129 -0
- package/README.md +84 -82
- package/api/build/_adapter.d.mts +20 -0
- package/api/build/_adapter.mjs +24 -0
- package/api/build/build.doc.mjs +1 -1
- package/api/build/build.test.mjs +1 -1
- package/api/build/build.type.d.mts +12 -0
- package/api/build/build.type.mjs +3 -0
- package/api/build/help/help.mjs +1 -1
- package/api/build/kit/kit.mjs +13 -1
- package/api/component/_adapter.d.mts +19 -0
- package/api/component/_adapter.mjs +33 -0
- package/api/component/component-replacement.test.mjs +615 -0
- package/api/component/component.doc.mjs +5 -2
- package/api/component/component.mjs +49 -15
- package/api/component/component.test.mjs +32 -0
- package/api/component/component.type.d.mts +33 -3
- package/api/component/component.type.mjs +10 -3
- package/api/component/detail/blocks/blocks.d.mts +2 -1
- package/api/component/detail/blocks/blocks.mjs +5 -2
- package/api/component/detail/detail.mjs +5 -1
- package/api/component/detail/props/props.d.mts +2 -1
- package/api/component/detail/props/props.mjs +3 -2
- package/api/component/detail/showcase/showcase.d.mts +3 -1
- package/api/component/detail/showcase/showcase.mjs +3 -1
- package/api/component/detail/source/source.d.mts +3 -2
- package/api/component/detail/source/source.mjs +7 -3
- package/api/component/list/list.mjs +128 -10
- package/api/docs/_adapter.d.mts +11 -0
- package/api/docs/_adapter.mjs +73 -1
- package/api/docs/compiled-topics.test.mjs +1 -1
- package/api/docs/detail/detail.mjs +19 -3
- package/api/docs/detail/section/section.d.mts +44 -0
- package/api/docs/detail/section/section.mjs +171 -14
- package/api/docs/detail/section/section.test.mjs +4 -4
- package/api/docs/docOverlays.test.mjs +38 -23
- package/api/docs/docs.depth.test.mjs +2 -0
- package/api/docs/docs.doc.mjs +3 -3
- package/api/docs/docs.mjs +13 -16
- package/api/docs/docs.test.mjs +9 -10
- package/api/docs/docs.type.d.mts +43 -3
- package/api/docs/docs.type.mjs +23 -3
- package/api/docs/index/index.mjs +11 -2
- package/api/docs/index/index.test.mjs +7 -2
- package/api/docs/integration-tree.test.mjs +26 -26
- package/api/docs/integrationDocs.test.mjs +8 -7
- package/api/docs/namespace-section.test.mjs +260 -0
- package/api/docs/node/node.mjs +3 -0
- package/api/docs/token-tables.test.mjs +93 -0
- package/api/doctor/_adapter.d.mts +50 -0
- package/api/doctor/_adapter.mjs +190 -0
- package/api/doctor/doctor.d.mts +6 -10
- package/api/doctor/doctor.doc.mjs +1 -3
- package/api/doctor/doctor.mjs +144 -150
- package/api/doctor/doctor.test.mjs +104 -0
- package/api/doctor/theme-checks.d.mts +24 -0
- package/api/doctor/theme-checks.mjs +1231 -0
- package/api/doctor/theme-checks.test.mjs +667 -0
- package/api/gap-report/gap-report.doc.mjs +2 -1
- package/api/gap-report/gap-report.mjs +15 -1
- package/api/hook/_adapter.d.mts +1 -0
- package/api/hook/_adapter.mjs +3 -0
- package/api/hook/detail/detail.mjs +2 -2
- package/api/hook/detail/params/params.mjs +2 -2
- package/api/hook/hook.type.d.mts +12 -0
- package/api/hook/hook.type.mjs +3 -0
- package/api/hook/list/list.mjs +8 -8
- package/api/index.d.mts +1 -1
- package/api/index.mjs +4 -0
- package/api/init/run/run.d.mts +3 -5
- package/api/init/run/run.mjs +11 -11
- package/api/integration/__fixtures__/released-0.6.5-ocean.d.mts +14 -0
- package/api/integration/__fixtures__/released-0.6.5-ocean.mjs +15 -0
- package/api/integration/add-helpers.d.mts +26 -5
- package/api/integration/add-helpers.mjs +50 -5
- package/api/integration/add-theme.mjs +16 -2
- package/api/integration/add-theme.test.mjs +66 -15
- package/api/integration/authoring-checks.mjs +21 -1
- package/api/integration/integrationComponentConflicts.doc.mjs +6 -3
- package/api/integration/pack-check.component-replaces.test.mjs +126 -0
- package/api/integration/pack-check.d.mts +10 -0
- package/api/integration/pack-check.lifecycle-output.test.mjs +21 -2
- package/api/integration/pack-check.mjs +483 -1
- package/api/integration/pack-check.test.mjs +568 -8
- package/api/integration/validate-integration.mjs +20 -4
- package/api/integration/validate-integration.test.mjs +73 -0
- package/api/layout/check/check.d.mts +1 -0
- package/api/layout/check/check.mjs +1 -0
- package/api/layout/expand/expand.d.mts +1 -0
- package/api/layout/expand/expand.mjs +1 -0
- package/api/layout/grammar/grammar.d.mts +1 -0
- package/api/layout/grammar/grammar.mjs +1 -0
- package/api/layout/layoutCheck.doc.mjs +1 -1
- package/api/layout/layoutExpand.doc.mjs +1 -1
- package/api/layout/layoutGrammar.doc.mjs +1 -1
- package/api/search/search.d.mts +47 -3
- package/api/search/search.doc.mjs +1 -1
- package/api/search/search.domain-priority.test.mjs +261 -0
- package/api/search/search.mjs +247 -43
- package/api/search/search.test.mjs +5 -1
- package/api/search/search.type.d.mts +3 -3
- package/api/search/search.type.mjs +2 -2
- package/api/swizzle/_adapter.d.mts +10 -0
- package/api/swizzle/_adapter.mjs +23 -0
- package/api/swizzle/copy/copy.d.mts +5 -6
- package/api/swizzle/copy/copy.mjs +29 -10
- package/api/swizzle/list/list.mjs +2 -2
- package/api/swizzle/swizzle.doc.mjs +5 -2
- package/api/swizzle/swizzle.test.mjs +55 -5
- package/api/swizzle/swizzle.type.d.mts +8 -0
- package/api/swizzle/swizzle.type.mjs +2 -0
- package/api/template/copy/copy.mjs +14 -1
- package/api/template/show/show.mjs +2 -0
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template.d.mts +1 -1
- package/api/template/template.doc.mjs +1 -1
- package/api/template/template.mjs +1 -0
- package/api/template/template.type.d.mts +15 -0
- package/api/template/template.type.mjs +6 -0
- package/api/theme/_adapter.d.mts +106 -6
- package/api/theme/_adapter.mjs +687 -18
- package/api/theme/add/add.binary.test.mjs +76 -3
- package/api/theme/add/add.d.mts +5 -9
- package/api/theme/add/add.mjs +87 -64
- package/api/theme/add/add.rollback.test.mjs +9 -9
- package/api/theme/add/add.staging.test.mjs +9 -9
- package/api/theme/add/add.test.mjs +461 -55
- package/api/theme/add/add.types.test.mjs +151 -0
- package/api/theme/build/build.d.mts +96 -2
- package/api/theme/build/build.family.test.mjs +13 -4
- package/api/theme/build/build.mjs +286 -118
- package/api/theme/build/build.test.mjs +30 -0
- package/api/theme/build/font-warning.d.mts +11 -0
- package/api/theme/build/font-warning.mjs +28 -3
- package/api/theme/eject/eject.binary.test.mjs +90 -0
- package/api/theme/eject/eject.d.mts +17 -0
- package/api/theme/eject/eject.mjs +65 -0
- package/api/theme/eject/eject.rollback.test.mjs +158 -0
- package/api/theme/eject/eject.staging.test.mjs +83 -0
- package/api/theme/eject/eject.test.mjs +160 -0
- package/api/theme/integration-themes.test.mjs +30 -6
- package/api/theme/list/list.d.mts +10 -0
- package/api/theme/list/list.mjs +75 -7
- package/api/theme/list/list.test.mjs +155 -4
- package/api/theme/remove/remove.d.mts +12 -0
- package/api/theme/remove/remove.mjs +15 -0
- package/api/theme/remove/remove.test.mjs +94 -0
- package/api/theme/template/template.mjs +3 -4
- package/api/theme/theme.d.mts +5 -2
- package/api/theme/theme.mjs +13 -8
- package/api/theme/theme.type.d.mts +106 -2
- package/api/theme/theme.type.mjs +54 -5
- package/api/theme/themeAdd.doc.d.mts +1 -3
- package/api/theme/themeAdd.doc.mjs +35 -22
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themeEject.doc.d.mts +8 -0
- package/api/theme/themeEject.doc.mjs +89 -0
- package/api/theme/themeListAvailable.doc.mjs +4 -4
- package/api/theme/themeListCopySources.doc.d.mts +8 -0
- package/api/theme/themeListCopySources.doc.mjs +60 -0
- package/api/theme/themeRemove.doc.d.mts +6 -0
- package/api/theme/themeRemove.doc.mjs +50 -0
- package/api/theme/themeTemplate.doc.mjs +4 -3
- package/api/theme/themeUse.doc.d.mts +6 -0
- package/api/theme/themeUse.doc.mjs +47 -0
- package/api/theme/use/use.d.mts +12 -0
- package/api/theme/use/use.mjs +15 -0
- package/api/theme/use/use.test.mjs +98 -0
- package/api/upgrade/_adapter.d.mts +1 -0
- package/api/upgrade/_adapter.mjs +3 -0
- package/api/upgrade/list/list.mjs +9 -3
- package/api/upgrade/upgrade.type.d.mts +4 -0
- package/api/upgrade/upgrade.type.mjs +1 -0
- package/assets/codemods/__tests__/registry.test.mjs +1 -0
- package/assets/codemods/integration-discovery.mjs +1 -1
- package/assets/codemods/integration-discovery.test.mjs +64 -0
- package/assets/codemods/registry.mjs +1 -0
- package/assets/codemods/transforms/v0.6.7/__tests__/migrate-copied-themes-to-descriptors.test.mjs +129 -0
- package/assets/codemods/transforms/v0.6.7/index.mjs +23 -0
- package/assets/codemods/transforms/v0.6.7/migrate-copied-themes-to-descriptors.mjs +54 -0
- package/assets/docs/author-a-theme.doc.mjs +166 -0
- package/assets/docs/getting-started.doc.mjs +61 -17
- package/assets/docs/principles.doc.dense.mjs +4 -4
- package/assets/docs/principles.doc.mjs +6 -6
- package/assets/docs/principles.doc.zh.mjs +4 -4
- package/assets/docs/styling-overview.doc.mjs +211 -0
- package/assets/docs/theme.doc.dense.mjs +10 -198
- package/assets/docs/theme.doc.mjs +13 -771
- package/assets/docs/theme.doc.zh.mjs +31 -12
- package/assets/docs/tree/add-a-theme.doc.mjs +2 -2
- package/assets/docs/tree/checks.doc.mjs +5 -4
- package/assets/docs/tree/component-migration.doc.mjs +107 -0
- package/assets/docs/tree/css-and-stylex.doc.mjs +150 -0
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/document-the-theme.doc.mjs +4 -4
- package/assets/docs/tree/font-setup.doc.mjs +122 -0
- package/assets/docs/tree/fonts-and-assets.doc.mjs +25 -20
- package/assets/docs/tree/headers-and-footers.doc.mjs +67 -0
- package/assets/docs/tree/i18n-library-integration.doc.mjs +167 -0
- package/assets/docs/tree/i18n-quick-start.doc.mjs +101 -0
- package/assets/docs/{internationalization.doc.mjs → tree/i18n-rtl-and-testing.doc.mjs} +17 -223
- package/assets/docs/tree/internationalization.doc.mjs +29 -0
- package/assets/docs/tree/layout-spacing.doc.mjs +168 -0
- package/assets/docs/tree/layout.doc.mjs +55 -0
- package/assets/docs/{migration.doc.mjs → tree/migration-setup.doc.mjs} +24 -129
- package/assets/docs/tree/migration-verification.doc.mjs +67 -0
- package/assets/docs/tree/migration.doc.mjs +28 -0
- package/assets/docs/tree/non-css-processing.doc.mjs +112 -0
- package/assets/docs/tree/other-libraries.doc.mjs +218 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +21 -4
- package/assets/docs/tree/responsive.doc.mjs +98 -0
- package/assets/docs/tree/scaffold.doc.mjs +140 -0
- package/assets/docs/tree/side-panels.doc.mjs +81 -0
- package/assets/docs/tree/structure.doc.mjs +140 -0
- package/assets/docs/tree/styling-advanced.doc.mjs +159 -0
- package/assets/docs/tree/styling-basics.doc.mjs +181 -0
- package/assets/docs/tree/styling-libraries.doc.mjs +30 -0
- package/assets/docs/tree/styling.doc.mjs +29 -0
- package/assets/docs/tree/tailwind.doc.mjs +65 -0
- package/assets/docs/tree/themes.doc.mjs +2 -2
- package/assets/docs/tree/tokens-and-setup.doc.mjs +128 -0
- package/assets/docs/tree/tokens-border.doc.mjs +46 -0
- package/assets/docs/tree/tokens-color.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-color.doc.mjs +438 -0
- package/assets/docs/tree/tokens-color.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-data.doc.mjs +323 -0
- package/assets/docs/tree/tokens-duration.doc.mjs +78 -0
- package/assets/docs/tree/tokens-ease.doc.mjs +46 -0
- package/assets/docs/tree/tokens-focus.doc.mjs +57 -0
- package/assets/docs/tree/tokens-font-weight.doc.mjs +58 -0
- package/assets/docs/tree/tokens-radius.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-radius.doc.mjs +70 -0
- package/assets/docs/tree/tokens-radius.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-shadow.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-shadow.doc.mjs +74 -0
- package/assets/docs/tree/tokens-shadow.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-size.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-size.doc.mjs +54 -0
- package/assets/docs/tree/tokens-size.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-spacing.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-spacing.doc.mjs +102 -0
- package/assets/docs/tree/tokens-spacing.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-syntax.doc.mjs +98 -0
- package/assets/docs/tree/tokens-text-size.doc.mjs +90 -0
- package/assets/docs/tree/tokens-type-scale.doc.mjs +210 -0
- package/assets/docs/tree/tokens-typography.doc.mjs +54 -0
- package/assets/docs/tree/tokens-usage.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-usage.doc.mjs +36 -0
- package/assets/docs/tree/tokens-usage.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens.doc.mjs +28 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +4 -0
- package/assets/docs/tree/type-scale.doc.mjs +147 -0
- package/assets/docs/tree/typography-best-practices.doc.mjs +55 -0
- package/assets/docs/tree/typography.doc.mjs +29 -0
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +22 -5
- package/assets/docs/tree/versioning.doc.mjs +4 -1
- package/assets/docs/use-a-theme.doc.mjs +212 -0
- package/assets/templates/pages/incident-console/page.tsx +1 -1
- package/assets/templates/pages/table-collapsible/page.tsx +1474 -0
- package/assets/templates/pages/table-collapsible/template.doc.mjs +12 -0
- package/assets/templates/pages/table-comparison/page.tsx +1449 -0
- package/assets/templates/pages/table-comparison/template.doc.mjs +12 -0
- package/assets/theme.template.ts +4 -3
- package/authoring/doctypes/command/command.doc.mjs +5 -0
- package/authoring/doctypes/command/type.ts +2 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/component/type.ts +8 -4
- package/authoring/doctypes/template/type.ts +1 -0
- package/authoring/integration/integration.doc.mjs +1 -1
- package/clients/cli/commands/blog.mjs +3 -3
- package/clients/cli/commands/build-theme.adaptations.test.mjs +1 -1
- package/clients/cli/commands/build-theme.ascii-output.test.mjs +11 -1
- package/clients/cli/commands/build-theme.batch-report.test.mjs +335 -0
- package/clients/cli/commands/build-theme.font-warning.test.mjs +36 -7
- package/clients/cli/commands/build-theme.import-path.test.mjs +3 -3
- package/clients/cli/commands/build-theme.mjs +338 -45
- package/clients/cli/commands/build-theme.watch.test.mjs +33 -0
- package/clients/cli/commands/build.mjs +8 -6
- package/clients/cli/commands/build.text-fields.test.mjs +1 -1
- package/clients/cli/commands/component/index.mjs +91 -12
- package/clients/cli/commands/component-replacement.text.test.mjs +316 -0
- package/clients/cli/commands/component.doc.mjs +9 -2
- package/clients/cli/commands/docs.doc.mjs +2 -1
- package/clients/cli/commands/docs.mjs +63 -23
- package/clients/cli/commands/docs.test.mjs +17 -15
- package/clients/cli/commands/doctor-integration-components.doc.mjs +15 -4
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/doctor.test.mjs +59 -52
- package/clients/cli/commands/gap-report.doc.mjs +2 -2
- package/clients/cli/commands/hook/index.mjs +7 -2
- package/clients/cli/commands/import-hint-correctness.test.mjs +28 -5
- package/clients/cli/commands/init.next-steps.test.mjs +18 -23
- package/clients/cli/commands/integration-real-world.test.mjs +61 -12
- package/clients/cli/commands/layout-check.doc.mjs +2 -0
- package/clients/cli/commands/layout-expand.doc.mjs +2 -0
- package/clients/cli/commands/layout-grammar.doc.mjs +2 -0
- package/clients/cli/commands/layout.deprecation-lifecycle.test.mjs +140 -0
- package/clients/cli/commands/layout.doc.mjs +2 -0
- package/clients/cli/commands/layout.mjs +40 -4
- package/clients/cli/commands/no-prompt-wording.test.mjs +4 -4
- package/clients/cli/commands/search.test.mjs +10 -4
- package/clients/cli/commands/swizzle.doc.mjs +12 -3
- package/clients/cli/commands/swizzle.mjs +2 -1
- package/clients/cli/commands/swizzle.routing.test.mjs +2 -1
- package/clients/cli/commands/template.mjs +56 -5
- package/clients/cli/commands/text-json-parity.test.mjs +40 -0
- package/clients/cli/commands/theme-add-lifecycle.test.mjs +135 -0
- package/clients/cli/commands/theme-add.doc.mjs +19 -19
- package/clients/cli/commands/theme-build.doc.mjs +3 -1
- package/clients/cli/commands/theme-eject.doc.mjs +47 -0
- package/clients/cli/commands/theme-list.behavior.test.mjs +5 -2
- package/clients/cli/commands/theme-list.doc.mjs +2 -2
- package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -2
- package/clients/cli/commands/theme-remove.doc.mjs +22 -0
- package/clients/cli/commands/theme-template.doc.mjs +4 -3
- package/clients/cli/commands/theme-use.doc.mjs +22 -0
- package/clients/cli/commands/theme.doc.mjs +21 -16
- package/clients/cli/commands/upgrade.config-ordering.test.mjs +2 -1
- package/clients/cli/commands/upgrade.mjs +1 -1
- package/clients/cli/index.mjs +5 -2
- package/clients/cli/lib/component-format.mjs +29 -2
- package/clients/cli/lib/component-format.test.mjs +1 -1
- package/clients/cli/lib/define-command.mjs +4 -0
- package/clients/cli/lib/resolve-theme.mjs +80 -78
- package/clients/cli/lib/resolve-theme.test.mjs +523 -27
- package/foundation/agent-docs/agent-docs.mjs +48 -30
- package/foundation/agent-docs/agent-docs.test.mjs +47 -34
- package/foundation/agent-docs/app-theme-workflow.test.mjs +13 -0
- package/foundation/config/project.d.mts +20 -5
- package/foundation/config/project.mjs +43 -6
- package/foundation/config/project.test.mjs +1 -1
- package/foundation/config/theme-private-vars.d.mts +12 -0
- package/foundation/config/theme-private-vars.mjs +107 -0
- package/foundation/config/theme-private-vars.test.mjs +55 -0
- package/foundation/config/theme-state.d.mts +145 -0
- package/foundation/config/theme-state.mjs +417 -0
- package/foundation/config/theme-state.test.mjs +182 -0
- package/foundation/discovery/component-discovery.d.mts +5 -2
- package/foundation/discovery/component-discovery.mjs +12 -6
- package/foundation/discovery/component-replacement.d.mts +91 -0
- package/foundation/discovery/component-replacement.mjs +417 -0
- package/foundation/discovery/component-replacement.test.mjs +480 -0
- package/foundation/discovery/docs-discovery.test.mjs +1 -1
- package/foundation/discovery/docs-output-budget.d.mts +6 -2
- package/foundation/discovery/docs-output-budget.mjs +2 -1
- package/foundation/discovery/docs-section-key.d.mts +4 -2
- package/foundation/discovery/docs-section-key.mjs +1 -1
- package/foundation/discovery/module-exports.d.mts +10 -0
- package/foundation/discovery/module-exports.mjs +146 -0
- package/foundation/discovery/package-exports.d.mts +29 -0
- package/foundation/discovery/package-exports.mjs +200 -0
- package/foundation/discovery/template-needs.d.mts +31 -0
- package/foundation/discovery/template-needs.mjs +156 -0
- package/foundation/discovery/template-needs.test.mjs +203 -0
- package/foundation/discovery/theme-discovery.d.mts +72 -5
- package/foundation/discovery/theme-discovery.mjs +134 -18
- package/foundation/discovery/theme-discovery.test.mjs +9 -3
- package/foundation/discovery/theme-imports.d.mts +15 -0
- package/foundation/discovery/theme-imports.mjs +217 -0
- package/foundation/discovery/theme-imports.test.mjs +173 -0
- package/foundation/doc-compiler/bundle.mjs +52 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +15 -5
- package/foundation/doc-compiler/inputs.mjs +2 -1
- package/foundation/doc-compiler/lenses.d.mts +4 -2
- package/foundation/doc-compiler/lenses.mjs +1 -1
- package/foundation/doc-compiler/split-topic-keywords.test.mjs +73 -0
- package/foundation/doc-compiler/tree.d.mts +10 -0
- package/foundation/doc-compiler/tree.mjs +22 -0
- package/foundation/doc-compiler/tree.test.mjs +3 -2
- package/foundation/env/package-manager.d.mts +31 -8
- package/foundation/env/package-manager.mjs +120 -13
- package/foundation/env/package-manager.test.mjs +174 -1
- package/foundation/fs/module-loader.d.mts +9 -0
- package/foundation/fs/module-loader.mjs +71 -2
- package/foundation/integrations/cli-requirement.d.mts +22 -0
- package/foundation/integrations/cli-requirement.mjs +31 -0
- package/foundation/integrations/cli-requirement.test.mjs +70 -0
- package/foundation/integrations/contribution-inventory.mjs +3 -3
- package/foundation/integrations/validate-contributions.d.mts +16 -0
- package/foundation/integrations/validate-contributions.mjs +56 -8
- package/foundation/response/base.d.ts +9 -3
- package/foundation/response/json.d.mts +7 -4
- package/foundation/response/json.mjs +10 -6
- package/foundation/response/response-types.doc.mjs +41 -26
- package/foundation/response/response.doc.mjs +18 -4
- package/foundation/text/copyright-header.mjs +1 -1
- package/foundation/text/copyright-header.test.mjs +1 -1
- package/package.json +1 -1
- package/assets/docs/layout.doc.dense.mjs +0 -388
- package/assets/docs/layout.doc.mjs +0 -550
- package/assets/docs/styling-libraries.doc.mjs +0 -469
- package/assets/docs/styling.doc.mjs +0 -412
- package/assets/docs/tokens.doc.dense.mjs +0 -15
- package/assets/docs/tokens.doc.mjs +0 -1491
- package/assets/docs/tokens.doc.zh.mjs +0 -15
- package/assets/docs/typography.doc.mjs +0 -286
|
@@ -24,7 +24,12 @@ import {
|
|
|
24
24
|
import {discoverExternalPackages} from '../../../foundation/fs/paths.mjs';
|
|
25
25
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
26
26
|
import {AstryxError} from '../../error.mjs';
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
loadComponentDoc,
|
|
29
|
+
loadComponentReplacements,
|
|
30
|
+
loadIntegrationsSafely,
|
|
31
|
+
withOwnership,
|
|
32
|
+
} from '../_adapter.mjs';
|
|
28
33
|
|
|
29
34
|
/**
|
|
30
35
|
* @typedef {import('../component.type.mjs').ComponentListResponse} ComponentListResponse
|
|
@@ -55,6 +60,66 @@ async function legacyImport(ext, name, coreDir, docOpts) {
|
|
|
55
60
|
return withOwnership(docs, {package: ext.name, sourcePath: null}, name, coreDir).import;
|
|
56
61
|
}
|
|
57
62
|
|
|
63
|
+
/**
|
|
64
|
+
* A full Core ComponentDoc list entry, naming the package that owns it.
|
|
65
|
+
* @param {any} doc
|
|
66
|
+
*/
|
|
67
|
+
const coreEntry = doc => ({name: doc.name, package: CORE_PACKAGE, ...doc});
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The entry for a Core slot an integration component replaces
|
|
71
|
+
* (spec:AST-035 FR11), at the list's detail level: the replacement's own name,
|
|
72
|
+
* its package, and the import `component <Name>` reports for it.
|
|
73
|
+
* @param {import('../../../foundation/discovery/component-replacement.mjs').ActiveComponentReplacement} replacement
|
|
74
|
+
* @param {'names'|'compact'|'full'} detail
|
|
75
|
+
* @param {{zh: boolean, dense: boolean, lang: string|null}} docOpts
|
|
76
|
+
* @returns {Promise<any>}
|
|
77
|
+
*/
|
|
78
|
+
async function replacementEntry(replacement, detail, {zh, dense, lang}) {
|
|
79
|
+
const {integration} = replacement;
|
|
80
|
+
/** @type {any} */
|
|
81
|
+
let docs = null;
|
|
82
|
+
try {
|
|
83
|
+
docs = await loadComponentDoc(
|
|
84
|
+
replacement.docPath,
|
|
85
|
+
detail === 'full' ? {zh, lang, dense} : {zh, lang},
|
|
86
|
+
);
|
|
87
|
+
} catch {
|
|
88
|
+
// Keep list resilient; validation owns malformed integration docs.
|
|
89
|
+
}
|
|
90
|
+
const importPath = resolveIntegrationImportPath(
|
|
91
|
+
{
|
|
92
|
+
exportsMap: integration.__packageExports,
|
|
93
|
+
packageDir: integration.__packageDir,
|
|
94
|
+
docPath: replacement.docPath,
|
|
95
|
+
packageName: replacement.package,
|
|
96
|
+
},
|
|
97
|
+
replacement.name,
|
|
98
|
+
docs?.import,
|
|
99
|
+
);
|
|
100
|
+
if (detail === 'names') {
|
|
101
|
+
return {name: replacement.name, package: replacement.package, import: importPath};
|
|
102
|
+
}
|
|
103
|
+
if (detail === 'compact') {
|
|
104
|
+
return {
|
|
105
|
+
name: replacement.name,
|
|
106
|
+
package: replacement.package,
|
|
107
|
+
description: docs?.usage?.description || docs?.description || '',
|
|
108
|
+
import: importPath,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (docs == null) {
|
|
112
|
+
return {name: replacement.name, package: replacement.package, description: ''};
|
|
113
|
+
}
|
|
114
|
+
const {package: _owner, ...doc} = docs;
|
|
115
|
+
return {
|
|
116
|
+
name: doc.name ?? replacement.name,
|
|
117
|
+
package: replacement.package,
|
|
118
|
+
...doc,
|
|
119
|
+
import: importPath,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
58
123
|
/**
|
|
59
124
|
* Build the `component.list` envelope. The list taxonomy is collapsed: all
|
|
60
125
|
* three detail levels emit ONE `component.list` type; the depth rides in
|
|
@@ -74,6 +139,15 @@ export async function componentList(
|
|
|
74
139
|
{cwd, category, detail, zh, dense, lang},
|
|
75
140
|
) {
|
|
76
141
|
const components = discoverComponents(coreDir);
|
|
142
|
+
// An active integration replacement takes its Core component's slot in
|
|
143
|
+
// every list view (spec:AST-035 FR11); the Core original stays reachable
|
|
144
|
+
// with `component <Name> --package @astryxdesign/core`.
|
|
145
|
+
const loadedIntegrations = await loadIntegrationsSafely(cwd);
|
|
146
|
+
const replacements = await loadComponentReplacements(
|
|
147
|
+
coreDir,
|
|
148
|
+
loadedIntegrations,
|
|
149
|
+
);
|
|
150
|
+
const docOpts = {zh, dense, lang};
|
|
77
151
|
|
|
78
152
|
if (category) {
|
|
79
153
|
const match = Object.entries(components).find(
|
|
@@ -91,18 +165,25 @@ export async function componentList(
|
|
|
91
165
|
/** @type {ComponentBriefEntry[]} */
|
|
92
166
|
const entries = [];
|
|
93
167
|
for (const comp of match[1]) {
|
|
168
|
+
const replacement = replacements.forTarget(comp);
|
|
169
|
+
if (replacement) {
|
|
170
|
+
entries.push(await replacementEntry(replacement, 'compact', docOpts));
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
94
173
|
const readme = findComponentReadme(coreDir, comp);
|
|
95
174
|
if (readme && readme.endsWith('.doc.mjs')) {
|
|
96
175
|
try {
|
|
97
176
|
const docs = await loadComponentDoc(readme, {zh, lang});
|
|
98
177
|
entries.push({
|
|
99
178
|
name: comp,
|
|
179
|
+
package: CORE_PACKAGE,
|
|
100
180
|
description: docs.usage?.description || docs.description || '',
|
|
101
181
|
import: resolveImportPath(coreDir, comp),
|
|
102
182
|
});
|
|
103
183
|
} catch {
|
|
104
184
|
entries.push({
|
|
105
185
|
name: comp,
|
|
186
|
+
package: CORE_PACKAGE,
|
|
106
187
|
description: '',
|
|
107
188
|
import: resolveImportPath(coreDir, comp),
|
|
108
189
|
});
|
|
@@ -110,6 +191,7 @@ export async function componentList(
|
|
|
110
191
|
} else {
|
|
111
192
|
entries.push({
|
|
112
193
|
name: comp,
|
|
194
|
+
package: CORE_PACKAGE,
|
|
113
195
|
description: '',
|
|
114
196
|
import: resolveImportPath(coreDir, comp),
|
|
115
197
|
});
|
|
@@ -125,15 +207,20 @@ export async function componentList(
|
|
|
125
207
|
/** @type {any[]} */
|
|
126
208
|
const entries = [];
|
|
127
209
|
for (const comp of match[1]) {
|
|
210
|
+
const replacement = replacements.forTarget(comp);
|
|
211
|
+
if (replacement) {
|
|
212
|
+
entries.push(await replacementEntry(replacement, 'full', docOpts));
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
128
215
|
const readme = findComponentReadme(coreDir, comp);
|
|
129
216
|
if (readme && readme.endsWith('.doc.mjs')) {
|
|
130
217
|
try {
|
|
131
|
-
entries.push(await loadComponentDoc(readme, {zh, lang, dense}));
|
|
218
|
+
entries.push(coreEntry(await loadComponentDoc(readme, {zh, lang, dense})));
|
|
132
219
|
} catch {
|
|
133
|
-
entries.push({name: `XDS${comp}`, description: ''});
|
|
220
|
+
entries.push({name: `XDS${comp}`, package: CORE_PACKAGE, description: ''});
|
|
134
221
|
}
|
|
135
222
|
} else {
|
|
136
|
-
entries.push({name: `XDS${comp}`, description: ''});
|
|
223
|
+
entries.push({name: `XDS${comp}`, package: CORE_PACKAGE, description: ''});
|
|
137
224
|
}
|
|
138
225
|
}
|
|
139
226
|
return {
|
|
@@ -150,7 +237,14 @@ export async function componentList(
|
|
|
150
237
|
data: {
|
|
151
238
|
detail: 'names',
|
|
152
239
|
components: {
|
|
153
|
-
[match[0]]:
|
|
240
|
+
[match[0]]: await Promise.all(
|
|
241
|
+
match[1].map(n => {
|
|
242
|
+
const replacement = replacements.forTarget(n);
|
|
243
|
+
return replacement
|
|
244
|
+
? replacementEntry(replacement, 'names', docOpts)
|
|
245
|
+
: {name: n, package: CORE_PACKAGE};
|
|
246
|
+
}),
|
|
247
|
+
),
|
|
154
248
|
},
|
|
155
249
|
},
|
|
156
250
|
};
|
|
@@ -163,18 +257,25 @@ export async function componentList(
|
|
|
163
257
|
for (const [cat, comps] of Object.entries(components)) {
|
|
164
258
|
result[cat] = [];
|
|
165
259
|
for (const comp of comps) {
|
|
260
|
+
const replacement = replacements.forTarget(comp);
|
|
261
|
+
if (replacement) {
|
|
262
|
+
result[cat].push(await replacementEntry(replacement, 'compact', docOpts));
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
166
265
|
const readme = findComponentReadme(coreDir, comp);
|
|
167
266
|
if (readme && readme.endsWith('.doc.mjs')) {
|
|
168
267
|
try {
|
|
169
268
|
const docs = await loadComponentDoc(readme, {zh, lang});
|
|
170
269
|
result[cat].push({
|
|
171
270
|
name: comp,
|
|
271
|
+
package: CORE_PACKAGE,
|
|
172
272
|
description: docs.usage?.description || docs.description || '',
|
|
173
273
|
import: resolveImportPath(coreDir, comp),
|
|
174
274
|
});
|
|
175
275
|
} catch {
|
|
176
276
|
result[cat].push({
|
|
177
277
|
name: comp,
|
|
278
|
+
package: CORE_PACKAGE,
|
|
178
279
|
description: '',
|
|
179
280
|
import: resolveImportPath(coreDir, comp),
|
|
180
281
|
});
|
|
@@ -182,6 +283,7 @@ export async function componentList(
|
|
|
182
283
|
} else {
|
|
183
284
|
result[cat].push({
|
|
184
285
|
name: comp,
|
|
286
|
+
package: CORE_PACKAGE,
|
|
185
287
|
description: '',
|
|
186
288
|
import: resolveImportPath(coreDir, comp),
|
|
187
289
|
});
|
|
@@ -200,15 +302,20 @@ export async function componentList(
|
|
|
200
302
|
for (const [cat, comps] of Object.entries(components)) {
|
|
201
303
|
result[cat] = [];
|
|
202
304
|
for (const comp of comps) {
|
|
305
|
+
const replacement = replacements.forTarget(comp);
|
|
306
|
+
if (replacement) {
|
|
307
|
+
result[cat].push(await replacementEntry(replacement, 'full', docOpts));
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
203
310
|
const readme = findComponentReadme(coreDir, comp);
|
|
204
311
|
if (readme && readme.endsWith('.doc.mjs')) {
|
|
205
312
|
try {
|
|
206
|
-
result[cat].push(await loadComponentDoc(readme, {zh, lang, dense}));
|
|
313
|
+
result[cat].push(coreEntry(await loadComponentDoc(readme, {zh, lang, dense})));
|
|
207
314
|
} catch {
|
|
208
|
-
result[cat].push({name: `XDS${comp}`, description: ''});
|
|
315
|
+
result[cat].push({name: `XDS${comp}`, package: CORE_PACKAGE, description: ''});
|
|
209
316
|
}
|
|
210
317
|
} else {
|
|
211
|
-
result[cat].push({name: `XDS${comp}`, description: ''});
|
|
318
|
+
result[cat].push({name: `XDS${comp}`, package: CORE_PACKAGE, description: ''});
|
|
212
319
|
}
|
|
213
320
|
}
|
|
214
321
|
}
|
|
@@ -220,11 +327,21 @@ export async function componentList(
|
|
|
220
327
|
/** @type {Record<string, ComponentListEntry[]>} */
|
|
221
328
|
const listData = {};
|
|
222
329
|
for (const [cat, comps] of Object.entries(components)) {
|
|
223
|
-
listData[cat] =
|
|
330
|
+
listData[cat] = await Promise.all(
|
|
331
|
+
comps.map(n => {
|
|
332
|
+
const replacement = replacements.forTarget(n);
|
|
333
|
+
return replacement
|
|
334
|
+
? replacementEntry(replacement, 'names', docOpts)
|
|
335
|
+
: {name: n, package: CORE_PACKAGE};
|
|
336
|
+
}),
|
|
337
|
+
);
|
|
224
338
|
}
|
|
339
|
+
// A replacement is listed once, in the Core slot it took.
|
|
340
|
+
const listedReplacements = new Set(
|
|
341
|
+
replacements.active.map(active => `${active.package}\0${active.name}`),
|
|
342
|
+
);
|
|
225
343
|
|
|
226
344
|
// Integration components (authoritative source: loadedIntegrations).
|
|
227
|
-
const loadedIntegrations = await loadIntegrationsSafely(cwd);
|
|
228
345
|
const seenIntegration = new Set();
|
|
229
346
|
for (const integration of loadedIntegrations) {
|
|
230
347
|
seenIntegration.add(integration.name);
|
|
@@ -236,6 +353,7 @@ export async function componentList(
|
|
|
236
353
|
/** @type {Map<string, Array<{name: string, package: string, import?: string}>>} */
|
|
237
354
|
const byGroup = new Map();
|
|
238
355
|
for (const rec of owned) {
|
|
356
|
+
if (listedReplacements.has(`${integration.name}\0${rec.name}`)) continue;
|
|
239
357
|
const groupLabel = rec.group ?? integration.name;
|
|
240
358
|
const key = `${groupLabel} (${integration.name})`;
|
|
241
359
|
if (!byGroup.has(key)) byGroup.set(key, []);
|
package/api/docs/_adapter.d.mts
CHANGED
|
@@ -20,6 +20,17 @@ export function loadDocsCatalog(cwd?: string): Promise<DocsCatalog>;
|
|
|
20
20
|
* @returns {DocsCatalog}
|
|
21
21
|
*/
|
|
22
22
|
export function builtinCatalog(): DocsCatalog;
|
|
23
|
+
/**
|
|
24
|
+
* The npm package that wrote each section of a lowered topic: the topic's own
|
|
25
|
+
* package, or the package of the extension that contributed the section
|
|
26
|
+
* (spec cli-surface INV28).
|
|
27
|
+
* @param {DocsTopicEntry} entry
|
|
28
|
+
* @param {{sectionProviders?: Record<string, string>}} node the lowered topic
|
|
29
|
+
* @returns {(sectionId: string | undefined) => string}
|
|
30
|
+
*/
|
|
31
|
+
export function sectionPackageOf(entry: DocsTopicEntry, node: {
|
|
32
|
+
sectionProviders?: Record<string, string>;
|
|
33
|
+
}): (sectionId: string | undefined) => string;
|
|
23
34
|
/**
|
|
24
35
|
* One topic, lowered for `lang` with every link between docs resolved
|
|
25
36
|
* (spec:AST-047 FR9): an inline `{@link <target>}` reads as the command that
|
package/api/docs/_adapter.mjs
CHANGED
|
@@ -150,6 +150,31 @@ function providerOf(entry) {
|
|
|
150
150
|
return normalizeProviderId(entry.providerId ?? entry.package);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* The npm package that wrote each section of a lowered topic: the topic's own
|
|
155
|
+
* package, or the package of the extension that contributed the section
|
|
156
|
+
* (spec cli-surface INV28).
|
|
157
|
+
* @param {DocsTopicEntry} entry
|
|
158
|
+
* @param {{sectionProviders?: Record<string, string>}} node the lowered topic
|
|
159
|
+
* @returns {(sectionId: string | undefined) => string}
|
|
160
|
+
*/
|
|
161
|
+
export function sectionPackageOf(entry, node) {
|
|
162
|
+
/** @type {Map<string, string>} */
|
|
163
|
+
const byProvider = new Map([[providerOf(entry), entry.package]]);
|
|
164
|
+
for (const extension of entry.extensions ?? []) {
|
|
165
|
+
byProvider.set(providerOf(extension), extension.package);
|
|
166
|
+
}
|
|
167
|
+
return sectionId => {
|
|
168
|
+
const provider =
|
|
169
|
+
sectionId == null ? undefined : node.sectionProviders?.[sectionId];
|
|
170
|
+
return (
|
|
171
|
+
(provider == null
|
|
172
|
+
? undefined
|
|
173
|
+
: byProvider.get(normalizeProviderId(provider))) ?? entry.package
|
|
174
|
+
);
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
153
178
|
/**
|
|
154
179
|
* One topic, lowered for `lang` with every link between docs resolved
|
|
155
180
|
* (spec:AST-047 FR9): an inline `{@link <target>}` reads as the command that
|
|
@@ -707,10 +732,57 @@ export async function packageDocsProblems(integration, discovered) {
|
|
|
707
732
|
export function referenceTargets(catalog, lang) {
|
|
708
733
|
return async topic => {
|
|
709
734
|
const target = catalog.resolve(topic);
|
|
710
|
-
|
|
735
|
+
if (target) return lowerTopic(catalog, target, lang);
|
|
736
|
+
return namespaceReferenceTarget(catalog, topic, lang);
|
|
711
737
|
};
|
|
712
738
|
}
|
|
713
739
|
|
|
740
|
+
/**
|
|
741
|
+
* A docs-tree namespace as the target of a token reference: every guide placed
|
|
742
|
+
* below it, lowered for `lang` and read in tree order as one topic. A flat
|
|
743
|
+
* topic split into a namespace keeps answering the references its readers
|
|
744
|
+
* wrote, so `{type: 'token-ref', topic: 'tokens', section: 'Color Tokens'}`
|
|
745
|
+
* finds the guide that now holds that table. Null for any other route.
|
|
746
|
+
* @param {DocsCatalog} catalog
|
|
747
|
+
* @param {string} route
|
|
748
|
+
* @param {string | null} lang
|
|
749
|
+
* @returns {Promise<import('../../foundation/doc-compiler/compile.mjs').CompiledReferenceNode | null>}
|
|
750
|
+
*/
|
|
751
|
+
async function namespaceReferenceTarget(catalog, route, lang) {
|
|
752
|
+
const tree = await projectTree(catalog);
|
|
753
|
+
const node = tree.get(route) ?? tree.getFolded(route);
|
|
754
|
+
if (!node || node.kind !== 'namespace' || node.generated) return null;
|
|
755
|
+
/** @type {any[]} */
|
|
756
|
+
const sections = [];
|
|
757
|
+
/** @type {Record<string, string>} */
|
|
758
|
+
const sourceTitles = {};
|
|
759
|
+
/** @param {TreeNode} parent */
|
|
760
|
+
const walk = async parent => {
|
|
761
|
+
for (const slot of parent.slots) {
|
|
762
|
+
for (const childRoute of slot.children) {
|
|
763
|
+
const child = tree.get(childRoute);
|
|
764
|
+
if (!child || child.parent !== parent.route) continue;
|
|
765
|
+
if (child.kind === 'namespace') {
|
|
766
|
+
await walk(child);
|
|
767
|
+
} else if (child.kind === 'generic' && child.ref?.topicFile) {
|
|
768
|
+
const lowered = await lowerTopic(catalog, guideEntry(child), lang);
|
|
769
|
+
sections.push(...lowered.doc.sections);
|
|
770
|
+
for (const [key, title] of Object.entries(lowered.sourceTitles)) {
|
|
771
|
+
sourceTitles[key] ??= title;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
await walk(node);
|
|
778
|
+
if (sections.length === 0) return null;
|
|
779
|
+
return /** @type {any} */ ({
|
|
780
|
+
id: node.route,
|
|
781
|
+
doc: {sections},
|
|
782
|
+
sourceTitles,
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
|
|
714
786
|
/**
|
|
715
787
|
* Each reference block in one integration's docs that cannot include what it
|
|
716
788
|
* names (spec:AST-047 FR9): a target that names no doc, a field its schema
|
|
@@ -53,7 +53,7 @@ describe('reads that share a catalog', () => {
|
|
|
53
53
|
'never let one read change another',
|
|
54
54
|
async () => {
|
|
55
55
|
const catalog = await loadDocsCatalog();
|
|
56
|
-
const tokens = catalog.resolve('
|
|
56
|
+
const tokens = catalog.resolve('color');
|
|
57
57
|
const first = detailView(await compileTopic(catalog, tokens));
|
|
58
58
|
for (const section of first.sections) {
|
|
59
59
|
section.title = 'EDITED';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @input A topic name plus optional {lang, zh, dense, cwd}. Resolves the topic
|
|
7
7
|
* via the shared adapter and compiles it with its token references linked.
|
|
8
|
-
* @output { type: 'docs.detail', data: ReferenceDoc } — the full doc with
|
|
8
|
+
* @output { type: 'docs.detail', package, data: ReferenceDoc } — the full doc with
|
|
9
9
|
* token-refs inlined, matching `astryx --json docs <topic>`.
|
|
10
10
|
* @position Leaf under api/docs. Reads the compiled node through the detail
|
|
11
11
|
* lens; resolution, overlays and extensions happen in the compiler.
|
|
@@ -13,7 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
import {linkReferenceTopic} from '../../../foundation/doc-compiler/compile.mjs';
|
|
15
15
|
import {detailView} from '../../../foundation/doc-compiler/lenses.mjs';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
referenceTargets,
|
|
18
|
+
resolveTopicDocs,
|
|
19
|
+
sectionPackageOf,
|
|
20
|
+
topicLinks,
|
|
21
|
+
} from '../_adapter.mjs';
|
|
17
22
|
|
|
18
23
|
/**
|
|
19
24
|
* @param {string} topic
|
|
@@ -30,10 +35,21 @@ export async function detail(topic, options = {}) {
|
|
|
30
35
|
node,
|
|
31
36
|
referenceTargets(catalog, lang),
|
|
32
37
|
);
|
|
38
|
+
const view = detailView(linked);
|
|
39
|
+
const sectionPackage = sectionPackageOf(entry, node);
|
|
33
40
|
return {
|
|
34
41
|
type: 'docs.detail',
|
|
42
|
+
package: entry.package,
|
|
35
43
|
data: {
|
|
36
|
-
...
|
|
44
|
+
...view,
|
|
45
|
+
// Each section names the package that wrote it: the topic's own, or an
|
|
46
|
+
// extension's.
|
|
47
|
+
sections: view.sections.map(
|
|
48
|
+
(/** @type {import('../docs.type.mjs').DocsReadSection} */ section) => {
|
|
49
|
+
const {id, title, ...rest} = section;
|
|
50
|
+
return {id, title, package: sectionPackage(id), ...rest};
|
|
51
|
+
},
|
|
52
|
+
),
|
|
37
53
|
// A guide the docs tree places is read by its route, not its doc name.
|
|
38
54
|
...(entry.tree ? {name: entry.name} : {}),
|
|
39
55
|
links: await topicLinks(catalog, entry),
|
|
@@ -17,3 +17,47 @@ export function section(topic: string, sectionName: string, options?: {
|
|
|
17
17
|
dense?: boolean | undefined;
|
|
18
18
|
cwd?: string | undefined;
|
|
19
19
|
}): Promise<import("../../docs.type.mjs").DocsDetailSectionResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* @typedef {object} GuideMatch
|
|
22
|
+
* @property {import('../../../../foundation/doc-compiler/tree.mjs').TreeNode} guide
|
|
23
|
+
* @property {Awaited<ReturnType<typeof resolveTopicDocs>>} resolved
|
|
24
|
+
* @property {any[]} sections the guide's reader sections
|
|
25
|
+
* @property {any} match the section it has
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* One section of a namespace (spec:AST-046 FR6): the section read of the one
|
|
29
|
+
* guide below the namespace, at any depth, that has it. Each guide answers
|
|
30
|
+
* with the section its own section read returns for the query; when that
|
|
31
|
+
* section's key (its `id`, else the key its title derives) is the query in
|
|
32
|
+
* some guides, those guides answer first. No guide, or several, fail with ERR_UNKNOWN_SECTION, naming
|
|
33
|
+
* the guides to read instead.
|
|
34
|
+
* @param {import('../../../../foundation/doc-compiler/tree.mjs').DocsTree} tree
|
|
35
|
+
* @param {import('../../../../foundation/doc-compiler/tree.mjs').TreeNode} namespace
|
|
36
|
+
* @param {string} sectionName
|
|
37
|
+
* @param {object} [options] as {@link section}
|
|
38
|
+
* @returns {Promise<import('../../docs.type.mjs').DocsDetailSectionResponse>}
|
|
39
|
+
*/
|
|
40
|
+
export function namespaceSection(tree: import("../../../../foundation/doc-compiler/tree.mjs").DocsTree, namespace: import("../../../../foundation/doc-compiler/tree.mjs").TreeNode, sectionName: string, options?: object): Promise<import("../../docs.type.mjs").DocsDetailSectionResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* The guide a namespace section read answers from, or null to ask. When the
|
|
43
|
+
* query matches sections in several guides, the read asks the reader which
|
|
44
|
+
* guide they mean (spec:AST-046 FR6), where a flat topic's section read
|
|
45
|
+
* returned its first title match. To return the first match in tree order
|
|
46
|
+
* instead, return `matches[0]` here.
|
|
47
|
+
* @param {GuideMatch[]} matches in tree order
|
|
48
|
+
* @returns {GuideMatch | null}
|
|
49
|
+
*/
|
|
50
|
+
export function oneGuide(matches: GuideMatch[]): GuideMatch | null;
|
|
51
|
+
export type GuideMatch = {
|
|
52
|
+
guide: import("../../../../foundation/doc-compiler/tree.mjs").TreeNode;
|
|
53
|
+
resolved: Awaited<ReturnType<typeof resolveTopicDocs>>;
|
|
54
|
+
/**
|
|
55
|
+
* the guide's reader sections
|
|
56
|
+
*/
|
|
57
|
+
sections: any[];
|
|
58
|
+
/**
|
|
59
|
+
* the section it has
|
|
60
|
+
*/
|
|
61
|
+
match: any;
|
|
62
|
+
};
|
|
63
|
+
import { resolveTopicDocs } from '../../_adapter.mjs';
|