@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
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* source.
|
|
9
9
|
* @output inputFieldsFrom(): the fields; sourceFieldProblems(): each
|
|
10
10
|
* misspelled field a source writes, with its line and the field it
|
|
11
|
-
* is near; sourceTypography(): the
|
|
11
|
+
* is near; sourceTypography() and sourceInputField(): the values it
|
|
12
|
+
* writes in its typography (or another input field).
|
|
12
13
|
* @position Shared by the editor, which refuses a misspelled field, and by
|
|
13
14
|
* theme build, which warns it: defineTheme() drops a field it does
|
|
14
15
|
* not take, so only the source shows it.
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
import {babelParse as parseModule} from '../../../foundation/runtime/lazy-dependencies.mjs';
|
|
18
19
|
import {levenshteinDistance} from '../../../foundation/text/levenshtein.mjs';
|
|
19
20
|
import {sourcePlugins} from './source-syntax.mjs';
|
|
21
|
+
import {entriesNotRead} from './written-values.mjs';
|
|
20
22
|
import {UNREAD} from './typography-values.mjs';
|
|
21
23
|
|
|
22
24
|
/**
|
|
@@ -210,6 +212,16 @@ function readModule({file, source}) {
|
|
|
210
212
|
consts.set(d.id.name, d.init);
|
|
211
213
|
if (decl !== st) exported.set(d.id.name, d.init);
|
|
212
214
|
}
|
|
215
|
+
// A top-level assignment gives a name its value from there on: the
|
|
216
|
+
// last one is the value the module ends with.
|
|
217
|
+
const assigned =
|
|
218
|
+
st.type === 'ExpressionStatement' &&
|
|
219
|
+
st.expression?.type === 'AssignmentExpression' &&
|
|
220
|
+
st.expression.operator === '=' &&
|
|
221
|
+
st.expression.left?.type === 'Identifier'
|
|
222
|
+
? st.expression
|
|
223
|
+
: null;
|
|
224
|
+
if (assigned) consts.set(assigned.left.name, assigned.right);
|
|
213
225
|
if (st.type === 'ImportDeclaration' && st.importKind !== 'type') {
|
|
214
226
|
const specifier = String(st.source.value);
|
|
215
227
|
for (const x of st.specifiers) {
|
|
@@ -286,17 +298,113 @@ function themeInputs(entry, load) {
|
|
|
286
298
|
* @param {any} node @param {any} mod @param {number} [depth]
|
|
287
299
|
* @returns {{node: any, mod: any} | null}
|
|
288
300
|
*/
|
|
289
|
-
const objectOf = (node, mod, depth = 0) =>
|
|
301
|
+
const objectOf = (node, mod, depth = 0) =>
|
|
302
|
+
objectsOf(node, mod, depth)[0] ?? null;
|
|
303
|
+
/**
|
|
304
|
+
* Every object literal a value can be, following consts and relative
|
|
305
|
+
* imports, with the module that writes each: a member of an object or an
|
|
306
|
+
* element of an array the source writes (`all.a`, `list[0]`), each branch
|
|
307
|
+
* of a ternary or a `||`/`??`, and each object `Object.assign` merges.
|
|
308
|
+
* Empty when the source shows none.
|
|
309
|
+
* @param {any} node @param {any} mod @param {number} [depth]
|
|
310
|
+
* @returns {Array<{node: any, mod: any}>}
|
|
311
|
+
*/
|
|
312
|
+
const objectsOf = (node, mod, depth = 0) => {
|
|
290
313
|
const value = unwrap(node);
|
|
291
|
-
if (!value || depth > 8) return
|
|
292
|
-
if (value.type === 'ObjectExpression') return {node: value, mod};
|
|
293
|
-
if (value.type
|
|
314
|
+
if (!value || depth > 8) return [];
|
|
315
|
+
if (value.type === 'ObjectExpression') return [{node: value, mod}];
|
|
316
|
+
if (value.type === 'ConditionalExpression')
|
|
317
|
+
return [
|
|
318
|
+
...objectsOf(value.consequent, mod, depth + 1),
|
|
319
|
+
...objectsOf(value.alternate, mod, depth + 1),
|
|
320
|
+
];
|
|
321
|
+
if (value.type === 'LogicalExpression')
|
|
322
|
+
return [
|
|
323
|
+
...objectsOf(value.left, mod, depth + 1),
|
|
324
|
+
...objectsOf(value.right, mod, depth + 1),
|
|
325
|
+
];
|
|
326
|
+
if (
|
|
327
|
+
value.type === 'CallExpression' &&
|
|
328
|
+
value.callee?.type === 'MemberExpression' &&
|
|
329
|
+
!value.callee.computed &&
|
|
330
|
+
value.callee.object?.type === 'Identifier' &&
|
|
331
|
+
value.callee.object.name === 'Object' &&
|
|
332
|
+
value.callee.property?.name === 'assign'
|
|
333
|
+
)
|
|
334
|
+
return value.arguments.flatMap((/** @type {any} */ a) =>
|
|
335
|
+
objectsOf(a, mod, depth + 1),
|
|
336
|
+
);
|
|
337
|
+
if (value.type === 'MemberExpression') {
|
|
338
|
+
const key = value.computed
|
|
339
|
+
? value.property?.type === 'StringLiteral' ||
|
|
340
|
+
value.property?.type === 'NumericLiteral'
|
|
341
|
+
? String(value.property.value)
|
|
342
|
+
: null
|
|
343
|
+
: value.property?.name;
|
|
344
|
+
if (key == null) return [];
|
|
345
|
+
// A member of a module a dynamic import loads is that module's export.
|
|
346
|
+
const ns = namespaceOf(value.object, mod, depth + 1);
|
|
347
|
+
if (ns) {
|
|
348
|
+
const found = exportOf(ns, key, depth + 1);
|
|
349
|
+
return found ? [found] : [];
|
|
350
|
+
}
|
|
351
|
+
const list = arrayOf(value.object, mod, depth + 1);
|
|
352
|
+
if (list && /^\d+$/.test(key)) {
|
|
353
|
+
const element = list.node.elements[Number(key)];
|
|
354
|
+
return element ? objectsOf(element, list.mod, depth + 1) : [];
|
|
355
|
+
}
|
|
356
|
+
return objectsOf(value.object, mod, depth + 1).flatMap(holder => {
|
|
357
|
+
const p = holder.node.properties.find(
|
|
358
|
+
(/** @type {any} */ x) =>
|
|
359
|
+
x.type === 'ObjectProperty' && keyOf(x) === key,
|
|
360
|
+
);
|
|
361
|
+
return p ? objectsOf(p.value, holder.mod, depth + 1) : [];
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
if (value.type !== 'Identifier') return [];
|
|
294
365
|
if (mod.consts.has(value.name))
|
|
295
|
-
return
|
|
366
|
+
return objectsOf(mod.consts.get(value.name), mod, depth + 1);
|
|
296
367
|
const from = mod.imports.get(value.name);
|
|
297
|
-
if (!from) return
|
|
368
|
+
if (!from) return [];
|
|
298
369
|
const other = imported(mod, from.specifier);
|
|
299
|
-
|
|
370
|
+
const found = other ? exportOf(other, from.imported, depth + 1) : null;
|
|
371
|
+
return found ? [found] : [];
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* The module a value is, when it is what a dynamic import of a relative
|
|
375
|
+
* module gives (`await import('./in')`), following the consts of its
|
|
376
|
+
* module; null otherwise.
|
|
377
|
+
* @param {any} node @param {any} mod @param {number} depth
|
|
378
|
+
* @returns {any}
|
|
379
|
+
*/
|
|
380
|
+
const namespaceOf = (node, mod, depth) => {
|
|
381
|
+
let value = unwrap(node);
|
|
382
|
+
if (value?.type === 'AwaitExpression') value = unwrap(value.argument);
|
|
383
|
+
if (!value || depth > 8) return null;
|
|
384
|
+
const source =
|
|
385
|
+
value.type === 'ImportExpression'
|
|
386
|
+
? value.source
|
|
387
|
+
: value.type === 'CallExpression' && value.callee?.type === 'Import'
|
|
388
|
+
? value.arguments?.[0]
|
|
389
|
+
: null;
|
|
390
|
+
if (source?.type === 'StringLiteral')
|
|
391
|
+
return imported(mod, String(source.value));
|
|
392
|
+
return value.type === 'Identifier' && mod.consts.has(value.name)
|
|
393
|
+
? namespaceOf(mod.consts.get(value.name), mod, depth + 1)
|
|
394
|
+
: null;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* The array literal a value is, following the consts of its module.
|
|
398
|
+
* @param {any} node @param {any} mod @param {number} depth
|
|
399
|
+
* @returns {{node: any, mod: any} | null}
|
|
400
|
+
*/
|
|
401
|
+
const arrayOf = (node, mod, depth) => {
|
|
402
|
+
const value = unwrap(node);
|
|
403
|
+
if (!value || depth > 8) return null;
|
|
404
|
+
if (value.type === 'ArrayExpression') return {node: value, mod};
|
|
405
|
+
return value.type === 'Identifier' && mod.consts.has(value.name)
|
|
406
|
+
? arrayOf(mod.consts.get(value.name), mod, depth + 1)
|
|
407
|
+
: null;
|
|
300
408
|
};
|
|
301
409
|
/**
|
|
302
410
|
* The object literal a module exports under a name.
|
|
@@ -349,17 +457,21 @@ function themeInputs(entry, load) {
|
|
|
349
457
|
: callee?.type === 'MemberExpression' && !callee.computed
|
|
350
458
|
? callee.property?.name
|
|
351
459
|
: null;
|
|
352
|
-
if (name === 'defineTheme')
|
|
353
|
-
|
|
354
|
-
//
|
|
460
|
+
if (name === 'defineTheme')
|
|
461
|
+
for (const value of objectsOf(node.arguments?.[0], mod)) add(value);
|
|
462
|
+
// A plain object exported as the default is a theme when it, or an
|
|
463
|
+
// object merged into it, has its name (one that holds themes by name
|
|
464
|
+
// is no theme input).
|
|
355
465
|
if (node.type === 'ExportDefaultDeclaration') {
|
|
356
|
-
const
|
|
466
|
+
const values = objectsOf(node.declaration, mod);
|
|
357
467
|
if (
|
|
358
|
-
|
|
359
|
-
(
|
|
468
|
+
values.some(value =>
|
|
469
|
+
value.node.properties.some(
|
|
470
|
+
(/** @type {any} */ p) => keyOf(p) === 'name',
|
|
471
|
+
),
|
|
360
472
|
)
|
|
361
473
|
)
|
|
362
|
-
add(value);
|
|
474
|
+
for (const value of values) add(value);
|
|
363
475
|
}
|
|
364
476
|
for (const [k, v] of Object.entries(node))
|
|
365
477
|
if (
|
|
@@ -458,6 +570,21 @@ export function sourceFieldProblems(entry, fields, load) {
|
|
|
458
570
|
if (k == null) continue;
|
|
459
571
|
const literal =
|
|
460
572
|
p.type === 'ObjectProperty' ? literalOf(p.value, object.mod) : null;
|
|
573
|
+
// A Map or a Set: defineTheme reads an object's own keys.
|
|
574
|
+
if (
|
|
575
|
+
takes.includes(k) &&
|
|
576
|
+
literal?.type === 'NewExpression' &&
|
|
577
|
+
literal.callee?.type === 'Identifier' &&
|
|
578
|
+
['Map', 'Set', 'WeakMap', 'WeakSet'].includes(literal.callee.name)
|
|
579
|
+
) {
|
|
580
|
+
out.push({
|
|
581
|
+
path: [...at, k],
|
|
582
|
+
file: object.mod.file,
|
|
583
|
+
line: p.loc?.start?.line ?? null,
|
|
584
|
+
why: entriesNotRead(k, literal.callee.name),
|
|
585
|
+
});
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
461
588
|
if (values_ && takes.includes(k) && literal?.type === 'BigIntLiteral') {
|
|
462
589
|
out.push({
|
|
463
590
|
path: [...at, k],
|
|
@@ -615,6 +742,18 @@ export function inputFieldProblems(input, fields) {
|
|
|
615
742
|
* @returns {unknown}
|
|
616
743
|
*/
|
|
617
744
|
export function sourceTypography(source, file = '') {
|
|
745
|
+
return sourceInputField(source, file, 'typography');
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* One field of a theme source's input (`typography`, `radius`) as the plain
|
|
750
|
+
* values it writes, read as sourceTypography() reads typography.
|
|
751
|
+
* @param {string} source
|
|
752
|
+
* @param {string} file the source's file name
|
|
753
|
+
* @param {string} field
|
|
754
|
+
* @returns {unknown}
|
|
755
|
+
*/
|
|
756
|
+
export function sourceInputField(source, file, field) {
|
|
618
757
|
const {inputs, objectOf} = themeInputs({file, source}, () => null);
|
|
619
758
|
/** @param {any} node @param {any} mod @returns {any} */
|
|
620
759
|
const plain = (node, mod) => {
|
|
@@ -658,7 +797,7 @@ export function sourceTypography(source, file = '') {
|
|
|
658
797
|
for (const input of inputs) {
|
|
659
798
|
const p = input.node.properties.find(
|
|
660
799
|
(/** @type {any} */ x) =>
|
|
661
|
-
x.type === 'ObjectProperty' && keyOf(x) ===
|
|
800
|
+
x.type === 'ObjectProperty' && keyOf(x) === field,
|
|
662
801
|
);
|
|
663
802
|
const v = p ? plain(p.value, input.mod) : UNREAD;
|
|
664
803
|
if (v !== UNREAD) return v;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Every problem in a theme's own radius scale: Core multiplies the base by
|
|
6
|
+
* the multiplier for each corner token, so a scale with no base or no
|
|
7
|
+
* multiplier, or one that is no number, builds every scaled corner as
|
|
8
|
+
* NaNpx, which the browser drops (the corners go square). A falsy radius
|
|
9
|
+
* (0, '', false) Core skips: it builds no corner token, and the base's
|
|
10
|
+
* corners stay.
|
|
11
|
+
* @param {unknown} radius the raw `radius` input
|
|
12
|
+
* @returns {Array<{path: string[], why: string, value: unknown}>}
|
|
13
|
+
*/
|
|
14
|
+
export function radiusInputProblems(radius: unknown): Array<{
|
|
15
|
+
path: string[];
|
|
16
|
+
why: string;
|
|
17
|
+
value: unknown;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file What is wrong with the radius scale a theme gives, judged by what
|
|
5
|
+
* Core builds from it.
|
|
6
|
+
* @input A theme's raw `radius` input.
|
|
7
|
+
* @output radiusInputProblems(): each problem, by its path.
|
|
8
|
+
* @position Shared by the editor, which refuses each problem, and by theme
|
|
9
|
+
* build, which warns it at its line: one judge for one file, as
|
|
10
|
+
* typography-values.mjs is for the typography block.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import {UNREAD} from './typography-values.mjs';
|
|
14
|
+
|
|
15
|
+
/** @param {unknown} value */
|
|
16
|
+
const isBlock = value =>
|
|
17
|
+
value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
18
|
+
|
|
19
|
+
/** What each field of the radius scale is, for the line that adds it. */
|
|
20
|
+
const FIELDS = /** @type {const} */ ({
|
|
21
|
+
base: 'the step in pixels, such as radius: {base: 4, multiplier: …}',
|
|
22
|
+
multiplier:
|
|
23
|
+
'how far each step is scaled, such as radius: {base: …, multiplier: 1}',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Every problem in a theme's own radius scale: Core multiplies the base by
|
|
28
|
+
* the multiplier for each corner token, so a scale with no base or no
|
|
29
|
+
* multiplier, or one that is no number, builds every scaled corner as
|
|
30
|
+
* NaNpx, which the browser drops (the corners go square). A falsy radius
|
|
31
|
+
* (0, '', false) Core skips: it builds no corner token, and the base's
|
|
32
|
+
* corners stay.
|
|
33
|
+
* @param {unknown} radius the raw `radius` input
|
|
34
|
+
* @returns {Array<{path: string[], why: string, value: unknown}>}
|
|
35
|
+
*/
|
|
36
|
+
export function radiusInputProblems(radius) {
|
|
37
|
+
/** @type {Array<{path: string[], why: string, value: unknown}>} */
|
|
38
|
+
const out = [];
|
|
39
|
+
// A value the source reader could not read is never judged as missing.
|
|
40
|
+
if (radius == null || radius === UNREAD) return out;
|
|
41
|
+
if (!radius) {
|
|
42
|
+
out.push({
|
|
43
|
+
path: ['radius'],
|
|
44
|
+
why: `Core skips a radius of ${JSON.stringify(radius) ?? String(radius)} and builds no corner token from it, so the theme keeps its base theme's corners; for square corners give radius: {base: 0, multiplier: 1}`,
|
|
45
|
+
value: radius,
|
|
46
|
+
});
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
if (!isBlock(radius)) {
|
|
50
|
+
out.push({
|
|
51
|
+
path: ['radius'],
|
|
52
|
+
why: `radius is a block of a base and a multiplier, such as radius: {base: 4, multiplier: 1}, and Core reads ${JSON.stringify(radius) ?? String(radius)} as one with neither, so it builds every scaled corner as NaNpx, which the browser drops`,
|
|
53
|
+
value: radius,
|
|
54
|
+
});
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
const r = /** @type {Record<string | symbol, unknown>} */ (radius);
|
|
58
|
+
for (const field of /** @type {const} */ (['base', 'multiplier'])) {
|
|
59
|
+
const value = r[field];
|
|
60
|
+
if (value === UNREAD) continue;
|
|
61
|
+
if (value === undefined && !r[UNREAD])
|
|
62
|
+
out.push({
|
|
63
|
+
path: ['radius'],
|
|
64
|
+
why: `the radius scale is given no ${field}, and Core builds each corner from the base and the multiplier together, so every scaled corner is NaNpx, which the browser drops (the corners go square): add ${FIELDS[field]}`,
|
|
65
|
+
value: radius,
|
|
66
|
+
});
|
|
67
|
+
// (Core multiplies what it is given: a boolean counts as 1 or 0.)
|
|
68
|
+
else if (value !== undefined && !Number.isFinite(Number(value)))
|
|
69
|
+
out.push({
|
|
70
|
+
path: ['radius', field],
|
|
71
|
+
why: `the radius scale's ${field} is a number, and Core builds every scaled corner from ${JSON.stringify(value) ?? String(value)} as NaNpx, which the browser drops: give ${FIELDS[field]}`,
|
|
72
|
+
value,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* build, which warns it at its line: one judge for one file.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import {writtenPrimitive} from './written-values.mjs';
|
|
18
|
+
|
|
17
19
|
/**
|
|
18
20
|
* A type scale field as the number Core reads, or NaN: a number, or text
|
|
19
21
|
* that is a number; any other value (a boolean, a symbol, an array) is no
|
|
@@ -21,7 +23,7 @@
|
|
|
21
23
|
* @param {unknown} value
|
|
22
24
|
*/
|
|
23
25
|
const scaleNumber = value => {
|
|
24
|
-
const v =
|
|
26
|
+
const v = writtenPrimitive(value);
|
|
25
27
|
return typeof v === 'number'
|
|
26
28
|
? v
|
|
27
29
|
: typeof v === 'string' && v.trim() !== ''
|
|
@@ -29,24 +31,6 @@ const scaleNumber = value => {
|
|
|
29
31
|
: NaN;
|
|
30
32
|
};
|
|
31
33
|
|
|
32
|
-
/**
|
|
33
|
-
* A value as the build hands it to Core: a boxed primitive
|
|
34
|
-
* (`new Number(16)`) as its primitive, and a BigInt as its digits, which is
|
|
35
|
-
* how the build writes it.
|
|
36
|
-
* @param {unknown} value
|
|
37
|
-
* @returns {unknown}
|
|
38
|
-
*/
|
|
39
|
-
function primitive(value) {
|
|
40
|
-
if (
|
|
41
|
-
value instanceof Number ||
|
|
42
|
-
value instanceof String ||
|
|
43
|
-
value instanceof Boolean
|
|
44
|
-
)
|
|
45
|
-
return value.valueOf();
|
|
46
|
-
if (typeof value === 'bigint') return String(value);
|
|
47
|
-
return value;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
34
|
/**
|
|
51
35
|
* A value the source writes that cannot be known without running it (a
|
|
52
36
|
* call, a name from another module). On a block, as a key, it marks a block
|
|
@@ -120,7 +104,7 @@ function nearWeightName(value) {
|
|
|
120
104
|
* @returns {string | null}
|
|
121
105
|
*/
|
|
122
106
|
function weightTextProblem(value) {
|
|
123
|
-
value =
|
|
107
|
+
value = writtenPrimitive(value);
|
|
124
108
|
if (typeof value !== 'string' || value === '' || isFontWeight(value))
|
|
125
109
|
return null;
|
|
126
110
|
const near = nearWeightName(value);
|
|
@@ -150,7 +134,7 @@ export function isHeadingLevel(key, levels) {
|
|
|
150
134
|
* @returns {string | null}
|
|
151
135
|
*/
|
|
152
136
|
export function typographyValueProblem(key, value) {
|
|
153
|
-
value =
|
|
137
|
+
value = writtenPrimitive(value);
|
|
154
138
|
const parts = key.split('.');
|
|
155
139
|
const field = parts.at(-1);
|
|
156
140
|
// A role and the scale are blocks: Core reads their fields, so a plain
|
|
@@ -243,7 +227,7 @@ export const missingScaleFieldWhy = field =>
|
|
|
243
227
|
* @param {unknown} value
|
|
244
228
|
*/
|
|
245
229
|
export const typographyBlockWhy = value =>
|
|
246
|
-
`typography is a block of roles and a scale, such as typography: {body: {family: 'Inter'}}, and Core reads nothing from ${describe(
|
|
230
|
+
`typography is a block of roles and a scale, such as typography: {body: {family: 'Inter'}}, and Core reads nothing from ${describe(writtenPrimitive(value))}, so it builds nothing`;
|
|
247
231
|
|
|
248
232
|
/**
|
|
249
233
|
* The keys of a role's weights that name a level another key names too
|
|
@@ -345,7 +329,7 @@ export function typographyInputProblems(typography, levels = []) {
|
|
|
345
329
|
}
|
|
346
330
|
for (const [field, value] of Object.entries(fields)) {
|
|
347
331
|
if (value === undefined || value === UNREAD) continue;
|
|
348
|
-
if (field === 'weights' && !isBlock(
|
|
332
|
+
if (field === 'weights' && !isBlock(writtenPrimitive(value))) {
|
|
349
333
|
const why = typographyValueProblem(`${block}.weights`, value);
|
|
350
334
|
if (why) {
|
|
351
335
|
shapeless.add(block);
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* One value as the build hands it to Core: a BigInt as its digits, a boxed
|
|
6
|
+
* primitive (`new Number(16)`) as its primitive, any other value as it is.
|
|
7
|
+
* The step `writtenPrimitives` takes at each value it meets.
|
|
8
|
+
* @param {unknown} value
|
|
9
|
+
* @returns {unknown}
|
|
10
|
+
*/
|
|
11
|
+
export function writtenPrimitive(value: unknown): unknown;
|
|
4
12
|
/**
|
|
5
13
|
* A value as the build hands it to Core: each BigInt in it, in plain
|
|
6
14
|
* objects and arrays at any depth, replaced by its digits, and each boxed
|
|
@@ -22,6 +30,15 @@ export function writtenPrimitives<T>(value: T, done?: Map<any, any>): T;
|
|
|
22
30
|
* @returns {string | null}
|
|
23
31
|
*/
|
|
24
32
|
export function partJsonText(value: unknown): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Why a theme field holding a collection that is no plain object (a Map, a
|
|
35
|
+
* Set) builds nothing from it: defineTheme reads an object's own keys.
|
|
36
|
+
* Shared with the source reader, which names one it sees written.
|
|
37
|
+
* @param {string} field
|
|
38
|
+
* @param {unknown} value the collection, or its kind's name (`Map`)
|
|
39
|
+
* @returns {string}
|
|
40
|
+
*/
|
|
41
|
+
export function entriesNotRead(field: string, value: unknown): string;
|
|
25
42
|
/**
|
|
26
43
|
* The custom properties set on one element that `name` reads back to
|
|
27
44
|
* itself through, `name` first and last (`--a`, `--b`, `--a`), or null. CSS
|
|
@@ -67,6 +84,7 @@ export function writtenValueProblems(theme: Record<string, any>, options?: {
|
|
|
67
84
|
* builds on.
|
|
68
85
|
*/
|
|
69
86
|
export const CUSTOM_PROPERTY: string;
|
|
87
|
+
export function boxed(value: unknown): boolean;
|
|
70
88
|
export function bigIntAsText(_key: string, value: unknown): unknown;
|
|
71
89
|
/**
|
|
72
90
|
* `unbuildable`: a value Core cannot write at all, so the build stops
|