@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
|
@@ -97,6 +97,15 @@ export const HEADING_WEIGHTS: Record<string, string>;
|
|
|
97
97
|
export const HEADING_TRACKING: Record<string, string>;
|
|
98
98
|
/** The `surfaces` dial: how every container sits on the page. */
|
|
99
99
|
export const SURFACES: Record<string, Record<string, string>>;
|
|
100
|
+
/**
|
|
101
|
+
* The panels that float over the page (menus, popovers, dialogs): under
|
|
102
|
+
* `surfaces flat` they keep their own fill and a hairline edge
|
|
103
|
+
* ({@link FLOATING_SURFACES}), since a panel over content needs an edge to
|
|
104
|
+
* be seen.
|
|
105
|
+
*/
|
|
106
|
+
export const FLOATING_PANELS: string[];
|
|
107
|
+
/** A rung of the `surfaces` dial as the floating panels take it, where it differs. */
|
|
108
|
+
export const FLOATING_SURFACES: Record<string, Record<string, string>>;
|
|
100
109
|
/** The parts the `surfaces` dial moves. */
|
|
101
110
|
export const SURFACE_PARTS: string[];
|
|
102
111
|
/** The `type` dial: heading scale ratio, heading weight, heading letter spacing. */
|
|
@@ -111,6 +120,8 @@ export const TYPE_STYLES: Record<string, {
|
|
|
111
120
|
* @property {string} values - The values it takes, `|`-separated.
|
|
112
121
|
* @property {string[]} examples - Commands after the prefix; `my` is the theme.
|
|
113
122
|
* @property {string} words - Words `how` matches to the dial.
|
|
123
|
+
* @property {'px'} [unit] - The unit its `<number>` is in: the number typed
|
|
124
|
+
* with that unit (`24px`, `24 PX`) is the same number (dialNumber).
|
|
114
125
|
*/
|
|
115
126
|
/** @type {Record<string, Dial>} */
|
|
116
127
|
export const DIALS: Record<string, Dial>;
|
|
@@ -189,6 +200,11 @@ export type Dial = {
|
|
|
189
200
|
* - Words `how` matches to the dial.
|
|
190
201
|
*/
|
|
191
202
|
words: string;
|
|
203
|
+
/**
|
|
204
|
+
* - The unit its `<number>` is in: the number typed
|
|
205
|
+
* with that unit (`24px`, `24 PX`) is the same number (dialNumber).
|
|
206
|
+
*/
|
|
207
|
+
unit?: "px" | undefined;
|
|
192
208
|
};
|
|
193
209
|
import { appleFaceGeneric } from '../theme/build/font-warning.mjs';
|
|
194
210
|
import { systemFontFamilies } from '../theme/build/font-warning.mjs';
|
|
@@ -411,6 +411,33 @@ export const SURFACES = wordTable(
|
|
|
411
411
|
},
|
|
412
412
|
}),
|
|
413
413
|
);
|
|
414
|
+
/**
|
|
415
|
+
* The panels that float over the page (menus, popovers, dialogs): under
|
|
416
|
+
* `surfaces flat` they keep their own fill and a hairline edge
|
|
417
|
+
* ({@link FLOATING_SURFACES}), since a panel over content needs an edge to
|
|
418
|
+
* be seen.
|
|
419
|
+
*/
|
|
420
|
+
export const FLOATING_PANELS = [
|
|
421
|
+
'dialog',
|
|
422
|
+
'popover',
|
|
423
|
+
'drawer',
|
|
424
|
+
'hover-card',
|
|
425
|
+
'dropdown-menu',
|
|
426
|
+
'selector-popup',
|
|
427
|
+
];
|
|
428
|
+
|
|
429
|
+
/** A rung of the `surfaces` dial as the floating panels take it, where it differs. */
|
|
430
|
+
export const FLOATING_SURFACES = wordTable(
|
|
431
|
+
/** @type {Record<string, Record<string, string>>} */ ({
|
|
432
|
+
flat: {
|
|
433
|
+
borderStyle: 'solid',
|
|
434
|
+
borderWidth: '1px',
|
|
435
|
+
borderColor: 'var(--color-border)',
|
|
436
|
+
boxShadow: 'none',
|
|
437
|
+
},
|
|
438
|
+
}),
|
|
439
|
+
);
|
|
440
|
+
|
|
414
441
|
/** The parts the `surfaces` dial moves. */
|
|
415
442
|
export const SURFACE_PARTS = [
|
|
416
443
|
'card',
|
|
@@ -438,6 +465,8 @@ export const TYPE_STYLES =
|
|
|
438
465
|
* @property {string} values - The values it takes, `|`-separated.
|
|
439
466
|
* @property {string[]} examples - Commands after the prefix; `my` is the theme.
|
|
440
467
|
* @property {string} words - Words `how` matches to the dial.
|
|
468
|
+
* @property {'px'} [unit] - The unit its `<number>` is in: the number typed
|
|
469
|
+
* with that unit (`24px`, `24 PX`) is the same number (dialNumber).
|
|
441
470
|
*/
|
|
442
471
|
|
|
443
472
|
/** @type {Record<string, Dial>} */
|
|
@@ -483,7 +512,7 @@ export const DIALS = wordTable({
|
|
|
483
512
|
'accent brand primary main color colour key highlight link selection seed',
|
|
484
513
|
},
|
|
485
514
|
neutral: {
|
|
486
|
-
help:
|
|
515
|
+
help: "The gray of the theme: surfaces (cards, panels, popovers, muted fills), text, icons, borders, skeletons and hover tints. The page background follows it too, at the official theme's page shade of the gray; a colored gray's pale shades fade toward white as a gray scale's do, so the page and the cards on it carry only a faint tint of it. For a clearly tinted page (cream, a pale blue) or a white one, set --color-background-body to that color (with --mode light in a theme with both modes), which then keeps its color. From the one color the editor generates light and dark shades; your exact color sits at its own shade in both modes, and the shades around it follow it. The surface, text, icon, border, skeleton and overlay tokens point at those shades. Secondary text and icons move to a shade that reads on the surfaces. Give a gray with a little color (\"#64748b\") for a cool or warm neutral; a strong color makes colored surfaces. `how colors` explains it.",
|
|
487
516
|
values: '<color>',
|
|
488
517
|
examples: ['set my neutral "#64748b"', 'set my neutral "#78716c"'],
|
|
489
518
|
words:
|
|
@@ -522,11 +551,11 @@ export const DIALS = wordTable({
|
|
|
522
551
|
},
|
|
523
552
|
font: {
|
|
524
553
|
help:
|
|
525
|
-
'The typeface. System presets (fonts systems ship, so no package loads them; a system with none of a stack shows its own font of that kind, and a picture says when this machine
|
|
554
|
+
'The typeface. System presets (fonts systems ship, so no package loads them; a system with none of a stack shows its own font of that kind, and a picture says when this machine draws a serif, monospace or cursive stack in a font of another kind): ' +
|
|
526
555
|
SYSTEM_FONTS.join(', ') +
|
|
527
556
|
'. Open fonts with a loading package: ' +
|
|
528
557
|
Object.keys(OPEN_FONTS).join(', ') +
|
|
529
|
-
' (previews show them when the package is installed; the result names the import line for the app). Also: rounded,
|
|
558
|
+
' (previews show them when the package is installed; the result names the import line for the app). Also: rounded (Nunito, an open font: it loads once its package is installed, and until then shows Varela Round or the system font), any family name in quotes, or a whole stack with commas ("Inter, Helvetica, sans-serif"). Whole theme: body and headings. With --on heading|body|code: only that role. An open font loads only once its package is installed (the result of set names the install line for your package manager, and the closest font that needs no install); any other font must be loaded by the app.',
|
|
530
559
|
values: `${[...Object.keys(FONTS), ...Object.keys(OPEN_FONTS)].join('|')}|"<family or stack>"`,
|
|
531
560
|
examples: [
|
|
532
561
|
'set my font mono',
|
|
@@ -556,7 +585,7 @@ export const DIALS = wordTable({
|
|
|
556
585
|
'heading headings title titles display headline bold heavy weight tracking letter spacing tight',
|
|
557
586
|
},
|
|
558
587
|
surfaces: {
|
|
559
|
-
help: 'How panels (cards, dialogs, popovers, menus, the banner) sit on the page. flat: no border, no shadow, a tinted fill. outlined: a 1px border, no shadow. raised: no border, a soft shadow. glass: see-through fill with a blur and a faint light edge. Moves every container at once.',
|
|
588
|
+
help: 'How panels (cards, dialogs, popovers, menus, the banner) sit on the page. flat: no border, no shadow, a tinted fill (menus, popovers and dialogs, which float over the page, keep their own fill and a hairline border instead). outlined: a 1px border, no shadow. raised: no border, a soft shadow. glass: see-through fill with a blur and a faint light edge. Moves every container at once.',
|
|
560
589
|
values: Object.keys(SURFACES).join('|'),
|
|
561
590
|
examples: ['set my surfaces outlined', 'set my surfaces raised'],
|
|
562
591
|
words:
|
|
@@ -581,6 +610,7 @@ export const DIALS = wordTable({
|
|
|
581
610
|
TEXT_SIZE.map(([n, v]) => `${n} (${v}px)`).join(', ') +
|
|
582
611
|
', or a number of pixels from 10 to 32. Phones (touch screens below 1024px wide) keep the base theme reading sizes.',
|
|
583
612
|
values: 'small|medium|large|larger|more|less|<number>',
|
|
613
|
+
unit: 'px',
|
|
584
614
|
examples: ['set my text-size small', 'set my text-size more'],
|
|
585
615
|
words: 'text size font size small big large scale',
|
|
586
616
|
},
|
|
@@ -143,7 +143,7 @@ export type ThemeEditPreviewFields = {
|
|
|
143
143
|
export type ThemeEditNewResponse = {
|
|
144
144
|
type: "themeEdit.new";
|
|
145
145
|
/**
|
|
146
|
-
* - `settings`: the dial settings it started with; `notes`: font loading, and with `png` the text the sample page's pictures draw cut short; `wiring`: the steps that put the theme into this app (`theme add <theme>` for its app copy in src/themes/<theme>/, else the root file, its imports and the Theme around the app; what builds it).
|
|
146
|
+
* - `settings`: the dial settings it started with; `missed`, `missedParts`, `missedOn`: what those settings did not reach, as a change reports it (left out when none); `notes`: font loading, and with `png` the text the sample page's pictures draw cut short; `wiring`: the steps that put the theme into this app (`theme add <theme>` for its app copy in src/themes/<theme>/, else the root file, its imports and the Theme around the app; what builds it).
|
|
147
147
|
*/
|
|
148
148
|
data: {
|
|
149
149
|
theme: string;
|
|
@@ -158,6 +158,9 @@ export type ThemeEditNewResponse = {
|
|
|
158
158
|
notes: string[];
|
|
159
159
|
problems: string[];
|
|
160
160
|
wiring: string[];
|
|
161
|
+
missed?: number;
|
|
162
|
+
missedParts?: number;
|
|
163
|
+
missedOn?: string[];
|
|
161
164
|
} & ThemeEditPreviewFields;
|
|
162
165
|
};
|
|
163
166
|
/**
|
|
@@ -221,6 +224,10 @@ export type ThemeEditChangeData = {
|
|
|
221
224
|
* - Resolved token changes, `name (mode): before -> after`.
|
|
222
225
|
*/
|
|
223
226
|
changedTokens: string[];
|
|
227
|
+
/**
|
|
228
|
+
* - Changes to the custom properties the built stylesheet sets on parts, `name on <rule> (mode): before -> after` (a readable text color on a selected row). With `changedTokens`, every custom property whose built value moved.
|
|
229
|
+
*/
|
|
230
|
+
changedPartTokens?: string[] | undefined;
|
|
224
231
|
/**
|
|
225
232
|
* - Part styles and typography the change wrote.
|
|
226
233
|
*/
|
|
@@ -234,7 +241,7 @@ export type ThemeEditChangeData = {
|
|
|
234
241
|
*/
|
|
235
242
|
lifted: string[];
|
|
236
243
|
/**
|
|
237
|
-
* - What else to know: the shade a color's main token uses and any shade contrast moved, then the generated color files; font loading; what a token feeds; with `png`, the text the sample page's pictures draw cut short, as the browser measured
|
|
244
|
+
* - What else to know: the shade a color's main token uses and any shade contrast moved, then the generated color files; font loading; what a token feeds; with `png`, the text the sample page's pictures draw cut short and the words they break inside the word, as the browser measured them (one note for each part, with its labels).
|
|
238
245
|
*/
|
|
239
246
|
notes: string[];
|
|
240
247
|
/**
|
|
@@ -260,6 +267,10 @@ export type ThemeEditChangeData = {
|
|
|
260
267
|
* - On how many parts those misses are (a part can miss two ways, its border and its shadow).
|
|
261
268
|
*/
|
|
262
269
|
missedParts?: number | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* - Those parts, in show's order; the text output names them.
|
|
272
|
+
*/
|
|
273
|
+
missedOn?: string[] | undefined;
|
|
263
274
|
/**
|
|
264
275
|
* - Warnings from the theme build.
|
|
265
276
|
*/
|
|
@@ -433,6 +444,7 @@ export type ThemeEditUndoResponse = {
|
|
|
433
444
|
settings: number;
|
|
434
445
|
stepsLeft: number;
|
|
435
446
|
changedTokens: string[];
|
|
447
|
+
changedPartTokens?: string[];
|
|
436
448
|
problems: string[];
|
|
437
449
|
newProblems: ThemeEditProblem[];
|
|
438
450
|
notes?: string[];
|
|
@@ -478,6 +490,7 @@ export type ThemeEditPreviewAddResponse = {
|
|
|
478
490
|
page: string;
|
|
479
491
|
reason: string;
|
|
480
492
|
installCommand: string | null;
|
|
493
|
+
installGuidance?: string;
|
|
481
494
|
}>;
|
|
482
495
|
notes: string[];
|
|
483
496
|
pages: string[];
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
* @experimental May change or be removed in a patch release.
|
|
64
64
|
* @typedef {object} ThemeEditNewResponse
|
|
65
65
|
* @property {'themeEdit.new'} type
|
|
66
|
-
* @property {{theme: string, like: string | null, files: {settings: string, source: string, css: string, module: string}, settings: string[], notes: string[], problems: string[], wiring: string[]} & ThemeEditPreviewFields} data - `settings`: the dial settings it started with; `notes`: font loading, and with `png` the text the sample page's pictures draw cut short; `wiring`: the steps that put the theme into this app (`theme add <theme>` for its app copy in src/themes/<theme>/, else the root file, its imports and the Theme around the app; what builds it).
|
|
66
|
+
* @property {{theme: string, like: string | null, files: {settings: string, source: string, css: string, module: string}, settings: string[], notes: string[], problems: string[], wiring: string[], missed?: number, missedParts?: number, missedOn?: string[]} & ThemeEditPreviewFields} data - `settings`: the dial settings it started with; `missed`, `missedParts`, `missedOn`: what those settings did not reach, as a change reports it (left out when none); `notes`: font loading, and with `png` the text the sample page's pictures draw cut short; `wiring`: the steps that put the theme into this app (`theme add <theme>` for its app copy in src/themes/<theme>/, else the root file, its imports and the Theme around the app; what builds it).
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
69
|
/**
|
|
@@ -98,15 +98,17 @@
|
|
|
98
98
|
* @property {string[]} parts - The parts it styles (a group's members when it spread).
|
|
99
99
|
* @property {{name: string, members: string[], onlyHint: boolean} | null} group - The group it spread to; `onlyHint` when `--only` would style one member.
|
|
100
100
|
* @property {string[]} changedTokens - Resolved token changes, `name (mode): before -> after`.
|
|
101
|
+
* @property {string[]} [changedPartTokens] - Changes to the custom properties the built stylesheet sets on parts, `name on <rule> (mode): before -> after` (a readable text color on a selected row). With `changedTokens`, every custom property whose built value moved.
|
|
101
102
|
* @property {string[]} styled - Part styles and typography the change wrote.
|
|
102
103
|
* @property {string[]} kept - Part settings a whole-theme dial left in place (a part setting wins).
|
|
103
104
|
* @property {string[]} lifted - Variant keys the setting was newly repeated on, so a more specific base rule cannot beat it.
|
|
104
|
-
* @property {string[]} notes - What else to know: the shade a color's main token uses and any shade contrast moved, then the generated color files; font loading; what a token feeds; with `png`, the text the sample page's pictures draw cut short, as the browser measured
|
|
105
|
+
* @property {string[]} notes - What else to know: the shade a color's main token uses and any shade contrast moved, then the generated color files; font loading; what a token feeds; with `png`, the text the sample page's pictures draw cut short and the words they break inside the word, as the browser measured them (one note for each part, with its labels).
|
|
105
106
|
* @property {Array<{note: string, run: string[]}>} leftOut - What a whole-theme change leaves out, each with the commands that reach it, one per part: the parts drawn as pills that square corners leave round; the surfaces a border width does not reach, and the dividers it moves. The text output prints it right under the status line.
|
|
106
107
|
* @property {string[]} problems - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
|
|
107
108
|
* @property {ThemeEditProblem[]} newProblems - What this change made unreadable or unseen, each with the command that fixes it: text and borders that read well before it, and the contrast checks the colors it made fail; with `png`, text the sample page's pictures draw cut short, with `flex-shrink 0` on its part when the browser measured that drawing it whole. The text output leads with them, under the status line.
|
|
108
109
|
* @property {number} [missed] - How many misses the theme's own changes left (show --json lists each, with the line that reaches it); the text output counts them near its top.
|
|
109
110
|
* @property {number} [missedParts] - On how many parts those misses are (a part can miss two ways, its border and its shadow).
|
|
111
|
+
* @property {string[]} [missedOn] - Those parts, in show's order; the text output names them.
|
|
110
112
|
* @property {string[]} warnings - Warnings from the theme build.
|
|
111
113
|
* @property {string | null} preview
|
|
112
114
|
* @property {string[]} pictures
|
|
@@ -146,7 +148,7 @@
|
|
|
146
148
|
* @property {string[]} data.colorNotes - What the color config keeps or replaced of a hand edit, tokens that use another shade than usual so they read, and any that still do not.
|
|
147
149
|
* @property {string[]} data.problems
|
|
148
150
|
* @property {ThemeEditProblem[]} data.openProblems - Every contrast problem the theme has now: its text, its borders, and the checks its colors fail, each with the command that fixes it; with `png`, text the sample page's pictures draw cut short, with `flex-shrink 0` on its part when the browser measured that drawing it whole. The text output ends with them.
|
|
149
|
-
* @property {string[]} data.notes - What else to know; with `png`, the text the sample page's pictures draw cut short, as the browser measured
|
|
151
|
+
* @property {string[]} data.notes - What else to know; with `png`, the text the sample page's pictures draw cut short and the words they break inside the word, as the browser measured them (one note for each part, with its labels).
|
|
150
152
|
* @property {string} data.preview
|
|
151
153
|
* @property {string[]} [data.previewStale] - In-app preview files changed by hand, so they were not written again and still show the theme as it was.
|
|
152
154
|
* @property {string} data.sheet - The theme-building page with every component.
|
|
@@ -154,7 +156,7 @@
|
|
|
154
156
|
* @property {string[]} data.skipped - Template pages left out, with the install line each needs.
|
|
155
157
|
* @property {string[]} data.pictures
|
|
156
158
|
* @property {string | null} data.pictureProblem
|
|
157
|
-
* @property {string} [data.look] - With `png`, when the run took them: the pictures to open: with show's full sheet, the picture of each family of components the theme sets a part of (of the buttons when it sets none) first (sheet-<family>.png), then the sample page's and the open states' (each control at rest, hovered, focused and pressed at its top, then every menu, tooltip, popover and list drawn open). The text output says it first and last.
|
|
159
|
+
* @property {string} [data.look] - With `png`, when the run took them: the pictures to open: with show's full sheet, the picture of each family of components the theme sets a part of (of the buttons when it sets none) first (sheet-<family>.png, or, for a family taller than 1600px, the pictures cut from it in order: sheet-<family>-1.png, -2 …), then the sample page's and the open states' (each control at rest, hovered, focused and pressed at its top, then every menu, tooltip, popover and list drawn open). The text output says it first and last.
|
|
158
160
|
* @property {{config: string, module: string, receipt: string} | null} data.colorFiles - The generated color files: the input (in the shape `theme palette generate` reads), the module the theme imports, and the receipt; null when the theme sets no color.
|
|
159
161
|
* @property {{wrote: string[]}} [data.appCopy] - Only the first time the theme's app copy is written: the files written in src/themes/<theme>/.
|
|
160
162
|
* @property {string} [data.appCopyStale] - Set when the app copy was not written: a file, folder or link of yours at one of its names; a link on the way to it (src/, src/themes/ or the copy's folder; the editor writes nothing through one); a file where src/, src/themes/ or the copy's folder goes; or a folder that cannot be written, or a write that failed (with the system's reason, such as not writable or the disk is full).
|
|
@@ -190,7 +192,7 @@
|
|
|
190
192
|
* @experimental May change or be removed in a patch release.
|
|
191
193
|
* @typedef {object} ThemeEditUndoResponse
|
|
192
194
|
* @property {'themeEdit.undo'} type
|
|
193
|
-
* @property {{theme: string, action: 'step', undid: string, refusedBefore?: string, undone: string[], next?: string, settings: number, stepsLeft: number, changedTokens: string[], problems: string[], newProblems: ThemeEditProblem[], notes?: string[]} & ThemeEditPreviewFields} data - `undid` names what the step took back (each setting, base and mode, in one line); `refusedBefore` says a change command refused since the last change changed nothing, so the step took back the change before it; `next` names the change now on top, which the next undo takes back; `notes`, with `png`, the text the sample page's pictures draw cut short.
|
|
195
|
+
* @property {{theme: string, action: 'step', undid: string, refusedBefore?: string, undone: string[], next?: string, settings: number, stepsLeft: number, changedTokens: string[], changedPartTokens?: string[], problems: string[], newProblems: ThemeEditProblem[], notes?: string[]} & ThemeEditPreviewFields} data - `undid` names what the step took back (each setting, base and mode, in one line); `refusedBefore` says a change command refused since the last change changed nothing, so the step took back the change before it; `next` names the change now on top, which the next undo takes back; `notes`, with `png`, the text the sample page's pictures draw cut short.
|
|
194
196
|
*/
|
|
195
197
|
|
|
196
198
|
/**
|
|
@@ -214,7 +216,7 @@
|
|
|
214
216
|
* @property {string[]} data.added - Pages added by this call.
|
|
215
217
|
* @property {string[]} data.refreshed - Pages that were there already and are written again.
|
|
216
218
|
* @property {Array<{page: string, why: string}>} data.matched - Each template page added for a description or --template, and why it was picked.
|
|
217
|
-
* @property {Array<{page: string, reason: string, installCommand: string | null}>} data.skipped - Template pages not added: why (packages the app lacks, or a StyleX compiler it does not have), with the command that installs what is missing.
|
|
219
|
+
* @property {Array<{page: string, reason: string, installCommand: string | null, installGuidance?: string}>} data.skipped - Template pages not added: why (packages the app lacks, or a StyleX compiler it does not have), with the command that installs what is missing, and `installGuidance`, the line a loaded integration gives for adding them, when one is given.
|
|
218
220
|
* @property {string[]} data.notes - What else to know.
|
|
219
221
|
* @property {string[]} data.pages - Every page of the preview, in order.
|
|
220
222
|
* @property {string[]} data.files - Every file the preview wrote.
|
|
@@ -71,14 +71,50 @@ export function relativeToOrigin<T extends {
|
|
|
71
71
|
* name before the legacy one, then Yarn Plug'n'Play. A Core above a project
|
|
72
72
|
* no workspace lists does not count, so a nested project that has not
|
|
73
73
|
* installed its own reports nothing installed. With no Astryx project, only
|
|
74
|
-
* the node_modules of `cwd` itself is read, as released versions did.
|
|
74
|
+
* the node_modules of `cwd` itself is read, as released versions did. The
|
|
75
|
+
* package read is the run's base: Core, or the base a project or `--base`
|
|
76
|
+
* names.
|
|
75
77
|
* @param {string} cwd
|
|
78
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} [base]
|
|
79
|
+
* the base of the upgrade in `cwd` ({@link upgradeBase})
|
|
76
80
|
* @returns {{version: string, packageName: string}|null}
|
|
77
81
|
*/
|
|
78
|
-
export function detectInstalledTargetVersion(cwd: string): {
|
|
82
|
+
export function detectInstalledTargetVersion(cwd: string, base?: import("../../foundation/bases/resolve.mjs").BaseResolution): {
|
|
79
83
|
version: string;
|
|
80
84
|
packageName: string;
|
|
81
85
|
} | null;
|
|
86
|
+
/**
|
|
87
|
+
* The base an upgrade in `cwd` reads, resolved from the project in that
|
|
88
|
+
* folder, so a caller of the package API gets the base the CLI reads there.
|
|
89
|
+
* @param {string} cwd
|
|
90
|
+
* @returns {Promise<import('../../foundation/bases/resolve.mjs').BaseResolution>}
|
|
91
|
+
*/
|
|
92
|
+
export function upgradeBase(cwd: string): Promise<import("../../foundation/bases/resolve.mjs").BaseResolution>;
|
|
93
|
+
/**
|
|
94
|
+
* The target package as a message names it, such as
|
|
95
|
+
* `@astryxdesign/core (or legacy @xds/core)`.
|
|
96
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} base
|
|
97
|
+
* @returns {string}
|
|
98
|
+
*/
|
|
99
|
+
export function upgradeTargetLabel(base: import("../../foundation/bases/resolve.mjs").BaseResolution): string;
|
|
100
|
+
/**
|
|
101
|
+
* Does an upgrade on `base` read Core? Core's codemods, its copied
|
|
102
|
+
* compositions, and the Core version the agent-docs block names belong to a
|
|
103
|
+
* run on Core. A run on another base reads none of them.
|
|
104
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} base
|
|
105
|
+
* @returns {boolean}
|
|
106
|
+
*/
|
|
107
|
+
export function upgradeReadsCore(base: import("../../foundation/bases/resolve.mjs").BaseResolution): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* The version the agent-docs block names after an upgrade: the target Core's
|
|
110
|
+
* in a run on Core, else the version `init` writes, so an upgrade and a later
|
|
111
|
+
* `init` agree.
|
|
112
|
+
* @param {string} cwd
|
|
113
|
+
* @param {string} targetVersion
|
|
114
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} base
|
|
115
|
+
* @returns {string}
|
|
116
|
+
*/
|
|
117
|
+
export function upgradeAgentDocsVersion(cwd: string, targetVersion: string, base: import("../../foundation/bases/resolve.mjs").BaseResolution): string;
|
|
82
118
|
/**
|
|
83
119
|
* Whether the installed Core is newer than this CLI, so part of the requested
|
|
84
120
|
* range has no codemods here.
|
|
@@ -169,9 +205,11 @@ export function collectAllCodemods(): Promise<Array<{
|
|
|
169
205
|
* Core version manifests for the (from, to] range.
|
|
170
206
|
* @param {string} from
|
|
171
207
|
* @param {string} to
|
|
208
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} [base]
|
|
209
|
+
* the upgrade's base ({@link upgradeBase})
|
|
172
210
|
* @returns {Promise<CoreVersionManifest[]>}
|
|
173
211
|
*/
|
|
174
|
-
export function getCoreVersionManifests(from: string, to: string): Promise<CoreVersionManifest[]>;
|
|
212
|
+
export function getCoreVersionManifests(from: string, to: string, base?: import("../../foundation/bases/resolve.mjs").BaseResolution): Promise<CoreVersionManifest[]>;
|
|
175
213
|
/**
|
|
176
214
|
* Ensure jscodeshift is available before running codemods.
|
|
177
215
|
* @param {{installDeps?: boolean}} [options]
|
|
@@ -271,7 +309,8 @@ export function runCoreCodemods(versionManifests: CoreVersionManifest[], { apply
|
|
|
271
309
|
* @param {string} cwd
|
|
272
310
|
* @param {string[]} [extraIntegrationSpecs] explicit `--integration` specs
|
|
273
311
|
* @returns {Promise<{postCodemodHooks: import('../../authoring/config/type').PostCodemodHook[], integrations: import('../../foundation/integrations/integrations.mjs').LoadedIntegration[], ledger: import('../../foundation/integrations/provider-resolution.mjs').ProviderLedger, iconSets: boolean}>}
|
|
274
|
-
* `iconSets`:
|
|
312
|
+
* `iconSets`: icon features are on (an installed icon-set package or
|
|
313
|
+
* `experimental.iconSet`)
|
|
275
314
|
*/
|
|
276
315
|
export function loadProjectContext(cwd: string, extraIntegrationSpecs?: string[]): Promise<{
|
|
277
316
|
postCodemodHooks: import("../../authoring/config/type").PostCodemodHook[];
|
|
@@ -284,9 +323,9 @@ export function loadProjectContext(cwd: string, extraIntegrationSpecs?: string[]
|
|
|
284
323
|
* nudge must not fail the upgrade) and is suppressed for --json/programmatic
|
|
285
324
|
* callers (the silent logger).
|
|
286
325
|
* @param {Array<import('../../foundation/integrations/integrations.mjs').LoadedIntegration>} integrations
|
|
287
|
-
* @param {{iconSets?: boolean}} [options] `iconSets`:
|
|
288
|
-
*
|
|
289
|
-
* is not checked (spec:AST-017 FR27, spec:AST-084 FR0), as in the project's
|
|
326
|
+
* @param {{iconSets?: boolean}} [options] `iconSets`: icon features are on
|
|
327
|
+
* in the project (the icon feature gate). Without them a package's
|
|
328
|
+
* experimental icon-set root is not checked (spec:AST-017 FR27, spec:AST-084 FR0), as in the project's
|
|
290
329
|
* own issues.
|
|
291
330
|
* @returns {Promise<void>}
|
|
292
331
|
*/
|
package/api/upgrade/_adapter.mjs
CHANGED
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
import {runIntegrationCodemods} from '../../assets/codemods/integration-runner.mjs';
|
|
33
33
|
import {
|
|
34
34
|
AgentDocsHomeError,
|
|
35
|
+
agentDocsVersion,
|
|
35
36
|
assertAgentDocsTarget,
|
|
36
37
|
installAgentDocs,
|
|
37
38
|
inspectAgentDocs,
|
|
@@ -52,10 +53,17 @@ import {
|
|
|
52
53
|
} from '../../foundation/fs/paths.mjs';
|
|
53
54
|
import {Project, providerLedgerOf} from '../../foundation/config/project.mjs';
|
|
54
55
|
import {loadIntegrations} from '../../foundation/integrations/integrations.mjs';
|
|
56
|
+
import {iconFeatureGate} from '../../foundation/integrations/icon-features.mjs';
|
|
55
57
|
import {resolveProviders} from '../../foundation/integrations/provider-resolution.mjs';
|
|
56
58
|
import {warnOnIntegrationIssues} from '../../foundation/integrations/integration-warnings.mjs';
|
|
57
59
|
import {logger} from '../logger.mjs';
|
|
58
|
-
import {
|
|
60
|
+
import {
|
|
61
|
+
isBaseIntegration,
|
|
62
|
+
runBase,
|
|
63
|
+
splitForBase,
|
|
64
|
+
} from '../../foundation/bases/resolve.mjs';
|
|
65
|
+
|
|
66
|
+
import {CORE_PROVIDER_ID} from '../../foundation/identity/providers.mjs';
|
|
59
67
|
|
|
60
68
|
/** The package that owns Core's components, hooks, and codemods. */
|
|
61
69
|
export {CORE_PROVIDER_ID as CORE_PACKAGE} from '../../foundation/identity/providers.mjs';
|
|
@@ -191,6 +199,12 @@ function rebaseDeclaration(rebase) {
|
|
|
191
199
|
};
|
|
192
200
|
}
|
|
193
201
|
|
|
202
|
+
/**
|
|
203
|
+
* Earlier names a base's package was published under.
|
|
204
|
+
* @type {Record<string, string[]>}
|
|
205
|
+
*/
|
|
206
|
+
const LEGACY_NAMES = {[CORE_PROVIDER_ID]: ['@xds/core']};
|
|
207
|
+
|
|
194
208
|
/**
|
|
195
209
|
* Detect the installed target version: the Core the Astryx project of `cwd`
|
|
196
210
|
* installed, in its own node_modules or, for a member its workspace lists, in
|
|
@@ -198,12 +212,16 @@ function rebaseDeclaration(rebase) {
|
|
|
198
212
|
* name before the legacy one, then Yarn Plug'n'Play. A Core above a project
|
|
199
213
|
* no workspace lists does not count, so a nested project that has not
|
|
200
214
|
* installed its own reports nothing installed. With no Astryx project, only
|
|
201
|
-
* the node_modules of `cwd` itself is read, as released versions did.
|
|
215
|
+
* the node_modules of `cwd` itself is read, as released versions did. The
|
|
216
|
+
* package read is the run's base: Core, or the base a project or `--base`
|
|
217
|
+
* names.
|
|
202
218
|
* @param {string} cwd
|
|
219
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} [base]
|
|
220
|
+
* the base of the upgrade in `cwd` ({@link upgradeBase})
|
|
203
221
|
* @returns {{version: string, packageName: string}|null}
|
|
204
222
|
*/
|
|
205
|
-
export function detectInstalledTargetVersion(cwd) {
|
|
206
|
-
const found = findProjectPackageOf(cwd,
|
|
223
|
+
export function detectInstalledTargetVersion(cwd, base = runBase(cwd)) {
|
|
224
|
+
const found = findProjectPackageOf(cwd, targetPackages(base));
|
|
207
225
|
if (!found) return null;
|
|
208
226
|
try {
|
|
209
227
|
const pkg = JSON.parse(
|
|
@@ -216,6 +234,68 @@ export function detectInstalledTargetVersion(cwd) {
|
|
|
216
234
|
}
|
|
217
235
|
}
|
|
218
236
|
|
|
237
|
+
/**
|
|
238
|
+
* The base an upgrade in `cwd` reads, resolved from the project in that
|
|
239
|
+
* folder, so a caller of the package API gets the base the CLI reads there.
|
|
240
|
+
* @param {string} cwd
|
|
241
|
+
* @returns {Promise<import('../../foundation/bases/resolve.mjs').BaseResolution>}
|
|
242
|
+
*/
|
|
243
|
+
export async function upgradeBase(cwd) {
|
|
244
|
+
try {
|
|
245
|
+
return (await Project.load(cwd, {core: 'project'})).base;
|
|
246
|
+
} catch {
|
|
247
|
+
// A config that does not load yet, which a config codemod may fix,
|
|
248
|
+
// leaves the base the CLI resolves without it.
|
|
249
|
+
return runBase(cwd);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* The packages that hold an upgrade's target version: the base's package,
|
|
255
|
+
* then the earlier names it was published under.
|
|
256
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} base
|
|
257
|
+
* @returns {string[]}
|
|
258
|
+
*/
|
|
259
|
+
function targetPackages(base) {
|
|
260
|
+
const name = base.ok ? base.base.name : CORE_PROVIDER_ID;
|
|
261
|
+
return [name, ...(LEGACY_NAMES[name] ?? [])];
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* The target package as a message names it, such as
|
|
266
|
+
* `@astryxdesign/core (or legacy @xds/core)`.
|
|
267
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} base
|
|
268
|
+
* @returns {string}
|
|
269
|
+
*/
|
|
270
|
+
export function upgradeTargetLabel(base) {
|
|
271
|
+
const [name, ...legacy] = targetPackages(base);
|
|
272
|
+
return legacy.length > 0 ? `${name} (or legacy ${legacy.join(', ')})` : name;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Does an upgrade on `base` read Core? Core's codemods, its copied
|
|
277
|
+
* compositions, and the Core version the agent-docs block names belong to a
|
|
278
|
+
* run on Core. A run on another base reads none of them.
|
|
279
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} base
|
|
280
|
+
* @returns {boolean}
|
|
281
|
+
*/
|
|
282
|
+
export function upgradeReadsCore(base) {
|
|
283
|
+
return !base.ok || base.base.core;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The version the agent-docs block names after an upgrade: the target Core's
|
|
288
|
+
* in a run on Core, else the version `init` writes, so an upgrade and a later
|
|
289
|
+
* `init` agree.
|
|
290
|
+
* @param {string} cwd
|
|
291
|
+
* @param {string} targetVersion
|
|
292
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} base
|
|
293
|
+
* @returns {string}
|
|
294
|
+
*/
|
|
295
|
+
export function upgradeAgentDocsVersion(cwd, targetVersion, base) {
|
|
296
|
+
return upgradeReadsCore(base) ? targetVersion : agentDocsVersion(cwd);
|
|
297
|
+
}
|
|
298
|
+
|
|
219
299
|
/**
|
|
220
300
|
* The running CLI's own version, read from its package.json.
|
|
221
301
|
* @returns {string | null} null when it cannot be read or is not semver
|
|
@@ -566,9 +646,10 @@ export function applyAgentDocsRefresh(plan) {
|
|
|
566
646
|
* a run whose base is not Core has none.
|
|
567
647
|
* @param {string} from
|
|
568
648
|
* @param {string} to
|
|
649
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} base
|
|
569
650
|
*/
|
|
570
|
-
async function coreTransformsBetween(from, to) {
|
|
571
|
-
return
|
|
651
|
+
async function coreTransformsBetween(from, to, base) {
|
|
652
|
+
return upgradeReadsCore(base) ? getTransformsBetween(from, to) : [];
|
|
572
653
|
}
|
|
573
654
|
|
|
574
655
|
/**
|
|
@@ -579,7 +660,7 @@ async function coreTransformsBetween(from, to) {
|
|
|
579
660
|
export async function collectAllCodemods() {
|
|
580
661
|
const codemods = [];
|
|
581
662
|
const manifests = /** @type {CoreVersionManifest[]} */ (
|
|
582
|
-
await coreTransformsBetween('0.0.0', latestVersion)
|
|
663
|
+
await coreTransformsBetween('0.0.0', latestVersion, runBase())
|
|
583
664
|
);
|
|
584
665
|
for (const {version, transforms} of manifests) {
|
|
585
666
|
for (const {name, meta, optional} of transforms) {
|
|
@@ -599,11 +680,13 @@ export async function collectAllCodemods() {
|
|
|
599
680
|
* Core version manifests for the (from, to] range.
|
|
600
681
|
* @param {string} from
|
|
601
682
|
* @param {string} to
|
|
683
|
+
* @param {import('../../foundation/bases/resolve.mjs').BaseResolution} [base]
|
|
684
|
+
* the upgrade's base ({@link upgradeBase})
|
|
602
685
|
* @returns {Promise<CoreVersionManifest[]>}
|
|
603
686
|
*/
|
|
604
|
-
export async function getCoreVersionManifests(from, to) {
|
|
687
|
+
export async function getCoreVersionManifests(from, to, base = runBase()) {
|
|
605
688
|
return /** @type {CoreVersionManifest[]} */ ([
|
|
606
|
-
...(await coreTransformsBetween(from, to)),
|
|
689
|
+
...(await coreTransformsBetween(from, to, base)),
|
|
607
690
|
]);
|
|
608
691
|
}
|
|
609
692
|
|
|
@@ -710,7 +793,8 @@ export async function runCoreCodemods(
|
|
|
710
793
|
* @param {string} cwd
|
|
711
794
|
* @param {string[]} [extraIntegrationSpecs] explicit `--integration` specs
|
|
712
795
|
* @returns {Promise<{postCodemodHooks: import('../../authoring/config/type').PostCodemodHook[], integrations: import('../../foundation/integrations/integrations.mjs').LoadedIntegration[], ledger: import('../../foundation/integrations/provider-resolution.mjs').ProviderLedger, iconSets: boolean}>}
|
|
713
|
-
* `iconSets`:
|
|
796
|
+
* `iconSets`: icon features are on (an installed icon-set package or
|
|
797
|
+
* `experimental.iconSet`)
|
|
714
798
|
*/
|
|
715
799
|
export async function loadProjectContext(cwd, extraIntegrationSpecs = []) {
|
|
716
800
|
// The CLI debug preflight may already have imported this config before core
|
|
@@ -763,7 +847,7 @@ export async function loadProjectContext(cwd, extraIntegrationSpecs = []) {
|
|
|
763
847
|
: // Resolved from the project, as --integration names a package it
|
|
764
848
|
// installed, not from whichever folder the process started in.
|
|
765
849
|
await loadIntegrations(extraSpecs, {cwd, resolveProviders: false});
|
|
766
|
-
const
|
|
850
|
+
const resolved = resolveProviders(
|
|
767
851
|
[
|
|
768
852
|
...candidates,
|
|
769
853
|
...installed.map(integration => ({
|
|
@@ -779,11 +863,22 @@ export async function loadProjectContext(cwd, extraIntegrationSpecs = []) {
|
|
|
779
863
|
],
|
|
780
864
|
{codemods: true, prior: providerLedgerOf(project)},
|
|
781
865
|
);
|
|
866
|
+
const {ledger} = resolved;
|
|
867
|
+
// Only integrations that are the run's base or build on it run codemods,
|
|
868
|
+
// the --integration packages included. Every base the project load found
|
|
869
|
+
// counts, whether or not the config lists it.
|
|
870
|
+
const bases = [
|
|
871
|
+
...project.loadedIntegrations,
|
|
872
|
+
...project.integrationsLeftOut.map(({integration}) => integration),
|
|
873
|
+
].filter(isBaseIntegration);
|
|
874
|
+
const integrations = project.base.ok
|
|
875
|
+
? splitForBase(resolved.integrations, project.base.base, bases).kept
|
|
876
|
+
: resolved.integrations;
|
|
782
877
|
return {
|
|
783
878
|
postCodemodHooks,
|
|
784
879
|
integrations,
|
|
785
880
|
ledger,
|
|
786
|
-
iconSets:
|
|
881
|
+
iconSets: iconFeatureGate(project).on,
|
|
787
882
|
};
|
|
788
883
|
}
|
|
789
884
|
|
|
@@ -792,9 +887,9 @@ export async function loadProjectContext(cwd, extraIntegrationSpecs = []) {
|
|
|
792
887
|
* nudge must not fail the upgrade) and is suppressed for --json/programmatic
|
|
793
888
|
* callers (the silent logger).
|
|
794
889
|
* @param {Array<import('../../foundation/integrations/integrations.mjs').LoadedIntegration>} integrations
|
|
795
|
-
* @param {{iconSets?: boolean}} [options] `iconSets`:
|
|
796
|
-
*
|
|
797
|
-
* is not checked (spec:AST-017 FR27, spec:AST-084 FR0), as in the project's
|
|
890
|
+
* @param {{iconSets?: boolean}} [options] `iconSets`: icon features are on
|
|
891
|
+
* in the project (the icon feature gate). Without them a package's
|
|
892
|
+
* experimental icon-set root is not checked (spec:AST-017 FR27, spec:AST-084 FR0), as in the project's
|
|
798
893
|
* own issues.
|
|
799
894
|
* @returns {Promise<void>}
|
|
800
895
|
*/
|
|
@@ -6,20 +6,23 @@ export function discoverRegistryReceipts(root: string): string[];
|
|
|
6
6
|
/**
|
|
7
7
|
* Reported paths are relative to the scanned source folder, or, when `origin`
|
|
8
8
|
* names the folder the command ran in below the project root `cwd`, to that
|
|
9
|
-
* folder, so they resolve from where the command ran.
|
|
9
|
+
* folder, so they resolve from where the command ran. Copied compositions
|
|
10
|
+
* come from Core, so with `readsCore` false (a run on another base) none is
|
|
11
|
+
* checked, once the source folder passes its check.
|
|
10
12
|
* @param {{apply?: boolean, path?: string}} options
|
|
11
|
-
* @param {{cwd?: string, origin?: string, fetchImpl?: typeof fetch, registryOrigin?: string, expectedVersion?: string, requireExpectedVersion?: boolean}} [ctx]
|
|
13
|
+
* @param {{cwd?: string, origin?: string, fetchImpl?: typeof fetch, registryOrigin?: string, expectedVersion?: string, requireExpectedVersion?: boolean, readsCore?: boolean}} [ctx]
|
|
12
14
|
*/
|
|
13
15
|
export function reconcileRegistryCompositions(options?: {
|
|
14
16
|
apply?: boolean;
|
|
15
17
|
path?: string;
|
|
16
|
-
}, { cwd, origin, fetchImpl, registryOrigin, expectedVersion, requireExpectedVersion, }?: {
|
|
18
|
+
}, { cwd, origin, fetchImpl, registryOrigin, expectedVersion, requireExpectedVersion, readsCore, }?: {
|
|
17
19
|
cwd?: string;
|
|
18
20
|
origin?: string;
|
|
19
21
|
fetchImpl?: typeof fetch;
|
|
20
22
|
registryOrigin?: string;
|
|
21
23
|
expectedVersion?: string;
|
|
22
24
|
requireExpectedVersion?: boolean;
|
|
25
|
+
readsCore?: boolean;
|
|
23
26
|
}): Promise<{
|
|
24
27
|
summary: import("../upgrade.type.mjs").RegistryCompositionSummary;
|
|
25
28
|
writtenFiles: string[];
|