@astryxdesign/cli 0.6.5-vanilla-poc.6e25cfc → 0.6.6-canary.e1dda17
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 +84 -0
- package/README.md +44 -75
- package/api/build/_adapter.d.mts +19 -0
- package/api/build/_adapter.mjs +60 -1
- package/api/build/build.test.mjs +74 -1
- package/api/build/build.type.d.mts +8 -0
- package/api/build/build.type.mjs +2 -0
- package/api/build/kit/kit.mjs +40 -7
- package/api/build/kit/rank.d.mts +8 -0
- package/api/build/kit/rank.mjs +14 -0
- 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 +20 -51
- package/api/component/_adapter.mjs +36 -110
- package/api/component/component-replacement.test.mjs +603 -0
- package/api/component/component.d.mts +1 -9
- package/api/component/component.doc.mjs +7 -52
- package/api/component/component.mjs +52 -291
- package/api/component/component.test.mjs +32 -0
- package/api/component/component.type.d.mts +34 -31
- package/api/component/component.type.mjs +11 -23
- 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 +1 -1
- 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/integrationDocs.test.mjs +6 -5
- 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/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.d.mts +1 -1
- package/api/hook/list/list.mjs +8 -8
- package/api/index.d.mts +1 -9
- package/api/index.mjs +4 -8
- 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-helpers.d.mts +26 -5
- package/api/integration/add-helpers.mjs +50 -5
- package/api/integration/add-theme.mjs +109 -5
- package/api/integration/add-theme.test.mjs +166 -15
- package/api/integration/authoring-checks.mjs +21 -1
- package/api/integration/integrationAddTheme.doc.mjs +1 -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/search/search.d.mts +11 -4
- package/api/search/search.doc.mjs +3 -3
- package/api/search/search.mjs +116 -89
- package/api/search/search.test.mjs +127 -22
- package/api/search/search.type.d.mts +3 -13
- package/api/search/search.type.mjs +2 -3
- 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.test.mjs +55 -5
- package/api/swizzle/swizzle.type.d.mts +8 -0
- package/api/swizzle/swizzle.type.mjs +2 -0
- package/api/template/cdn/cdn.test.mjs +2 -50
- package/api/template/copy/copy.mjs +2 -1
- package/api/template/show/show.mjs +2 -0
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template.d.mts +1 -7
- package/api/template/template.doc.mjs +4 -56
- package/api/template/template.mjs +1 -82
- package/api/template/template.type.d.mts +12 -12
- package/api/template/template.type.mjs +3 -7
- 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 +26 -2
- package/api/theme/build/build.family.test.mjs +13 -4
- package/api/theme/build/build.mjs +82 -78
- package/api/theme/build/build.test.mjs +30 -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.mjs +1 -1
- package/api/{template/html/html.doc.d.mts → theme/themeEject.doc.d.mts} +3 -0
- package/api/theme/themeEject.doc.mjs +89 -0
- package/api/theme/themeListAvailable.doc.mjs +4 -4
- package/api/{component/html/html.doc.d.mts → theme/themeListCopySources.doc.d.mts} +3 -0
- package/api/theme/themeListCopySources.doc.mjs +60 -0
- package/api/{component/web-components/web-components.doc.d.mts → theme/themeRemove.doc.d.mts} +1 -0
- package/api/theme/themeRemove.doc.mjs +50 -0
- package/api/theme/themeTemplate.doc.mjs +4 -3
- package/api/{template/web-components/web-components.doc.d.mts → theme/themeUse.doc.d.mts} +1 -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/cdn.template.html +5 -19
- 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/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 -771
- 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/checks.doc.mjs +5 -4
- 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/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/side-panels.doc.mjs +82 -0
- package/assets/docs/tree/structure.doc.mjs +144 -0
- package/assets/docs/tree/themes.doc.mjs +2 -2
- package/assets/docs/tree/troubleshooting.doc.mjs +8 -4
- 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 +97 -0
- 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/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/integration/integration.doc.mjs +1 -1
- package/clients/cli/commands/build-theme.mjs +271 -28
- 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 +95 -76
- package/clients/cli/commands/component-replacement.text.test.mjs +271 -0
- package/clients/cli/commands/component.doc.mjs +10 -25
- 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 +2 -3
- 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 +9 -51
- 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 +5 -5
- package/clients/cli/commands/init.next-steps.test.mjs +18 -23
- package/clients/cli/commands/integration-add.doc.mjs +1 -1
- package/clients/cli/commands/integration-real-world.test.mjs +61 -12
- package/clients/cli/commands/layout-check.doc.mjs +1 -0
- package/clients/cli/commands/layout-expand.doc.mjs +1 -0
- package/clients/cli/commands/layout-grammar.doc.mjs +1 -0
- package/clients/cli/commands/layout.doc.mjs +1 -0
- package/clients/cli/commands/layout.mjs +45 -4
- package/clients/cli/commands/no-prompt-wording.test.mjs +4 -4
- package/clients/cli/commands/search.doc.mjs +2 -3
- package/clients/cli/commands/search.mjs +11 -8
- package/clients/cli/commands/search.test.mjs +39 -42
- package/clients/cli/commands/swizzle.doc.mjs +12 -3
- package/clients/cli/commands/swizzle.mjs +2 -1
- package/clients/cli/commands/template.doc.mjs +3 -31
- package/clients/cli/commands/template.mjs +56 -41
- 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 +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.mjs +1 -1
- package/clients/cli/index.mjs +4 -1
- package/clients/cli/lib/component-format.mjs +19 -2
- 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 -29
- package/foundation/agent-docs/agent-docs.test.mjs +29 -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/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/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 +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/tree.test.mjs +2 -2
- 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/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 +38 -61
- 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 -13
- package/api/_vanilla-assets.d.mts +0 -10
- package/api/_vanilla-assets.mjs +0 -59
- package/api/component/html/html.d.mts +0 -12
- package/api/component/html/html.doc.mjs +0 -66
- package/api/component/html/html.mjs +0 -25
- package/api/component/html/html.test.mjs +0 -61
- package/api/component/html/html.type.d.mts +0 -23
- package/api/component/html/html.type.mjs +0 -27
- package/api/component/web-components/web-components.d.mts +0 -12
- package/api/component/web-components/web-components.doc.mjs +0 -70
- package/api/component/web-components/web-components.mjs +0 -32
- package/api/component/web-components/web-components.test.mjs +0 -50
- package/api/component/web-components/web-components.type.d.mts +0 -23
- package/api/component/web-components/web-components.type.mjs +0 -27
- package/api/template/_adapter.d.mts +0 -38
- package/api/template/_adapter.mjs +0 -90
- package/api/template/html/html.d.mts +0 -17
- package/api/template/html/html.doc.mjs +0 -72
- package/api/template/html/html.mjs +0 -61
- package/api/template/html/html.test.mjs +0 -71
- package/api/template/html/html.type.d.mts +0 -26
- package/api/template/html/html.type.mjs +0 -28
- package/api/template/web-components/web-components.d.mts +0 -13
- package/api/template/web-components/web-components.doc.mjs +0 -69
- package/api/template/web-components/web-components.mjs +0 -51
- package/api/template/web-components/web-components.test.mjs +0 -73
- package/api/template/web-components/web-components.type.d.mts +0 -26
- package/api/template/web-components/web-components.type.mjs +0 -28
- package/assets/docs/layout.doc.dense.mjs +0 -388
- package/assets/docs/layout.doc.mjs +0 -550
- package/assets/generated/core-component-docs.json +0 -1
- package/assets/vanilla/elements-markup/Avatar.html +0 -27
- package/assets/vanilla/elements-markup/Badge.html +0 -16
- package/assets/vanilla/elements-markup/Banner.html +0 -32
- package/assets/vanilla/elements-markup/Breadcrumbs.html +0 -23
- package/assets/vanilla/elements-markup/Button.html +0 -37
- package/assets/vanilla/elements-markup/Card.html +0 -24
- package/assets/vanilla/elements-markup/CheckboxInput.html +0 -28
- package/assets/vanilla/elements-markup/Collapsible.html +0 -26
- package/assets/vanilla/elements-markup/DateInput.html +0 -28
- package/assets/vanilla/elements-markup/Dialog.html +0 -33
- package/assets/vanilla/elements-markup/Divider.html +0 -20
- package/assets/vanilla/elements-markup/DropdownMenu.html +0 -26
- package/assets/vanilla/elements-markup/EmptyState.html +0 -27
- package/assets/vanilla/elements-markup/Heading.html +0 -18
- package/assets/vanilla/elements-markup/HoverCard.html +0 -39
- package/assets/vanilla/elements-markup/Layout.html +0 -28
- package/assets/vanilla/elements-markup/Lightbox.html +0 -33
- package/assets/vanilla/elements-markup/Link.html +0 -23
- package/assets/vanilla/elements-markup/NumberInput.html +0 -34
- package/assets/vanilla/elements-markup/ProgressBar.html +0 -47
- package/assets/vanilla/elements-markup/RadioList.html +0 -28
- package/assets/vanilla/elements-markup/Selector.html +0 -34
- package/assets/vanilla/elements-markup/SideNav.html +0 -32
- package/assets/vanilla/elements-markup/Skeleton.html +0 -18
- package/assets/vanilla/elements-markup/Slider.html +0 -31
- package/assets/vanilla/elements-markup/Stack.html +0 -33
- package/assets/vanilla/elements-markup/StatusDot.html +0 -19
- package/assets/vanilla/elements-markup/Switch.html +0 -28
- package/assets/vanilla/elements-markup/Tab.html +0 -18
- package/assets/vanilla/elements-markup/TabList.html +0 -31
- package/assets/vanilla/elements-markup/Table.html +0 -31
- package/assets/vanilla/elements-markup/Text.html +0 -24
- package/assets/vanilla/elements-markup/TextArea.html +0 -32
- package/assets/vanilla/elements-markup/TextInput.html +0 -92
- package/assets/vanilla/elements-markup/Theme.html +0 -16
- package/assets/vanilla/elements-markup/TimeInput.html +0 -29
- package/assets/vanilla/elements-markup/Toast.html +0 -22
- package/assets/vanilla/elements-markup/Tooltip.html +0 -30
- package/assets/vanilla/elements-markup/TopNav.html +0 -85
- package/assets/vanilla/elements-markup/Typeahead.html +0 -31
- package/assets/vanilla/elements-templates/dashboard.html +0 -167
- package/assets/vanilla/elements-templates/detail-page.html +0 -145
- package/assets/vanilla/elements-templates/form-two-column.html +0 -135
- package/assets/vanilla/elements-templates/kanban-board.html +0 -141
- package/assets/vanilla/elements-templates/login.html +0 -100
- package/assets/vanilla/elements-templates/product-detail.html +0 -128
- package/assets/vanilla/elements-templates/settings.html +0 -130
- package/assets/vanilla/elements-templates/shell-side-nav.html +0 -160
- package/assets/vanilla/elements-templates/table-filter.html +0 -154
- package/assets/vanilla/markup/Avatar.html +0 -24
- package/assets/vanilla/markup/Badge.html +0 -12
- package/assets/vanilla/markup/Banner.html +0 -49
- package/assets/vanilla/markup/Breadcrumbs.html +0 -38
- package/assets/vanilla/markup/Button.html +0 -37
- package/assets/vanilla/markup/Card.html +0 -16
- package/assets/vanilla/markup/CheckboxInput.html +0 -45
- package/assets/vanilla/markup/Collapsible.html +0 -9
- package/assets/vanilla/markup/DateInput.html +0 -42
- package/assets/vanilla/markup/Dialog.html +0 -45
- package/assets/vanilla/markup/Divider.html +0 -9
- package/assets/vanilla/markup/DropdownMenu.html +0 -30
- package/assets/vanilla/markup/EmptyState.html +0 -41
- package/assets/vanilla/markup/Heading.html +0 -9
- package/assets/vanilla/markup/HoverCard.html +0 -85
- package/assets/vanilla/markup/Layout.html +0 -35
- package/assets/vanilla/markup/Lightbox.html +0 -107
- package/assets/vanilla/markup/Link.html +0 -6
- package/assets/vanilla/markup/NumberInput.html +0 -55
- package/assets/vanilla/markup/ProgressBar.html +0 -101
- package/assets/vanilla/markup/RadioList.html +0 -90
- package/assets/vanilla/markup/Selector.html +0 -92
- package/assets/vanilla/markup/SideNav.html +0 -82
- package/assets/vanilla/markup/Skeleton.html +0 -26
- package/assets/vanilla/markup/Slider.html +0 -65
- package/assets/vanilla/markup/Stack.html +0 -13
- package/assets/vanilla/markup/StatusDot.html +0 -22
- package/assets/vanilla/markup/Switch.html +0 -47
- package/assets/vanilla/markup/TabList.html +0 -56
- package/assets/vanilla/markup/Table.html +0 -75
- package/assets/vanilla/markup/Text.html +0 -9
- package/assets/vanilla/markup/TextArea.html +0 -37
- package/assets/vanilla/markup/TextInput.html +0 -80
- package/assets/vanilla/markup/Theme.html +0 -48
- package/assets/vanilla/markup/TimeInput.html +0 -43
- package/assets/vanilla/markup/Toast.html +0 -42
- package/assets/vanilla/markup/Tooltip.html +0 -18
- package/assets/vanilla/markup/TopNav.html +0 -81
- package/assets/vanilla/markup/Typeahead.html +0 -60
- package/assets/vanilla/templates/dashboard.html +0 -462
- package/assets/vanilla/templates/detail-page.html +0 -536
- package/assets/vanilla/templates/form-two-column.html +0 -438
- package/assets/vanilla/templates/kanban-board.html +0 -443
- package/assets/vanilla/templates/login.html +0 -199
- package/assets/vanilla/templates/product-detail.html +0 -335
- package/assets/vanilla/templates/settings.html +0 -374
- package/assets/vanilla/templates/shell-side-nav.html +0 -440
- package/assets/vanilla/templates/table-filter.html +0 -514
- package/clients/cli/commands/vanilla-html.test.mjs +0 -245
- package/foundation/discovery/bundled-component-docs.d.mts +0 -39
- package/foundation/discovery/bundled-component-docs.mjs +0 -92
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# @xds/cli
|
|
2
2
|
|
|
3
|
+
# 0.6.6
|
|
4
|
+
|
|
5
|
+
#### New Features
|
|
6
|
+
|
|
7
|
+
- Add a shared `upload` icon, and use it for FileInput's upload affordance instead of the directional `arrowUp`
|
|
8
|
+
Themes draw `upload` through `icons.upload`, separately from `arrowUp`, so sort arrows and every other `arrowUp` use stay unchanged. Every bundled theme and theme template draws `upload` in its own icon style. FileInput keeps its icon size, placement, color, and accessibility in both modes; a theme with no `upload` artwork shows the default upload-into-tray glyph there.
|
|
9
|
+
|
|
10
|
+
A complete `IconRegistry` may still omit `upload` in this release. The next minor makes it required, so add an `upload` entry to any registry you type as `IconRegistry`.
|
|
11
|
+
|
|
12
|
+
- Templates declare their `keywords`, and `build` tells a part of a page from a page by the components the project can use (#6805)
|
|
13
|
+
- `build` chooses where to start with a checked-in table of word weights blended with the page ranker
|
|
14
|
+
- `astryx docs <route> --depth <levels>` reads as far down the docs tree as you ask, from one doc to everything below it.
|
|
15
|
+
`--depth 0` reads only the namespace you name, `--depth 1` adds the docs right below it (what a read without `--depth` shows), and `--depth all` goes to the bottom. With `--depth`, `--detail` sets how much of each doc below shows: `brief` (the default) is one line each, named by where it sits so you can open it, `compact` adds its sections, and `full` prints it whole. So `astryx docs cli --depth all` is a map of every CLI doc, and `astryx docs cli/integrations --depth all --detail full` prints the integration guides as one read. Where a read stops, a namespace says how many docs sit below it. `--json` returns the same tree as `docs.node`: each child carries its own `slots` while the read goes deeper, `childCount` where it stops, and its text at `compact` or `full`. `docs()` takes the same `depth` and `detail` options. Reads without `--depth` are unchanged.
|
|
16
|
+
- Point at `discover` where people look for things to add
|
|
17
|
+
Nothing an agent reads named `discover`, so agents asked to find a theme searched the package registry instead. The agent block `astryx init` writes now lists `discover <words>` (integrations you could add, and the ones you have), `theme list` ends with `More themes in packages you could add: astryx discover theme`, and a text search ends with `More in packages you could add: astryx discover <query>` (except `--type hook`, since no integration adds hooks). JSON output is unchanged.
|
|
18
|
+
- `integration add theme --from <base>` forks an existing theme as the starting point instead of a blank scaffold. The new theme copies the base's source files — renamed and rewritten for the new slug — with no link back. Use `--from` when you want to change a lot; for a small change that stays linked, use `extends` in `defineTheme`.
|
|
19
|
+
|
|
20
|
+
#### Fixes
|
|
21
|
+
|
|
22
|
+
- Say when a command did nothing: `upgrade` reports `sourcePathFound`, the integration checks report `validated`.
|
|
23
|
+
Two commands could legitimately do nothing and produce an envelope identical to a clean success. Both now carry the fact in a field of their own response instead of only in human text.
|
|
24
|
+
|
|
25
|
+
`astryx upgrade` defaults `--path` to `./src`. A project laid out as `app/` (or a typo) skipped every code codemod and still reported exit 0, `filesChanged: 0`, `errors: []` and "Upgrade complete". The only warning was a log line `--json` suppresses by design. `upgrade.run` now carries `sourcePathFound`, and the human completion line names the directory it did not find.
|
|
26
|
+
|
|
27
|
+
`astryx doctor integration validate|components|docs|templates` returned `{name: null, version: null, issues: []}` and exit 0 when no integration manifest was found — the same shape as a validated, healthy integration. All four envelopes now carry `validated`, false only when nothing was inspected.
|
|
28
|
+
|
|
29
|
+
- `astryx manifest --json` now takes each command's examples from its CommandDoc and its response types from the API function it wraps, so no example differs from the documented one and `upgrade` lists `upgrade.registry`, which `upgrade --registry --json` already emits.
|
|
30
|
+
- `astryx template <name> <path>` and `astryx layout expand` now say when they replaced Astryx demo media. The `template.copy` and `layout.expand` receipts carry `demoMediaReplaced`, the number of demo image and video references that became placeholders (one per reference, however many fixture paths its URL carries), and the text output names the file to update (when `layout expand` prints the code instead, the same line follows it as a comment, so the output is still valid TSX). Nothing about the copy itself changed.
|
|
31
|
+
- `astryx template <name>` and `template()` now return the same source that `astryx template <name> <path>` writes, and say how many Astryx demo media references they replaced. Demo images and videos that only Astryx's own previews serve are replaced the same way in both, so code copied from the printed source no longer points at media your project doesn't have. `template.show` gains `demoMediaReplaced` (0 when the template carried none); in text mode the count is stated on stderr so the printed source stays exact.
|
|
32
|
+
- A write that fails reports ERR_WRITE_FAILED instead of a raw Node errno.
|
|
33
|
+
`astryx template` into an unwritable directory returned `{"error": "EACCES: permission denied, open '/home/you/project/readonly/x.tsx'", "code": "ERR_UNKNOWN"}`, and `swizzle` returned the `mkdir` equivalent. Two things were wrong: ERR_WRITE_FAILED is already in the frozen error registry for exactly this case, and the message carried an absolute host path where every other Astryx message names its target relative to the project.
|
|
34
|
+
|
|
35
|
+
Both now throw ERR_WRITE_FAILED with the errno kept (it is the part that says what to fix) and the target named relative to the project. Nothing is left half-written: a `swizzle` that fails part-way removes the files it already copied and puts back any it replaced before it reports the error, and the message names any file it could not restore.
|
|
36
|
+
|
|
37
|
+
- When `discover --available` runs without a discover source, the CLI now
|
|
38
|
+
explains what discover sources are and where to find Astryx packages on npm, instead of the misleading message that told users to add package names they had no way to find. The base `discover` with no integrations also gains a pointer to npm and the integrations docs.
|
|
39
|
+
- A package with a namespace doc or a placed guide needs `@astryxdesign/cli` 0.6.4, not 0.7.0.
|
|
40
|
+
Published 0.6.4 reads an integration's docs tree: it lists the namespace and reads each guide placed in it. 0.6.3 rejects a namespace doc and hides every doc topic the package ships. `integration add doc --parent` wrote `"@astryxdesign/cli": ">=0.7.0"`, a range no released CLI satisfies, and `integration verify` failed a docs-tree package whose CLI peer started at 0.6.4. `integration add doc --parent` now writes `">=0.6.4"`, marked optional, and `integration verify` accepts it. A template that sets `replaces` or `keywords` still needs `">=0.7.0"`.
|
|
41
|
+
- `gap-report` fails when a listed integration cannot load, instead of reporting a clean result.
|
|
42
|
+
An integration whose `astryx.integration` module throws on import or fails validation was left out of the handler set. With no other handler, the report fell through to the built-in GitHub fallback for Core: the command exited 0 with `consent_required`, printed nothing on stderr, and offered `--confirm-public` to file on Core's public tracker a report the integration might have been meant to receive.
|
|
43
|
+
|
|
44
|
+
The unloadable integration now records a failed delivery in its config position, with the load error and the fix in its message. Like any handler, it turns the fallback off, so the report never goes to another package's tracker. The command exits 1, and a failed or partial report now prints each failed delivery on stderr as well as in the receipt.
|
|
45
|
+
|
|
46
|
+
- `astryx integration add theme <name> --from <base>` now adds the packages the copied theme files import to `dependencies`.
|
|
47
|
+
A fork of a bundled theme such as `neutral` copies its `icons.tsx`, which imports `lucide-react`, but the package did not declare it. So `astryx theme build` on the fork failed with "Cannot find module 'lucide-react'", and an app that installed the package hit the same error. `--from` now adds each package the copied files import, at the range the bundled themes use. It leaves out Core and React, which every Astryx app already has, and anything the package already declares.
|
|
48
|
+
- `astryx integration pack` without `--check` now points only at `astryx integration verify`.
|
|
49
|
+
It used to say "Pass --check to verify the integration tarball, or run `astryx integration verify`", which sent people to the deprecated spelling. It now says that `integration pack` is now `integration verify`, and that `npm pack` builds the tarball. The error code and exit code are unchanged, and `integration pack --check` still runs the same check as before.
|
|
50
|
+
- Search: differentiate all-word matches by total quality; index themes
|
|
51
|
+
Within the all-words tier, every candidate whose strongest token hit was a keyword scored the same (e.g. 157), regardless of how the other query words matched. A doc matching both words by keyword outranked nothing, and `search "how to use a theme"` put API reference docs above the consumer theme guide.
|
|
52
|
+
|
|
53
|
+
The bonus now uses the sum of ALL token scores instead of just the strongest, so a candidate matching every word by keyword outranks one matching keyword + prose. The `theme` doc also gains consumer-facing keywords so it surfaces for questions like "how to use a theme" and "how to apply a theme".
|
|
54
|
+
|
|
55
|
+
Themes are now a search domain: bundled and integration-provided themes appear in results with their slug, displayName, package, and the `astryx theme add` command. `--type theme` filters to them. Like `--type doc`, it works outside an app, where an open search now covers the docs and themes. Search help, the manifest, and the API reference list the new domain and its result fields.
|
|
56
|
+
|
|
57
|
+
- Search ranks a theme's description as prose, not as keywords
|
|
58
|
+
A word a theme shares with your query only through its description, such as `minimal`, `focus` or `content`, now ranks the theme like any other description instead of like a declared keyword, so it no longer lands above the components, hooks and docs that declare that word. A theme still comes first for its own slug or display name: `astryx search neutral` finds the Neutral theme first.
|
|
59
|
+
- A package that ships a theme or a doc section `id` needs `@astryxdesign/cli` 0.6.4, not 0.7.0.
|
|
60
|
+
Published 0.6.4 reads typed theme descriptors and section ids; 0.6.3 rejects both and hides the package's themes or doc topics. The 0.6.5 notes said a stable CLI before 0.7.0 rejects them, so `integration add theme` wrote `"@astryxdesign/cli": ">=0.7.0"`, a range no released CLI satisfies, and `integration verify` failed a theme or section-id package whose CLI peer started at 0.6.4. `integration add theme` now writes `">=0.6.4"`, marked optional, and `integration verify` accepts it for themes and section ids. A template that sets `replaces` or `keywords` still needs `">=0.7.0"`.
|
|
61
|
+
- `theme build` resolves real icon imports from the selected theme instead of matching comment or string contents. Generated modules preserve named, aliased, default, and namespace registry imports, plus inherited icons with child overrides. Normal builds and `--check` reject unsupported inline registries with `ERR_THEME_INVALID` before generating or writing output. Move such a registry into its own module and import it into the theme file.
|
|
62
|
+
- `astryx theme build` in an app uses the app's installed `@astryxdesign/core`, and says to install Core when there is none.
|
|
63
|
+
Run one-off with `npx @astryxdesign/cli`, it failed with "Build @astryxdesign/core first (e.g. `pnpm -F @astryxdesign/core build`)" even when the app had Core installed, because it looked for Core only next to the CLI. It now generates with the Core the project installed, the same Core the app's `<Theme>` runs on. In an app without Core, the error now says to install it (`npm install @astryxdesign/core`). The build command stays only for the Astryx repository itself. The error code (`ERR_CORE_NOT_FOUND`) is unchanged.
|
|
64
|
+
|
|
65
|
+
#### Other Changes
|
|
66
|
+
|
|
67
|
+
- `TemplateDoc` gains an optional `keywords` list: the ideas, domains, and other names a builder might use for what the template serves. `parseTemplate` validates it, discovery carries it from every template source, `astryx search` matches it as it matches a template's description, and `astryx build` ranks page templates on it. Each Core page template's closing list of ideas moved out of its `description` into `keywords`, so descriptions describe the layout.
|
|
68
|
+
- `build` starts a part of a page where it lives (`spec:AST-048` FR3), and the project's own components say what a part is: an idea whose head noun is a word of a component's name or keywords, Core's or an integration's, asks for a part, unless the noun names a family of page templates or the idea lists three or more pieces. A part starts from the base template of the family the idea names, else from the app shell; a change to an existing page or part (an idea whose "existing" names a page family or a component, such as "the existing table", and that does not ask for a new page) starts from the app shell. The start's reason says which case applies and why.
|
|
69
|
+
- A family's base template leads its family unless a variant matches two terms of its own; a base that cannot start on its own never displaces the variant that leads.
|
|
70
|
+
|
|
71
|
+
Integration templates that set `keywords` need `@astryxdesign/cli` 0.7.0 or later. The template metadata object is strict, so a stable CLI before 0.7.0 rejects the field, drops that template, and hides the package's doc topics; only `template --list` and `search` print a warning. `integration verify` fails a package whose template sets `keywords` until it declares `@astryxdesign/cli >=0.7.0`, as it does for `replaces`.
|
|
72
|
+
|
|
73
|
+
- `api/build/kit/weights.mjs` scores each candidate start (the app shell and every ready page template) from the idea's stemmed words using the tables in `weights.json`, and blends those scores with the ranker's own. The blend decides the start of every whole page; a part or an edit starts where it did before, and the ranker's pick of a template the tables do not list stands. Without a weights file the ranker's pick stands. The response's shape is unchanged.
|
|
74
|
+
|
|
75
|
+
#### Contributors
|
|
76
|
+
|
|
77
|
+
Thanks to everyone who contributed to this release:
|
|
78
|
+
|
|
79
|
+
- @AstryxBot
|
|
80
|
+
- @cixzhang
|
|
81
|
+
- @jiunshinn
|
|
82
|
+
- @josephfarina
|
|
83
|
+
- @rubyycheung
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
3
87
|
# 0.6.5
|
|
4
88
|
|
|
5
89
|
#### New Features
|
package/README.md
CHANGED
|
@@ -15,31 +15,6 @@ npx @astryxdesign/cli template --list
|
|
|
15
15
|
|
|
16
16
|
Once it's a project dependency (`npm install -D @astryxdesign/cli`), drop the scope and use the shorter `astryx` — e.g. `npx astryx component Button` or `pnpm exec astryx component Button`. Bare `astryx` resolves to an unrelated npm package until the CLI is installed, so prefer the scoped form above for first-run/one-off use.
|
|
17
17
|
|
|
18
|
-
## Install the preview CLI
|
|
19
|
-
|
|
20
|
-
Install the self-contained vanilla HTML preview from its immutable commit:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm install -g https://cdn.jsdelivr.net/gh/facebook/astryx@9bd9b20ef7dd4c91d72e7e0d0bbe03b48750dccb/packages/vanilla/dist/cli/astryx-cli-vanilla.tgz
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
The preview package is `@astryxdesign/cli@0.6.5-vanilla.3eb9597f5`; it is not published to npm.
|
|
27
|
-
|
|
28
|
-
## Choosing a framework
|
|
29
|
-
|
|
30
|
-
`component` and `template` default to the React catalog. Use `--framework html`
|
|
31
|
-
for the no-build vanilla markup, or `--framework web-components` for the
|
|
32
|
-
custom-element markup. Both alternatives support named reads and `--list`:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
astryx component Button --framework html
|
|
36
|
-
astryx component Button --framework web-components
|
|
37
|
-
astryx template dashboard --framework html
|
|
38
|
-
astryx template dashboard --framework web-components
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
`--html` remains a deprecated alias for `--framework html`.
|
|
42
|
-
|
|
43
18
|
## Reading the CLI's own docs
|
|
44
19
|
|
|
45
20
|
The CLI documents itself, so these commands print what the installed version does:
|
|
@@ -103,24 +78,24 @@ Options:
|
|
|
103
78
|
|
|
104
79
|
<!-- BEGIN GENERATED: commands -->
|
|
105
80
|
|
|
106
|
-
| Command | Description
|
|
107
|
-
| ------------- |
|
|
108
|
-
| `blog` | Read the Astryx blog from the published feed
|
|
109
|
-
| `build` | Build a page: the template to start from, or the workflow playbook (no query)
|
|
110
|
-
| `component` | List components or print component docs
|
|
111
|
-
| `discover` | Browse and search integrations: the ones you have and the ones you could add
|
|
112
|
-
| `docs` | Print reference docs
|
|
113
|
-
| `doctor` | Diagnose Astryx projects and integration packages
|
|
114
|
-
| `gap-report` | Report a missing component or feature to the package that owns it
|
|
115
|
-
| `hook` | List hooks or print hook docs
|
|
116
|
-
| `init` | Initialize the design system in your project
|
|
117
|
-
| `integration` | Author and verify an Astryx integration package
|
|
118
|
-
| `layout` | Generate XDS layouts from compressed expressions (XLE/XLO)
|
|
119
|
-
| `search` | Search components, hooks, docs, templates, and themes in one ranked list
|
|
120
|
-
| `swizzle` | Copy component source for customization
|
|
121
|
-
| `template` | List, show,
|
|
122
|
-
| `theme` |
|
|
123
|
-
| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components
|
|
81
|
+
| Command | Description |
|
|
82
|
+
| ------------- | ----------------------------------------------------------------------------- |
|
|
83
|
+
| `blog` | Read the Astryx blog from the published feed |
|
|
84
|
+
| `build` | Build a page: the template to start from, or the workflow playbook (no query) |
|
|
85
|
+
| `component` | List components or print component docs |
|
|
86
|
+
| `discover` | Browse and search integrations: the ones you have and the ones you could add |
|
|
87
|
+
| `docs` | Print reference docs |
|
|
88
|
+
| `doctor` | Diagnose Astryx projects and integration packages |
|
|
89
|
+
| `gap-report` | Report a missing component or feature to the package that owns it |
|
|
90
|
+
| `hook` | List hooks or print hook docs |
|
|
91
|
+
| `init` | Initialize the design system in your project |
|
|
92
|
+
| `integration` | Author and verify an Astryx integration package |
|
|
93
|
+
| `layout` | Generate XDS layouts from compressed expressions (XLE/XLO) |
|
|
94
|
+
| `search` | Search components, hooks, docs, templates, and themes in one ranked list |
|
|
95
|
+
| `swizzle` | Copy component source for customization |
|
|
96
|
+
| `template` | List, show, or scaffold page and block templates |
|
|
97
|
+
| `theme` | Add, switch, build, and author themes |
|
|
98
|
+
| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components |
|
|
124
99
|
|
|
125
100
|
<!-- END GENERATED: commands -->
|
|
126
101
|
<!-- Generated by scripts/generate-cli-readme.mjs from `astryx manifest`. Run `pnpm -F @astryxdesign/cli readme`. -->
|
|
@@ -129,7 +104,7 @@ Options:
|
|
|
129
104
|
|
|
130
105
|
`--json` works with every command listed in `jsonSupported` (`astryx manifest --json`), which is every command except the bare groups such as `astryx theme`. The other four change only the reads named here; other commands ignore them:
|
|
131
106
|
|
|
132
|
-
- `--json`: Output as typed JSON envelope: `{ apiVersion, type, data, meta? }` (errors: `{ apiVersion, error, code, suggestions? }`)
|
|
107
|
+
- `--json`: Output as typed JSON envelope: `{ apiVersion, type, package?, data, meta? }` (errors: `{ apiVersion, error, code, suggestions? }`)
|
|
133
108
|
- `--detail <level>`: Detail level for `component`, `hook`, and docs tree reads (such as `astryx docs cli/commands/build`), increasing in size: `brief` (names only, default for lists) < `compact` (names + 1-line descriptions) < `full` (full docs per entry). Single-item views default to `full`.
|
|
134
109
|
- `--zh`: Simplified Chinese for component reads and for docs topics that have a translation (English otherwise)
|
|
135
110
|
- `--dense`: Token-efficient dense text for `astryx component <Name>` and `astryx docs <topic>`
|
|
@@ -449,22 +424,18 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
449
424
|
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
450
425
|
| `init.run` | The install receipt: the `mode` (`default` \| `features`), the features run, agent-doc files written, any soft `docsError`, whether theme guidance was emitted, the template outcome (`workflow` \| `created` \| `skipped`) plus its path, and whether the next-steps were emitted. |
|
|
451
426
|
| `init.remove` | Confirmation that the managed agent-docs block was removed (`data.removed: true`) — returned when --remove-agents is set. |
|
|
452
|
-
| `component.list` | The component catalog grouped by component group (each component's group field): `detail` (the level: names \| compact \| full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries, or a full ComponentDoc per entry.
|
|
427
|
+
| `component.list` | The component catalog grouped by component group (each component's group field): `detail` (the level: names \| compact \| full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries ({name, package, description, import}), or a full ComponentDoc per entry with its package. |
|
|
453
428
|
| `component.batch` | The component specialization of the shared `BatchResponse` and `BatchRow` types. An explicit programmatic selector array, or two or more CLI selectors, returns one ordered receipt: `count` plus `results`, one row per selector including duplicates. Every row carries `selector` and `status` (found \| not_found \| ambiguous \| error). A found row carries `result`, the same {type, data} response as one selector. An ambiguous row carries `code`, `error`, and `candidates` ({package, component, kind, installed}). Other failed rows carry `code`, `error`, and optional `suggestions` ({name, reason}). |
|
|
454
|
-
| `component.detail` | One component's authored ComponentDoc plus ownership fields (package, the owner; import, the specifier; sourceAvailable, whether source exists) and parentDoc (present when the component is documented inside another component's doc, naming that doc).
|
|
455
|
-
| `component.detail.props` | Just one component's props table (ComponentPropDoc[]).
|
|
456
|
-
| `component.detail.source` | One component's source file, as {component, source}.
|
|
457
|
-
| `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}.
|
|
458
|
-
| `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry.
|
|
459
|
-
| `component.html.list` | The sorted packages/vanilla/markup files as {name, file}. |
|
|
460
|
-
| `component.html` | One vanilla component markup file as {component, file, source}, preserving docs and variant comments verbatim. |
|
|
461
|
-
| `component.web-components.list` | The sorted packages/vanilla/elements-markup files as {name, file}. |
|
|
462
|
-
| `component.web-components` | One vanilla web-component markup file as {component, file, source}, preserving generated docs and variant comments verbatim. |
|
|
429
|
+
| `component.detail` | One component's authored ComponentDoc plus ownership fields (package, the owner; import, the specifier; sourceAvailable, whether source exists) and parentDoc (present when the component is documented inside another component's doc, naming that doc). The envelope's package names the same owner. |
|
|
430
|
+
| `component.detail.props` | Just one component's props table (ComponentPropDoc[]). The envelope's package names the npm package that owns the component. |
|
|
431
|
+
| `component.detail.source` | One component's source file, as {component, source}. The envelope's package names the npm package that owns the component. |
|
|
432
|
+
| `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. The envelope's package names the npm package that owns the component. |
|
|
433
|
+
| `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry ({name, package, displayName, description, isShowcase, category}); each block names the package that owns it, and the envelope's package names the component's owner. |
|
|
463
434
|
| `docs.list` | All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load. |
|
|
464
|
-
| `docs.detail` | One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there).
|
|
465
|
-
| `docs.index` | One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, summary} (pass the id as the section argument; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there).
|
|
466
|
-
| `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open its topic index and the sections before and after it).
|
|
467
|
-
| `docs.node` | One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names).
|
|
435
|
+
| `docs.detail` | One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined and each section naming the package that wrote it, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
|
|
436
|
+
| `docs.index` | One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, package, summary} (pass the id as the section argument; package is the npm package that wrote the section; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
|
|
437
|
+
| `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open its topic index and the sections before and after it). The envelope's package names the npm package that wrote the section. |
|
|
438
|
+
| `docs.node` | One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down, each naming its package) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names). |
|
|
468
439
|
| `blog.list` | The feed URL plus every post parsed from the RSS feed, each with slug, title, description, date, type, authors, link, and plaintext URL. |
|
|
469
440
|
| `blog.detail` | One post's metadata plus the feed URL and the post's full plaintext body. |
|
|
470
441
|
| `discover.list` | The integrations the project loads (name, category, components, version, a list per other kind they add, and latest when a source knows it); with a discover source, meta.available lists what the project could add and meta.sources reports each source; when empty it carries meta.configured to tell "nothing configured" from "nothing discovered". |
|
|
@@ -472,34 +443,32 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
472
443
|
| `discover.detail.doc` | The validated ComponentDoc for one installed component, for an @scope/name/Component query. |
|
|
473
444
|
| `discover.item` | One item that is not an installed component, for an @scope/name/<item> query: its kind, name, package, version, and whether the project has the package. |
|
|
474
445
|
| `discover.search` | The echoed query plus every matching item and package across all packages, each with its kind and whether the project has it, even when only one matches; total is set when --limit cut the list. |
|
|
475
|
-
| `search` | The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, score, reason, description, command}, plus import (components, hooks), title, parent (the command that opens the level above),
|
|
446
|
+
| `search` | The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, package, score, reason, description, command} (package is the npm package that owns the result), plus import (components, hooks), title, parent (the command that opens the level above), and, for a hit on one section, section (docs), or displayName and kind (templates). |
|
|
476
447
|
| `build.help` | The how-to-build-a-page playbook, emitted when no query is given: `playbook: true`, a title, the ordered steps (title, commands, optional returns), the on-system rules, and related lookups. Commands are bare subcommands for the caller to render with its own invocation. |
|
|
477
|
-
| `build.kit` | The template to start from and its kit: query, hasResults, matchCount (never a cap), directMatch, start {name, command, basis, reason, alternatives, ...}, pages (search's closest templates), blocks and domain as SearchResultEntry[], frame
|
|
478
|
-
| `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core.
|
|
479
|
-
| `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling.
|
|
448
|
+
| `build.kit` | The template to start from and its kit: query, hasResults, matchCount (never a cap), directMatch, start {name, package, command, basis, reason, alternatives, ...} (the start and each alternative name the package that owns the template), pages (search's closest templates), blocks and domain as SearchResultEntry[] (each naming its package), frame and foundation (Core component names), and hint {reason, commands} when thin. |
|
|
449
|
+
| `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. The envelope's package is @astryxdesign/core. |
|
|
450
|
+
| `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling. The envelope's package names the same owning package. |
|
|
480
451
|
| `gap-report.categories` | The fixed gap category values and human-readable labels. |
|
|
481
452
|
| `gap-report.file` | An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project \| integration \| fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals. |
|
|
482
453
|
| `template.list` | The effective discovered TemplateListEntry[] for pages and blocks. A winning replacement entry includes optional `replaces`, naming the Core id omitted from the default list. |
|
|
483
454
|
| `template.show` | 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 were replaced with placeholders for you to swap for your own media). |
|
|
484
|
-
| `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes.
|
|
485
|
-
| `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media).
|
|
455
|
+
| `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. The envelope's package names the npm package that owns the template. |
|
|
456
|
+
| `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media). The envelope's package names the npm package that owns the template. |
|
|
486
457
|
| `template.cdn` | A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
|
|
487
|
-
| `
|
|
488
|
-
| `
|
|
489
|
-
| `
|
|
490
|
-
| `
|
|
491
|
-
| `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. |
|
|
492
|
-
| `hook.detail` | One hook's full authored HookDoc. |
|
|
493
|
-
| `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). |
|
|
494
|
-
| `theme.build` | A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load). |
|
|
458
|
+
| `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. The envelope's package is @astryxdesign/core, the only package that ships hooks. |
|
|
459
|
+
| `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core. |
|
|
460
|
+
| `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). The envelope's package is @astryxdesign/core. |
|
|
461
|
+
| `theme.build` | A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, cssDts, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load). |
|
|
495
462
|
| `theme.build.check` | The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing \| outdated}), and the full list of checked paths. Writes nothing. |
|
|
496
463
|
| `theme.build.batch` | Several themes built in one invocation: `count` plus one {file, receipt} per theme in argument order, where receipt is that theme's theme.build (or theme.build.check) envelope, or null when it produced no CSS. |
|
|
497
|
-
| `theme.list` | Every bundled
|
|
498
|
-
| `theme.add` |
|
|
464
|
+
| `theme.list` | Every bundled, installed package, and local theme as a ThemeListEntry[]. Each entry has slug, displayName, description, maintained, owner package or local root, source, added, and default fields. Optional meta.unmigratedCopies names earlier descriptor-less copies, their missing descriptor, and the upgrade command; those copies are not data entries. |
|
|
465
|
+
| `theme.add` | The released source-copy receipt: slug, displayName, maintained flag, owner package, outputDir, source entry, exportName, and files. Its additive meta.deprecations entry names DEP-0005 and the source-fork/import replacements. |
|
|
466
|
+
| `theme.app` | The app theme record after add, remove, or use. It includes every added theme and its built imports, the default slug, generated module path, and the command change. After add, the envelope package names the npm package that owns the added theme; a local theme has none. |
|
|
467
|
+
| `theme.eject` | A local source-fork receipt with the resolved slug, displayName, source theme maintained flag, source-selector package, outputDir, source entry, exportName, and every file written, including the descriptor. The written local descriptor always uses maintained: false. |
|
|
499
468
|
| `theme.template` | A write receipt for the annotated theme template: the path (relative to cwd), whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
|
|
500
469
|
| `theme.targets` | The whole themeable surface: the echoed filter, componentCount, and targets, one per theming target — {key, className, component, props, states, deprecatedFor?}, where props and states are its legal override keys and deprecatedFor names the canonical replacement key. |
|
|
501
470
|
| `theme.palette.generate` | An author-reviewable OKLCH palette candidate, its reproducibility receipt, summary counts, and optional candidate/receipt file-write result. |
|
|
502
|
-
| `upgrade.list` | Every available codemod, oldest→newest, as {name, title, version, optional}; returned for --list without running anything.
|
|
471
|
+
| `upgrade.list` | Every available codemod, oldest→newest, as {name, package, title, version, optional}; returned for --list without running anything. |
|
|
503
472
|
| `upgrade.registry` | The copied-composition receipt for --registry: applied, ok, the counts (found, current, wouldUpdate, updated, wouldMerge, merged, wouldRefreshReceipt, receiptsRefreshed, conflicts, missing, invalid, failed), and items. |
|
|
504
473
|
| `upgrade.status` | A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary. |
|
|
505
474
|
| `upgrade.run` | The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, sourcePathFound (false when the resolved source directory does not exist, so no source file was read), and (apply mode) filesChanged, transformsApplied, and per-codemod errors. |
|
package/api/build/_adapter.d.mts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @property {string} command `astryx template <id> --type page`, the command that selects exactly this template: an integration replacement is selected by the Core id it replaces, and `--type page` keeps a block with the same id from making it ambiguous. Search prints template commands the same way.
|
|
9
9
|
* @property {string} displayName Human-facing name.
|
|
10
10
|
* @property {string} description What the page is and how it is laid out.
|
|
11
|
+
* @property {string} package The npm package that owns this template.
|
|
11
12
|
* @property {string} category The template's own `Family - Variant` label; empty when it declares none.
|
|
12
13
|
* @property {string[]} keywords The ideas the page serves, as its own descriptor names them; empty when it declares none.
|
|
13
14
|
*/
|
|
@@ -40,6 +41,20 @@ export function loadPageTemplates(cwd: string): Promise<PageTemplate[]>;
|
|
|
40
41
|
* @returns {Promise<ComponentWords[]>}
|
|
41
42
|
*/
|
|
42
43
|
export function loadComponents(cwd: string): Promise<ComponentWords[]>;
|
|
44
|
+
/**
|
|
45
|
+
* The matcher weights checked in beside the kit (`kit/weights.json`), read
|
|
46
|
+
* once; null when the file is absent or unreadable.
|
|
47
|
+
* @returns {import('./kit/weights.mjs').WeightsFile | null}
|
|
48
|
+
*/
|
|
49
|
+
export function loadWeights(): import("./kit/weights.mjs").WeightsFile | null;
|
|
50
|
+
/**
|
|
51
|
+
* Whether a parsed weights file has the shape the kit reads: every row has a
|
|
52
|
+
* weight per candidate, every bias a number per candidate, and three blend
|
|
53
|
+
* numbers per member (the tables plus the ranker) and one for the shell.
|
|
54
|
+
* @param {any} file
|
|
55
|
+
* @returns {file is import('./kit/weights.mjs').WeightsFile}
|
|
56
|
+
*/
|
|
57
|
+
export function isWeightsFile(file: any): file is import("./kit/weights.mjs").WeightsFile;
|
|
43
58
|
/**
|
|
44
59
|
* A page template the kit can recommend starting from.
|
|
45
60
|
*/
|
|
@@ -60,6 +75,10 @@ export type PageTemplate = {
|
|
|
60
75
|
* What the page is and how it is laid out.
|
|
61
76
|
*/
|
|
62
77
|
description: string;
|
|
78
|
+
/**
|
|
79
|
+
* The npm package that owns this template.
|
|
80
|
+
*/
|
|
81
|
+
package: string;
|
|
63
82
|
/**
|
|
64
83
|
* The template's own `Family - Variant` label; empty when it declares none.
|
|
65
84
|
*/
|
package/api/build/_adapter.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file The build subject's environment access: the page templates a project
|
|
5
|
-
* can scaffold,
|
|
5
|
+
* can scaffold, the components it can use, and the checked-in matcher weights.
|
|
6
6
|
*
|
|
7
7
|
* @input Template and component discovery for `cwd` — the CLI's own templates
|
|
8
8
|
* and Core's components, plus any that the project's configured integrations
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
* from the template subject's, components from search's.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import fs from 'node:fs';
|
|
20
|
+
|
|
19
21
|
import {discoverTemplates} from '../template/template.mjs';
|
|
20
22
|
import {componentKeywords} from '../search/search.mjs';
|
|
21
23
|
import {findCoreDir} from '../../foundation/fs/paths.mjs';
|
|
@@ -27,6 +29,7 @@ import {findCoreDir} from '../../foundation/fs/paths.mjs';
|
|
|
27
29
|
* @property {string} command `astryx template <id> --type page`, the command that selects exactly this template: an integration replacement is selected by the Core id it replaces, and `--type page` keeps a block with the same id from making it ambiguous. Search prints template commands the same way.
|
|
28
30
|
* @property {string} displayName Human-facing name.
|
|
29
31
|
* @property {string} description What the page is and how it is laid out.
|
|
32
|
+
* @property {string} package The npm package that owns this template.
|
|
30
33
|
* @property {string} category The template's own `Family - Variant` label; empty when it declares none.
|
|
31
34
|
* @property {string[]} keywords The ideas the page serves, as its own descriptor names them; empty when it declares none.
|
|
32
35
|
*/
|
|
@@ -63,6 +66,7 @@ export async function loadPageTemplates(cwd) {
|
|
|
63
66
|
name: t.dirName,
|
|
64
67
|
displayName: t.displayName || t.name,
|
|
65
68
|
description: t.description || '',
|
|
69
|
+
package: t.package ?? '@astryxdesign/core',
|
|
66
70
|
category: t.category || '',
|
|
67
71
|
keywords: t.keywords ?? [],
|
|
68
72
|
// The id `template()` resolves back to this entry: an active replacement
|
|
@@ -89,3 +93,58 @@ export async function loadComponents(cwd) {
|
|
|
89
93
|
return [];
|
|
90
94
|
}
|
|
91
95
|
}
|
|
96
|
+
|
|
97
|
+
/** @type {import('./kit/weights.mjs').WeightsFile | null | undefined} */
|
|
98
|
+
let weights;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The matcher weights checked in beside the kit (`kit/weights.json`), read
|
|
102
|
+
* once; null when the file is absent or unreadable.
|
|
103
|
+
* @returns {import('./kit/weights.mjs').WeightsFile | null}
|
|
104
|
+
*/
|
|
105
|
+
export function loadWeights() {
|
|
106
|
+
if (weights === undefined) {
|
|
107
|
+
try {
|
|
108
|
+
const file = JSON.parse(
|
|
109
|
+
fs.readFileSync(new URL('./kit/weights.json', import.meta.url), 'utf8'),
|
|
110
|
+
);
|
|
111
|
+
weights = isWeightsFile(file) ? file : null;
|
|
112
|
+
} catch {
|
|
113
|
+
weights = null;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return weights ?? null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Whether a parsed weights file has the shape the kit reads: every row has a
|
|
121
|
+
* weight per candidate, every bias a number per candidate, and three blend
|
|
122
|
+
* numbers per member (the tables plus the ranker) and one for the shell.
|
|
123
|
+
* @param {any} file
|
|
124
|
+
* @returns {file is import('./kit/weights.mjs').WeightsFile}
|
|
125
|
+
*/
|
|
126
|
+
export function isWeightsFile(file) {
|
|
127
|
+
const n = Array.isArray(file?.candidates) ? file.candidates.length : 0;
|
|
128
|
+
return (
|
|
129
|
+
n > 0 &&
|
|
130
|
+
Array.isArray(file.tables) &&
|
|
131
|
+
file.tables.length > 0 &&
|
|
132
|
+
file.tables.every(
|
|
133
|
+
(/** @type {any} */ t) =>
|
|
134
|
+
Array.isArray(t?.words) &&
|
|
135
|
+
Array.isArray(t.rows) &&
|
|
136
|
+
t.rows.length === t.words.length &&
|
|
137
|
+
t.rows.every(
|
|
138
|
+
(/** @type {any} */ r) => typeof r === 'string' && r.length === n,
|
|
139
|
+
) &&
|
|
140
|
+
Array.isArray(t.bias) &&
|
|
141
|
+
t.bias.length === n &&
|
|
142
|
+
t.bias.every((/** @type {any} */ b) => Number.isFinite(b)) &&
|
|
143
|
+
Number.isFinite(t.clip) &&
|
|
144
|
+
Number.isFinite(t.step),
|
|
145
|
+
) &&
|
|
146
|
+
Array.isArray(file.blend) &&
|
|
147
|
+
file.blend.length === 3 * (file.tables.length + 1) + 1 &&
|
|
148
|
+
file.blend.every((/** @type {any} */ x) => Number.isFinite(x))
|
|
149
|
+
);
|
|
150
|
+
}
|
package/api/build/build.test.mjs
CHANGED
|
@@ -269,7 +269,7 @@ describe('build kit — a thin kit says what to try next', () => {
|
|
|
269
269
|
// A skeleton is a 35-line excerpt: a reader who studies it and composes
|
|
270
270
|
// the rest loses the spacing the template exists to carry. A loose match
|
|
271
271
|
// is still the best start there is, so `start` scaffolds it.
|
|
272
|
-
const r = await build('
|
|
272
|
+
const r = await build('weekly business review with targets', {cwd: REPO});
|
|
273
273
|
expect(r.type).toBe('build.kit');
|
|
274
274
|
if (r.type !== 'build.kit') return;
|
|
275
275
|
expect(r.data.directMatch).toBe(false);
|
|
@@ -477,6 +477,79 @@ describe('build kit — every page starts from a template', () => {
|
|
|
477
477
|
expect(r.data.pages.map(p => p.name)).not.toContain('side-gallery');
|
|
478
478
|
});
|
|
479
479
|
|
|
480
|
+
it('names a direct match the start does not use, and calls the start direct only when it is', async () => {
|
|
481
|
+
for (const idea of ['a login form', 'a docs site for our API', 'contact form']) {
|
|
482
|
+
const r = await build(idea, {cwd: REPO});
|
|
483
|
+
if (r.type !== 'build.kit') throw new Error(r.type);
|
|
484
|
+
expect(r.data.directMatch).toBe(true);
|
|
485
|
+
const match = r.data.pages[0].name;
|
|
486
|
+
if (r.data.start?.name === match) {
|
|
487
|
+
expect(r.data.start?.basis).toBe('direct');
|
|
488
|
+
} else {
|
|
489
|
+
expect(['closest', 'fallback']).toContain(r.data.start?.basis);
|
|
490
|
+
expect(r.data.start?.reason).toContain(`\`${match}\``);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
it('keeps a template search matched directly rather than the app shell', async () => {
|
|
496
|
+
for (const [idea, name] of [
|
|
497
|
+
['a login screen', 'login'],
|
|
498
|
+
['a checkout wizard', 'checkout-wizard'],
|
|
499
|
+
]) {
|
|
500
|
+
const r = await build(idea, {cwd: REPO});
|
|
501
|
+
if (r.type !== 'build.kit') throw new Error(r.type);
|
|
502
|
+
expect(r.data.directMatch).toBe(true);
|
|
503
|
+
expect(r.data.start?.name).toBe(name);
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
it('lets the weights choose another template over a direct match', async () => {
|
|
508
|
+
const r = await build('a login form', {cwd: REPO});
|
|
509
|
+
if (r.type !== 'build.kit') throw new Error(r.type);
|
|
510
|
+
expect(r.data.directMatch).toBe(true);
|
|
511
|
+
const match = r.data.pages[0].name;
|
|
512
|
+
expect(r.data.start?.name).not.toBe('shell-top-nav');
|
|
513
|
+
expect(r.data.start?.name).not.toBe(match);
|
|
514
|
+
expect(r.data.start?.reason).toContain(`\`${match}\``);
|
|
515
|
+
});
|
|
516
|
+
|
|
517
|
+
it('starts a part that names no page from the app shell', async () => {
|
|
518
|
+
for (const idea of ['a kanban card', 'a date range picker']) {
|
|
519
|
+
const r = await build(idea, {cwd: REPO});
|
|
520
|
+
if (r.type !== 'build.kit') throw new Error(r.type);
|
|
521
|
+
expect(r.data.start).toMatchObject({name: 'shell-top-nav', basis: 'fallback'});
|
|
522
|
+
expect(r.data.start?.reason).toMatch(/part of a page/);
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
it('does not keep a loose match over the app shell', async () => {
|
|
527
|
+
// Search matches no template directly, so the ranker's closest page does
|
|
528
|
+
// not override the shell the weights choose.
|
|
529
|
+
const r = await build('quarterly business review', {cwd: REPO});
|
|
530
|
+
if (r.type !== 'build.kit') throw new Error(r.type);
|
|
531
|
+
expect(r.data.directMatch).toBe(false);
|
|
532
|
+
expect(r.data.start).toMatchObject({name: 'shell-top-nav', basis: 'fallback'});
|
|
533
|
+
expect(r.data.start?.reason).toMatch(/closest/);
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
it('starts a new page with no matching template from the app shell', async () => {
|
|
537
|
+
const r = await build('a new page', {cwd: REPO});
|
|
538
|
+
if (r.type !== 'build.kit') throw new Error(r.type);
|
|
539
|
+
expect(r.data.start?.name).toBe('shell-top-nav');
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
it('starts a page the words describe from its template', async () => {
|
|
543
|
+
for (const [idea, name] of [
|
|
544
|
+
['a weekly report of sales by region', 'dashboard-scorecard'],
|
|
545
|
+
['a pricing page with three plans and a comparison table', 'table-comparison'],
|
|
546
|
+
]) {
|
|
547
|
+
const r = await build(idea, {cwd: REPO});
|
|
548
|
+
if (r.type !== 'build.kit') throw new Error(r.type);
|
|
549
|
+
expect(r.data.start?.name).toBe(name);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
|
|
480
553
|
it('starts a component in a container from a template with that frame', async () => {
|
|
481
554
|
// "in a modal": the modal is the frame, so the dialog template leads
|
|
482
555
|
// instead of the app shell.
|
|
@@ -60,6 +60,10 @@ export type BuildStart = {
|
|
|
60
60
|
* What the page is: its layout and the ideas it serves.
|
|
61
61
|
*/
|
|
62
62
|
description: string;
|
|
63
|
+
/**
|
|
64
|
+
* The npm package that owns this template.
|
|
65
|
+
*/
|
|
66
|
+
package: string;
|
|
63
67
|
/**
|
|
64
68
|
* The scaffold command that selects exactly this template, `astryx template <id> --type page <path>`: `<id>` is the Core id an integration replacement stands in for, else the template's own id, `<path>` is a placeholder for the file or folder to write the template to, and the `astryx` prefix is for the caller to replace with its own invocation.
|
|
65
69
|
*/
|
|
@@ -93,6 +97,10 @@ export type BuildAlternative = {
|
|
|
93
97
|
* What the page is: its layout and the ideas it serves.
|
|
94
98
|
*/
|
|
95
99
|
description: string;
|
|
100
|
+
/**
|
|
101
|
+
* The npm package that owns this template.
|
|
102
|
+
*/
|
|
103
|
+
package: string;
|
|
96
104
|
/**
|
|
97
105
|
* The scaffold command, in the same form as the start's.
|
|
98
106
|
*/
|