astro 6.0.0-alpha.0 → 6.0.0-alpha.1
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/astro-jsx.d.ts +11 -0
- package/client.d.ts +17 -41
- package/components/Code.astro +2 -2
- package/components/Image.astro +2 -2
- package/components/Picture.astro +1 -1
- package/dist/actions/consts.d.ts +2 -5
- package/dist/actions/consts.js +4 -8
- package/dist/actions/integration.js +2 -4
- package/dist/actions/runtime/client.d.ts +84 -3
- package/dist/actions/runtime/client.js +238 -7
- package/dist/actions/runtime/entrypoints/client.d.ts +7 -0
- package/dist/actions/runtime/entrypoints/client.js +91 -0
- package/dist/actions/runtime/entrypoints/route.d.ts +2 -0
- package/dist/actions/runtime/{route.js → entrypoints/route.js} +1 -1
- package/dist/actions/runtime/entrypoints/server.d.ts +6 -0
- package/dist/actions/runtime/entrypoints/server.js +33 -0
- package/dist/actions/runtime/server.d.ts +11 -18
- package/dist/actions/runtime/server.js +162 -82
- package/dist/actions/runtime/types.d.ts +64 -0
- package/dist/actions/utils.d.ts +2 -2
- package/dist/actions/utils.js +2 -2
- package/dist/actions/vite-plugin-actions.js +18 -21
- package/dist/assets/build/generate.d.ts +2 -2
- package/dist/assets/build/generate.js +12 -10
- package/dist/assets/endpoint/config.js +2 -2
- package/dist/assets/endpoint/dev.js +7 -6
- package/dist/assets/fonts/config.d.ts +91 -350
- package/dist/assets/fonts/config.js +35 -136
- package/dist/assets/fonts/constants.js +1 -1
- package/dist/assets/fonts/core/dedupe-font-faces.d.ts +2 -0
- package/dist/assets/fonts/core/dedupe-font-faces.js +30 -0
- package/dist/assets/fonts/definitions.d.ts +9 -22
- package/dist/assets/fonts/infra/build-remote-font-provider-mod-resolver.d.ts +4 -0
- package/dist/assets/fonts/infra/build-remote-font-provider-mod-resolver.js +8 -0
- package/dist/assets/fonts/infra/build-url-proxy-hash-resolver.d.ts +15 -0
- package/dist/assets/fonts/infra/build-url-proxy-hash-resolver.js +20 -0
- package/dist/assets/fonts/infra/build-url-resolver.d.ts +12 -0
- package/dist/assets/fonts/infra/build-url-resolver.js +40 -0
- package/dist/assets/fonts/infra/cached-font-fetcher.d.ts +11 -0
- package/dist/assets/fonts/infra/cached-font-fetcher.js +42 -0
- package/dist/assets/fonts/infra/capsize-font-metrics-resolver.d.ts +18 -0
- package/dist/assets/fonts/infra/capsize-font-metrics-resolver.js +71 -0
- package/dist/assets/fonts/infra/data-collector.d.ts +10 -0
- package/dist/assets/fonts/infra/data-collector.js +35 -0
- package/dist/assets/fonts/infra/dev-remote-font-provider-mod-resolver.d.ts +9 -0
- package/dist/assets/fonts/infra/dev-remote-font-provider-mod-resolver.js +14 -0
- package/dist/assets/fonts/infra/dev-url-proxy-hash-resolver.d.ts +15 -0
- package/dist/assets/fonts/infra/dev-url-proxy-hash-resolver.js +37 -0
- package/dist/assets/fonts/infra/dev-url-resolver.d.ts +10 -0
- package/dist/assets/fonts/infra/dev-url-resolver.js +29 -0
- package/dist/assets/fonts/infra/font-type-extractor.d.ts +5 -0
- package/dist/assets/fonts/infra/font-type-extractor.js +21 -0
- package/dist/assets/fonts/infra/fontace-font-file-reader.d.ts +11 -0
- package/dist/assets/fonts/infra/fontace-font-file-reader.js +25 -0
- package/dist/assets/fonts/infra/levenshtein-string-matcher.d.ts +5 -0
- package/dist/assets/fonts/infra/levenshtein-string-matcher.js +145 -0
- package/dist/assets/fonts/infra/local-url-proxy-content-resolver.d.ts +4 -0
- package/dist/assets/fonts/infra/local-url-proxy-content-resolver.js +14 -0
- package/dist/assets/fonts/{implementations/css-renderer.d.ts → infra/minifiable-css-renderer.d.ts} +8 -3
- package/dist/assets/fonts/{implementations/css-renderer.js → infra/minifiable-css-renderer.js} +12 -10
- package/dist/assets/fonts/infra/remote-font-provider-resolver.d.ts +10 -0
- package/dist/assets/fonts/infra/remote-font-provider-resolver.js +49 -0
- package/dist/assets/fonts/infra/remote-url-proxy-content-resolver.d.ts +4 -0
- package/dist/assets/fonts/infra/remote-url-proxy-content-resolver.js +9 -0
- package/dist/assets/fonts/infra/require-local-provider-url-resolver.d.ts +9 -0
- package/dist/assets/fonts/infra/require-local-provider-url-resolver.js +22 -0
- package/dist/assets/fonts/infra/system-fallbacks-provider.d.ts +6 -0
- package/dist/assets/fonts/{implementations → infra}/system-fallbacks-provider.js +8 -11
- package/dist/assets/fonts/infra/unstorage-fs-storage.d.ts +11 -0
- package/dist/assets/fonts/infra/unstorage-fs-storage.js +26 -0
- package/dist/assets/fonts/infra/url-proxy.d.ts +16 -0
- package/dist/assets/fonts/infra/url-proxy.js +50 -0
- package/dist/assets/fonts/infra/xxhash-hasher.d.ts +7 -0
- package/dist/assets/fonts/infra/xxhash-hasher.js +18 -0
- package/dist/assets/fonts/orchestrate.d.ts +1 -2
- package/dist/assets/fonts/orchestrate.js +50 -17
- package/dist/assets/fonts/providers/index.d.ts +6 -24
- package/dist/assets/fonts/types.d.ts +138 -8
- package/dist/assets/fonts/utils.d.ts +1 -2
- package/dist/assets/fonts/vite-plugin-fonts.js +56 -61
- package/dist/assets/services/noop.js +5 -0
- package/dist/assets/utils/index.d.ts +0 -2
- package/dist/assets/utils/index.js +0 -5
- package/dist/assets/utils/{transformToPath.d.ts → node.d.ts} +15 -1
- package/dist/assets/utils/{node/emitAsset.js → node.js} +34 -6
- package/dist/assets/utils/remotePattern.d.ts +1 -3
- package/dist/assets/utils/svg.d.ts +2 -1
- package/dist/assets/utils/svg.js +30 -4
- package/dist/assets/vite-plugin-assets.js +10 -8
- package/dist/cli/add/index.js +21 -13
- package/dist/cli/create-key/infra/crypto-key-generator.d.ts +3 -1
- package/dist/cli/create-key/infra/crypto-key-generator.js +7 -9
- package/dist/cli/definitions.d.ts +19 -2
- package/dist/cli/dev/index.js +1 -1
- package/dist/cli/docs/core/open-docs.d.ts +5 -3
- package/dist/cli/docs/core/open-docs.js +2 -9
- package/dist/cli/docs/definitions.d.ts +3 -11
- package/dist/cli/docs/domain/cloud-ide.d.ts +1 -0
- package/dist/cli/docs/domain/cloud-ide.js +0 -0
- package/dist/cli/docs/infra/process-cloud-ide-provider.d.ts +5 -0
- package/dist/cli/docs/infra/process-cloud-ide-provider.js +6 -0
- package/dist/cli/flags.d.ts +1 -0
- package/dist/cli/index.js +78 -21
- package/dist/cli/info/core/get-package-manager.d.ts +8 -0
- package/dist/cli/info/core/get-package-manager.js +37 -0
- package/dist/cli/info/core/info.d.ts +21 -0
- package/dist/cli/info/core/info.js +21 -0
- package/dist/cli/info/definitions.d.ts +30 -0
- package/dist/cli/info/definitions.js +0 -0
- package/dist/cli/info/domain/debug-info.d.ts +1 -0
- package/dist/cli/info/domain/debug-info.js +0 -0
- package/dist/cli/info/infra/bun-package-manager.d.ts +5 -0
- package/dist/cli/info/infra/bun-package-manager.js +9 -0
- package/dist/cli/info/infra/cli-astro-config-resolver.d.ts +10 -0
- package/dist/cli/info/infra/cli-astro-config-resolver.js +36 -0
- package/dist/cli/info/infra/cli-clipboard.d.ts +13 -0
- package/dist/cli/info/infra/cli-clipboard.js +78 -0
- package/dist/cli/info/infra/cli-debug-info-provider.d.ts +15 -0
- package/dist/cli/info/infra/cli-debug-info-provider.js +57 -0
- package/dist/cli/info/infra/dev-debug-info-provider.d.ts +18 -0
- package/dist/cli/info/infra/dev-debug-info-provider.js +36 -0
- package/dist/cli/info/infra/noop-package-manager.d.ts +5 -0
- package/dist/cli/info/infra/noop-package-manager.js +9 -0
- package/dist/cli/info/infra/npm-package-manager.d.ts +10 -0
- package/dist/cli/info/infra/npm-package-manager.js +32 -0
- package/dist/cli/info/infra/pnpm-package-manager.d.ts +10 -0
- package/dist/cli/info/infra/pnpm-package-manager.js +33 -0
- package/dist/cli/info/infra/process-node-version-provider.d.ts +4 -0
- package/dist/cli/info/infra/process-node-version-provider.js +6 -0
- package/dist/cli/info/infra/process-package-manager-user-agent-provider.d.ts +4 -0
- package/dist/cli/info/infra/process-package-manager-user-agent-provider.js +7 -0
- package/dist/cli/info/infra/prompts-prompt.d.ts +11 -0
- package/dist/cli/info/infra/prompts-prompt.js +25 -0
- package/dist/cli/info/infra/styled-debug-info-formatter.d.ts +10 -0
- package/dist/cli/info/infra/styled-debug-info-formatter.js +29 -0
- package/dist/cli/info/infra/yarn-package-manager.d.ts +10 -0
- package/dist/cli/info/infra/yarn-package-manager.js +34 -0
- package/dist/cli/infra/build-time-astro-version-provider.d.ts +3 -1
- package/dist/cli/infra/build-time-astro-version-provider.js +4 -8
- package/dist/cli/infra/cli-command-runner.d.ts +7 -4
- package/dist/cli/infra/cli-command-runner.js +14 -10
- package/dist/cli/infra/logger-help-display.d.ts +11 -7
- package/dist/cli/infra/logger-help-display.js +62 -50
- package/dist/cli/infra/passthrough-text-styler.d.ts +9 -0
- package/dist/cli/infra/passthrough-text-styler.js +23 -0
- package/dist/cli/infra/piccolore-text-styler.d.ts +2 -0
- package/dist/cli/infra/piccolore-text-styler.js +5 -0
- package/dist/cli/infra/process-operating-system-provider.d.ts +6 -0
- package/dist/cli/infra/process-operating-system-provider.js +12 -0
- package/dist/cli/infra/tinyexec-command-executor.d.ts +6 -0
- package/dist/cli/infra/tinyexec-command-executor.js +34 -0
- package/dist/cli/install-package.js +1 -1
- package/dist/cli/preferences/index.js +6 -2
- package/dist/cli/preview/index.js +1 -1
- package/dist/cli/utils/format-version.js +1 -1
- package/dist/config/index.js +9 -5
- package/dist/container/index.js +19 -13
- package/dist/container/pipeline.d.ts +2 -1
- package/dist/container/pipeline.js +4 -11
- package/dist/content/config.d.ts +34 -40
- package/dist/content/content-layer.js +13 -18
- package/dist/content/loaders/errors.d.ts +3 -3
- package/dist/content/loaders/errors.js +5 -2
- package/dist/content/loaders/glob.js +6 -1
- package/dist/content/loaders/types.d.ts +11 -4
- package/dist/content/runtime-assets.d.ts +4 -4
- package/dist/content/runtime-assets.js +2 -2
- package/dist/content/runtime.d.ts +21 -20
- package/dist/content/runtime.js +14 -16
- package/dist/content/types-generator.js +81 -54
- package/dist/content/utils.d.ts +46 -338
- package/dist/content/utils.js +43 -48
- package/dist/content/vite-plugin-content-assets.d.ts +12 -4
- package/dist/content/vite-plugin-content-assets.js +100 -56
- package/dist/content/vite-plugin-content-imports.js +10 -4
- package/dist/content/vite-plugin-content-virtual-mod.js +10 -7
- package/dist/core/app/app.d.ts +5 -0
- package/dist/core/app/app.js +13 -0
- package/dist/core/app/base.d.ts +132 -0
- package/dist/core/app/base.js +448 -0
- package/dist/core/app/common.d.ts +6 -2
- package/dist/core/app/common.js +60 -33
- package/dist/core/app/dev/app.d.ts +15 -0
- package/dist/core/app/dev/app.js +86 -0
- package/dist/core/app/dev/pipeline.d.ts +13 -0
- package/dist/core/app/dev/pipeline.js +123 -0
- package/dist/core/app/entrypoint.d.ts +2 -0
- package/dist/core/app/entrypoint.js +15 -0
- package/dist/core/app/index.d.ts +7 -99
- package/dist/core/app/index.js +20 -486
- package/dist/core/app/logging.d.ts +3 -0
- package/dist/core/app/logging.js +11 -0
- package/dist/core/app/manifest.d.ts +9 -0
- package/dist/core/app/manifest.js +107 -0
- package/dist/core/app/middlewares.js +1 -1
- package/dist/core/app/node.js +14 -13
- package/dist/core/app/pipeline.d.ts +6 -5
- package/dist/core/app/pipeline.js +65 -49
- package/dist/core/app/types.d.ts +58 -22
- package/dist/core/app/validate-forwarded-headers.d.ts +16 -0
- package/dist/core/app/validate-forwarded-headers.js +60 -0
- package/dist/core/base-pipeline.d.ts +22 -14
- package/dist/core/base-pipeline.js +54 -6
- package/dist/core/build/app.d.ts +13 -0
- package/dist/core/build/app.js +38 -0
- package/dist/core/build/common.d.ts +1 -1
- package/dist/core/build/common.js +2 -2
- package/dist/core/build/generate.d.ts +1 -1
- package/dist/core/build/generate.js +96 -204
- package/dist/core/build/graph.js +2 -2
- package/dist/core/build/index.js +11 -16
- package/dist/core/build/internal.d.ts +2 -27
- package/dist/core/build/internal.js +1 -44
- package/dist/core/build/page-data.js +1 -1
- package/dist/core/build/pipeline.d.ts +15 -26
- package/dist/core/build/pipeline.js +106 -170
- package/dist/core/build/plugins/index.d.ts +4 -2
- package/dist/core/build/plugins/index.js +17 -23
- package/dist/core/build/plugins/plugin-analyzer.d.ts +2 -2
- package/dist/core/build/plugins/plugin-analyzer.js +5 -13
- package/dist/core/build/plugins/plugin-component-entry.d.ts +7 -2
- package/dist/core/build/plugins/plugin-component-entry.js +5 -13
- package/dist/core/build/plugins/plugin-css.d.ts +2 -2
- package/dist/core/build/plugins/plugin-css.js +86 -41
- package/dist/core/build/plugins/plugin-internals.d.ts +2 -2
- package/dist/core/build/plugins/plugin-internals.js +24 -18
- package/dist/core/build/plugins/plugin-manifest.d.ts +33 -5
- package/dist/core/build/plugins/plugin-manifest.js +89 -129
- package/dist/core/build/plugins/plugin-middleware.d.ts +2 -2
- package/dist/core/build/plugins/plugin-middleware.js +5 -7
- package/dist/core/build/plugins/plugin-noop.d.ts +3 -0
- package/dist/core/build/plugins/plugin-noop.js +29 -0
- package/dist/core/build/plugins/plugin-prerender.d.ts +2 -2
- package/dist/core/build/plugins/plugin-prerender.js +7 -64
- package/dist/core/build/plugins/plugin-scripts.d.ts +5 -2
- package/dist/core/build/plugins/plugin-scripts.js +5 -13
- package/dist/core/build/plugins/plugin-ssr.d.ts +2 -2
- package/dist/core/build/plugins/plugin-ssr.js +60 -132
- package/dist/core/build/plugins/util.d.ts +1 -25
- package/dist/core/build/plugins/util.js +0 -47
- package/dist/core/build/runtime.d.ts +26 -0
- package/dist/core/build/runtime.js +45 -0
- package/dist/core/build/static-build.d.ts +2 -2
- package/dist/core/build/static-build.js +181 -155
- package/dist/core/build/types.d.ts +1 -2
- package/dist/core/build/util.d.ts +0 -1
- package/dist/core/build/util.js +0 -7
- package/dist/core/compile/compile.d.ts +2 -3
- package/dist/core/compile/compile.js +2 -2
- package/dist/core/config/config.js +3 -3
- package/dist/core/config/index.d.ts +0 -1
- package/dist/core/config/index.js +0 -2
- package/dist/core/config/schemas/base.d.ts +336 -1434
- package/dist/core/config/schemas/base.js +42 -41
- package/dist/core/config/schemas/refined.d.ts +2 -2
- package/dist/core/config/schemas/refined.js +1 -1
- package/dist/core/config/schemas/relative.d.ts +672 -1761
- package/dist/core/config/schemas/relative.js +4 -4
- package/dist/core/config/settings.d.ts +3 -3
- package/dist/core/config/settings.js +5 -6
- package/dist/core/config/validate.js +13 -2
- package/dist/core/config/vite-load.js +12 -3
- package/dist/core/constants.d.ts +11 -0
- package/dist/core/constants.js +20 -1
- package/dist/core/create-vite.d.ts +2 -6
- package/dist/core/create-vite.js +35 -43
- package/dist/core/csp/common.d.ts +1 -1
- package/dist/core/csp/common.js +1 -1
- package/dist/core/csp/config.d.ts +8 -4
- package/dist/core/csp/config.js +1 -1
- package/dist/core/csp/runtime.d.ts +11 -0
- package/dist/core/csp/runtime.js +35 -0
- package/dist/core/dev/container.js +13 -7
- package/dist/core/dev/dev.js +2 -2
- package/dist/core/dev/restart.js +15 -6
- package/dist/core/errors/dev/runtime.d.ts +6 -0
- package/dist/core/errors/dev/runtime.js +27 -0
- package/dist/core/errors/dev/utils.js +1 -1
- package/dist/core/errors/dev/vite.js +1 -1
- package/dist/core/errors/errors-data.d.ts +27 -7
- package/dist/core/errors/errors-data.js +17 -4
- package/dist/core/errors/errors.d.ts +3 -3
- package/dist/core/errors/errors.js +8 -8
- package/dist/core/errors/zod-error-map.d.ts +2 -2
- package/dist/core/errors/zod-error-map.js +26 -24
- package/dist/core/logger/core.js +1 -1
- package/dist/core/messages.d.ts +2 -2
- package/dist/core/messages.js +3 -3
- package/dist/core/middleware/callMiddleware.js +1 -1
- package/dist/core/middleware/defineMiddleware.d.ts +2 -0
- package/dist/core/middleware/defineMiddleware.js +6 -0
- package/dist/core/middleware/index.d.ts +3 -3
- package/dist/core/middleware/index.js +1 -3
- package/dist/core/middleware/sequence.js +4 -4
- package/dist/core/middleware/vite-plugin.d.ts +1 -1
- package/dist/core/middleware/vite-plugin.js +18 -7
- package/dist/core/module-loader/index.d.ts +2 -2
- package/dist/core/module-loader/index.js +1 -1
- package/dist/core/module-loader/{loader.d.ts → runner.d.ts} +6 -17
- package/dist/core/module-loader/{loader.js → runner.js} +3 -0
- package/dist/core/module-loader/vite.d.ts +3 -2
- package/dist/core/module-loader/vite.js +17 -13
- package/dist/core/preview/index.js +20 -3
- package/dist/core/preview/static-preview-server.js +11 -0
- package/dist/core/redirects/component.js +1 -2
- package/dist/core/redirects/index.d.ts +0 -1
- package/dist/core/redirects/index.js +1 -3
- package/dist/core/redirects/render.js +5 -2
- package/dist/core/render/paginate.d.ts +1 -1
- package/dist/core/render/paginate.js +8 -6
- package/dist/core/render/params-and-props.d.ts +2 -0
- package/dist/core/render/params-and-props.js +19 -6
- package/dist/core/render/route-cache.d.ts +3 -2
- package/dist/core/render/route-cache.js +6 -5
- package/dist/core/render-context.d.ts +6 -4
- package/dist/core/render-context.js +66 -25
- package/dist/core/routing/astro-designed-error-pages.js +2 -2
- package/dist/core/routing/default.js +1 -1
- package/dist/core/routing/helpers.d.ts +22 -0
- package/dist/core/routing/helpers.js +25 -0
- package/dist/core/routing/index.d.ts +1 -1
- package/dist/core/routing/index.js +2 -2
- package/dist/core/routing/manifest/create.d.ts +6 -1
- package/dist/core/routing/manifest/create.js +11 -14
- package/dist/core/routing/manifest/generator.d.ts +3 -1
- package/dist/core/routing/params.d.ts +2 -1
- package/dist/core/routing/params.js +3 -2
- package/dist/core/server-islands/endpoint.js +40 -19
- package/dist/core/server-islands/vite-plugin-server-islands.d.ts +1 -1
- package/dist/core/server-islands/vite-plugin-server-islands.js +89 -44
- package/dist/core/session/vite-plugin.d.ts +6 -0
- package/dist/core/session/vite-plugin.js +53 -0
- package/dist/core/session.d.ts +4 -2
- package/dist/core/session.js +8 -48
- package/dist/core/sync/index.d.ts +2 -5
- package/dist/core/sync/index.js +34 -22
- package/dist/core/util/pathname.d.ts +10 -0
- package/dist/core/util/pathname.js +17 -0
- package/dist/core/util.d.ts +2 -2
- package/dist/core/util.js +3 -3
- package/dist/entrypoints/legacy.d.ts +2 -0
- package/dist/entrypoints/legacy.js +12 -0
- package/dist/entrypoints/prerender.d.ts +4 -0
- package/dist/entrypoints/prerender.js +7 -0
- package/dist/env/schema.d.ts +21 -251
- package/dist/env/schema.js +6 -3
- package/dist/env/vite-plugin-env.js +15 -10
- package/dist/env/vite-plugin-import-meta-env.js +3 -2
- package/dist/environments.d.ts +3 -0
- package/dist/environments.js +11 -0
- package/dist/events/error.d.ts +2 -2
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/utils.d.ts +1 -6
- package/dist/i18n/utils.js +1 -63
- package/dist/i18n/vite-plugin-i18n.d.ts +0 -5
- package/dist/i18n/vite-plugin-i18n.js +1 -22
- package/dist/integrations/hooks.d.ts +1 -1
- package/dist/integrations/hooks.js +10 -7
- package/dist/manifest/serialized.d.ts +9 -0
- package/dist/manifest/serialized.js +144 -0
- package/dist/manifest/virtual-module.d.ts +1 -4
- package/dist/manifest/virtual-module.js +77 -80
- package/dist/preferences/index.d.ts +1 -2
- package/dist/prerender/routing.d.ts +5 -7
- package/dist/prerender/routing.js +6 -17
- package/dist/runtime/client/dev-toolbar/ui-library/badge.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/button.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/card.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/highlight.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/radio-checkbox.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/select.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/toggle.d.ts +2 -2
- package/dist/runtime/server/endpoint.js +1 -1
- package/dist/runtime/server/render/server-islands.js +5 -4
- package/dist/runtime/server/transition.d.ts +1 -0
- package/dist/template/4xx.js +3 -1
- package/dist/transitions/events.d.ts +7 -0
- package/dist/transitions/router.js +7 -3
- package/dist/transitions/swap-functions.js +4 -0
- package/dist/types/astro.d.ts +8 -6
- package/dist/types/public/config.d.ts +404 -288
- package/dist/types/public/context.d.ts +3 -4
- package/dist/types/public/index.d.ts +2 -1
- package/dist/types/public/integrations.d.ts +23 -1
- package/dist/types/public/internal.d.ts +1 -16
- package/dist/types/public/preview.d.ts +6 -0
- package/dist/virtual-modules/i18n.d.ts +10 -2
- package/dist/virtual-modules/i18n.js +16 -7
- package/dist/virtual-modules/live-config.d.ts +1 -1
- package/dist/virtual-modules/live-config.js +1 -1
- package/dist/virtual-modules/middleware.d.ts +2 -1
- package/dist/virtual-modules/middleware.js +2 -1
- package/dist/vite-plugin-adapter-config/index.js +3 -2
- package/dist/vite-plugin-app/app.d.ts +47 -0
- package/dist/vite-plugin-app/app.js +410 -0
- package/dist/vite-plugin-app/createAstroServerApp.d.ts +8 -0
- package/dist/vite-plugin-app/createAstroServerApp.js +56 -0
- package/dist/vite-plugin-app/index.d.ts +3 -0
- package/dist/vite-plugin-app/index.js +16 -0
- package/dist/{vite-plugin-astro-server → vite-plugin-app}/pipeline.d.ts +6 -7
- package/dist/vite-plugin-app/pipeline.js +166 -0
- package/dist/vite-plugin-astro/index.js +21 -7
- package/dist/vite-plugin-astro-server/base.js +1 -1
- package/dist/vite-plugin-astro-server/controller.d.ts +1 -1
- package/dist/vite-plugin-astro-server/error.d.ts +3 -4
- package/dist/vite-plugin-astro-server/error.js +2 -5
- package/dist/vite-plugin-astro-server/index.d.ts +1 -2
- package/dist/vite-plugin-astro-server/index.js +6 -4
- package/dist/vite-plugin-astro-server/metadata.js +1 -1
- package/dist/vite-plugin-astro-server/plugin.d.ts +4 -7
- package/dist/vite-plugin-astro-server/plugin.js +54 -65
- package/dist/vite-plugin-astro-server/server-state.d.ts +1 -1
- package/dist/vite-plugin-astro-server/util.d.ts +0 -2
- package/dist/vite-plugin-astro-server/util.js +1 -2
- package/dist/vite-plugin-astro-server/vite.d.ts +2 -2
- package/dist/vite-plugin-astro-server/vite.js +7 -7
- package/dist/vite-plugin-config-alias/index.js +40 -32
- package/dist/vite-plugin-css/index.d.ts +18 -0
- package/dist/vite-plugin-css/index.js +134 -0
- package/dist/vite-plugin-css/util.d.ts +5 -0
- package/dist/vite-plugin-css/util.js +8 -0
- package/dist/vite-plugin-environment/index.d.ts +15 -0
- package/dist/vite-plugin-environment/index.js +77 -0
- package/dist/vite-plugin-head/index.d.ts +1 -2
- package/dist/vite-plugin-head/index.js +42 -58
- package/dist/vite-plugin-hmr-reload/index.js +2 -1
- package/dist/vite-plugin-pages/const.d.ts +2 -0
- package/dist/vite-plugin-pages/const.js +6 -0
- package/dist/vite-plugin-pages/index.d.ts +2 -0
- package/dist/vite-plugin-pages/index.js +7 -0
- package/dist/vite-plugin-pages/page.d.ts +7 -0
- package/dist/vite-plugin-pages/page.js +48 -0
- package/dist/vite-plugin-pages/pages.d.ts +8 -0
- package/dist/vite-plugin-pages/pages.js +57 -0
- package/dist/vite-plugin-pages/util.d.ts +8 -0
- package/dist/vite-plugin-pages/util.js +15 -0
- package/dist/vite-plugin-renderers/index.d.ts +9 -0
- package/dist/vite-plugin-renderers/index.js +40 -0
- package/dist/vite-plugin-routes/index.d.ts +14 -0
- package/dist/vite-plugin-routes/index.js +177 -0
- package/dist/vite-plugin-scripts/index.js +2 -6
- package/dist/vite-plugin-scripts/page-ssr.js +3 -2
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +2 -2
- package/package.json +34 -31
- package/templates/content/module.mjs +1 -0
- package/templates/content/types.d.ts +24 -11
- package/types/actions.d.ts +1 -5
- package/types/content.d.ts +9 -11
- package/types/transitions.d.ts +25 -0
- package/dist/actions/loadActions.d.ts +0 -8
- package/dist/actions/loadActions.js +0 -13
- package/dist/actions/runtime/route.d.ts +0 -2
- package/dist/actions/runtime/shared.d.ts +0 -60
- package/dist/actions/runtime/shared.js +0 -296
- package/dist/actions/runtime/utils.d.ts +0 -25
- package/dist/actions/runtime/utils.js +0 -16
- package/dist/actions/runtime/virtual.d.ts +0 -4
- package/dist/actions/runtime/virtual.js +0 -127
- package/dist/assets/fonts/implementations/data-collector.d.ts +0 -3
- package/dist/assets/fonts/implementations/data-collector.js +0 -21
- package/dist/assets/fonts/implementations/error-handler.d.ts +0 -2
- package/dist/assets/fonts/implementations/error-handler.js +0 -41
- package/dist/assets/fonts/implementations/font-fetcher.d.ts +0 -8
- package/dist/assets/fonts/implementations/font-fetcher.js +0 -34
- package/dist/assets/fonts/implementations/font-file-reader.d.ts +0 -4
- package/dist/assets/fonts/implementations/font-file-reader.js +0 -26
- package/dist/assets/fonts/implementations/font-metrics-resolver.d.ts +0 -5
- package/dist/assets/fonts/implementations/font-metrics-resolver.js +0 -66
- package/dist/assets/fonts/implementations/font-type-extractor.d.ts +0 -4
- package/dist/assets/fonts/implementations/font-type-extractor.js +0 -22
- package/dist/assets/fonts/implementations/hasher.d.ts +0 -2
- package/dist/assets/fonts/implementations/hasher.js +0 -14
- package/dist/assets/fonts/implementations/levenshtein-string-matcher.d.ts +0 -2
- package/dist/assets/fonts/implementations/levenshtein-string-matcher.js +0 -147
- package/dist/assets/fonts/implementations/local-provider-url-resolver.d.ts +0 -5
- package/dist/assets/fonts/implementations/local-provider-url-resolver.js +0 -17
- package/dist/assets/fonts/implementations/remote-font-provider-mod-resolver.d.ts +0 -6
- package/dist/assets/fonts/implementations/remote-font-provider-mod-resolver.js +0 -20
- package/dist/assets/fonts/implementations/remote-font-provider-resolver.d.ts +0 -6
- package/dist/assets/fonts/implementations/remote-font-provider-resolver.js +0 -47
- package/dist/assets/fonts/implementations/storage.d.ts +0 -4
- package/dist/assets/fonts/implementations/storage.js +0 -14
- package/dist/assets/fonts/implementations/system-fallbacks-provider.d.ts +0 -11
- package/dist/assets/fonts/implementations/url-proxy-content-resolver.d.ts +0 -5
- package/dist/assets/fonts/implementations/url-proxy-content-resolver.js +0 -28
- package/dist/assets/fonts/implementations/url-proxy-hash-resolver.d.ts +0 -8
- package/dist/assets/fonts/implementations/url-proxy-hash-resolver.js +0 -39
- package/dist/assets/fonts/implementations/url-proxy.d.ts +0 -7
- package/dist/assets/fonts/implementations/url-proxy.js +0 -31
- package/dist/assets/fonts/implementations/url-resolver.d.ts +0 -11
- package/dist/assets/fonts/implementations/url-resolver.js +0 -55
- package/dist/assets/utils/node/emitAsset.d.ts +0 -15
- package/dist/assets/utils/transformToPath.js +0 -32
- package/dist/cli/docs/domains/platform.d.ts +0 -1
- package/dist/cli/docs/infra/process-platform-provider.d.ts +0 -2
- package/dist/cli/docs/infra/process-platform-provider.js +0 -11
- package/dist/cli/docs/infra/tinyexec-command-executor.d.ts +0 -2
- package/dist/cli/docs/infra/tinyexec-command-executor.js +0 -30
- package/dist/cli/info/index.d.ts +0 -12
- package/dist/cli/info/index.js +0 -267
- package/dist/cli/infra/picocolors-text-styler.d.ts +0 -2
- package/dist/cli/infra/picocolors-text-styler.js +0 -7
- package/dist/core/build/css-asset-name.d.ts +0 -9
- package/dist/core/build/css-asset-name.js +0 -89
- package/dist/core/build/plugin.d.ts +0 -43
- package/dist/core/build/plugin.js +0 -61
- package/dist/core/build/plugins/plugin-actions.d.ts +0 -4
- package/dist/core/build/plugins/plugin-actions.js +0 -16
- package/dist/core/build/plugins/plugin-chunks.d.ts +0 -2
- package/dist/core/build/plugins/plugin-chunks.js +0 -33
- package/dist/core/build/plugins/plugin-pages.d.ts +0 -6
- package/dist/core/build/plugins/plugin-pages.js +0 -66
- package/dist/core/build/plugins/plugin-renderers.d.ts +0 -5
- package/dist/core/build/plugins/plugin-renderers.js +0 -54
- package/dist/core/middleware/loadMiddleware.d.ts +0 -7
- package/dist/core/middleware/loadMiddleware.js +0 -14
- package/dist/core/redirects/helpers.d.ts +0 -7
- package/dist/core/redirects/helpers.js +0 -10
- package/dist/core/routing/manifest/serialization.d.ts +0 -5
- package/dist/core/routing/manifest/serialization.js +0 -37
- package/dist/prerender/metadata.d.ts +0 -8
- package/dist/prerender/metadata.js +0 -18
- package/dist/vite-plugin-astro-server/css.d.ts +0 -13
- package/dist/vite-plugin-astro-server/css.js +0 -48
- package/dist/vite-plugin-astro-server/pipeline.js +0 -161
- package/dist/vite-plugin-astro-server/request.d.ts +0 -14
- package/dist/vite-plugin-astro-server/request.js +0 -66
- package/dist/vite-plugin-astro-server/route.d.ts +0 -25
- package/dist/vite-plugin-astro-server/route.js +0 -283
- package/dist/vite-plugin-scanner/index.d.ts +0 -10
- package/dist/vite-plugin-scanner/index.js +0 -87
- package/dist/vite-plugin-ssr-manifest/index.d.ts +0 -2
- package/dist/vite-plugin-ssr-manifest/index.js +0 -26
- /package/dist/{cli/docs/domains/platform.js → actions/runtime/types.js} +0 -0
- /package/dist/assets/fonts/{logic → core}/extract-unifont-providers.d.ts +0 -0
- /package/dist/assets/fonts/{logic → core}/extract-unifont-providers.js +0 -0
- /package/dist/assets/fonts/{logic → core}/normalize-remote-font-faces.d.ts +0 -0
- /package/dist/assets/fonts/{logic → core}/normalize-remote-font-faces.js +0 -0
- /package/dist/assets/fonts/{logic → core}/optimize-fallbacks.d.ts +0 -0
- /package/dist/assets/fonts/{logic → core}/optimize-fallbacks.js +0 -0
- /package/dist/assets/fonts/{logic → core}/resolve-families.d.ts +0 -0
- /package/dist/assets/fonts/{logic → core}/resolve-families.js +0 -0
|
@@ -1,363 +1,104 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
config?: Record<string, any> | undefined;
|
|
15
|
-
}, {
|
|
16
|
-
entrypoint: string | URL;
|
|
17
|
-
config?: Record<string, any> | undefined;
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export declare const weightSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3
|
+
export declare const styleSchema: z.ZodEnum<{
|
|
4
|
+
normal: "normal";
|
|
5
|
+
italic: "italic";
|
|
6
|
+
oblique: "oblique";
|
|
7
|
+
}>;
|
|
8
|
+
export declare const displaySchema: z.ZodEnum<{
|
|
9
|
+
optional: "optional";
|
|
10
|
+
auto: "auto";
|
|
11
|
+
block: "block";
|
|
12
|
+
swap: "swap";
|
|
13
|
+
fallback: "fallback";
|
|
18
14
|
}>;
|
|
19
15
|
export declare const localFontFamilySchema: z.ZodObject<{
|
|
20
|
-
/**
|
|
21
|
-
* The font family name, as identified by your font provider.
|
|
22
|
-
*/
|
|
23
|
-
name: z.ZodString;
|
|
24
|
-
/**
|
|
25
|
-
* A valid [ident](https://developer.mozilla.org/en-US/docs/Web/CSS/ident) in the form of a CSS variable (i.e. starting with `--`).
|
|
26
|
-
*/
|
|
27
|
-
cssVariable: z.ZodString;
|
|
28
|
-
} & {
|
|
29
|
-
/**
|
|
30
|
-
* @default `["sans-serif"]`
|
|
31
|
-
*
|
|
32
|
-
* An array of fonts to use when your chosen font is unavailable, or loading. Fallback fonts will be chosen in the order listed. The first available font will be used:
|
|
33
|
-
*
|
|
34
|
-
* ```js
|
|
35
|
-
* fallbacks: ["CustomFont", "serif"]
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* To disable fallback fonts completely, configure an empty array:
|
|
39
|
-
*
|
|
40
|
-
* ```js
|
|
41
|
-
* fallbacks: []
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
|
|
45
|
-
* If the last font in the `fallbacks` array is a [generic family name](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name), Astro will attempt to generate [optimized fallbacks](https://developer.chrome.com/blog/font-fallbacks) using font metrics will be generated. To disable this optimization, set `optimizedFallbacks` to false.
|
|
46
|
-
*/
|
|
47
|
-
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
48
|
-
/**
|
|
49
|
-
* @default `true`
|
|
50
|
-
*
|
|
51
|
-
* Whether or not to enable optimized fallback generation. You may disable this default optimization to have full control over `fallbacks`.
|
|
52
|
-
*/
|
|
53
|
-
optimizedFallbacks: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
-
} & {
|
|
55
|
-
/**
|
|
56
|
-
* The source of your font files. Set to `"local"` to use local font files.
|
|
57
|
-
*/
|
|
58
16
|
provider: z.ZodLiteral<"local">;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
display: z.ZodOptional<z.ZodEnum<["auto", "block", "swap", "fallback", "optional"]>>;
|
|
81
|
-
/**
|
|
82
|
-
* A [font stretch](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-stretch).
|
|
83
|
-
*/
|
|
17
|
+
variants: z.ZodTuple<[z.ZodObject<{
|
|
18
|
+
src: z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>, z.ZodObject<{
|
|
19
|
+
url: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
|
|
20
|
+
tech: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strict>]>], z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>, z.ZodObject<{
|
|
22
|
+
url: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
|
|
23
|
+
tech: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strict>]>>;
|
|
25
|
+
weight: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
26
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
normal: "normal";
|
|
28
|
+
italic: "italic";
|
|
29
|
+
oblique: "oblique";
|
|
30
|
+
}>>;
|
|
31
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
optional: "optional";
|
|
33
|
+
auto: "auto";
|
|
34
|
+
block: "block";
|
|
35
|
+
swap: "swap";
|
|
36
|
+
fallback: "fallback";
|
|
37
|
+
}>>;
|
|
84
38
|
stretch: z.ZodOptional<z.ZodString>;
|
|
85
|
-
/**
|
|
86
|
-
* Font [feature settings](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-feature-settings).
|
|
87
|
-
*/
|
|
88
39
|
featureSettings: z.ZodOptional<z.ZodString>;
|
|
89
|
-
/**
|
|
90
|
-
* Font [variation settings](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-variation-settings).
|
|
91
|
-
*/
|
|
92
40
|
variationSettings: z.ZodOptional<z.ZodString>;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
src: z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<URL, z.ZodTypeDef, URL>]>, z.ZodObject<{
|
|
98
|
-
url: z.ZodUnion<[z.ZodString, z.ZodType<URL, z.ZodTypeDef, URL>]>;
|
|
41
|
+
unicodeRange: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
|
|
42
|
+
}, z.core.$strict>], z.ZodObject<{
|
|
43
|
+
src: z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>, z.ZodObject<{
|
|
44
|
+
url: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
|
|
99
45
|
tech: z.ZodOptional<z.ZodString>;
|
|
100
|
-
},
|
|
101
|
-
url:
|
|
102
|
-
tech
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
variationSettings?: string | undefined;
|
|
125
|
-
unicodeRange?: [string, ...string[]] | undefined;
|
|
126
|
-
}, {
|
|
127
|
-
src: [string | URL | {
|
|
128
|
-
url: string | URL;
|
|
129
|
-
tech?: string | undefined;
|
|
130
|
-
}, ...(string | URL | {
|
|
131
|
-
url: string | URL;
|
|
132
|
-
tech?: string | undefined;
|
|
133
|
-
})[]];
|
|
134
|
-
weight?: string | number | undefined;
|
|
135
|
-
style?: "normal" | "italic" | "oblique" | undefined;
|
|
136
|
-
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
137
|
-
stretch?: string | undefined;
|
|
138
|
-
featureSettings?: string | undefined;
|
|
139
|
-
variationSettings?: string | undefined;
|
|
140
|
-
unicodeRange?: [string, ...string[]] | undefined;
|
|
141
|
-
}>, "atleastone">;
|
|
142
|
-
}, "strict", z.ZodTypeAny, {
|
|
143
|
-
name: string;
|
|
144
|
-
cssVariable: string;
|
|
145
|
-
provider: "local";
|
|
146
|
-
variants: [{
|
|
147
|
-
src: [string | URL | {
|
|
148
|
-
url: string | URL;
|
|
149
|
-
tech?: string | undefined;
|
|
150
|
-
}, ...(string | URL | {
|
|
151
|
-
url: string | URL;
|
|
152
|
-
tech?: string | undefined;
|
|
153
|
-
})[]];
|
|
154
|
-
weight?: string | number | undefined;
|
|
155
|
-
style?: "normal" | "italic" | "oblique" | undefined;
|
|
156
|
-
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
157
|
-
stretch?: string | undefined;
|
|
158
|
-
featureSettings?: string | undefined;
|
|
159
|
-
variationSettings?: string | undefined;
|
|
160
|
-
unicodeRange?: [string, ...string[]] | undefined;
|
|
161
|
-
}, ...{
|
|
162
|
-
src: [string | URL | {
|
|
163
|
-
url: string | URL;
|
|
164
|
-
tech?: string | undefined;
|
|
165
|
-
}, ...(string | URL | {
|
|
166
|
-
url: string | URL;
|
|
167
|
-
tech?: string | undefined;
|
|
168
|
-
})[]];
|
|
169
|
-
weight?: string | number | undefined;
|
|
170
|
-
style?: "normal" | "italic" | "oblique" | undefined;
|
|
171
|
-
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
172
|
-
stretch?: string | undefined;
|
|
173
|
-
featureSettings?: string | undefined;
|
|
174
|
-
variationSettings?: string | undefined;
|
|
175
|
-
unicodeRange?: [string, ...string[]] | undefined;
|
|
176
|
-
}[]];
|
|
177
|
-
fallbacks?: string[] | undefined;
|
|
178
|
-
optimizedFallbacks?: boolean | undefined;
|
|
179
|
-
}, {
|
|
180
|
-
name: string;
|
|
181
|
-
cssVariable: string;
|
|
182
|
-
provider: "local";
|
|
183
|
-
variants: [{
|
|
184
|
-
src: [string | URL | {
|
|
185
|
-
url: string | URL;
|
|
186
|
-
tech?: string | undefined;
|
|
187
|
-
}, ...(string | URL | {
|
|
188
|
-
url: string | URL;
|
|
189
|
-
tech?: string | undefined;
|
|
190
|
-
})[]];
|
|
191
|
-
weight?: string | number | undefined;
|
|
192
|
-
style?: "normal" | "italic" | "oblique" | undefined;
|
|
193
|
-
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
194
|
-
stretch?: string | undefined;
|
|
195
|
-
featureSettings?: string | undefined;
|
|
196
|
-
variationSettings?: string | undefined;
|
|
197
|
-
unicodeRange?: [string, ...string[]] | undefined;
|
|
198
|
-
}, ...{
|
|
199
|
-
src: [string | URL | {
|
|
200
|
-
url: string | URL;
|
|
201
|
-
tech?: string | undefined;
|
|
202
|
-
}, ...(string | URL | {
|
|
203
|
-
url: string | URL;
|
|
204
|
-
tech?: string | undefined;
|
|
205
|
-
})[]];
|
|
206
|
-
weight?: string | number | undefined;
|
|
207
|
-
style?: "normal" | "italic" | "oblique" | undefined;
|
|
208
|
-
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
209
|
-
stretch?: string | undefined;
|
|
210
|
-
featureSettings?: string | undefined;
|
|
211
|
-
variationSettings?: string | undefined;
|
|
212
|
-
unicodeRange?: [string, ...string[]] | undefined;
|
|
213
|
-
}[]];
|
|
214
|
-
fallbacks?: string[] | undefined;
|
|
215
|
-
optimizedFallbacks?: boolean | undefined;
|
|
216
|
-
}>;
|
|
217
|
-
export declare const remoteFontFamilySchema: z.ZodObject<{
|
|
218
|
-
/**
|
|
219
|
-
* The font family name, as identified by your font provider.
|
|
220
|
-
*/
|
|
46
|
+
}, z.core.$strict>]>], z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>, z.ZodObject<{
|
|
47
|
+
url: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
|
|
48
|
+
tech: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strict>]>>;
|
|
50
|
+
weight: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
51
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
normal: "normal";
|
|
53
|
+
italic: "italic";
|
|
54
|
+
oblique: "oblique";
|
|
55
|
+
}>>;
|
|
56
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
optional: "optional";
|
|
58
|
+
auto: "auto";
|
|
59
|
+
block: "block";
|
|
60
|
+
swap: "swap";
|
|
61
|
+
fallback: "fallback";
|
|
62
|
+
}>>;
|
|
63
|
+
stretch: z.ZodOptional<z.ZodString>;
|
|
64
|
+
featureSettings: z.ZodOptional<z.ZodString>;
|
|
65
|
+
variationSettings: z.ZodOptional<z.ZodString>;
|
|
66
|
+
unicodeRange: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
|
|
67
|
+
}, z.core.$strict>>;
|
|
68
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
|
+
optimizedFallbacks: z.ZodOptional<z.ZodBoolean>;
|
|
221
70
|
name: z.ZodString;
|
|
222
|
-
/**
|
|
223
|
-
* A valid [ident](https://developer.mozilla.org/en-US/docs/Web/CSS/ident) in the form of a CSS variable (i.e. starting with `--`).
|
|
224
|
-
*/
|
|
225
71
|
cssVariable: z.ZodString;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
export declare const remoteFontFamilySchema: z.ZodObject<{
|
|
74
|
+
provider: z.ZodObject<{
|
|
75
|
+
entrypoint: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
|
|
76
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
weights: z.ZodOptional<z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>], z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
79
|
+
styles: z.ZodOptional<z.ZodTuple<[z.ZodEnum<{
|
|
80
|
+
normal: "normal";
|
|
81
|
+
italic: "italic";
|
|
82
|
+
oblique: "oblique";
|
|
83
|
+
}>], z.ZodEnum<{
|
|
84
|
+
normal: "normal";
|
|
85
|
+
italic: "italic";
|
|
86
|
+
oblique: "oblique";
|
|
87
|
+
}>>>;
|
|
88
|
+
subsets: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
|
|
89
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
90
|
+
optional: "optional";
|
|
91
|
+
auto: "auto";
|
|
92
|
+
block: "block";
|
|
93
|
+
swap: "swap";
|
|
94
|
+
fallback: "fallback";
|
|
95
|
+
}>>;
|
|
248
96
|
stretch: z.ZodOptional<z.ZodString>;
|
|
249
|
-
/**
|
|
250
|
-
* Font [feature settings](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-feature-settings).
|
|
251
|
-
*/
|
|
252
97
|
featureSettings: z.ZodOptional<z.ZodString>;
|
|
253
|
-
/**
|
|
254
|
-
* Font [variation settings](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-variation-settings).
|
|
255
|
-
*/
|
|
256
98
|
variationSettings: z.ZodOptional<z.ZodString>;
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
* @default `["sans-serif"]`
|
|
260
|
-
*
|
|
261
|
-
* An array of fonts to use when your chosen font is unavailable, or loading. Fallback fonts will be chosen in the order listed. The first available font will be used:
|
|
262
|
-
*
|
|
263
|
-
* ```js
|
|
264
|
-
* fallbacks: ["CustomFont", "serif"]
|
|
265
|
-
* ```
|
|
266
|
-
*
|
|
267
|
-
* To disable fallback fonts completely, configure an empty array:
|
|
268
|
-
*
|
|
269
|
-
* ```js
|
|
270
|
-
* fallbacks: []
|
|
271
|
-
* ```
|
|
272
|
-
*
|
|
273
|
-
|
|
274
|
-
* If the last font in the `fallbacks` array is a [generic family name](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name), Astro will attempt to generate [optimized fallbacks](https://developer.chrome.com/blog/font-fallbacks) using font metrics will be generated. To disable this optimization, set `optimizedFallbacks` to false.
|
|
275
|
-
*/
|
|
276
|
-
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
277
|
-
/**
|
|
278
|
-
* @default `true`
|
|
279
|
-
*
|
|
280
|
-
* Whether or not to enable optimized fallback generation. You may disable this default optimization to have full control over `fallbacks`.
|
|
281
|
-
*/
|
|
99
|
+
unicodeRange: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
|
|
100
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
282
101
|
optimizedFallbacks: z.ZodOptional<z.ZodBoolean>;
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
*/
|
|
287
|
-
provider: z.ZodObject<{
|
|
288
|
-
/**
|
|
289
|
-
* URL, path relative to the root or package import.
|
|
290
|
-
*/
|
|
291
|
-
entrypoint: z.ZodUnion<[z.ZodString, z.ZodType<URL, z.ZodTypeDef, URL>]>;
|
|
292
|
-
/**
|
|
293
|
-
* Optional serializable object passed to the unifont provider.
|
|
294
|
-
*/
|
|
295
|
-
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
296
|
-
}, "strict", z.ZodTypeAny, {
|
|
297
|
-
entrypoint: string | URL;
|
|
298
|
-
config?: Record<string, any> | undefined;
|
|
299
|
-
}, {
|
|
300
|
-
entrypoint: string | URL;
|
|
301
|
-
config?: Record<string, any> | undefined;
|
|
302
|
-
}>;
|
|
303
|
-
/**
|
|
304
|
-
* @default `[400]`
|
|
305
|
-
*
|
|
306
|
-
* An array of [font weights](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight). If the associated font is a [variable font](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_fonts/Variable_fonts_guide), you can specify a range of weights:
|
|
307
|
-
*
|
|
308
|
-
* ```js
|
|
309
|
-
* weight: "100 900"
|
|
310
|
-
* ```
|
|
311
|
-
*/
|
|
312
|
-
weights: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "atleastone">>;
|
|
313
|
-
/**
|
|
314
|
-
* @default `["normal", "italic"]`
|
|
315
|
-
*
|
|
316
|
-
* An array of [font styles](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style).
|
|
317
|
-
*/
|
|
318
|
-
styles: z.ZodOptional<z.ZodArray<z.ZodEnum<["normal", "italic", "oblique"]>, "atleastone">>;
|
|
319
|
-
/**
|
|
320
|
-
* @default `["cyrillic-ext", "cyrillic", "greek-ext", "greek", "vietnamese", "latin-ext", "latin"]`
|
|
321
|
-
*
|
|
322
|
-
* An array of [font subsets](https://knaap.dev/posts/font-subsetting/):
|
|
323
|
-
*/
|
|
324
|
-
subsets: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
325
|
-
/**
|
|
326
|
-
* A [unicode range](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range).
|
|
327
|
-
*/
|
|
328
|
-
unicodeRange: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
329
|
-
}, "strict", z.ZodTypeAny, {
|
|
330
|
-
name: string;
|
|
331
|
-
cssVariable: string;
|
|
332
|
-
provider: {
|
|
333
|
-
entrypoint: string | URL;
|
|
334
|
-
config?: Record<string, any> | undefined;
|
|
335
|
-
};
|
|
336
|
-
weights?: [string | number, ...(string | number)[]] | undefined;
|
|
337
|
-
styles?: ["normal" | "italic" | "oblique", ...("normal" | "italic" | "oblique")[]] | undefined;
|
|
338
|
-
subsets?: [string, ...string[]] | undefined;
|
|
339
|
-
fallbacks?: string[] | undefined;
|
|
340
|
-
optimizedFallbacks?: boolean | undefined;
|
|
341
|
-
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
342
|
-
stretch?: string | undefined;
|
|
343
|
-
featureSettings?: string | undefined;
|
|
344
|
-
variationSettings?: string | undefined;
|
|
345
|
-
unicodeRange?: [string, ...string[]] | undefined;
|
|
346
|
-
}, {
|
|
347
|
-
name: string;
|
|
348
|
-
cssVariable: string;
|
|
349
|
-
provider: {
|
|
350
|
-
entrypoint: string | URL;
|
|
351
|
-
config?: Record<string, any> | undefined;
|
|
352
|
-
};
|
|
353
|
-
weights?: [string | number, ...(string | number)[]] | undefined;
|
|
354
|
-
styles?: ["normal" | "italic" | "oblique", ...("normal" | "italic" | "oblique")[]] | undefined;
|
|
355
|
-
subsets?: [string, ...string[]] | undefined;
|
|
356
|
-
fallbacks?: string[] | undefined;
|
|
357
|
-
optimizedFallbacks?: boolean | undefined;
|
|
358
|
-
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
359
|
-
stretch?: string | undefined;
|
|
360
|
-
featureSettings?: string | undefined;
|
|
361
|
-
variationSettings?: string | undefined;
|
|
362
|
-
unicodeRange?: [string, ...string[]] | undefined;
|
|
363
|
-
}>;
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
cssVariable: z.ZodString;
|
|
104
|
+
}, z.core.$strict>;
|
|
@@ -1,161 +1,60 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
2
|
import { LOCAL_PROVIDER_NAME } from "./constants.js";
|
|
3
3
|
const weightSchema = z.union([z.string(), z.number()]);
|
|
4
4
|
const styleSchema = z.enum(["normal", "italic", "oblique"]);
|
|
5
|
-
const
|
|
5
|
+
const displaySchema = z.enum(["auto", "block", "swap", "fallback", "optional"]);
|
|
6
6
|
const familyPropertiesSchema = z.object({
|
|
7
|
-
/**
|
|
8
|
-
* A [font weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight). If the associated font is a [variable font](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_fonts/Variable_fonts_guide), you can specify a range of weights:
|
|
9
|
-
*
|
|
10
|
-
* ```js
|
|
11
|
-
* weight: "100 900"
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
7
|
weight: weightSchema.optional(),
|
|
15
|
-
/**
|
|
16
|
-
* A [font style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style).
|
|
17
|
-
*/
|
|
18
8
|
style: styleSchema.optional(),
|
|
19
|
-
|
|
20
|
-
* @default `"swap"`
|
|
21
|
-
*
|
|
22
|
-
* A [font display](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display).
|
|
23
|
-
*/
|
|
24
|
-
display: z.enum(["auto", "block", "swap", "fallback", "optional"]).optional(),
|
|
25
|
-
/**
|
|
26
|
-
* A [font stretch](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-stretch).
|
|
27
|
-
*/
|
|
9
|
+
display: displaySchema.optional(),
|
|
28
10
|
stretch: z.string().optional(),
|
|
29
|
-
/**
|
|
30
|
-
* Font [feature settings](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-feature-settings).
|
|
31
|
-
*/
|
|
32
11
|
featureSettings: z.string().optional(),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*/
|
|
36
|
-
variationSettings: z.string().optional()
|
|
12
|
+
variationSettings: z.string().optional(),
|
|
13
|
+
unicodeRange: z.tuple([z.string()], z.string()).optional()
|
|
37
14
|
});
|
|
38
15
|
const fallbacksSchema = z.object({
|
|
39
|
-
/**
|
|
40
|
-
* @default `["sans-serif"]`
|
|
41
|
-
*
|
|
42
|
-
* An array of fonts to use when your chosen font is unavailable, or loading. Fallback fonts will be chosen in the order listed. The first available font will be used:
|
|
43
|
-
*
|
|
44
|
-
* ```js
|
|
45
|
-
* fallbacks: ["CustomFont", "serif"]
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* To disable fallback fonts completely, configure an empty array:
|
|
49
|
-
*
|
|
50
|
-
* ```js
|
|
51
|
-
* fallbacks: []
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
* If the last font in the `fallbacks` array is a [generic family name](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name), Astro will attempt to generate [optimized fallbacks](https://developer.chrome.com/blog/font-fallbacks) using font metrics will be generated. To disable this optimization, set `optimizedFallbacks` to false.
|
|
56
|
-
*/
|
|
57
16
|
fallbacks: z.array(z.string()).optional(),
|
|
58
|
-
/**
|
|
59
|
-
* @default `true`
|
|
60
|
-
*
|
|
61
|
-
* Whether or not to enable optimized fallback generation. You may disable this default optimization to have full control over `fallbacks`.
|
|
62
|
-
*/
|
|
63
17
|
optimizedFallbacks: z.boolean().optional()
|
|
64
18
|
});
|
|
65
19
|
const requiredFamilyAttributesSchema = z.object({
|
|
66
|
-
/**
|
|
67
|
-
* The font family name, as identified by your font provider.
|
|
68
|
-
*/
|
|
69
20
|
name: z.string(),
|
|
70
|
-
/**
|
|
71
|
-
* A valid [ident](https://developer.mozilla.org/en-US/docs/Web/CSS/ident) in the form of a CSS variable (i.e. starting with `--`).
|
|
72
|
-
*/
|
|
73
21
|
cssVariable: z.string()
|
|
74
22
|
});
|
|
75
23
|
const entrypointSchema = z.union([z.string(), z.instanceof(URL)]);
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
config: z.record(z.string(), z.any()).optional()
|
|
24
|
+
const srcSchema = z.union([
|
|
25
|
+
entrypointSchema,
|
|
26
|
+
z.object({ url: entrypointSchema, tech: z.string().optional() }).strict()
|
|
27
|
+
]);
|
|
28
|
+
const variantSchema = z.object({
|
|
29
|
+
...familyPropertiesSchema.shape,
|
|
30
|
+
src: z.tuple([srcSchema], srcSchema)
|
|
31
|
+
// TODO: find a way to support subsets (through fontkit?)
|
|
85
32
|
}).strict();
|
|
86
|
-
const localFontFamilySchema =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
familyPropertiesSchema.merge(
|
|
97
|
-
z.object({
|
|
98
|
-
/**
|
|
99
|
-
* Font [sources](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src). It can be a path relative to the root, a package import or a URL. URLs are particularly useful if you inject local fonts through an integration.
|
|
100
|
-
*/
|
|
101
|
-
src: z.array(
|
|
102
|
-
z.union([
|
|
103
|
-
entrypointSchema,
|
|
104
|
-
z.object({ url: entrypointSchema, tech: z.string().optional() }).strict()
|
|
105
|
-
])
|
|
106
|
-
).nonempty(),
|
|
107
|
-
/**
|
|
108
|
-
* A [unicode range](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range).
|
|
109
|
-
*/
|
|
110
|
-
unicodeRange: unicodeRangeSchema.optional()
|
|
111
|
-
// TODO: find a way to support subsets (through fontkit?)
|
|
112
|
-
}).strict()
|
|
113
|
-
)
|
|
114
|
-
).nonempty()
|
|
115
|
-
})
|
|
116
|
-
).strict();
|
|
117
|
-
const remoteFontFamilySchema = requiredFamilyAttributesSchema.merge(
|
|
118
|
-
familyPropertiesSchema.omit({
|
|
33
|
+
const localFontFamilySchema = z.object({
|
|
34
|
+
...requiredFamilyAttributesSchema.shape,
|
|
35
|
+
...fallbacksSchema.shape,
|
|
36
|
+
provider: z.literal(LOCAL_PROVIDER_NAME),
|
|
37
|
+
variants: z.tuple([variantSchema], variantSchema)
|
|
38
|
+
}).strict();
|
|
39
|
+
const remoteFontFamilySchema = z.object({
|
|
40
|
+
...requiredFamilyAttributesSchema.shape,
|
|
41
|
+
...fallbacksSchema.shape,
|
|
42
|
+
...familyPropertiesSchema.omit({
|
|
119
43
|
weight: true,
|
|
120
44
|
style: true
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
*
|
|
131
|
-
* An array of [font weights](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight). If the associated font is a [variable font](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_fonts/Variable_fonts_guide), you can specify a range of weights:
|
|
132
|
-
*
|
|
133
|
-
* ```js
|
|
134
|
-
* weight: "100 900"
|
|
135
|
-
* ```
|
|
136
|
-
*/
|
|
137
|
-
weights: z.array(weightSchema).nonempty().optional(),
|
|
138
|
-
/**
|
|
139
|
-
* @default `["normal", "italic"]`
|
|
140
|
-
*
|
|
141
|
-
* An array of [font styles](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style).
|
|
142
|
-
*/
|
|
143
|
-
styles: z.array(styleSchema).nonempty().optional(),
|
|
144
|
-
/**
|
|
145
|
-
* @default `["cyrillic-ext", "cyrillic", "greek-ext", "greek", "vietnamese", "latin-ext", "latin"]`
|
|
146
|
-
*
|
|
147
|
-
* An array of [font subsets](https://knaap.dev/posts/font-subsetting/):
|
|
148
|
-
*/
|
|
149
|
-
subsets: z.array(z.string()).nonempty().optional(),
|
|
150
|
-
/**
|
|
151
|
-
* A [unicode range](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range).
|
|
152
|
-
*/
|
|
153
|
-
unicodeRange: unicodeRangeSchema.optional()
|
|
154
|
-
})
|
|
155
|
-
).strict();
|
|
45
|
+
}).shape,
|
|
46
|
+
provider: z.object({
|
|
47
|
+
entrypoint: entrypointSchema,
|
|
48
|
+
config: z.record(z.string(), z.any()).optional()
|
|
49
|
+
}).strict(),
|
|
50
|
+
weights: z.tuple([weightSchema], weightSchema).optional(),
|
|
51
|
+
styles: z.tuple([styleSchema], styleSchema).optional(),
|
|
52
|
+
subsets: z.tuple([z.string()], z.string()).optional()
|
|
53
|
+
}).strict();
|
|
156
54
|
export {
|
|
157
|
-
|
|
55
|
+
displaySchema,
|
|
158
56
|
localFontFamilySchema,
|
|
159
57
|
remoteFontFamilySchema,
|
|
160
|
-
styleSchema
|
|
58
|
+
styleSchema,
|
|
59
|
+
weightSchema
|
|
161
60
|
};
|
|
@@ -2,7 +2,7 @@ const LOCAL_PROVIDER_NAME = "local";
|
|
|
2
2
|
const DEFAULTS = {
|
|
3
3
|
weights: ["400"],
|
|
4
4
|
styles: ["normal", "italic"],
|
|
5
|
-
subsets: ["
|
|
5
|
+
subsets: ["latin"],
|
|
6
6
|
// Technically serif is the browser default but most websites these days use sans-serif
|
|
7
7
|
fallbacks: ["sans-serif"],
|
|
8
8
|
optimizedFallbacks: true
|