@astryxdesign/cli 0.6.5 → 0.6.6-canary.1f4eb3c
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 +87 -0
- package/README.md +58 -55
- package/api/build/_adapter.d.mts +55 -2
- package/api/build/_adapter.mjs +100 -10
- package/api/build/build.doc.mjs +2 -2
- package/api/build/build.test.mjs +111 -2
- package/api/build/build.type.d.mts +8 -0
- package/api/build/build.type.mjs +2 -0
- package/api/build/kit/kit.mjs +99 -22
- package/api/build/kit/rank.d.mts +32 -8
- package/api/build/kit/rank.mjs +291 -97
- package/api/build/kit/rank.test.mjs +231 -48
- package/api/build/kit/weights.d.mts +82 -0
- package/api/build/kit/weights.json +1 -0
- package/api/build/kit/weights.mjs +305 -0
- package/api/build/kit/weights.test.mjs +190 -0
- package/api/component/_adapter.d.mts +19 -0
- package/api/component/_adapter.mjs +33 -0
- package/api/component/component-replacement.test.mjs +603 -0
- 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 +25 -0
- package/api/docs/detail/detail.mjs +19 -3
- package/api/docs/detail/section/section.mjs +7 -1
- package/api/docs/docOverlays.test.mjs +10 -6
- package/api/docs/docs.d.mts +6 -0
- package/api/docs/docs.depth.test.mjs +134 -0
- package/api/docs/docs.doc.mjs +31 -2
- package/api/docs/docs.mjs +46 -1
- package/api/docs/docs.test.mjs +279 -0
- package/api/docs/docs.type.d.mts +81 -4
- package/api/docs/docs.type.mjs +41 -4
- package/api/docs/index/index.mjs +11 -2
- package/api/docs/index/index.test.mjs +7 -2
- package/api/docs/integration-tree.test.mjs +572 -0
- package/api/docs/integrationDocs.test.mjs +337 -0
- package/api/docs/node/node.d.mts +28 -3
- package/api/docs/node/node.mjs +149 -23
- package/api/doctor/_adapter.d.mts +43 -0
- package/api/doctor/_adapter.mjs +142 -0
- package/api/doctor/doctor.d.mts +0 -10
- package/api/doctor/doctor.doc.mjs +1 -3
- package/api/doctor/doctor.mjs +6 -123
- package/api/doctor/theme-checks.d.mts +12 -0
- package/api/doctor/theme-checks.mjs +1117 -0
- package/api/doctor/theme-checks.test.mjs +526 -0
- package/api/error.d.mts +22 -0
- package/api/error.mjs +42 -0
- package/api/gap-report/gap-report.d.mts +3 -1
- package/api/gap-report/gap-report.mjs +27 -3
- package/api/gap-report/gap-report.test.mjs +106 -0
- 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.d.mts +1 -1
- 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 +10 -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-contribution.d.mts +2 -1
- package/api/integration/add-contribution.mjs +7 -3
- package/api/integration/add-contribution.test.mjs +3 -3
- package/api/integration/add-helpers.d.mts +26 -5
- package/api/integration/add-helpers.mjs +50 -5
- package/api/integration/add-theme.mjs +354 -28
- package/api/integration/add-theme.test.mjs +380 -16
- package/api/integration/authoring-checks.mjs +31 -8
- package/api/integration/authoring-checks.type.d.mts +8 -0
- package/api/integration/authoring-checks.type.mjs +7 -3
- package/api/integration/integration-authoring.type.d.mts +4 -1
- package/api/integration/integration-authoring.type.mjs +6 -1
- package/api/integration/integrationAdd.doc.mjs +6 -0
- package/api/integration/integrationAddTheme.doc.mjs +10 -0
- package/api/integration/integrationComponentConflicts.doc.mjs +6 -3
- package/api/integration/integrationDocConflicts.doc.mjs +1 -1
- package/api/integration/integrationTemplateConflicts.doc.mjs +1 -1
- 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 +495 -4
- package/api/integration/pack-check.test.mjs +619 -10
- package/api/integration/validate-integration.d.mts +4 -2
- package/api/integration/validate-integration.mjs +7 -2
- package/api/integration/validate-integration.test.mjs +55 -0
- package/api/integration/validate-integration.type.d.mts +5 -0
- package/api/integration/validate-integration.type.mjs +5 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/layout/expand/expand.mjs +12 -7
- package/api/layout/expand/expand.receipt.test.mjs +74 -0
- package/api/layout/layout.type.d.mts +1 -0
- package/api/layout/layout.type.mjs +1 -0
- package/api/layout/layoutExpand.doc.mjs +1 -1
- package/api/search/search.d.mts +39 -8
- package/api/search/search.doc.mjs +4 -4
- package/api/search/search.mjs +248 -66
- package/api/search/search.test.mjs +829 -0
- package/api/search/search.type.d.mts +6 -6
- package/api/search/search.type.mjs +5 -5
- 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 +95 -13
- package/api/swizzle/list/list.mjs +2 -2
- package/api/swizzle/swizzle.doc.mjs +4 -0
- 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 +15 -8
- package/api/template/copy/copy.receipt.test.mjs +77 -0
- package/api/template/show/show.mjs +17 -4
- package/api/template/show/show.test.mjs +76 -0
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template-integration.test.mjs +14 -0
- package/api/template/template.d.mts +1 -1
- package/api/template/template.doc.mjs +6 -2
- package/api/template/template.mjs +2 -0
- package/api/template/template.type.d.mts +14 -0
- package/api/template/template.type.mjs +5 -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 +50 -2
- package/api/theme/build/build.family.test.mjs +13 -4
- package/api/theme/build/build.icon-lineage.test.mjs +117 -0
- package/api/theme/build/build.icon-preservation.test.mjs +639 -0
- package/api/theme/build/build.mjs +463 -155
- package/api/theme/build/build.project-core.test.mjs +165 -0
- package/api/theme/build/build.test.mjs +220 -1
- package/api/theme/build/icon-imports.d.mts +47 -0
- package/api/theme/build/icon-imports.mjs +691 -0
- 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.d.mts +4 -1
- package/api/theme/themeBuild.doc.mjs +15 -4
- 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/run/run.mjs +20 -3
- package/api/upgrade/run/run.test.mjs +45 -1
- package/api/upgrade/upgrade.doc.mjs +1 -1
- package/api/upgrade/upgrade.type.d.mts +5 -0
- package/api/upgrade/upgrade.type.mjs +2 -0
- package/assets/codemods/integration-discovery.mjs +1 -1
- package/assets/codemods/integration-discovery.test.mjs +64 -0
- package/assets/codemods/transforms/next/__tests__/migrate-copied-themes-to-descriptors.test.mjs +129 -0
- package/assets/codemods/transforms/next/index.mjs +14 -1
- package/assets/codemods/transforms/next/migrate-copied-themes-to-descriptors.mjs +54 -0
- package/assets/docs/author-a-theme.doc.mjs +161 -0
- package/assets/docs/getting-started.doc.mjs +59 -15
- package/assets/docs/icons.doc.mjs +1 -0
- package/assets/docs/principles.doc.dense.mjs +2 -2
- package/assets/docs/principles.doc.mjs +2 -2
- package/assets/docs/principles.doc.zh.mjs +2 -2
- package/assets/docs/styling-libraries.doc.mjs +1 -1
- package/assets/docs/styling.doc.mjs +2 -2
- package/assets/docs/theme.doc.dense.mjs +10 -198
- package/assets/docs/theme.doc.mjs +13 -770
- package/assets/docs/theme.doc.zh.mjs +31 -12
- package/assets/docs/tokens.doc.mjs +4 -4
- package/assets/docs/tree/add-a-theme.doc.mjs +6 -2
- package/assets/docs/tree/add-a-topic.doc.mjs +1 -1
- package/assets/docs/tree/check-your-docs.doc.mjs +2 -2
- package/assets/docs/tree/checks.doc.mjs +6 -5
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +1 -1
- package/assets/docs/tree/define-the-theme.doc.mjs +2 -2
- package/assets/docs/tree/document-the-theme.doc.mjs +4 -4
- package/assets/docs/tree/fonts-and-assets.doc.mjs +25 -20
- package/assets/docs/tree/headers-and-footers.doc.mjs +68 -0
- package/assets/docs/tree/layout-spacing.doc.mjs +168 -0
- package/assets/docs/tree/layout.doc.mjs +32 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +21 -4
- package/assets/docs/tree/responsive.doc.mjs +102 -0
- package/assets/docs/tree/scaffold.doc.mjs +145 -0
- package/assets/docs/tree/sections-and-placement.doc.mjs +1 -1
- package/assets/docs/tree/side-panels.doc.mjs +82 -0
- package/assets/docs/tree/structure.doc.mjs +144 -0
- package/assets/docs/tree/template-doc-overview.doc.mjs +13 -1
- package/assets/docs/tree/themes.doc.mjs +2 -2
- package/assets/docs/tree/troubleshooting.doc.mjs +13 -5
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +22 -5
- package/assets/docs/tree/versioning.doc.mjs +11 -7
- package/assets/docs/use-a-theme.doc.mjs +97 -0
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.doc.mjs +15 -0
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +38 -0
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.doc.mjs +20 -0
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.tsx +48 -0
- package/assets/templates/pages/ai-chat/template.doc.mjs +16 -1
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +9 -1
- package/assets/templates/pages/blank/template.doc.mjs +3 -1
- package/assets/templates/pages/canvas-editor/template.doc.mjs +9 -1
- package/assets/templates/pages/centered-hero/template.doc.mjs +3 -1
- package/assets/templates/pages/checkout-wizard/template.doc.mjs +1 -0
- package/assets/templates/pages/classic-gallery/template.doc.mjs +3 -1
- package/assets/templates/pages/contact-form/template.doc.mjs +16 -1
- package/assets/templates/pages/dashboard/template.doc.mjs +15 -1
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +23 -1
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +10 -1
- package/assets/templates/pages/dashboard-comparison/template.doc.mjs +9 -1
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +10 -1
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +17 -1
- package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +2 -1
- package/assets/templates/pages/detail-page/template.doc.mjs +8 -0
- package/assets/templates/pages/documentation/template.doc.mjs +10 -1
- package/assets/templates/pages/documentation-design/template.doc.mjs +10 -1
- package/assets/templates/pages/documentation-technical/template.doc.mjs +10 -1
- package/assets/templates/pages/editor/template.doc.mjs +9 -1
- package/assets/templates/pages/file-explorer/template.doc.mjs +3 -1
- package/assets/templates/pages/form-two-column/template.doc.mjs +17 -1
- package/assets/templates/pages/form-wizard/template.doc.mjs +14 -1
- package/assets/templates/pages/form-wizard-dialog/template.doc.mjs +1 -0
- package/assets/templates/pages/gallery-hero/template.doc.mjs +10 -1
- package/assets/templates/pages/ide/template.doc.mjs +9 -1
- package/assets/templates/pages/incident-console/template.doc.mjs +10 -1
- package/assets/templates/pages/kanban-board/template.doc.mjs +11 -1
- package/assets/templates/pages/library/template.doc.mjs +15 -1
- package/assets/templates/pages/login/template.doc.mjs +10 -1
- package/assets/templates/pages/login-card/template.doc.mjs +11 -1
- package/assets/templates/pages/login-split/template.doc.mjs +10 -1
- package/assets/templates/pages/login-sso/template.doc.mjs +10 -1
- package/assets/templates/pages/messaging-shell/template.doc.mjs +11 -1
- package/assets/templates/pages/mixed-gallery/template.doc.mjs +10 -1
- package/assets/templates/pages/payment-form/template.doc.mjs +3 -1
- package/assets/templates/pages/product-detail/template.doc.mjs +9 -1
- package/assets/templates/pages/product-gallery/template.doc.mjs +10 -1
- package/assets/templates/pages/settings/template.doc.mjs +3 -1
- package/assets/templates/pages/settings-dialog/template.doc.mjs +9 -1
- package/assets/templates/pages/settings-sidebar/template.doc.mjs +9 -1
- package/assets/templates/pages/shell-nav/template.doc.mjs +10 -1
- package/assets/templates/pages/shell-side-nav/template.doc.mjs +14 -1
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +11 -1
- package/assets/templates/pages/side-gallery/template.doc.mjs +3 -1
- package/assets/templates/pages/table/template.doc.mjs +11 -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/templates/pages/table-filter/template.doc.mjs +21 -1
- package/assets/templates/pages/table-grouped/template.doc.mjs +15 -1
- package/assets/templates/pages/table-inbox/template.doc.mjs +18 -6
- package/assets/templates/pages/table-page/template.doc.mjs +20 -1
- package/assets/templates/pages/table-tree/template.doc.mjs +14 -1
- package/assets/templates/pages/theme-showcase/template.doc.mjs +10 -1
- package/assets/templates/pages/work-item-detail/template.doc.mjs +10 -0
- package/assets/templates/themes/butter/icons.tsx +2 -0
- package/assets/templates/themes/chocolate/icons.tsx +2 -0
- package/assets/templates/themes/gothic/icons.tsx +2 -0
- package/assets/templates/themes/matcha/icons.tsx +2 -0
- package/assets/templates/themes/neutral/icons.tsx +2 -0
- package/assets/templates/themes/stone/icons.tsx +2 -0
- package/assets/templates/themes/y2k/icons.tsx +2 -0
- 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/parse.d.mts +2 -0
- package/authoring/doctypes/template/parse.mjs +1 -0
- package/authoring/doctypes/template/parse.test.mjs +21 -0
- package/authoring/doctypes/template/template.doc.mjs +6 -0
- package/authoring/doctypes/template/type.ts +10 -0
- package/authoring/integration/integration.doc.mjs +1 -1
- package/clients/cli/commands/build-theme.mjs +279 -30
- package/clients/cli/commands/build.mjs +7 -6
- package/clients/cli/commands/build.text-fields.test.mjs +1 -1
- package/clients/cli/commands/component/index.mjs +88 -12
- package/clients/cli/commands/component-replacement.text.test.mjs +271 -0
- package/clients/cli/commands/component.doc.mjs +9 -2
- package/clients/cli/commands/discover.mjs +29 -1
- package/clients/cli/commands/discover.no-source.test.mjs +75 -0
- package/clients/cli/commands/docs.depth.test.mjs +219 -0
- package/clients/cli/commands/docs.doc.mjs +15 -2
- package/clients/cli/commands/docs.mjs +273 -16
- package/clients/cli/commands/docs.test.mjs +382 -0
- 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.mjs +4 -4
- package/clients/cli/commands/doctor.test.mjs +9 -51
- package/clients/cli/commands/gap-report.doc.mjs +2 -2
- package/clients/cli/commands/gap-report.mjs +12 -0
- package/clients/cli/commands/gap-report.test.mjs +63 -0
- package/clients/cli/commands/hook/index.mjs +7 -2
- package/clients/cli/commands/import-hint-correctness.test.mjs +5 -5
- package/clients/cli/commands/init.next-steps.test.mjs +18 -23
- package/clients/cli/commands/integration-add.doc.mjs +10 -0
- package/clients/cli/commands/integration-authoring.test.mjs +12 -2
- package/clients/cli/commands/integration-real-world.test.mjs +61 -12
- package/clients/cli/commands/integration.mjs +3 -1
- package/clients/cli/commands/layout-check.doc.mjs +1 -0
- package/clients/cli/commands/layout-expand.doc.mjs +4 -1
- package/clients/cli/commands/layout-grammar.doc.mjs +1 -0
- package/clients/cli/commands/layout.doc.mjs +1 -0
- package/clients/cli/commands/layout.expand-receipt.test.mjs +94 -0
- package/clients/cli/commands/layout.mjs +61 -4
- package/clients/cli/commands/no-prompt-wording.test.mjs +4 -4
- package/clients/cli/commands/search.doc.mjs +5 -4
- package/clients/cli/commands/search.mjs +30 -6
- package/clients/cli/commands/search.test.mjs +63 -17
- package/clients/cli/commands/swizzle.doc.mjs +12 -3
- package/clients/cli/commands/swizzle.mjs +2 -1
- package/clients/cli/commands/template.copy-receipt.test.mjs +60 -0
- package/clients/cli/commands/template.mjs +70 -6
- package/clients/cli/commands/template.show-media.test.mjs +62 -0
- package/clients/cli/commands/text-json-parity.test.mjs +40 -0
- package/clients/cli/commands/theme-add-lifecycle.test.mjs +132 -0
- package/clients/cli/commands/theme-add.doc.mjs +19 -19
- package/clients/cli/commands/theme-eject.doc.mjs +47 -0
- package/clients/cli/commands/theme-list.behavior.test.mjs +44 -0
- 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.ascii-output.test.mjs +14 -0
- package/clients/cli/commands/upgrade.mjs +1 -1
- package/clients/cli/commands/write-failure.test.mjs +175 -0
- package/clients/cli/index.mjs +4 -1
- package/clients/cli/lib/component-format.mjs +19 -2
- package/clients/cli/lib/manifest.mjs +44 -165
- package/clients/cli/lib/manifest.test.mjs +98 -7
- 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 +31 -28
- package/foundation/agent-docs/agent-docs.test.mjs +1163 -0
- 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/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-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-adapter.d.mts +14 -0
- package/foundation/discovery/template-adapter.fixture-refs.test.mjs +37 -1
- package/foundation/discovery/template-adapter.mjs +21 -1
- package/foundation/discovery/theme-discovery.d.mts +78 -5
- package/foundation/discovery/theme-discovery.mjs +143 -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/doc-loads.test.mjs +18 -8
- package/foundation/doc-compiler/inputs.mjs +2 -1
- package/foundation/doc-compiler/inputs.test.mjs +0 -1
- package/foundation/doc-compiler/lenses.d.mts +4 -2
- package/foundation/doc-compiler/lenses.mjs +1 -1
- package/foundation/doc-compiler/tree.test.mjs +649 -0
- package/foundation/fs/module-loader.d.mts +9 -0
- package/foundation/fs/module-loader.mjs +71 -2
- package/foundation/integrations/cli-requirement.d.mts +79 -13
- package/foundation/integrations/cli-requirement.mjs +115 -22
- package/foundation/integrations/cli-requirement.test.mjs +205 -8
- package/foundation/integrations/contribution-inventory.mjs +3 -3
- 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.d.mts +5 -5
- package/foundation/response/response-types.doc.mjs +50 -35
- 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 +9 -9
- package/assets/docs/layout.doc.dense.mjs +0 -388
- package/assets/docs/layout.doc.mjs +0 -550
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Colocated tests for the template.show leaf — the source it returns is
|
|
5
|
+
* the source template.copy writes. An agent that prints a template and pastes
|
|
6
|
+
* it must end up with the same file as one that scaffolds it, demo media
|
|
7
|
+
* included (spec:AST-028 FR7).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {describe, it, expect, beforeAll, afterAll} from 'vitest';
|
|
11
|
+
import * as fs from 'node:fs';
|
|
12
|
+
import * as os from 'node:os';
|
|
13
|
+
import * as path from 'node:path';
|
|
14
|
+
import {discoverAll, template} from '../template.mjs';
|
|
15
|
+
import {templateCopy} from '../copy/copy.mjs';
|
|
16
|
+
import {templateShow} from './show.mjs';
|
|
17
|
+
|
|
18
|
+
const SLOW = 60_000;
|
|
19
|
+
/** Astryx's demo-media namespace: only its own previews serve these files. */
|
|
20
|
+
const FIXTURE = '/template-assets/';
|
|
21
|
+
const FIXTURE_IMAGE = /\/template-assets\/[^'"`\s]+\.(png|jpe?g|webp)/i;
|
|
22
|
+
|
|
23
|
+
const read = (/** @type {string} */ file) => fs.readFileSync(file, 'utf-8');
|
|
24
|
+
|
|
25
|
+
describe('template.show', () => {
|
|
26
|
+
/** @type {string} */
|
|
27
|
+
let dir;
|
|
28
|
+
/** @type {Awaited<ReturnType<typeof discoverAll>>} */
|
|
29
|
+
let templates;
|
|
30
|
+
beforeAll(async () => {
|
|
31
|
+
dir = fs.mkdtempSync(path.join(os.tmpdir(), 'tmpl-show-'));
|
|
32
|
+
templates = await discoverAll(dir);
|
|
33
|
+
}, SLOW);
|
|
34
|
+
afterAll(() => fs.rmSync(dir, {recursive: true, force: true}));
|
|
35
|
+
|
|
36
|
+
it('returns exactly the source copy writes, for every template', () => {
|
|
37
|
+
let withFixtures = 0;
|
|
38
|
+
templates.forEach((match, index) => {
|
|
39
|
+
if (read(match.filePath).includes(FIXTURE)) withFixtures += 1;
|
|
40
|
+
const shown = templateShow(match).data.source;
|
|
41
|
+
const copied = templateCopy(match, {targetPath: `out-${index}`, cwd: dir});
|
|
42
|
+
const written = read(
|
|
43
|
+
path.join(dir, copied.data.outputDir, copied.data.fileName),
|
|
44
|
+
);
|
|
45
|
+
expect(shown, match.dirName).toBe(written);
|
|
46
|
+
});
|
|
47
|
+
// The templates with demo media are the ones that used to differ.
|
|
48
|
+
expect(withFixtures).toBeGreaterThan(0);
|
|
49
|
+
}, SLOW);
|
|
50
|
+
|
|
51
|
+
it('reports a replaced count when the source changed, and 0 when it did not', () => {
|
|
52
|
+
let reported = 0;
|
|
53
|
+
for (const match of templates) {
|
|
54
|
+
const raw = read(match.filePath);
|
|
55
|
+
const {source, demoMediaReplaced} = templateShow(match).data;
|
|
56
|
+
if (source === raw) expect(demoMediaReplaced, match.dirName).toBe(0);
|
|
57
|
+
else expect(demoMediaReplaced, match.dirName).toBeGreaterThan(0);
|
|
58
|
+
reported += demoMediaReplaced;
|
|
59
|
+
}
|
|
60
|
+
expect(reported).toBeGreaterThan(0);
|
|
61
|
+
}, SLOW);
|
|
62
|
+
|
|
63
|
+
it('prints a placeholder where a template shows a demo image', async () => {
|
|
64
|
+
const match = templates.find(
|
|
65
|
+
t => t.type === 'page' && FIXTURE_IMAGE.test(read(t.filePath)),
|
|
66
|
+
);
|
|
67
|
+
expect(match).toBeDefined();
|
|
68
|
+
if (!match) return;
|
|
69
|
+
const res = await template(match.dirName, {type: 'page', cwd: dir});
|
|
70
|
+
expect(res.type).toBe('template.show');
|
|
71
|
+
if (res.type !== 'template.show') return;
|
|
72
|
+
expect(res.data.source).not.toContain(FIXTURE);
|
|
73
|
+
expect(res.data.source).toContain('data:image/svg+xml,');
|
|
74
|
+
expect(res.data.demoMediaReplaced).toBeGreaterThan(0);
|
|
75
|
+
}, SLOW);
|
|
76
|
+
});
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import * as fs from 'node:fs';
|
|
12
12
|
import {AstryxError} from '../../error.mjs';
|
|
13
13
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
14
|
-
import {extractComponents} from '../../../foundation/discovery/template-adapter.mjs';
|
|
14
|
+
import {extractComponents, pkgOf} from '../../../foundation/discovery/template-adapter.mjs';
|
|
15
15
|
|
|
16
16
|
const STRUCTURAL = new Set([
|
|
17
17
|
'AppShell',
|
|
@@ -245,6 +245,7 @@ export function templateSkeleton(match, templates) {
|
|
|
245
245
|
const src = fs.readFileSync(match.filePath, 'utf-8');
|
|
246
246
|
return {
|
|
247
247
|
type: 'template.skeleton',
|
|
248
|
+
package: pkgOf(match),
|
|
248
249
|
data: {
|
|
249
250
|
template: match.dirName,
|
|
250
251
|
description: match.description,
|
|
@@ -125,6 +125,20 @@ describe('integration template discovery', () => {
|
|
|
125
125
|
expect(entry.description).toBe('pricing desc');
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
+
it("reads an integration template's keywords in search and build", async () => {
|
|
129
|
+
const pkgDir = installWidgets(tmpDir);
|
|
130
|
+
writeTemplate(pkgDir, 'observatory', {
|
|
131
|
+
kind: 'page',
|
|
132
|
+
body: "export default {type: 'page', name: 'Observatory', description: 'Live tiles over a sky view.', category: 'Dashboard - Observatory', keywords: ['telescope', 'star map']};\n",
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const found = await search('telescope', {cwd: tmpDir, type: 'template'});
|
|
136
|
+
expect(found.data.results.map(r => r.name)).toContain('observatory');
|
|
137
|
+
const kit = await build('telescope star map page', {cwd: tmpDir});
|
|
138
|
+
if (kit.type !== 'build.kit') throw new Error(kit.type);
|
|
139
|
+
expect(kit.data.start?.name).toBe('observatory');
|
|
140
|
+
});
|
|
141
|
+
|
|
128
142
|
it('preserves integration block showcase metadata in list output', async () => {
|
|
129
143
|
const pkgDir = installWidgets(tmpDir);
|
|
130
144
|
writeTemplate(pkgDir, 'chart-showcase', {
|
|
@@ -41,4 +41,4 @@ export function template(name?: string, options?: {
|
|
|
41
41
|
export type DiscoveredTemplate = import("../../foundation/discovery/template-adapter.mjs").DiscoveredTemplate;
|
|
42
42
|
export type TemplateDiscoveryError = import("../../foundation/discovery/template-adapter.mjs").TemplateDiscoveryError;
|
|
43
43
|
export type TemplateDocModule = import("../../foundation/discovery/template-adapter.mjs").TemplateDocModule;
|
|
44
|
-
export { discoverAll, discoverAll as discoverTemplates, discoverAllWithErrors, discoverCoreTemplates, discoverIntegrationTemplatesForOne, stripTemplateAssetRefs, listTemplates, findRelatedBlocks, findShowcase, extractComponents } from "../../foundation/discovery/template-adapter.mjs";
|
|
44
|
+
export { discoverAll, discoverAll as discoverTemplates, discoverAllWithErrors, discoverCoreTemplates, discoverIntegrationTemplatesForOne, stripTemplateAssetRefs, replaceDemoMedia, listTemplates, findRelatedBlocks, findShowcase, extractComponents, pkgOf } from "../../foundation/discovery/template-adapter.mjs";
|
|
@@ -114,7 +114,7 @@ export const doc = {
|
|
|
114
114
|
{
|
|
115
115
|
type: 'template.show',
|
|
116
116
|
description:
|
|
117
|
-
"The resolved template's
|
|
117
|
+
"The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and `demoMediaReplaced` — how many Astryx demo media references (images, posters, videos) in the source were replaced with placeholders for you to swap for your own media.",
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
type: 'template.skeleton',
|
|
@@ -124,7 +124,7 @@ export const doc = {
|
|
|
124
124
|
{
|
|
125
125
|
type: 'template.copy',
|
|
126
126
|
description:
|
|
127
|
-
'A receipt after scaffolding the template into the project: the template id, output directory, written file name, and file
|
|
127
|
+
'A receipt after scaffolding the template into the project: the template id, output directory, written file name, file count, and `demoMediaReplaced` — how many Astryx demo media references (images, posters, videos) in the written file were replaced with placeholders for you to swap for your own media.',
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
type: 'template.cdn',
|
|
@@ -153,6 +153,10 @@ export const doc = {
|
|
|
153
153
|
code: 'ERR_FILE_EXISTS',
|
|
154
154
|
when: 'the copy target already exists and overwrite is not set',
|
|
155
155
|
},
|
|
156
|
+
{
|
|
157
|
+
code: 'ERR_WRITE_FAILED',
|
|
158
|
+
when: 'the copy target could not be written (no permission, read-only mount, full disk); nothing is written',
|
|
159
|
+
},
|
|
156
160
|
],
|
|
157
161
|
examples: [
|
|
158
162
|
{label: 'List templates', code: 'const {data} = await template();'},
|
|
@@ -41,10 +41,12 @@ export {
|
|
|
41
41
|
discoverCoreTemplates,
|
|
42
42
|
discoverIntegrationTemplatesForOne,
|
|
43
43
|
stripTemplateAssetRefs,
|
|
44
|
+
replaceDemoMedia,
|
|
44
45
|
listTemplates,
|
|
45
46
|
findRelatedBlocks,
|
|
46
47
|
findShowcase,
|
|
47
48
|
extractComponents,
|
|
49
|
+
pkgOf,
|
|
48
50
|
} from '../../foundation/discovery/template-adapter.mjs';
|
|
49
51
|
|
|
50
52
|
/**
|
|
@@ -61,12 +61,17 @@ export type TemplateListEntry = {
|
|
|
61
61
|
*/
|
|
62
62
|
export type TemplateShowResponse = {
|
|
63
63
|
type: "template.show";
|
|
64
|
+
/**
|
|
65
|
+
* The npm package that owns the template.
|
|
66
|
+
*/
|
|
67
|
+
package: string;
|
|
64
68
|
data: {
|
|
65
69
|
template: string;
|
|
66
70
|
description: string;
|
|
67
71
|
type: "page" | "block";
|
|
68
72
|
components: string[];
|
|
69
73
|
source: string;
|
|
74
|
+
demoMediaReplaced: number;
|
|
70
75
|
};
|
|
71
76
|
};
|
|
72
77
|
/**
|
|
@@ -74,6 +79,10 @@ export type TemplateShowResponse = {
|
|
|
74
79
|
*/
|
|
75
80
|
export type TemplateSkeletonResponse = {
|
|
76
81
|
type: "template.skeleton";
|
|
82
|
+
/**
|
|
83
|
+
* The npm package that owns the template.
|
|
84
|
+
*/
|
|
85
|
+
package: string;
|
|
77
86
|
data: {
|
|
78
87
|
template: string;
|
|
79
88
|
description: string;
|
|
@@ -86,11 +95,16 @@ export type TemplateSkeletonResponse = {
|
|
|
86
95
|
*/
|
|
87
96
|
export type TemplateCopyResponse = {
|
|
88
97
|
type: "template.copy";
|
|
98
|
+
/**
|
|
99
|
+
* The npm package that owns the template.
|
|
100
|
+
*/
|
|
101
|
+
package: string;
|
|
89
102
|
data: {
|
|
90
103
|
template: string;
|
|
91
104
|
outputDir: string;
|
|
92
105
|
fileName: string;
|
|
93
106
|
filesCopied: number;
|
|
107
|
+
demoMediaReplaced: number;
|
|
94
108
|
};
|
|
95
109
|
};
|
|
96
110
|
/**
|
|
@@ -47,18 +47,21 @@
|
|
|
47
47
|
* astryx --json template <name>
|
|
48
48
|
* @typedef {object} TemplateShowResponse
|
|
49
49
|
* @property {'template.show'} type
|
|
50
|
+
* @property {string} package The npm package that owns the template.
|
|
50
51
|
* @property {object} data
|
|
51
52
|
* @property {string} data.template
|
|
52
53
|
* @property {string} data.description
|
|
53
54
|
* @property {'page' | 'block'} data.type
|
|
54
55
|
* @property {string[]} data.components
|
|
55
56
|
* @property {string} data.source
|
|
57
|
+
* @property {number} data.demoMediaReplaced Astryx demo media references (images, posters, videos) replaced in the returned source: images with a neutral placeholder, videos with an empty source. Swap in your own media at those points; no media is installed. 0 when the template carried none.
|
|
56
58
|
*/
|
|
57
59
|
|
|
58
60
|
/**
|
|
59
61
|
* astryx --json template <name> --skeleton
|
|
60
62
|
* @typedef {object} TemplateSkeletonResponse
|
|
61
63
|
* @property {'template.skeleton'} type
|
|
64
|
+
* @property {string} package The npm package that owns the template.
|
|
62
65
|
* @property {object} data
|
|
63
66
|
* @property {string} data.template
|
|
64
67
|
* @property {string} data.description
|
|
@@ -70,11 +73,13 @@
|
|
|
70
73
|
* astryx --json template <name> [path]
|
|
71
74
|
* @typedef {object} TemplateCopyResponse
|
|
72
75
|
* @property {'template.copy'} type
|
|
76
|
+
* @property {string} package The npm package that owns the template.
|
|
73
77
|
* @property {object} data
|
|
74
78
|
* @property {string} data.template
|
|
75
79
|
* @property {string} data.outputDir
|
|
76
80
|
* @property {string} data.fileName
|
|
77
81
|
* @property {number} data.filesCopied
|
|
82
|
+
* @property {number} data.demoMediaReplaced Astryx demo media references (images, posters, videos) replaced in the written file: images with a neutral placeholder, videos with an empty source. Swap in your own media at those points; no media is installed. 0 when the template carried none.
|
|
78
83
|
*/
|
|
79
84
|
|
|
80
85
|
/**
|
package/api/theme/_adapter.d.mts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Package written to the generated app record for one discovered theme.
|
|
6
|
+
* @param {import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme} theme
|
|
7
|
+
*/
|
|
8
|
+
export function themeRecordOwner(theme: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme): string;
|
|
4
9
|
/**
|
|
5
10
|
* A bundled theme entry kept for the historical public `listThemes()` helper.
|
|
6
11
|
* @typedef {Pick<import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme, 'slug' | 'displayName' | 'description' | 'maintained' | 'entry' | 'exportName' | 'files'>} BundledTheme
|
|
@@ -12,28 +17,123 @@
|
|
|
12
17
|
*/
|
|
13
18
|
export function listThemes(): BundledTheme[];
|
|
14
19
|
/**
|
|
15
|
-
* Bundled themes plus
|
|
16
|
-
*
|
|
17
|
-
* command's historical usefulness outside a configured project.
|
|
20
|
+
* Bundled themes plus local and installed integration themes available to the
|
|
21
|
+
* project.
|
|
18
22
|
* @param {string} [cwd]
|
|
23
|
+
* @param {{includeLocal?: boolean}} [options]
|
|
19
24
|
* @returns {Promise<import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme[]>}
|
|
20
25
|
*/
|
|
21
|
-
export function listAvailableThemes(cwd?: string
|
|
26
|
+
export function listAvailableThemes(cwd?: string, options?: {
|
|
27
|
+
includeLocal?: boolean;
|
|
28
|
+
}): Promise<import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Load one built theme named by the generated app record. Callers choose how to
|
|
31
|
+
* present missing, ambiguous, or malformed results; unrelated loader failures
|
|
32
|
+
* propagate. A missing generated module is reported as `configured: false` so
|
|
33
|
+
* the released package-field path can remain separate.
|
|
34
|
+
*
|
|
35
|
+
* @param {string} cwd
|
|
36
|
+
* @param {string} [requestedSlug] defaults to the record's default
|
|
37
|
+
* @returns {Promise<{configured: boolean, slug: string|null, owner: string|null, module: Record<string, unknown>|null, specifier: string, missing?: boolean, problem: string|null}>}
|
|
38
|
+
*/
|
|
39
|
+
export function resolveRecordedTheme(cwd: string, requestedSlug?: string): Promise<{
|
|
40
|
+
configured: boolean;
|
|
41
|
+
slug: string | null;
|
|
42
|
+
owner: string | null;
|
|
43
|
+
module: Record<string, unknown> | null;
|
|
44
|
+
specifier: string;
|
|
45
|
+
missing?: boolean;
|
|
46
|
+
problem: string | null;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Source copies made by the released `theme add` before local descriptors.
|
|
50
|
+
* @param {string} cwd
|
|
51
|
+
*/
|
|
52
|
+
export function listUnmigratedThemeCopies(cwd: string): import("../../foundation/discovery/theme-discovery.mjs").UnmigratedThemeCopy[];
|
|
53
|
+
/**
|
|
54
|
+
* Publish one theme's complete source inventory as an atomic local fork.
|
|
55
|
+
* @param {import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme} theme
|
|
56
|
+
* @param {{cwd: string, targetPath?: string, overwrite?: boolean}} options
|
|
57
|
+
* @returns {string} project-relative output directory
|
|
58
|
+
*/
|
|
59
|
+
export function ejectThemeFiles(theme: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme, { cwd, targetPath, overwrite }: {
|
|
60
|
+
cwd: string;
|
|
61
|
+
targetPath?: string;
|
|
62
|
+
overwrite?: boolean;
|
|
63
|
+
}): string;
|
|
22
64
|
/**
|
|
23
65
|
* Resolve an available theme by case-insensitive slug and optional owner package.
|
|
24
|
-
*
|
|
66
|
+
* Without an explicit package, a local theme shadows package themes that share
|
|
67
|
+
* its slug. Other duplicate slugs fail closed until the caller selects an owner.
|
|
25
68
|
* @param {string} [slug]
|
|
26
|
-
* @param {{cwd?: string, package?: string}} [options]
|
|
69
|
+
* @param {{cwd?: string, package?: string, includeLocal?: boolean}} [options]
|
|
27
70
|
* @returns {Promise<import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme | undefined>}
|
|
28
71
|
*/
|
|
29
72
|
export function findTheme(slug?: string, options?: {
|
|
30
73
|
cwd?: string;
|
|
31
74
|
package?: string;
|
|
75
|
+
includeLocal?: boolean;
|
|
32
76
|
}): Promise<import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme | undefined>;
|
|
77
|
+
/**
|
|
78
|
+
* Read the generated module's app-theme record with stable CLI errors.
|
|
79
|
+
* @param {string} [cwd]
|
|
80
|
+
*/
|
|
81
|
+
export function readAppThemeState(cwd?: string): import("../../foundation/config/theme-state.mjs").ThemeState;
|
|
82
|
+
/**
|
|
83
|
+
* Read the app state needed by a list operation. Outside a package project,
|
|
84
|
+
* bundled themes remain listable and there is no generated app state.
|
|
85
|
+
* @param {string} [cwd]
|
|
86
|
+
* @returns {Pick<ReturnType<typeof readThemeState>, 'projectDir' | 'themes' | 'defaultSlug'>}
|
|
87
|
+
*/
|
|
88
|
+
export function readThemeListState(cwd?: string): Pick<ReturnType<typeof readThemeState>, "projectDir" | "themes" | "defaultSlug">;
|
|
89
|
+
/**
|
|
90
|
+
* Resolve every recorded owner to built import metadata, in record order.
|
|
91
|
+
* @param {ReturnType<typeof readThemeState>} state
|
|
92
|
+
* @param {import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme[]} available
|
|
93
|
+
*/
|
|
94
|
+
export function resolveRecordedThemes(state: ReturnType<typeof readThemeState>, available: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme[]): import("../../foundation/config/theme-state.mjs").ResolvedAppTheme[];
|
|
95
|
+
/**
|
|
96
|
+
* Resolve the current generated-module state without changing it.
|
|
97
|
+
* @param {string} [cwd]
|
|
98
|
+
*/
|
|
99
|
+
export function resolveThemeApp(cwd?: string): Promise<{
|
|
100
|
+
state: import("../../foundation/config/theme-state.mjs").ThemeState;
|
|
101
|
+
available: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme[];
|
|
102
|
+
entries: import("../../foundation/config/theme-state.mjs").ResolvedAppTheme[];
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Add one available built theme to the app record.
|
|
106
|
+
* @param {string} slug
|
|
107
|
+
* @param {{cwd?: string, package?: string}} [options]
|
|
108
|
+
* @returns {Promise<import('./theme.type.mjs').ThemeAppResponse>}
|
|
109
|
+
*/
|
|
110
|
+
export function addThemeToApp(slug: string, options?: {
|
|
111
|
+
cwd?: string;
|
|
112
|
+
package?: string;
|
|
113
|
+
}): Promise<import("./theme.type.mjs").ThemeAppResponse>;
|
|
114
|
+
/**
|
|
115
|
+
* Remove one non-default theme from the app record.
|
|
116
|
+
* @param {string} slug
|
|
117
|
+
* @param {{cwd?: string}} [options]
|
|
118
|
+
* @returns {Promise<import('./theme.type.mjs').ThemeAppResponse>}
|
|
119
|
+
*/
|
|
120
|
+
export function removeThemeFromApp(slug: string, options?: {
|
|
121
|
+
cwd?: string;
|
|
122
|
+
}): Promise<import("./theme.type.mjs").ThemeAppResponse>;
|
|
123
|
+
/**
|
|
124
|
+
* Select one added theme as the app default.
|
|
125
|
+
* @param {string} slug
|
|
126
|
+
* @param {{cwd?: string}} [options]
|
|
127
|
+
* @returns {Promise<import('./theme.type.mjs').ThemeAppResponse>}
|
|
128
|
+
*/
|
|
129
|
+
export function useThemeInApp(slug: string, options?: {
|
|
130
|
+
cwd?: string;
|
|
131
|
+
}): Promise<import("./theme.type.mjs").ThemeAppResponse>;
|
|
33
132
|
/**
|
|
34
133
|
* A bundled theme entry kept for the historical public `listThemes()` helper.
|
|
35
134
|
*/
|
|
36
135
|
export type BundledTheme = Pick<import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme, "slug" | "displayName" | "description" | "maintained" | "entry" | "exportName" | "files">;
|
|
136
|
+
import { readThemeState } from '../../foundation/config/theme-state.mjs';
|
|
37
137
|
import { BUNDLED_THEME_PACKAGE } from '../../foundation/discovery/theme-discovery.mjs';
|
|
38
138
|
import { THEMES_DIR } from '../../foundation/discovery/theme-discovery.mjs';
|
|
39
139
|
export { BUNDLED_THEME_PACKAGE, THEMES_DIR };
|