astro 6.0.0-alpha.0 → 6.0.0-alpha.2
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 +58 -47
- package/dist/assets/build/generate.d.ts +2 -2
- package/dist/assets/build/generate.js +12 -10
- package/dist/assets/consts.d.ts +1 -0
- package/dist/assets/consts.js +2 -0
- 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 +66 -65
- package/dist/assets/services/noop.js +11 -1
- package/dist/assets/services/service.d.ts +1 -1
- package/dist/assets/services/service.js +55 -51
- package/dist/assets/types.d.ts +2 -2
- package/dist/assets/utils/index.d.ts +1 -3
- package/dist/assets/utils/index.js +4 -9
- 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/svg.d.ts +2 -1
- package/dist/assets/utils/svg.js +30 -4
- package/dist/assets/vite-plugin-assets.js +36 -19
- 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/container/vite-plugin-container.js +7 -4
- 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 +90 -54
- package/dist/content/utils.d.ts +46 -338
- package/dist/content/utils.js +52 -50
- package/dist/content/vite-plugin-content-assets.d.ts +12 -4
- package/dist/content/vite-plugin-content-assets.js +152 -102
- package/dist/content/vite-plugin-content-imports.js +58 -40
- package/dist/content/vite-plugin-content-virtual-mod.js +95 -77
- 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 +15 -17
- package/dist/core/build/plugins/plugin-css.d.ts +2 -2
- package/dist/core/build/plugins/plugin-css.js +90 -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 +35 -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 +85 -139
- 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 +32 -16
- package/dist/core/errors/errors-data.js +23 -10
- 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 +41 -24
- 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 +106 -46
- package/dist/core/session/vite-plugin.d.ts +6 -0
- package/dist/core/session/vite-plugin.js +59 -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/core/viteUtils.d.ts +1 -0
- package/dist/core/viteUtils.js +2 -0
- 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 +61 -42
- package/dist/env/vite-plugin-import-meta-env.js +45 -37
- 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 +8 -26
- 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 +150 -0
- package/dist/manifest/virtual-module.d.ts +1 -4
- package/dist/manifest/virtual-module.js +100 -91
- package/dist/preferences/index.d.ts +1 -2
- package/dist/prefetch/vite-plugin-prefetch.js +20 -9
- 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/toolbar/vite-plugin-dev-toolbar.js +13 -7
- 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/transitions/vite-plugin-transitions.js +35 -22
- package/dist/types/astro.d.ts +8 -6
- package/dist/types/public/config.d.ts +438 -289
- package/dist/types/public/context.d.ts +3 -4
- package/dist/types/public/extendables.d.ts +2 -0
- 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 +12 -5
- 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 +19 -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 +215 -170
- 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 +0 -1
- package/dist/vite-plugin-astro-server/index.js +0 -2
- package/dist/vite-plugin-astro-server/metadata.js +1 -1
- package/dist/vite-plugin-astro-server/plugin.d.ts +3 -7
- package/dist/vite-plugin-astro-server/plugin.js +40 -108
- package/dist/vite-plugin-astro-server/server-state.d.ts +1 -1
- package/dist/vite-plugin-astro-server/util.d.ts +2 -2
- package/dist/vite-plugin-astro-server/util.js +2 -1
- 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-chromedevtools/index.d.ts +7 -0
- package/dist/vite-plugin-chromedevtools/index.js +47 -0
- package/dist/vite-plugin-config-alias/index.js +59 -44
- package/dist/vite-plugin-css/index.d.ts +18 -0
- package/dist/vite-plugin-css/index.js +155 -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-fileurl/index.js +6 -3
- 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-html/index.d.ts +7 -4
- package/dist/vite-plugin-html/index.js +5 -3
- package/dist/vite-plugin-load-fallback/index.js +12 -5
- package/dist/vite-plugin-markdown/index.js +27 -8
- package/dist/vite-plugin-overlay/index.d.ts +2 -0
- package/dist/vite-plugin-overlay/index.js +21 -0
- 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 +54 -0
- package/dist/vite-plugin-pages/pages.d.ts +8 -0
- package/dist/vite-plugin-pages/pages.js +63 -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 +45 -0
- package/dist/vite-plugin-routes/index.d.ts +14 -0
- package/dist/vite-plugin-routes/index.js +181 -0
- package/dist/vite-plugin-scripts/index.js +27 -25
- package/dist/vite-plugin-scripts/page-ssr.js +3 -2
- package/dist/vite-plugin-utils/index.d.ts +1 -0
- package/dist/vite-plugin-utils/index.js +2 -1
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +2 -2
- package/package.json +35 -32
- 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/remotePattern.d.ts +0 -3
- package/dist/assets/utils/remotePattern.js +0 -16
- 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,42 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { routeIsRedirect } from "../core/routing/index.js";
|
|
2
2
|
import { routeComparator } from "../core/routing/priority.js";
|
|
3
|
-
import { getPrerenderStatus } from "./metadata.js";
|
|
4
3
|
async function getSortedPreloadedMatches({
|
|
5
4
|
pipeline,
|
|
6
5
|
matches,
|
|
7
|
-
|
|
6
|
+
manifest
|
|
8
7
|
}) {
|
|
9
8
|
return (await preloadAndSetPrerenderStatus({
|
|
10
9
|
pipeline,
|
|
11
10
|
matches,
|
|
12
|
-
|
|
11
|
+
manifest
|
|
13
12
|
})).sort((a, b) => routeComparator(a.route, b.route)).sort((a, b) => prioritizePrerenderedMatchesComparator(a.route, b.route));
|
|
14
13
|
}
|
|
15
14
|
async function preloadAndSetPrerenderStatus({
|
|
16
|
-
pipeline,
|
|
17
15
|
matches,
|
|
18
|
-
|
|
16
|
+
manifest
|
|
19
17
|
}) {
|
|
20
18
|
const preloaded = new Array();
|
|
21
19
|
for (const route of matches) {
|
|
22
|
-
const filePath = new URL(`./${route.component}`,
|
|
20
|
+
const filePath = new URL(`./${route.component}`, manifest.rootDir);
|
|
23
21
|
if (routeIsRedirect(route)) {
|
|
24
22
|
preloaded.push({
|
|
25
|
-
preloadedComponent: RedirectComponentInstance,
|
|
26
23
|
route,
|
|
27
24
|
filePath
|
|
28
25
|
});
|
|
29
26
|
continue;
|
|
30
27
|
}
|
|
31
|
-
|
|
32
|
-
const prerenderStatus = getPrerenderStatus({
|
|
33
|
-
filePath,
|
|
34
|
-
loader: pipeline.loader
|
|
35
|
-
});
|
|
36
|
-
if (prerenderStatus !== void 0) {
|
|
37
|
-
route.prerender = prerenderStatus;
|
|
38
|
-
}
|
|
39
|
-
preloaded.push({ preloadedComponent, route, filePath });
|
|
28
|
+
preloaded.push({ route, filePath });
|
|
40
29
|
}
|
|
41
30
|
return preloaded;
|
|
42
31
|
}
|
|
@@ -7,8 +7,8 @@ export declare class DevToolbarBadge extends HTMLElement {
|
|
|
7
7
|
_badgeStyle: BadgeStyle;
|
|
8
8
|
get size(): "small" | "large";
|
|
9
9
|
set size(value: "small" | "large");
|
|
10
|
-
get badgeStyle(): "red" | "
|
|
11
|
-
set badgeStyle(value: "red" | "
|
|
10
|
+
get badgeStyle(): "red" | "green" | "yellow" | "blue" | "gray" | "purple";
|
|
11
|
+
set badgeStyle(value: "red" | "green" | "yellow" | "blue" | "gray" | "purple");
|
|
12
12
|
shadowRoot: ShadowRoot;
|
|
13
13
|
static observedAttributes: string[];
|
|
14
14
|
constructor();
|
|
@@ -10,8 +10,8 @@ export declare class DevToolbarButton extends HTMLElement {
|
|
|
10
10
|
_buttonBorderRadius: ButtonBorderRadius;
|
|
11
11
|
get size(): "small" | "large" | "medium";
|
|
12
12
|
set size(value: "small" | "large" | "medium");
|
|
13
|
-
get buttonStyle(): "red" | "
|
|
14
|
-
set buttonStyle(value: "red" | "
|
|
13
|
+
get buttonStyle(): "red" | "green" | "yellow" | "blue" | "gray" | "purple" | "ghost" | "outline";
|
|
14
|
+
set buttonStyle(value: "red" | "green" | "yellow" | "blue" | "gray" | "purple" | "ghost" | "outline");
|
|
15
15
|
get buttonBorderRadius(): "normal" | "rounded";
|
|
16
16
|
set buttonBorderRadius(value: "normal" | "rounded");
|
|
17
17
|
static observedAttributes: string[];
|
|
@@ -5,8 +5,8 @@ export declare class DevToolbarCard extends HTMLElement {
|
|
|
5
5
|
clickAction?: () => void | (() => Promise<void>);
|
|
6
6
|
shadowRoot: ShadowRoot;
|
|
7
7
|
_cardStyle: CardStyle;
|
|
8
|
-
get cardStyle(): "red" | "
|
|
9
|
-
set cardStyle(value: "red" | "
|
|
8
|
+
get cardStyle(): "red" | "green" | "yellow" | "blue" | "gray" | "purple";
|
|
9
|
+
set cardStyle(value: "red" | "green" | "yellow" | "blue" | "gray" | "purple");
|
|
10
10
|
static observedAttributes: string[];
|
|
11
11
|
constructor();
|
|
12
12
|
attributeChangedCallback(): void;
|
|
@@ -4,8 +4,8 @@ type HighlightStyle = (typeof styles)[number];
|
|
|
4
4
|
export declare class DevToolbarHighlight extends HTMLElement {
|
|
5
5
|
icon?: Icon | undefined | null;
|
|
6
6
|
_highlightStyle: HighlightStyle;
|
|
7
|
-
get highlightStyle(): "red" | "
|
|
8
|
-
set highlightStyle(value: "red" | "
|
|
7
|
+
get highlightStyle(): "red" | "green" | "yellow" | "blue" | "gray" | "purple";
|
|
8
|
+
set highlightStyle(value: "red" | "green" | "yellow" | "blue" | "gray" | "purple");
|
|
9
9
|
static observedAttributes: string[];
|
|
10
10
|
shadowRoot: ShadowRoot;
|
|
11
11
|
constructor();
|
|
@@ -2,8 +2,8 @@ export declare class DevToolbarRadioCheckbox extends HTMLElement {
|
|
|
2
2
|
private _radioStyle;
|
|
3
3
|
input: HTMLInputElement;
|
|
4
4
|
shadowRoot: ShadowRoot;
|
|
5
|
-
get radioStyle(): "red" | "
|
|
6
|
-
set radioStyle(value: "red" | "
|
|
5
|
+
get radioStyle(): "red" | "green" | "yellow" | "blue" | "gray" | "purple";
|
|
6
|
+
set radioStyle(value: "red" | "green" | "yellow" | "blue" | "gray" | "purple");
|
|
7
7
|
static observedAttributes: string[];
|
|
8
8
|
constructor();
|
|
9
9
|
connectedCallback(): void;
|
|
@@ -4,8 +4,8 @@ export declare class DevToolbarSelect extends HTMLElement {
|
|
|
4
4
|
shadowRoot: ShadowRoot;
|
|
5
5
|
element: HTMLSelectElement;
|
|
6
6
|
_selectStyle: SelectStyle;
|
|
7
|
-
get selectStyle(): "red" | "
|
|
8
|
-
set selectStyle(value: "red" | "
|
|
7
|
+
get selectStyle(): "red" | "green" | "yellow" | "blue" | "gray" | "purple";
|
|
8
|
+
set selectStyle(value: "red" | "green" | "yellow" | "blue" | "gray" | "purple");
|
|
9
9
|
static observedAttributes: string[];
|
|
10
10
|
constructor();
|
|
11
11
|
connectedCallback(): void;
|
|
@@ -4,8 +4,8 @@ export declare class DevToolbarToggle extends HTMLElement {
|
|
|
4
4
|
shadowRoot: ShadowRoot;
|
|
5
5
|
input: HTMLInputElement;
|
|
6
6
|
_toggleStyle: ToggleStyle;
|
|
7
|
-
get toggleStyle(): "red" | "
|
|
8
|
-
set toggleStyle(value: "red" | "
|
|
7
|
+
get toggleStyle(): "red" | "green" | "yellow" | "blue" | "gray" | "purple";
|
|
8
|
+
set toggleStyle(value: "red" | "green" | "yellow" | "blue" | "gray" | "purple");
|
|
9
9
|
static observedAttributes: string[];
|
|
10
10
|
constructor();
|
|
11
11
|
attributeChangedCallback(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import colors from "
|
|
1
|
+
import colors from "piccolore";
|
|
2
2
|
import { REROUTABLE_STATUS_CODES, REROUTE_DIRECTIVE_HEADER } from "../../core/constants.js";
|
|
3
3
|
import { AstroError } from "../../core/errors/errors.js";
|
|
4
4
|
import { EndpointDidNotReturnAResponse } from "../../core/errors/errors-data.js";
|
|
@@ -107,9 +107,9 @@ class ServerIslandComponent {
|
|
|
107
107
|
}
|
|
108
108
|
const componentPath = this.getComponentPath();
|
|
109
109
|
const componentExport = this.getComponentExport();
|
|
110
|
-
|
|
110
|
+
let componentId = this.result.serverIslandNameMap.get(componentPath);
|
|
111
111
|
if (!componentId) {
|
|
112
|
-
throw new Error(`Could not find server component name`);
|
|
112
|
+
throw new Error(`Could not find server component name ${componentPath}`);
|
|
113
113
|
}
|
|
114
114
|
for (const key2 of Object.keys(this.props)) {
|
|
115
115
|
if (internalProps.has(key2)) {
|
|
@@ -125,13 +125,14 @@ class ServerIslandComponent {
|
|
|
125
125
|
}
|
|
126
126
|
const key = await this.result.key;
|
|
127
127
|
const propsEncrypted = Object.keys(this.props).length === 0 ? "" : await encryptString(key, JSON.stringify(this.props));
|
|
128
|
+
const slotsEncrypted = Object.keys(renderedSlots).length === 0 ? "" : await encryptString(key, JSON.stringify(renderedSlots));
|
|
128
129
|
const hostId = await this.getHostId();
|
|
129
130
|
const slash = this.result.base.endsWith("/") ? "" : "/";
|
|
130
131
|
let serverIslandUrl = `${this.result.base}${slash}_server-islands/${componentId}${this.result.trailingSlash === "always" ? "/" : ""}`;
|
|
131
132
|
const potentialSearchParams = createSearchParams(
|
|
132
133
|
componentExport,
|
|
133
134
|
propsEncrypted,
|
|
134
|
-
|
|
135
|
+
slotsEncrypted
|
|
135
136
|
);
|
|
136
137
|
const useGETRequest = isWithinURLLimit(serverIslandUrl, potentialSearchParams);
|
|
137
138
|
if (useGETRequest) {
|
|
@@ -153,7 +154,7 @@ let response = await fetch('${serverIslandUrl}', { headers });`
|
|
|
153
154
|
`let data = {
|
|
154
155
|
componentExport: ${safeJsonStringify(componentExport)},
|
|
155
156
|
encryptedProps: ${safeJsonStringify(propsEncrypted)},
|
|
156
|
-
|
|
157
|
+
encryptedSlots: ${safeJsonStringify(slotsEncrypted)},
|
|
157
158
|
};
|
|
158
159
|
const headers = new Headers({ 'Content-Type': 'application/json', ...${headersJson} });
|
|
159
160
|
let response = await fetch('${serverIslandUrl}', {
|
|
@@ -2,6 +2,7 @@ import type { SSRResult } from '../../types/public/internal.js';
|
|
|
2
2
|
import type { TransitionAnimationPair, TransitionAnimationValue } from '../../types/public/view-transitions.js';
|
|
3
3
|
export declare function createTransitionScope(result: SSRResult, hash: string): string;
|
|
4
4
|
export declare function renderTransition(result: SSRResult, hash: string, animationName: TransitionAnimationValue | undefined, transitionName: string): string;
|
|
5
|
+
/** @deprecated This will be removed in Astro 7 */
|
|
5
6
|
export declare function createAnimationScope(transitionName: string, animations: Record<string, TransitionAnimationPair>): {
|
|
6
7
|
scope: string;
|
|
7
8
|
styles: string;
|
package/dist/template/4xx.js
CHANGED
|
@@ -109,7 +109,9 @@ function subpathNotUsedTemplate(base, pathname) {
|
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
function trailingSlashMismatchTemplate(pathname, trailingSlash) {
|
|
112
|
-
const corrected =
|
|
112
|
+
const corrected = escape(
|
|
113
|
+
trailingSlash === "always" ? appendForwardSlash(pathname) : removeTrailingForwardSlash(pathname)
|
|
114
|
+
);
|
|
113
115
|
return template({
|
|
114
116
|
pathname,
|
|
115
117
|
statusCode: 404,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { telemetry } from "../events/index.js";
|
|
2
2
|
import { eventAppToggled } from "../events/toolbar.js";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const VIRTUAL_MODULE_ID = "astro:toolbar:internal";
|
|
4
|
+
const RESOLVED_VIRTUAL_MODULE_ID = "\0" + VIRTUAL_MODULE_ID;
|
|
5
5
|
function astroDevToolbar({ settings, logger }) {
|
|
6
6
|
let telemetryTimeout;
|
|
7
7
|
return {
|
|
@@ -14,9 +14,12 @@ function astroDevToolbar({ settings, logger }) {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
},
|
|
17
|
-
resolveId
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
resolveId: {
|
|
18
|
+
filter: {
|
|
19
|
+
id: new RegExp(`^${VIRTUAL_MODULE_ID}$`)
|
|
20
|
+
},
|
|
21
|
+
handler() {
|
|
22
|
+
return RESOLVED_VIRTUAL_MODULE_ID;
|
|
20
23
|
}
|
|
21
24
|
},
|
|
22
25
|
configureServer(server) {
|
|
@@ -48,8 +51,11 @@ ${args.error}`
|
|
|
48
51
|
}, 200);
|
|
49
52
|
});
|
|
50
53
|
},
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
load: {
|
|
55
|
+
filter: {
|
|
56
|
+
id: new RegExp(`^${RESOLVED_VIRTUAL_MODULE_ID}$`)
|
|
57
|
+
},
|
|
58
|
+
handler() {
|
|
53
59
|
return {
|
|
54
60
|
code: `
|
|
55
61
|
export const loadDevToolbarApps = async () => {
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { Direction, NavigationTypeString } from './types.js';
|
|
2
|
+
/** @deprecated This will be removed in Astro 7 */
|
|
2
3
|
export declare const TRANSITION_BEFORE_PREPARATION = "astro:before-preparation";
|
|
4
|
+
/** @deprecated This will be removed in Astro 7 */
|
|
3
5
|
export declare const TRANSITION_AFTER_PREPARATION = "astro:after-preparation";
|
|
6
|
+
/** @deprecated This will be removed in Astro 7 */
|
|
4
7
|
export declare const TRANSITION_BEFORE_SWAP = "astro:before-swap";
|
|
8
|
+
/** @deprecated This will be removed in Astro 7 */
|
|
5
9
|
export declare const TRANSITION_AFTER_SWAP = "astro:after-swap";
|
|
10
|
+
/** @deprecated This will be removed in Astro 7 */
|
|
6
11
|
export declare const TRANSITION_PAGE_LOAD = "astro:page-load";
|
|
7
12
|
type Events = typeof TRANSITION_AFTER_PREPARATION | typeof TRANSITION_AFTER_SWAP | typeof TRANSITION_PAGE_LOAD;
|
|
8
13
|
export declare const triggerEvent: (name: Events) => boolean;
|
|
@@ -18,12 +23,14 @@ declare class BeforeEvent extends Event {
|
|
|
18
23
|
readonly signal: AbortSignal;
|
|
19
24
|
constructor(type: string, eventInitDict: EventInit | undefined, from: URL, to: URL, direction: Direction | string, navigationType: NavigationTypeString, sourceElement: Element | undefined, info: any, newDocument: Document, signal: AbortSignal);
|
|
20
25
|
}
|
|
26
|
+
/** @deprecated This will be removed in Astro 7 */
|
|
21
27
|
export declare const isTransitionBeforePreparationEvent: (value: any) => value is TransitionBeforePreparationEvent;
|
|
22
28
|
export declare class TransitionBeforePreparationEvent extends BeforeEvent {
|
|
23
29
|
formData: FormData | undefined;
|
|
24
30
|
loader: () => Promise<void>;
|
|
25
31
|
constructor(from: URL, to: URL, direction: Direction | string, navigationType: NavigationTypeString, sourceElement: Element | undefined, info: any, newDocument: Document, signal: AbortSignal, formData: FormData | undefined, loader: (event: TransitionBeforePreparationEvent) => Promise<void>);
|
|
26
32
|
}
|
|
33
|
+
/** @deprecated This will be removed in Astro 7 */
|
|
27
34
|
export declare const isTransitionBeforeSwapEvent: (value: any) => value is TransitionBeforeSwapEvent;
|
|
28
35
|
export declare class TransitionBeforeSwapEvent extends BeforeEvent {
|
|
29
36
|
readonly direction: Direction | string;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { internalFetchHeaders } from "virtual:astro:adapter-config/client";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
doPreparation,
|
|
4
|
+
doSwap,
|
|
5
|
+
TRANSITION_AFTER_SWAP,
|
|
6
|
+
onPageLoad,
|
|
7
|
+
triggerEvent
|
|
8
|
+
} from "./events.js";
|
|
3
9
|
import { detectScriptExecuted } from "./swap-functions.js";
|
|
4
10
|
const inBrowser = import.meta.env.SSR === false;
|
|
5
11
|
const updateScrollPosition = (positions) => {
|
|
@@ -14,8 +20,6 @@ const samePage = (thisLocation, otherLocation) => thisLocation.pathname === othe
|
|
|
14
20
|
let mostRecentNavigation;
|
|
15
21
|
let mostRecentTransition;
|
|
16
22
|
let originalLocation;
|
|
17
|
-
const triggerEvent = (name) => document.dispatchEvent(new Event(name));
|
|
18
|
-
const onPageLoad = () => triggerEvent("astro:page-load");
|
|
19
23
|
const announce = () => {
|
|
20
24
|
let div = document.createElement("div");
|
|
21
25
|
div.setAttribute("aria-live", "assertive");
|
|
@@ -58,6 +58,10 @@ function attachShadowRoots(root) {
|
|
|
58
58
|
const mode = template.getAttribute("shadowrootmode");
|
|
59
59
|
const parent = template.parentNode;
|
|
60
60
|
if ((mode === "closed" || mode === "open") && parent instanceof HTMLElement) {
|
|
61
|
+
if (parent.shadowRoot) {
|
|
62
|
+
template.remove();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
61
65
|
const shadowRoot = parent.attachShadow({ mode });
|
|
62
66
|
shadowRoot.appendChild(template.content);
|
|
63
67
|
template.remove();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
1
|
+
const VIRTUAL_MODULE_ID = "astro:transitions";
|
|
2
|
+
const RESOLVED_VIRTUAL_MODULE_ID = "\0" + VIRTUAL_MODULE_ID;
|
|
3
|
+
const VIRTUAL_CLIENT_MODULE_ID = "astro:transitions/client";
|
|
4
|
+
const RESOLVED_VIRTUAL_CLIENT_MODULE_ID = "\0" + VIRTUAL_CLIENT_MODULE_ID;
|
|
5
5
|
function astroTransitions({ settings }) {
|
|
6
6
|
return {
|
|
7
7
|
name: "astro:transitions",
|
|
@@ -12,26 +12,35 @@ function astroTransitions({ settings }) {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
resolveId: {
|
|
16
|
+
filter: {
|
|
17
|
+
id: new RegExp(`^(${VIRTUAL_MODULE_ID}|${VIRTUAL_CLIENT_MODULE_ID})$`)
|
|
18
|
+
},
|
|
19
|
+
handler(id) {
|
|
20
|
+
if (id === VIRTUAL_MODULE_ID) {
|
|
21
|
+
return RESOLVED_VIRTUAL_MODULE_ID;
|
|
22
|
+
}
|
|
23
|
+
if (id === VIRTUAL_CLIENT_MODULE_ID) {
|
|
24
|
+
return RESOLVED_VIRTUAL_CLIENT_MODULE_ID;
|
|
25
|
+
}
|
|
21
26
|
}
|
|
22
27
|
},
|
|
23
|
-
load
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
load: {
|
|
29
|
+
filter: {
|
|
30
|
+
id: new RegExp(`^(${RESOLVED_VIRTUAL_MODULE_ID}|${RESOLVED_VIRTUAL_CLIENT_MODULE_ID})$`)
|
|
31
|
+
},
|
|
32
|
+
handler(id) {
|
|
33
|
+
if (id === RESOLVED_VIRTUAL_MODULE_ID) {
|
|
34
|
+
return {
|
|
35
|
+
code: `
|
|
27
36
|
export * from "astro/virtual-modules/transitions.js";
|
|
28
37
|
export { default as ClientRouter } from "astro/components/ClientRouter.astro";
|
|
29
38
|
`
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (id === RESOLVED_VIRTUAL_CLIENT_MODULE_ID) {
|
|
42
|
+
return {
|
|
43
|
+
code: `
|
|
35
44
|
export { navigate, supportsViewTransitions, transitionEnabledOnThisPage } from "astro/virtual-modules/transitions-router.js";
|
|
36
45
|
export * from "astro/virtual-modules/transitions-types.js";
|
|
37
46
|
export {
|
|
@@ -42,11 +51,15 @@ function astroTransitions({ settings }) {
|
|
|
42
51
|
} from "astro/virtual-modules/transitions-events.js";
|
|
43
52
|
export { swapFunctions } from "astro/virtual-modules/transitions-swap-functions.js";
|
|
44
53
|
`
|
|
45
|
-
|
|
54
|
+
};
|
|
55
|
+
}
|
|
46
56
|
}
|
|
47
57
|
},
|
|
48
|
-
transform
|
|
49
|
-
|
|
58
|
+
transform: {
|
|
59
|
+
filter: {
|
|
60
|
+
id: /ClientRouter\.astro.*\.ts$/
|
|
61
|
+
},
|
|
62
|
+
handler(code) {
|
|
50
63
|
const prefetchDisabled = settings.config.prefetch === false;
|
|
51
64
|
return code.replace("__PREFETCH_DISABLED__", JSON.stringify(prefetchDisabled));
|
|
52
65
|
}
|
package/dist/types/astro.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { SSRManifest } from '../core/app/types.js';
|
|
2
1
|
import type { AstroTimer } from '../core/config/timer.js';
|
|
3
2
|
import type { TSConfig } from '../core/config/tsconfig.js';
|
|
4
|
-
import type { Logger } from '../core/logger/core.js';
|
|
3
|
+
import type { Logger, LoggerLevel } from '../core/logger/core.js';
|
|
5
4
|
import type { AstroPreferences } from '../preferences/index.js';
|
|
6
5
|
import type { AstroComponentFactory } from '../runtime/server/index.js';
|
|
7
6
|
import type { GetStaticPaths } from './public/common.js';
|
|
@@ -11,7 +10,6 @@ import type { AstroAdapter, AstroRenderer, InjectedScriptStage, InjectedType } f
|
|
|
11
10
|
import type { InternalInjectedRoute, ResolvedInjectedRoute, RouteData } from './public/internal.js';
|
|
12
11
|
import type { DevToolbarAppEntry } from './public/toolbar.js';
|
|
13
12
|
export type SerializedRouteData = Omit<RouteData, 'generate' | 'pattern' | 'redirectRoute' | 'fallbackRoutes'> & {
|
|
14
|
-
generate: undefined;
|
|
15
13
|
pattern: string;
|
|
16
14
|
redirectRoute: SerializedRouteData | undefined;
|
|
17
15
|
fallbackRoutes: SerializedRouteData[];
|
|
@@ -19,7 +17,7 @@ export type SerializedRouteData = Omit<RouteData, 'generate' | 'pattern' | 'redi
|
|
|
19
17
|
trailingSlash: AstroConfig['trailingSlash'];
|
|
20
18
|
};
|
|
21
19
|
};
|
|
22
|
-
type CspObject = Required<Exclude<AstroConfig['
|
|
20
|
+
type CspObject = Required<Exclude<AstroConfig['security']['csp'], boolean>>;
|
|
23
21
|
export interface AstroSettings {
|
|
24
22
|
config: AstroConfig;
|
|
25
23
|
adapter: AstroAdapter | undefined;
|
|
@@ -56,8 +54,6 @@ export interface AstroSettings {
|
|
|
56
54
|
* - the user is on the latest version already
|
|
57
55
|
*/
|
|
58
56
|
latestAstroVersion: string | undefined;
|
|
59
|
-
serverIslandMap: NonNullable<SSRManifest['serverIslandMap']>;
|
|
60
|
-
serverIslandNameMap: NonNullable<SSRManifest['serverIslandNameMap']>;
|
|
61
57
|
injectedTypes: Array<Omit<InjectedType, 'content'> & Partial<Pick<InjectedType, 'content'>>>;
|
|
62
58
|
/**
|
|
63
59
|
* Determine if the build output should be a static, dist folder or a adapter-based server output
|
|
@@ -68,6 +64,7 @@ export interface AstroSettings {
|
|
|
68
64
|
fontResources: Set<string>;
|
|
69
65
|
styleHashes: Required<CspObject['styleDirective']>['hashes'];
|
|
70
66
|
};
|
|
67
|
+
logLevel: LoggerLevel;
|
|
71
68
|
}
|
|
72
69
|
/** Generic interface for a component (Astro, Svelte, React, etc.) */
|
|
73
70
|
export interface ComponentInstance {
|
|
@@ -84,4 +81,9 @@ export interface AstroPluginOptions {
|
|
|
84
81
|
settings: AstroSettings;
|
|
85
82
|
logger: Logger;
|
|
86
83
|
}
|
|
84
|
+
export interface ImportedDevStyle {
|
|
85
|
+
id: string;
|
|
86
|
+
url: string;
|
|
87
|
+
content: string;
|
|
88
|
+
}
|
|
87
89
|
export {};
|