@astryxdesign/cli 0.7.17-canary.g5a3fd39 → 0.7.17-canary.g5cf5d69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -63
- package/api/build/_adapter.d.mts +51 -0
- package/api/build/_adapter.mjs +122 -6
- package/api/build/build.doc.mjs +1 -1
- package/api/build/build.mjs +23 -14
- package/api/build/build.type.d.mts +1 -1
- package/api/build/build.type.mjs +3 -3
- package/api/build/help/help.d.mts +15 -14
- package/api/build/help/help.mjs +62 -3
- package/api/build/kit/answer.mjs +2 -3
- package/api/build/kit/signals.d.mts +10 -0
- package/api/build/kit/signals.mjs +15 -2
- package/api/component/detail/blocks/blocks.mjs +2 -1
- package/api/discover/_adapter.d.mts +57 -6
- package/api/discover/_adapter.mjs +278 -49
- package/api/discover/_catalog-view.d.mts +7 -0
- package/api/discover/_catalog-view.mjs +10 -1
- package/api/discover/detail/detail.d.mts +3 -2
- package/api/discover/detail/detail.mjs +3 -2
- package/api/discover/detail/doc/doc.mjs +1 -1
- package/api/discover/discover.d.mts +24 -0
- package/api/discover/discover.doc.mjs +1 -1
- package/api/discover/discover.mjs +146 -25
- package/api/discover/discover.type.d.mts +6 -4
- package/api/discover/discover.type.mjs +6 -4
- package/api/discover/search/search.d.mts +22 -0
- package/api/discover/search/search.mjs +290 -70
- package/api/docs/_entry-names.mjs +4 -3
- package/api/doctor/_adapter.d.mts +43 -3
- package/api/doctor/_adapter.mjs +142 -18
- package/api/doctor/built-checks.d.mts +30 -3
- package/api/doctor/built-checks.mjs +132 -5
- package/api/doctor/doctor.d.mts +93 -6
- package/api/doctor/doctor.doc.mjs +2 -2
- package/api/doctor/doctor.mjs +524 -33
- package/api/doctor/doctor.type.d.mts +2 -1
- package/api/doctor/doctor.type.mjs +2 -1
- package/api/doctor/theme-checks.d.mts +19 -0
- package/api/doctor/theme-checks.mjs +74 -6
- package/api/hook/hook.type.d.mts +1 -1
- package/api/hook/hook.type.mjs +1 -1
- package/api/hook/list/list.mjs +11 -7
- package/api/icon/_adapter.d.mts +2 -1
- package/api/icon/_adapter.mjs +10 -15
- package/api/icon/_records.d.mts +3 -1
- package/api/icon/_records.mjs +30 -3
- package/api/icon/exportIconIndex.doc.mjs +1 -1
- package/api/icon/icon.doc.mjs +3 -3
- package/api/icon/icon.type.d.mts +32 -1
- package/api/icon/icon.type.mjs +19 -3
- package/api/icon/list/list.mjs +4 -1
- package/api/icon/rankIconIndex.doc.mjs +1 -1
- package/api/icon/search/icon-index.mjs +18 -8
- package/api/icon/search/search.d.mts +26 -3
- package/api/icon/search/search.mjs +155 -9
- package/api/init/_adapter.d.mts +14 -0
- package/api/init/_adapter.mjs +26 -4
- package/api/init/init.d.mts +1 -1
- package/api/init/init.doc.mjs +2 -2
- package/api/init/init.mjs +1 -1
- package/api/init/init.type.d.mts +29 -1
- package/api/init/init.type.mjs +14 -1
- package/api/init/run/run.d.mts +11 -1
- package/api/init/run/run.mjs +84 -5
- package/api/integration/_adapter.d.mts +5 -4
- package/api/integration/_adapter.mjs +7 -5
- package/api/integration/integrationCheck.doc.mjs +1 -1
- package/api/integration/pack-check.mjs +8 -9
- package/api/integration/validate-integration.d.mts +1 -1
- package/api/integration/validate-integration.mjs +26 -24
- package/api/integration/validate-integration.type.d.mts +5 -2
- package/api/integration/validate-integration.type.mjs +5 -2
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.d.mts +4 -2
- package/api/render/_adapter.mjs +62 -21
- package/api/render/render.doc.mjs +8 -5
- package/api/render/render.mjs +1 -1
- package/api/render/render.type.d.mts +2 -0
- package/api/render/render.type.mjs +2 -0
- package/api/search/ORDERING.md +2 -2
- package/api/search/_candidate-score.d.mts +3 -0
- package/api/search/_candidate-score.mjs +36 -3
- package/api/search/_gather-docs.mjs +29 -2
- package/api/search/_gather-templates.mjs +2 -1
- package/api/search/_main-searcher.mjs +13 -0
- package/api/search/_named-keywords.d.mts +2 -1
- package/api/search/_named-keywords.mjs +48 -6
- package/api/search/_order.d.mts +36 -1
- package/api/search/_order.mjs +141 -3
- package/api/swizzle/list/list.mjs +8 -1
- package/api/swizzle/swizzle.type.d.mts +1 -1
- package/api/swizzle/swizzle.type.mjs +1 -1
- package/api/template/copy/copy.mjs +3 -4
- package/api/template/list/list.mjs +2 -1
- package/api/template/show/show.mjs +2 -1
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template.doc.mjs +1 -1
- package/api/template/template.mjs +19 -1
- package/api/template/template.type.d.mts +1 -0
- package/api/template/template.type.mjs +2 -1
- package/api/theme/_adapter.d.mts +1 -0
- package/api/theme/_adapter.mjs +3 -5
- package/api/theme/_app-provider.d.mts +42 -0
- package/api/theme/_app-provider.mjs +61 -27
- package/api/theme/build/build.d.mts +4 -10
- package/api/theme/build/build.mjs +165 -116
- package/api/theme/build/input-fields.d.mts +9 -0
- package/api/theme/build/input-fields.mjs +155 -16
- package/api/theme/build/radius-values.d.mts +18 -0
- package/api/theme/build/radius-values.mjs +76 -0
- package/api/theme/build/typography-values.mjs +7 -23
- package/api/theme/build/written-values.d.mts +18 -0
- package/api/theme/build/written-values.mjs +107 -31
- package/api/theme/eject/eject.mjs +6 -1
- package/api/theme/palette/generate/generator.mjs +24 -0
- package/api/theme/theme.type.d.mts +4 -2
- package/api/theme/theme.type.mjs +3 -2
- package/api/theme/themeBuild.doc.mjs +2 -2
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme-edit/_catalog.d.mts +40 -0
- package/api/theme-edit/_catalog.mjs +100 -22
- package/api/theme-edit/_check.mjs +213 -43
- package/api/theme-edit/_color.d.mts +14 -0
- package/api/theme-edit/_color.mjs +22 -0
- package/api/theme-edit/_compiler.mjs +52 -0
- package/api/theme-edit/_context.d.mts +20 -2
- package/api/theme-edit/_context.mjs +157 -29
- package/api/theme-edit/_edit.mjs +426 -58
- package/api/theme-edit/_how-question.d.mts +14 -0
- package/api/theme-edit/_how-question.mjs +1541 -127
- package/api/theme-edit/_how.mjs +43 -0
- package/api/theme-edit/_missed.mjs +107 -27
- package/api/theme-edit/_normal.d.mts +18 -4
- package/api/theme-edit/_normal.mjs +84 -3
- package/api/theme-edit/_palette.d.mts +9 -0
- package/api/theme-edit/_palette.mjs +158 -33
- package/api/theme-edit/_part-words.mjs +16 -3
- package/api/theme-edit/_parts.d.mts +8 -0
- package/api/theme-edit/_parts.mjs +120 -36
- package/api/theme-edit/_png.d.mts +24 -0
- package/api/theme-edit/_png.mjs +99 -0
- package/api/theme-edit/_preview-app.d.mts +16 -0
- package/api/theme-edit/_preview-app.mjs +52 -18
- package/api/theme-edit/_preview.d.mts +44 -26
- package/api/theme-edit/_preview.mjs +255 -67
- package/api/theme-edit/_project.d.mts +12 -1
- package/api/theme-edit/_project.mjs +16 -1
- package/api/theme-edit/_settings.d.mts +116 -0
- package/api/theme-edit/_settings.mjs +1197 -58
- package/api/theme-edit/_tables.d.mts +16 -0
- package/api/theme-edit/_tables.mjs +34 -4
- package/api/theme-edit/theme-edit.type.d.mts +15 -2
- package/api/theme-edit/theme-edit.type.mjs +8 -6
- package/api/upgrade/_adapter.d.mts +46 -7
- package/api/upgrade/_adapter.mjs +110 -15
- package/api/upgrade/registry/registry.d.mts +6 -3
- package/api/upgrade/registry/registry.mjs +21 -6
- package/api/upgrade/run/run.mjs +23 -11
- package/api/upgrade/upgrade.doc.mjs +4 -3
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/tree/agent-guidance.doc.mjs +3 -2
- package/assets/docs/tree/checks.doc.mjs +2 -2
- package/assets/docs/tree/host-entry.doc.mjs +4 -0
- package/assets/docs/tree/icon-definitions.doc.mjs +3 -3
- package/assets/docs/tree/icon-sets.doc.mjs +6 -6
- package/assets/docs/tree/problems.doc.mjs +3 -3
- package/assets/docs/tree/render-pages.doc.mjs +17 -3
- package/assets/docs/tree/share-a-page.doc.mjs +5 -5
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/troubleshooting.doc.mjs +8 -0
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/versioning.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +40 -5
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/installed-icon-set.doc.mjs +30 -0
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +6 -1
- package/assets/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
- package/assets/templates/blocks/components/LinkProvider/LinkProviderCustomLink.tsx +3 -1
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +6 -2
- package/assets/templates/pages/ai-chat-landing/page.tsx +1 -1
- package/assets/templates/pages/blank/page.tsx +4 -2
- package/assets/templates/pages/canvas-editor/page.tsx +3 -1
- package/assets/templates/pages/centered-hero/page.tsx +1 -1
- package/assets/templates/pages/checkout-wizard/page.tsx +1 -1
- package/assets/templates/pages/classic-gallery/page.tsx +1 -1
- package/assets/templates/pages/contact-form/page.tsx +2 -2
- package/assets/templates/pages/course-detail/page.tsx +1 -1
- package/assets/templates/pages/dashboard/page.tsx +24 -8
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +4 -2
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +7 -3
- package/assets/templates/pages/dashboard-comparison/page.tsx +5 -2
- package/assets/templates/pages/dashboard-composition/page.tsx +10 -4
- package/assets/templates/pages/dashboard-progress/page.tsx +6 -3
- package/assets/templates/pages/dashboard-scorecard/page.tsx +17 -8
- package/assets/templates/pages/detail-page/page.tsx +22 -5
- package/assets/templates/pages/documentation/page.tsx +4 -2
- package/assets/templates/pages/documentation-design/page.tsx +5 -2
- package/assets/templates/pages/documentation-technical/page.tsx +4 -2
- package/assets/templates/pages/editor/page.tsx +28 -9
- package/assets/templates/pages/file-explorer/page.tsx +3 -1
- package/assets/templates/pages/form-two-column/page.tsx +1 -1
- package/assets/templates/pages/form-wizard/page.tsx +1 -1
- package/assets/templates/pages/form-wizard-dialog/page.tsx +3 -1
- package/assets/templates/pages/form-wizard-inline/page.tsx +1 -1
- package/assets/templates/pages/form-wizard-vertical/page.tsx +1 -1
- package/assets/templates/pages/gallery-hero/page.tsx +1 -1
- package/assets/templates/pages/ide/page.tsx +7 -2
- package/assets/templates/pages/kanban-board/page.tsx +10 -4
- package/assets/templates/pages/library/page.tsx +31 -61
- package/assets/templates/pages/login/page.tsx +4 -2
- package/assets/templates/pages/login-card/page.tsx +4 -2
- package/assets/templates/pages/login-split/page.tsx +3 -2
- package/assets/templates/pages/login-sso/page.tsx +4 -4
- package/assets/templates/pages/mixed-gallery/page.tsx +1 -1
- package/assets/templates/pages/payment-form/page.tsx +1 -1
- package/assets/templates/pages/product-detail/page.tsx +16 -4
- package/assets/templates/pages/product-gallery/page.tsx +1 -1
- package/assets/templates/pages/settings/page.tsx +10 -4
- package/assets/templates/pages/settings-dialog/page.tsx +5 -6
- package/assets/templates/pages/settings-sidebar/page.tsx +39 -13
- package/assets/templates/pages/side-gallery/page.tsx +1 -1
- package/assets/templates/pages/table/page.tsx +2 -2
- package/assets/templates/pages/table-filter/page.tsx +21 -6
- package/assets/templates/pages/table-grouped/page.tsx +23 -2
- package/assets/templates/pages/table-inbox/page.tsx +82 -32
- package/assets/templates/pages/theme-showcase/page.tsx +3 -2
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +12 -12
- package/assets/templates/themes/butter/butterTheme.ts +197 -4
- package/assets/templates/themes/chocolate/chocolateTheme.ts +72 -8
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +3 -3
- package/assets/templates/themes/gothic/gothicTheme.ts +114 -4
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +8 -8
- package/assets/templates/themes/matcha/matchaTheme.ts +48 -12
- package/assets/templates/themes/neutral/neutralTheme.ts +29 -0
- package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +2 -2
- package/assets/templates/themes/stone/stoneTheme.ts +69 -0
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +9 -9
- package/assets/templates/themes/y2k/y2kTheme.ts +249 -14
- package/authoring/codemod/parse.d.mts +0 -36
- package/authoring/codemod/parse.mjs +62 -41
- package/authoring/config/config.doc.mjs +1 -1
- package/authoring/config/parse.d.mts +0 -47
- package/authoring/config/parse.mjs +128 -103
- package/authoring/config/type.ts +4 -3
- package/authoring/debug/parse.d.mts +2 -2
- package/authoring/discover/parse.d.mts +2 -2
- package/authoring/discover/parse.mjs +52 -38
- package/authoring/discover/type.ts +2 -1
- package/authoring/doctypes/_schema.d.mts +834 -950
- package/authoring/doctypes/_schema.mjs +863 -825
- package/authoring/doctypes/command/parse.mjs +2 -2
- package/authoring/doctypes/component/parse.mjs +2 -2
- package/authoring/doctypes/enum/parse.mjs +2 -2
- package/authoring/doctypes/hook/parse.mjs +2 -2
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +1 -1
- package/authoring/doctypes/icon-definition/parse.d.mts +0 -24
- package/authoring/doctypes/icon-definition/parse.mjs +59 -43
- package/authoring/doctypes/icon-set/parse.d.mts +0 -75
- package/authoring/doctypes/icon-set/parse.mjs +239 -210
- package/authoring/doctypes/legacy.mjs +3 -3
- package/authoring/doctypes/namespace/parse.mjs +2 -2
- package/authoring/doctypes/reference/parse.mjs +2 -2
- package/authoring/doctypes/schema/parse.mjs +2 -2
- package/authoring/doctypes/template/parse.d.mts +0 -101
- package/authoring/doctypes/template/parse.mjs +131 -106
- package/authoring/doctypes/theme/parse.d.mts +0 -23
- package/authoring/doctypes/theme/parse.mjs +52 -36
- package/authoring/gap-report/parse.d.mts +1 -1
- package/authoring/integration/integration.doc.mjs +8 -0
- package/authoring/integration/schema.d.mts +14 -3
- package/authoring/integration/schema.mjs +20 -2
- package/authoring/integration/type.ts +14 -0
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.mjs +27 -13
- package/clients/cli/commands/component.mjs +14 -3
- package/clients/cli/commands/discover.doc.mjs +2 -2
- package/clients/cli/commands/discover.mjs +20 -3
- package/clients/cli/commands/docs.doc.mjs +11 -9
- package/clients/cli/commands/docs.mjs +50 -21
- package/clients/cli/commands/experimental/icon.mjs +330 -227
- package/clients/cli/commands/experimental/render.mjs +16 -1
- package/clients/cli/commands/experimental/theme.mjs +42 -17
- package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-map.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
- package/clients/cli/commands/experimental-render.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/init.doc.mjs +36 -24
- package/clients/cli/commands/integration-check.doc.mjs +1 -1
- package/clients/cli/commands/mcp.doc.mjs +53 -0
- package/clients/cli/commands/mcp.mjs +51 -0
- package/clients/cli/commands/search.mjs +46 -9
- package/clients/cli/commands/template.mjs +3 -2
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +12 -2
- package/clients/cli/commands/upgrade.doc.mjs +3 -2
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/formatters/index.mjs +52 -6
- package/clients/cli/index.mjs +23 -17
- package/clients/cli/lib/base-gate.mjs +37 -5
- package/clients/cli/lib/define-command.mjs +82 -4
- package/clients/cli/lib/json-shim.mjs +61 -4
- package/clients/cli/lib/manifest.mjs +9 -1
- package/clients/cli/lib/mcp-server.mjs +286 -0
- package/clients/cli/lib/mcp-tools.mjs +405 -0
- package/clients/cli/lib/other-cli-words.mjs +99 -0
- package/clients/cli/lib/stray-option.mjs +27 -1
- package/clients/cli/lib/unknown-command.mjs +326 -11
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +1 -1
- package/foundation/agent-docs/agent-docs.d.mts +49 -1
- package/foundation/agent-docs/agent-docs.mjs +108 -7
- package/foundation/agent-docs/computer-agent-text.mjs +1 -1
- package/foundation/bases/core.d.mts +1 -1
- package/foundation/bases/core.mjs +3 -3
- package/foundation/bases/resolve.d.mts +4 -8
- package/foundation/bases/resolve.mjs +15 -21
- package/foundation/bases/state.d.mts +15 -9
- package/foundation/bases/state.mjs +33 -6
- package/foundation/config/project.d.mts +5 -4
- package/foundation/config/project.mjs +33 -17
- package/foundation/discovery/component-discovery.mjs +15 -28
- package/foundation/discovery/icon-imports.d.mts +66 -0
- package/foundation/discovery/icon-imports.mjs +225 -0
- package/foundation/discovery/icon-ranking.d.mts +12 -2
- package/foundation/discovery/icon-ranking.mjs +197 -10
- package/foundation/discovery/icon-set-checks.mjs +2 -1
- package/foundation/discovery/icon-set-discovery.d.mts +28 -0
- package/foundation/discovery/icon-set-discovery.mjs +42 -0
- package/foundation/discovery/icon-set-writer.d.mts +2 -11
- package/foundation/discovery/icon-set-writer.mjs +3 -29
- package/foundation/discovery/module-exports.d.mts +1 -1
- package/foundation/discovery/module-exports.mjs +136 -33
- package/foundation/discovery/name-roots.d.mts +5 -0
- package/foundation/discovery/name-roots.mjs +11 -0
- package/foundation/discovery/runner-allowlist.d.mts +1 -0
- package/foundation/discovery/runner-allowlist.mjs +2 -0
- package/foundation/discovery/runner-commands.mjs +1 -0
- package/foundation/discovery/template-adapter.d.mts +1 -1
- package/foundation/discovery/template-destination.d.mts +14 -6
- package/foundation/discovery/template-destination.mjs +42 -8
- package/foundation/discovery/template-icons.d.mts +45 -2
- package/foundation/discovery/template-icons.mjs +26 -54
- package/foundation/discovery/template-needs.d.mts +28 -2
- package/foundation/discovery/template-needs.mjs +92 -11
- package/foundation/discovery/theme-discovery.d.mts +8 -0
- package/foundation/discovery/theme-discovery.mjs +23 -6
- package/foundation/discovery/theme-imports.mjs +2 -4
- package/foundation/doc-compiler/parse-readable.mjs +4 -3
- package/foundation/doc-compiler/stored-docs.d.mts +13 -0
- package/foundation/doc-compiler/stored-docs.mjs +74 -3
- package/foundation/env/cli-command.d.mts +68 -10
- package/foundation/env/cli-command.mjs +116 -22
- package/foundation/env/project-scope.d.mts +9 -0
- package/foundation/env/project-scope.mjs +28 -2
- package/foundation/fs/gather-cache.d.mts +23 -0
- package/foundation/fs/gather-cache.mjs +94 -2
- package/foundation/fs/module-loader.d.mts +3 -1
- package/foundation/fs/module-loader.mjs +85 -5
- package/foundation/fs/read-record.mjs +9 -5
- package/foundation/identity/package-names.d.mts +18 -0
- package/foundation/identity/package-names.mjs +19 -0
- package/foundation/identity/providers.mjs +3 -2
- package/foundation/integrations/icon-features.d.mts +63 -0
- package/foundation/integrations/icon-features.mjs +54 -0
- package/foundation/integrations/integrations.d.mts +13 -1
- package/foundation/integrations/integrations.mjs +47 -6
- package/foundation/integrations/pack-state.d.mts +21 -0
- package/foundation/integrations/pack-state.mjs +42 -19
- package/foundation/integrations/validate-contributions.d.mts +11 -3
- package/foundation/integrations/validate-contributions.mjs +51 -13
- package/foundation/release/cache.d.mts +13 -1
- package/foundation/release/cache.mjs +94 -14
- package/foundation/release/notices.d.mts +15 -0
- package/foundation/release/notices.mjs +111 -7
- package/foundation/release/project.d.mts +3 -4
- package/foundation/release/project.mjs +5 -6
- package/foundation/render/client-bundle.d.mts +126 -0
- package/foundation/render/client-bundle.mjs +565 -0
- package/foundation/render/cut-short.d.mts +7 -1
- package/foundation/render/cut-short.mjs +46 -6
- package/foundation/render/embedded-imports.d.mts +4 -3
- package/foundation/render/embedded-imports.mjs +13 -8
- package/foundation/render/esbuild-dependency.d.mts +14 -0
- package/foundation/render/esbuild-dependency.mjs +41 -0
- package/foundation/render/file-header.mjs +5 -4
- package/foundation/render/page-worker.mjs +562 -86
- package/foundation/render/picture-chrome.mjs +54 -29
- package/foundation/render/picture-playwright.mjs +78 -42
- package/foundation/render/picture-window.d.mts +33 -0
- package/foundation/render/picture-window.mjs +78 -0
- package/foundation/render/render-page.d.mts +55 -4
- package/foundation/render/render-page.mjs +199 -28
- package/foundation/render/restore-folder.d.mts +13 -0
- package/foundation/render/restore-folder.mjs +30 -0
- package/foundation/render/served-packages.d.mts +2 -1
- package/foundation/render/served-packages.mjs +5 -3
- package/foundation/render/ts-paths.d.mts +11 -0
- package/foundation/render/ts-paths.mjs +27 -2
- package/foundation/render/value-uses.d.mts +43 -0
- package/foundation/render/value-uses.mjs +110 -0
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.doc.mjs +7 -1
- package/foundation/response/error-codes.mjs +10 -2
- package/foundation/response/response-types.doc.mjs +12 -12
- package/foundation/runtime/package-root.d.mts +8 -0
- package/foundation/runtime/package-root.mjs +20 -0
- package/foundation/suggest/other-command.d.mts +11 -0
- package/foundation/suggest/other-command.mjs +1 -1
- package/foundation/text/icon-id.d.mts +20 -0
- package/foundation/text/icon-id.mjs +40 -0
- package/foundation/text/icon-set-next.d.mts +25 -0
- package/foundation/text/icon-set-next.mjs +29 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +7 -6
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file The answer to a word the CLI has no command for. It names the
|
|
5
5
|
* command the run meant when the words point at one: a whole command passed
|
|
6
|
-
* as one word,
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* as one word, another command line's word order (a verb before its group),
|
|
7
|
+
* a word from the table in other-cli-words.mjs, a command's plural, an option
|
|
8
|
+
* some commands take, a command deeper in the tree, or a name another command
|
|
9
|
+
* reads. Otherwise it names the commands with a near name, else every
|
|
10
|
+
* command. It only suggests: it runs nothing, and it never names an
|
|
11
|
+
* experimental command.
|
|
9
12
|
*
|
|
10
13
|
* @input the program and the words of the run after the program name
|
|
11
14
|
* @output the message and the suggestions the unknown-command error prints
|
|
@@ -15,7 +18,16 @@
|
|
|
15
18
|
|
|
16
19
|
import {levenshteinDistance} from '../../../foundation/text/levenshtein.mjs';
|
|
17
20
|
import {quoteCommandArgument} from '../../../foundation/env/package-manager.mjs';
|
|
18
|
-
import {runParses} from './stray-option.mjs';
|
|
21
|
+
import {optionsInReach, runParses} from './stray-option.mjs';
|
|
22
|
+
import {
|
|
23
|
+
ADD_WORDS as ADD_TABLE,
|
|
24
|
+
JOB_WORDS,
|
|
25
|
+
LIST_WORDS as LIST_TABLE,
|
|
26
|
+
PATH_OPTIONS as PATH_TABLE,
|
|
27
|
+
PROPS_WORDS as PROPS_TABLE,
|
|
28
|
+
READ_WORDS as READ_TABLE,
|
|
29
|
+
SOURCE_WORDS as SOURCE_TABLE,
|
|
30
|
+
} from './other-cli-words.mjs';
|
|
19
31
|
import {
|
|
20
32
|
helpBase,
|
|
21
33
|
optionAvailable,
|
|
@@ -24,12 +36,12 @@ import {
|
|
|
24
36
|
|
|
25
37
|
/**
|
|
26
38
|
* The part of a Commander option this module reads.
|
|
27
|
-
* @typedef {{long?: string, short?: string, required?: boolean, hidden?: boolean}} OptionLike
|
|
39
|
+
* @typedef {{long?: string, short?: string, required?: boolean, optional?: boolean, hidden?: boolean}} OptionLike
|
|
28
40
|
*/
|
|
29
41
|
|
|
30
42
|
/**
|
|
31
43
|
* The part of a Commander command this module reads.
|
|
32
|
-
* @typedef {{name(): string, commands?: readonly CommandLike[], options?: readonly OptionLike[], registeredArguments?: ReadonlyArray<{variadic?: boolean}>, _hidden?: boolean}} CommandLike
|
|
44
|
+
* @typedef {{name(): string, commands?: readonly CommandLike[], options?: readonly OptionLike[], registeredArguments?: ReadonlyArray<{variadic?: boolean, name?: () => string}>, _hidden?: boolean}} CommandLike
|
|
33
45
|
*/
|
|
34
46
|
|
|
35
47
|
/**
|
|
@@ -177,15 +189,275 @@ function nearNames(word, names) {
|
|
|
177
189
|
.map(s => s.name);
|
|
178
190
|
}
|
|
179
191
|
|
|
192
|
+
/**
|
|
193
|
+
* The words of one table in other-cli-words.mjs, as a set.
|
|
194
|
+
* @param {readonly {word: string}[]} table
|
|
195
|
+
* @returns {Set<string>}
|
|
196
|
+
*/
|
|
197
|
+
function wordsOf(table) {
|
|
198
|
+
return new Set(table.map(entry => entry.word));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const LIST_WORDS = wordsOf(LIST_TABLE);
|
|
202
|
+
const READ_WORDS = wordsOf(READ_TABLE);
|
|
203
|
+
const ADD_WORDS = wordsOf(ADD_TABLE);
|
|
204
|
+
const SOURCE_WORDS = wordsOf(SOURCE_TABLE);
|
|
205
|
+
const PROPS_WORDS = wordsOf(PROPS_TABLE);
|
|
206
|
+
const PATH_OPTIONS = wordsOf(PATH_TABLE);
|
|
207
|
+
|
|
208
|
+
/** Words that ask to run the command after them (`add template settings`). */
|
|
209
|
+
const RUN_WORDS = new Set([...READ_WORDS, ...ADD_WORDS]);
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Whether a word names an input to fill (`<old-version>`), not a value.
|
|
213
|
+
* @param {string} word
|
|
214
|
+
* @returns {boolean}
|
|
215
|
+
*/
|
|
216
|
+
function isPlaceholder(word) {
|
|
217
|
+
return /^<[^<>\s]+>$/.test(word);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Template kinds a list asks for by a plural (`list pages`). */
|
|
221
|
+
const TEMPLATE_KINDS = /** @type {Record<string, string>} */ ({
|
|
222
|
+
pages: 'page',
|
|
223
|
+
blocks: 'block',
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* The words a command takes from another command line's run: the options in
|
|
228
|
+
* its reach (its own and the program's) with their values, as many other
|
|
229
|
+
* words as it takes arguments, and the value of an option in
|
|
230
|
+
* {@link PATH_OPTIONS} as the `path` argument when the command takes one.
|
|
231
|
+
* Other options and their values are left out.
|
|
232
|
+
* @param {CommandLike} cmd
|
|
233
|
+
* @param {string[]} words
|
|
234
|
+
* @returns {string[]}
|
|
235
|
+
*/
|
|
236
|
+
function fitWords(cmd, words) {
|
|
237
|
+
/** @type {string[]} */
|
|
238
|
+
const options = [];
|
|
239
|
+
/** @type {string[]} */
|
|
240
|
+
const args = [];
|
|
241
|
+
/** @type {string[]} */
|
|
242
|
+
const paths = [];
|
|
243
|
+
const declared = cmd.registeredArguments ?? [];
|
|
244
|
+
const takesPath = declared.some(a => a.name?.() === 'path');
|
|
245
|
+
for (let i = 0; i < words.length; i += 1) {
|
|
246
|
+
const word = words[i];
|
|
247
|
+
if (!word.startsWith('-')) {
|
|
248
|
+
args.push(word);
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
const [flag, inline] = word.split(/=(.*)/s);
|
|
252
|
+
const next = words[i + 1];
|
|
253
|
+
const nextIsValue =
|
|
254
|
+
inline === undefined && next !== undefined && !next.startsWith('-');
|
|
255
|
+
const option = optionsInReach(
|
|
256
|
+
/** @type {any} */ (cmd),
|
|
257
|
+
(/** @type {OptionLike} */ o) => !o.hidden,
|
|
258
|
+
).find(o => o.long === flag || o.short === flag);
|
|
259
|
+
if (option) {
|
|
260
|
+
options.push(word);
|
|
261
|
+
if ((option.required || option.optional) && nextIsValue) {
|
|
262
|
+
options.push(next);
|
|
263
|
+
i += 1;
|
|
264
|
+
}
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
if (PATH_OPTIONS.has(flag) && takesPath) {
|
|
268
|
+
const value = inline ?? (nextIsValue ? next : undefined);
|
|
269
|
+
if (value !== undefined) paths.push(value);
|
|
270
|
+
}
|
|
271
|
+
if (nextIsValue) i += 1;
|
|
272
|
+
}
|
|
273
|
+
const given = [...args, ...paths];
|
|
274
|
+
const kept = declared.some(a => a.variadic)
|
|
275
|
+
? given
|
|
276
|
+
: given.slice(0, declared.length);
|
|
277
|
+
return [...kept, ...options];
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* A job's run with its inputs filled from the words typed: an option's
|
|
282
|
+
* placeholder takes the value typed for that option, and an argument's
|
|
283
|
+
* placeholder takes the next word typed that is no option. A placeholder
|
|
284
|
+
* nothing fills stays, so the run names the input it needs. The words left
|
|
285
|
+
* over follow the run.
|
|
286
|
+
* @param {readonly string[]} template the run, with placeholders
|
|
287
|
+
* @param {string[]} words the words typed, fitted to the command
|
|
288
|
+
* @returns {string[]}
|
|
289
|
+
*/
|
|
290
|
+
function filled(template, words) {
|
|
291
|
+
const left = [...words];
|
|
292
|
+
/** @type {string[]} */
|
|
293
|
+
const out = [];
|
|
294
|
+
for (let i = 0; i < template.length; i += 1) {
|
|
295
|
+
const part = template[i];
|
|
296
|
+
const value = template[i + 1];
|
|
297
|
+
if (part.startsWith('-') && value !== undefined && isPlaceholder(value)) {
|
|
298
|
+
const at = left.findIndex(w => w === part || w.startsWith(`${part}=`));
|
|
299
|
+
if (at === -1) out.push(part, value);
|
|
300
|
+
else if (left[at].includes('=')) out.push(...left.splice(at, 1));
|
|
301
|
+
else out.push(...left.splice(at, 2));
|
|
302
|
+
i += 1;
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
if (isPlaceholder(part)) {
|
|
306
|
+
const at = left.findIndex(w => !w.startsWith('-'));
|
|
307
|
+
out.push(at === -1 ? part : left.splice(at, 1)[0]);
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
out.push(part);
|
|
311
|
+
}
|
|
312
|
+
return [...out, ...left];
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* The commands words from another command line point at, as runs, best
|
|
317
|
+
* first; empty when they point at none. Rules, in order: a verb before its
|
|
318
|
+
* group (`add theme matcha` is `theme add matcha`, `list themes` is `theme
|
|
319
|
+
* list`); a list of template kinds (`list pages` is `template --list --type
|
|
320
|
+
* page`); a word that asks to run the command after it (`add template
|
|
321
|
+
* settings --out <path>` is `template settings <path>`); a verb that copies a
|
|
322
|
+
* component's source (`eject button` is `swizzle Button`); `add` and the name
|
|
323
|
+
* of a component, template, hook or docs topic (`add button` is `swizzle
|
|
324
|
+
* Button`, then `component Button`); a word that asks for a component's props
|
|
325
|
+
* (`props Card` is `component Card --props`); a word other command lines use
|
|
326
|
+
* for a job one command here does ({@link JOB_WORDS}: `migrate` is `upgrade
|
|
327
|
+
* --from <old-version>`).
|
|
328
|
+
* @param {{word: string, before: string[], after: string[]}} run
|
|
329
|
+
* @param {CommandLike} program
|
|
330
|
+
* @param {FindEntry} findEntry
|
|
331
|
+
* @returns {Promise<Array<{words: string[], reason: string}>>}
|
|
332
|
+
*/
|
|
333
|
+
async function otherCliWords({word, before, after: rest}, program, findEntry) {
|
|
334
|
+
// A stable answer names no experimental command, so no rule here reads
|
|
335
|
+
// the experimental group.
|
|
336
|
+
const top = visible(program).filter(c => c.name() !== 'experimental');
|
|
337
|
+
/** @param {string} name */
|
|
338
|
+
const command = name => top.find(c => c.name() === name);
|
|
339
|
+
/** @param {string[]} parts @param {string} reason */
|
|
340
|
+
const run = (parts, reason) => ({words: [...before, ...parts], reason});
|
|
341
|
+
const verb = word.toLowerCase();
|
|
342
|
+
const [object, ...after] = rest;
|
|
343
|
+
const objectWord =
|
|
344
|
+
object !== undefined && !object.startsWith('-') ? object : undefined;
|
|
345
|
+
|
|
346
|
+
if (objectWord) {
|
|
347
|
+
const group = top.find(c => spellings(objectWord).includes(c.name()));
|
|
348
|
+
const sub =
|
|
349
|
+
group && visible(group).find(c => spellings(verb).includes(c.name()));
|
|
350
|
+
if (group && sub)
|
|
351
|
+
return [
|
|
352
|
+
run(
|
|
353
|
+
[group.name(), sub.name(), ...fitWords(sub, after)],
|
|
354
|
+
`the command is ${group.name()} ${sub.name()}`,
|
|
355
|
+
),
|
|
356
|
+
];
|
|
357
|
+
const kind = TEMPLATE_KINDS[objectWord.toLowerCase()];
|
|
358
|
+
const template = command('template');
|
|
359
|
+
if (LIST_WORDS.has(verb) && kind && template && offers(template, '--list'))
|
|
360
|
+
return [
|
|
361
|
+
run(
|
|
362
|
+
['template', '--list', '--type', kind, ...fitWords(template, after)],
|
|
363
|
+
`template --list lists the ${objectWord.toLowerCase()}`,
|
|
364
|
+
),
|
|
365
|
+
];
|
|
366
|
+
const commandNamed = top.find(
|
|
367
|
+
c =>
|
|
368
|
+
spellings(objectWord).includes(c.name()) &&
|
|
369
|
+
takesWords(c, fitWords(c, after)),
|
|
370
|
+
);
|
|
371
|
+
if (RUN_WORDS.has(verb) && commandNamed)
|
|
372
|
+
return [
|
|
373
|
+
run(
|
|
374
|
+
[commandNamed.name(), ...fitWords(commandNamed, after)],
|
|
375
|
+
`the command is ${commandNamed.name()}`,
|
|
376
|
+
),
|
|
377
|
+
];
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
const entryOf = async (/** @type {string} */ name) =>
|
|
381
|
+
findEntry(name).catch(() => null);
|
|
382
|
+
if (
|
|
383
|
+
objectWord &&
|
|
384
|
+
(SOURCE_WORDS.has(verb) || ADD_WORDS.has(verb) || PROPS_WORDS.has(verb))
|
|
385
|
+
) {
|
|
386
|
+
const entry = await entryOf(objectWord);
|
|
387
|
+
const swizzle = command('swizzle');
|
|
388
|
+
const component = command('component');
|
|
389
|
+
if (entry?.command === 'component' && component) {
|
|
390
|
+
if (PROPS_WORDS.has(verb))
|
|
391
|
+
return [
|
|
392
|
+
run(
|
|
393
|
+
['component', entry.name, '--props', ...fitWords(component, after)],
|
|
394
|
+
`the props of ${entry.name}`,
|
|
395
|
+
),
|
|
396
|
+
];
|
|
397
|
+
/** @type {Array<{words: string[], reason: string}>} */
|
|
398
|
+
const runs = [];
|
|
399
|
+
if (swizzle)
|
|
400
|
+
runs.push(
|
|
401
|
+
run(
|
|
402
|
+
['swizzle', entry.name, ...fitWords(swizzle, after)],
|
|
403
|
+
"swizzle copies a component's source into the project",
|
|
404
|
+
),
|
|
405
|
+
);
|
|
406
|
+
if (ADD_WORDS.has(verb))
|
|
407
|
+
runs.push(
|
|
408
|
+
run(
|
|
409
|
+
['component', entry.name, ...fitWords(component, after)],
|
|
410
|
+
`${entry.name} ships in the package: import it`,
|
|
411
|
+
),
|
|
412
|
+
);
|
|
413
|
+
if (runs.length > 0) return runs;
|
|
414
|
+
}
|
|
415
|
+
const reader = entry && command(entry.command);
|
|
416
|
+
if (ADD_WORDS.has(verb) && entry && reader)
|
|
417
|
+
return [
|
|
418
|
+
run(
|
|
419
|
+
[entry.command, entry.name, ...fitWords(reader, after)],
|
|
420
|
+
`${entry.name} is read by ${entry.command}`,
|
|
421
|
+
),
|
|
422
|
+
];
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
const job = JOB_WORDS.find(entry => entry.word === verb);
|
|
426
|
+
const target = job && command(job.run[0]);
|
|
427
|
+
if (!job || !target) return [];
|
|
428
|
+
// A list word, or a word that names a command, names what the job is
|
|
429
|
+
// about, not an input (`browse integrations` is `discover`).
|
|
430
|
+
const inputs = rest.filter(
|
|
431
|
+
w =>
|
|
432
|
+
!LIST_WORDS.has(w.toLowerCase()) &&
|
|
433
|
+
!top.some(c => spellings(w).includes(c.name())),
|
|
434
|
+
);
|
|
435
|
+
const fitted = fitWords(target, inputs);
|
|
436
|
+
const unneeded = fitted.some(w =>
|
|
437
|
+
(job.notNeededWith ?? []).includes(w.split('=')[0]),
|
|
438
|
+
);
|
|
439
|
+
const template = unneeded
|
|
440
|
+
? job.run.filter(
|
|
441
|
+
(part, i) =>
|
|
442
|
+
!isPlaceholder(part) && !isPlaceholder(job.run[i + 1] ?? ''),
|
|
443
|
+
)
|
|
444
|
+
: job.run;
|
|
445
|
+
return [run(filled(template, fitted), job.reason)];
|
|
446
|
+
}
|
|
447
|
+
|
|
180
448
|
/**
|
|
181
449
|
* The commands the words point at, as runs (`astryx …`), best first, with
|
|
182
450
|
* the reason each is offered; empty when they point at none. Rules, in
|
|
183
451
|
* order: the word is an option of the program written after `--`
|
|
184
452
|
* (`astryx -- --help`); the word holds a whole command (`"component Table"`
|
|
185
|
-
* passed as one word); the
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* `
|
|
453
|
+
* passed as one word); the words come from another command line (see
|
|
454
|
+
* {@link otherCliWords}: `add theme matcha` is `theme add matcha`); the
|
|
455
|
+
* word, or its singular, is a command (`components Button`), a group named
|
|
456
|
+
* alone is its list (`themes` is `theme list`), and a list word or a read
|
|
457
|
+
* word after it asks for its list or the name after it (`templates list` is
|
|
458
|
+
* `template --list`, `templates view settings` is `template settings`); the
|
|
459
|
+
* word is an option commands take (`list components` is `component --list`);
|
|
460
|
+
* the word, or its singular, is a command deeper in
|
|
189
461
|
* the tree (`verify` is `integration verify`, `themes` is `theme list`), or its hyphenated parts name that command (`validate-integration`
|
|
190
462
|
* is `doctor integration validate`); the next word, else the word itself,
|
|
191
463
|
* is a name another command reads (`info Text` is `component Text`).
|
|
@@ -212,8 +484,48 @@ async function pointed({word, before, after: rest}, program, findEntry) {
|
|
|
212
484
|
return [
|
|
213
485
|
run([...parts, ...rest], 'the words of one command, passed as one word'),
|
|
214
486
|
];
|
|
487
|
+
// A borrowed run that does not parse leaves the word to the rules below
|
|
488
|
+
// (`info theme` names a group alone, so it is `component Theme`).
|
|
489
|
+
const borrowed = (
|
|
490
|
+
await otherCliWords({word, before, after: rest}, program, findEntry)
|
|
491
|
+
).filter(r => runParses(program, r.words));
|
|
492
|
+
if (borrowed.length > 0) return borrowed;
|
|
215
493
|
const named = top.find(c => spellings(word).includes(c.name()));
|
|
494
|
+
const [next, ...more] = rest;
|
|
495
|
+
const nextIsSub =
|
|
496
|
+
named !== undefined &&
|
|
497
|
+
next !== undefined &&
|
|
498
|
+
visible(named).some(c => c.name() === next);
|
|
499
|
+
// A list word after the command asks for its list (`templates list`); a
|
|
500
|
+
// group without a list answers with its commands.
|
|
501
|
+
if (
|
|
502
|
+
named &&
|
|
503
|
+
next !== undefined &&
|
|
504
|
+
!nextIsSub &&
|
|
505
|
+
LIST_WORDS.has(next.toLowerCase())
|
|
506
|
+
) {
|
|
507
|
+
if (offers(named, '--list'))
|
|
508
|
+
return [
|
|
509
|
+
run(
|
|
510
|
+
[named.name(), '--list', ...more],
|
|
511
|
+
`${named.name()} --list lists them`,
|
|
512
|
+
),
|
|
513
|
+
];
|
|
514
|
+
if (visible(named).length > 0)
|
|
515
|
+
return [
|
|
516
|
+
run([named.name(), '--help'], `the commands of ${named.name()}`),
|
|
517
|
+
];
|
|
518
|
+
}
|
|
216
519
|
if (named && takesWords(named, rest)) {
|
|
520
|
+
// A read word after the command only asks to read the name after it
|
|
521
|
+
// (`templates view settings`).
|
|
522
|
+
if (
|
|
523
|
+
next !== undefined &&
|
|
524
|
+
!nextIsSub &&
|
|
525
|
+
READ_WORDS.has(next.toLowerCase()) &&
|
|
526
|
+
more.some(w => !w.startsWith('-'))
|
|
527
|
+
)
|
|
528
|
+
return [run([named.name(), ...more], `the command is ${named.name()}`)];
|
|
217
529
|
const listing = visible(named).find(c => c.name() === 'list');
|
|
218
530
|
// A group named alone runs no command: a plural asks for its list.
|
|
219
531
|
if (visible(named).length > 0 && rest.length === 0)
|
|
@@ -336,7 +648,10 @@ export async function unknownCommandAnswer(
|
|
|
336
648
|
const runs = (await pointed(first, program, findEntry))
|
|
337
649
|
.filter(r => runParses(program, r.words))
|
|
338
650
|
.map(r => ({
|
|
339
|
-
name: [
|
|
651
|
+
name: [
|
|
652
|
+
'astryx',
|
|
653
|
+
...r.words.map(w => (isPlaceholder(w) ? w : quoteCommandArgument(w))),
|
|
654
|
+
].join(' '),
|
|
340
655
|
reason: r.reason,
|
|
341
656
|
}));
|
|
342
657
|
if (runs.length > 0) return {word, message, suggestions: runs};
|