astro 5.16.5 → 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.js → bin/astro.mjs} +7 -8
- package/client.d.ts +19 -45
- package/components/ClientRouter.astro +0 -5
- 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 -29
- package/dist/actions/runtime/server.js +162 -82
- package/dist/actions/runtime/types.d.ts +64 -0
- package/dist/actions/runtime/types.js +0 -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 +11 -9
- package/dist/assets/build/remote.js +4 -14
- package/dist/assets/endpoint/config.js +2 -2
- package/dist/assets/endpoint/dev.js +7 -6
- package/dist/assets/fonts/config.d.ts +86 -174
- package/dist/assets/fonts/config.js +15 -17
- package/dist/assets/fonts/infra/dev-remote-font-provider-mod-resolver.d.ts +3 -3
- package/dist/assets/fonts/infra/dev-remote-font-provider-mod-resolver.js +4 -4
- package/dist/assets/fonts/types.d.ts +1 -1
- package/dist/assets/fonts/vite-plugin-fonts.js +6 -3
- package/dist/assets/services/sharp.js +5 -6
- package/dist/assets/utils/index.d.ts +0 -6
- package/dist/assets/utils/index.js +0 -9
- package/dist/assets/utils/{transformToPath.d.ts → node.d.ts} +15 -1
- package/dist/assets/utils/{node/emitAsset.js → node.js} +34 -56
- package/dist/assets/vite-plugin-assets.js +9 -14
- package/dist/cli/index.js +0 -2
- package/dist/cli/infra/build-time-astro-version-provider.js +1 -1
- package/dist/cli/preferences/index.js +5 -1
- package/dist/config/index.js +11 -16
- package/dist/container/index.d.ts +0 -1
- package/dist/container/index.js +19 -14
- 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/config.js +17 -13
- package/dist/content/content-layer.js +14 -21
- package/dist/content/data-store.d.ts +0 -2
- package/dist/content/loaders/errors.d.ts +3 -3
- package/dist/content/loaders/errors.js +5 -2
- package/dist/content/loaders/glob.d.ts +0 -5
- package/dist/content/loaders/glob.js +3 -30
- package/dist/content/loaders/types.d.ts +11 -4
- package/dist/content/mutable-data-store.js +1 -14
- package/dist/content/runtime-assets.d.ts +4 -4
- package/dist/content/runtime-assets.js +4 -7
- package/dist/content/runtime.d.ts +35 -73
- package/dist/content/runtime.js +63 -231
- package/dist/content/server-listeners.js +25 -88
- package/dist/content/types-generator.d.ts +1 -6
- package/dist/content/types-generator.js +87 -156
- package/dist/content/utils.d.ts +47 -412
- package/dist/content/utils.js +88 -203
- 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 -8
- package/dist/content/vite-plugin-content-virtual-mod.js +13 -131
- 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 -114
- package/dist/core/app/index.js +20 -557
- 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.d.ts +2 -8
- package/dist/core/app/node.js +8 -9
- 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 +95 -204
- package/dist/core/build/graph.js +2 -2
- package/dist/core/build/index.js +11 -19
- package/dist/core/build/internal.d.ts +3 -29
- package/dist/core/build/internal.js +1 -45
- 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 -131
- 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 +180 -154
- 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 -4
- package/dist/core/config/config.js +2 -2
- 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 +330 -1463
- package/dist/core/config/schemas/base.js +40 -56
- package/dist/core/config/schemas/refined.d.ts +2 -2
- package/dist/core/config/schemas/refined.js +8 -1
- package/dist/core/config/schemas/relative.d.ts +607 -1737
- 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 +12 -0
- package/dist/core/constants.js +22 -1
- package/dist/core/create-vite.d.ts +2 -6
- package/dist/core/create-vite.js +36 -47
- 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/dev/container.js +13 -9
- package/dist/core/dev/dev.js +1 -1
- 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/vite.js +2 -19
- package/dist/core/errors/errors-data.d.ts +85 -57
- package/dist/core/errors/errors-data.js +40 -28
- package/dist/core/errors/errors.d.ts +3 -3
- package/dist/core/errors/errors.js +1 -1
- package/dist/core/errors/overlay.js +1 -1
- package/dist/core/errors/zod-error-map.d.ts +2 -2
- package/dist/core/errors/zod-error-map.js +26 -24
- package/dist/core/messages.d.ts +2 -2
- package/dist/core/messages.js +2 -2
- 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 +4 -4
- package/dist/core/middleware/index.js +6 -12
- 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 -5
- package/dist/core/preview/static-preview-server.js +1 -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 -7
- package/dist/core/render/route-cache.d.ts +3 -3
- package/dist/core/render/route-cache.js +7 -7
- package/dist/core/render-context.d.ts +9 -7
- package/dist/core/render-context.js +46 -47
- 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 +9 -13
- 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 +8 -8
- package/dist/core/routing/validation.d.ts +1 -2
- package/dist/core/routing/validation.js +2 -18
- package/dist/core/server-islands/endpoint.d.ts +1 -2
- package/dist/core/server-islands/endpoint.js +5 -4
- 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 +19 -34
- 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/env-loader.d.ts +0 -1
- package/dist/env/env-loader.js +4 -17
- package/dist/env/schema.d.ts +21 -251
- package/dist/env/schema.js +6 -3
- package/dist/env/vite-plugin-env.js +3 -2
- 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/index.js +0 -3
- 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 +2 -3
- package/dist/integrations/hooks.js +9 -33
- 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/prefetch/index.d.ts +0 -10
- package/dist/prefetch/index.js +1 -1
- package/dist/prerender/routing.d.ts +5 -7
- package/dist/prerender/routing.js +6 -17
- package/dist/runtime/server/astro-global.d.ts +2 -2
- package/dist/runtime/server/astro-global.js +86 -24
- package/dist/runtime/server/render/server-islands.js +2 -2
- package/dist/runtime/server/transition.d.ts +1 -0
- package/dist/transitions/events.d.ts +7 -0
- package/dist/transitions/router.js +7 -3
- package/dist/transitions/vite-plugin-transitions.js +1 -4
- package/dist/types/astro.d.ts +10 -8
- package/dist/types/public/common.d.ts +1 -3
- package/dist/types/public/config.d.ts +364 -415
- package/dist/types/public/context.d.ts +21 -52
- package/dist/types/public/index.d.ts +2 -1
- package/dist/types/public/integrations.d.ts +23 -18
- package/dist/types/public/internal.d.ts +3 -18
- 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 -3
- package/dist/virtual-modules/live-config.js +1 -5
- 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 +5 -7
- package/dist/vite-plugin-app/pipeline.js +166 -0
- package/dist/vite-plugin-astro/index.js +11 -13
- 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 +53 -96
- 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-markdown/index.js +0 -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 +14 -15
- package/templates/content/module.mjs +9 -63
- package/templates/content/types.d.ts +32 -78
- 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 -31
- 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/utils/node/emitAsset.d.ts +0 -29
- package/dist/assets/utils/transformToPath.js +0 -32
- package/dist/config/vite-plugin-content-listen.d.ts +0 -17
- package/dist/config/vite-plugin-content-listen.js +0 -26
- package/dist/container/polyfill.d.ts +0 -1
- package/dist/container/polyfill.js +0 -2
- 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/polyfill.d.ts +0 -5
- package/dist/core/polyfill.js +0 -17
- 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-postprocess/index.d.ts +0 -2
- package/dist/vite-plugin-astro-postprocess/index.js +0 -48
- 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 -166
- package/dist/vite-plugin-astro-server/request.d.ts +0 -14
- package/dist/vite-plugin-astro-server/request.js +0 -73
- 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
|
@@ -2,9 +2,9 @@ import * as fs from "node:fs";
|
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import { codeToHtml, createCssVariablesTheme } from "shiki";
|
|
4
4
|
import { AstroError } from "../errors.js";
|
|
5
|
-
import { FailedToLoadModuleSSR,
|
|
5
|
+
import { FailedToLoadModuleSSR, MdxIntegrationMissingError } from "../errors-data.js";
|
|
6
6
|
import { createSafeError } from "../utils.js";
|
|
7
|
-
import { getDocsForError, renderErrorMarkdown } from "./
|
|
7
|
+
import { getDocsForError, renderErrorMarkdown } from "./runtime.js";
|
|
8
8
|
function enhanceViteSSRError({
|
|
9
9
|
error,
|
|
10
10
|
filePath,
|
|
@@ -47,23 +47,6 @@ function enhanceViteSSRError({
|
|
|
47
47
|
stack: safeError.stack
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
if (safeError.message.includes("Invalid glob")) {
|
|
51
|
-
const globPattern = /glob: "(.+)" \(/.exec(safeError.message)?.[1];
|
|
52
|
-
if (globPattern) {
|
|
53
|
-
safeError.message = InvalidGlob.message(globPattern);
|
|
54
|
-
safeError.name = "InvalidGlob";
|
|
55
|
-
safeError.title = InvalidGlob.title;
|
|
56
|
-
const line = lns.findIndex((ln) => ln.includes(globPattern));
|
|
57
|
-
if (line !== -1) {
|
|
58
|
-
const column = lns[line]?.indexOf(globPattern);
|
|
59
|
-
safeError.loc = {
|
|
60
|
-
file: path,
|
|
61
|
-
line: line + 1,
|
|
62
|
-
column
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
50
|
}
|
|
68
51
|
return safeError;
|
|
69
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ZodError } from 'zod';
|
|
1
|
+
import type { $ZodError } from 'zod/v4/core';
|
|
2
2
|
export interface ErrorData {
|
|
3
3
|
name: string;
|
|
4
4
|
title: string;
|
|
@@ -282,8 +282,9 @@ export declare const GetStaticPathsExpectedParams: {
|
|
|
282
282
|
* export async function getStaticPaths() {
|
|
283
283
|
* return [
|
|
284
284
|
* { params: { id: '1' } } // Works
|
|
285
|
-
* { params: { id: 2 } } //
|
|
285
|
+
* { params: { id: 2 } } // Does not work
|
|
286
286
|
* { params: { id: false } } // Does not work
|
|
287
|
+
* { params: { id: [1, 2] } } // Does not work
|
|
287
288
|
* ];
|
|
288
289
|
* }
|
|
289
290
|
* ---
|
|
@@ -295,8 +296,8 @@ export declare const GetStaticPathsExpectedParams: {
|
|
|
295
296
|
* ---
|
|
296
297
|
* export async function getStaticPaths() {
|
|
297
298
|
* return [
|
|
298
|
-
* { params: { id: 1 } } // /route/1
|
|
299
|
-
* { params: { id: 2 } } // /route/2
|
|
299
|
+
* { params: { id: '1' } } // /route/1
|
|
300
|
+
* { params: { id: '2' } } // /route/2
|
|
300
301
|
* { params: { id: undefined } } // /route/
|
|
301
302
|
* ];
|
|
302
303
|
* }
|
|
@@ -306,7 +307,7 @@ export declare const GetStaticPathsExpectedParams: {
|
|
|
306
307
|
export declare const GetStaticPathsInvalidRouteParam: {
|
|
307
308
|
name: string;
|
|
308
309
|
title: string;
|
|
309
|
-
message: (key: string, value: any, valueType:
|
|
310
|
+
message: (key: string, value: any, valueType: string) => string;
|
|
310
311
|
hint: string;
|
|
311
312
|
};
|
|
312
313
|
/**
|
|
@@ -542,8 +543,8 @@ export declare const PrerenderDynamicEndpointPathCollide: {
|
|
|
542
543
|
/**
|
|
543
544
|
* @docs
|
|
544
545
|
* @see
|
|
545
|
-
* - [
|
|
546
|
-
* - [`
|
|
546
|
+
* - [Route Priority Order](https://docs.astro.build/en/guides/routing/#route-priority-order)
|
|
547
|
+
* - [`prerenderConflictBehavior`](https://docs.astro.build/en/reference/configuration-reference/#prerenderconflictbehavior)
|
|
547
548
|
* @description
|
|
548
549
|
* Two prerendered routes generate the same path, resulting in a collision.
|
|
549
550
|
* A static path can only be generated by one route.
|
|
@@ -850,6 +851,7 @@ export declare const LocalImageUsedWrongly: {
|
|
|
850
851
|
* - [Astro.glob](https://docs.astro.build/en/reference/api-reference/#astroglob)
|
|
851
852
|
* @description
|
|
852
853
|
* `Astro.glob()` can only be used in `.astro` files. You can use [`import.meta.glob()`](https://vite.dev/guide/features.html#glob-import) instead to achieve the same result.
|
|
854
|
+
* @deprecated This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
|
|
853
855
|
*/
|
|
854
856
|
export declare const AstroGlobUsedOutside: {
|
|
855
857
|
name: string;
|
|
@@ -863,6 +865,7 @@ export declare const AstroGlobUsedOutside: {
|
|
|
863
865
|
* - [Astro.glob](https://docs.astro.build/en/reference/api-reference/#astroglob)
|
|
864
866
|
* @description
|
|
865
867
|
* `Astro.glob()` did not return any matching files. There might be a typo in the glob pattern.
|
|
868
|
+
* @deprecated This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
|
|
866
869
|
*/
|
|
867
870
|
export declare const AstroGlobNoMatch: {
|
|
868
871
|
name: string;
|
|
@@ -965,6 +968,7 @@ export declare const FailedToLoadModuleSSR: {
|
|
|
965
968
|
* - [Glob Patterns](https://docs.astro.build/en/guides/imports/#glob-patterns)
|
|
966
969
|
* @description
|
|
967
970
|
* Astro encountered an invalid glob pattern. This is often caused by the glob pattern not being a valid file path.
|
|
971
|
+
* @deprecated This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
|
|
968
972
|
*/
|
|
969
973
|
export declare const InvalidGlob: {
|
|
970
974
|
name: string;
|
|
@@ -1039,6 +1043,16 @@ export declare const MissingMiddlewareForInternationalization: {
|
|
|
1039
1043
|
title: string;
|
|
1040
1044
|
message: string;
|
|
1041
1045
|
};
|
|
1046
|
+
/**
|
|
1047
|
+
* @docs
|
|
1048
|
+
* @description
|
|
1049
|
+
* An invalid i18n middleware configuration was detected.
|
|
1050
|
+
*/
|
|
1051
|
+
export declare const InvalidI18nMiddlewareConfiguration: {
|
|
1052
|
+
name: string;
|
|
1053
|
+
title: string;
|
|
1054
|
+
message: string;
|
|
1055
|
+
};
|
|
1042
1056
|
/**
|
|
1043
1057
|
* @docs
|
|
1044
1058
|
* @description
|
|
@@ -1252,13 +1266,25 @@ export declare const FontFamilyNotFound: {
|
|
|
1252
1266
|
* @description
|
|
1253
1267
|
* The CSP feature isn't enabled
|
|
1254
1268
|
* @message
|
|
1255
|
-
* The `
|
|
1269
|
+
* The `security.csp` configuration isn't enabled.
|
|
1256
1270
|
*/
|
|
1257
1271
|
export declare const CspNotEnabled: {
|
|
1258
1272
|
name: string;
|
|
1259
1273
|
title: string;
|
|
1260
1274
|
message: string;
|
|
1261
1275
|
};
|
|
1276
|
+
/**
|
|
1277
|
+
* @docs
|
|
1278
|
+
* @description
|
|
1279
|
+
* Unavailable Astro global in getStaticPaths
|
|
1280
|
+
* @message
|
|
1281
|
+
* The Astro global is not available in getStaticPaths().
|
|
1282
|
+
*/
|
|
1283
|
+
export declare const UnavailableAstroGlobal: {
|
|
1284
|
+
name: string;
|
|
1285
|
+
title: string;
|
|
1286
|
+
message: (name: string) => string;
|
|
1287
|
+
};
|
|
1262
1288
|
/**
|
|
1263
1289
|
* @docs
|
|
1264
1290
|
* @kind heading
|
|
@@ -1441,7 +1467,7 @@ export declare const RenderUndefinedEntryError: {
|
|
|
1441
1467
|
/**
|
|
1442
1468
|
* @docs
|
|
1443
1469
|
* @description
|
|
1444
|
-
* The `getDataEntryById` and `getEntryBySlug` functions are deprecated and cannot be used with content
|
|
1470
|
+
* The `getDataEntryById` and `getEntryBySlug` functions are deprecated and cannot be used with content collections. Use the `getEntry` function instead.
|
|
1445
1471
|
*/
|
|
1446
1472
|
export declare const GetEntryDeprecationError: {
|
|
1447
1473
|
name: string;
|
|
@@ -1461,18 +1487,19 @@ export declare const GetEntryDeprecationError: {
|
|
|
1461
1487
|
* Make sure that all required fields are present, and that all fields are of the correct type.
|
|
1462
1488
|
* You can check against the collection schema in your `src/content.config.*` file.
|
|
1463
1489
|
* See the [Content collections documentation](https://docs.astro.build/en/guides/content-collections/) for more information.
|
|
1490
|
+
* @deprecated This error only applies to legacy content collections which were removed in Astro 6.
|
|
1464
1491
|
*/
|
|
1465
1492
|
export declare const InvalidContentEntryFrontmatterError: {
|
|
1466
1493
|
name: string;
|
|
1467
1494
|
title: string;
|
|
1468
|
-
message(collection: string, entryId: string, error: ZodError): string;
|
|
1495
|
+
message(collection: string, entryId: string, error: $ZodError): string;
|
|
1469
1496
|
hint: string;
|
|
1470
1497
|
};
|
|
1471
1498
|
/**
|
|
1472
1499
|
* @docs
|
|
1473
1500
|
* @message
|
|
1474
1501
|
* **Example error message:**<br/>
|
|
1475
|
-
* **blog** → **post**
|
|
1502
|
+
* **blog** → **post** data does not match collection schema.<br/>
|
|
1476
1503
|
* "title" is required.<br/>
|
|
1477
1504
|
* "date" must be a valid date.
|
|
1478
1505
|
* @description
|
|
@@ -1484,7 +1511,52 @@ export declare const InvalidContentEntryFrontmatterError: {
|
|
|
1484
1511
|
export declare const InvalidContentEntryDataError: {
|
|
1485
1512
|
name: string;
|
|
1486
1513
|
title: string;
|
|
1487
|
-
message(collection: string, entryId: string, error: ZodError): string;
|
|
1514
|
+
message(collection: string, entryId: string, error: $ZodError): string;
|
|
1515
|
+
hint: string;
|
|
1516
|
+
};
|
|
1517
|
+
/**
|
|
1518
|
+
* @docs
|
|
1519
|
+
* @message
|
|
1520
|
+
* **Example error message:**<br/>
|
|
1521
|
+
* Found legacy content config file in "src/content/config.ts". Please move this file to "src/content.config.ts" and ensure each collection has a loader defined.<br/>
|
|
1522
|
+
* @description
|
|
1523
|
+
* A legacy content config file was found. Move the file to `src/content.config.ts` and update any collection definitions if needed.
|
|
1524
|
+
* See the [Astro 6 migration guide](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections) for more information.
|
|
1525
|
+
*/
|
|
1526
|
+
export declare const LegacyContentConfigError: {
|
|
1527
|
+
name: string;
|
|
1528
|
+
title: string;
|
|
1529
|
+
message: (filename: string) => string;
|
|
1530
|
+
hint: string;
|
|
1531
|
+
};
|
|
1532
|
+
/**
|
|
1533
|
+
* @docs
|
|
1534
|
+
* @message
|
|
1535
|
+
* **Example error message:**<br/>
|
|
1536
|
+
* Collections must have a `loader` defined. Check your collection definitions in your content config file.<br/>
|
|
1537
|
+
* @description
|
|
1538
|
+
* A content collection is missing a `loader` definition. Make sure that each collection in your content config file has a `loader`.
|
|
1539
|
+
* See the [Content collections documentation](https://docs.astro.build/en/guides/content-collections/) for more information.
|
|
1540
|
+
*/
|
|
1541
|
+
export declare const ContentCollectionMissingLoader: {
|
|
1542
|
+
name: string;
|
|
1543
|
+
title: string;
|
|
1544
|
+
message: (file?: any) => string;
|
|
1545
|
+
hint: string;
|
|
1546
|
+
};
|
|
1547
|
+
/**
|
|
1548
|
+
* @docs
|
|
1549
|
+
* @message
|
|
1550
|
+
* **Example error message:**<br/>
|
|
1551
|
+
* Invalid collection type "data". Remove the type from your collection definition in your content config file.
|
|
1552
|
+
* @description
|
|
1553
|
+
* Content collections should no longer have a `type` field. Remove this field from your content config file.
|
|
1554
|
+
* See the [Astro 6 migration guide](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections) for more information.
|
|
1555
|
+
*/
|
|
1556
|
+
export declare const ContentCollectionInvalidType: {
|
|
1557
|
+
name: string;
|
|
1558
|
+
title: string;
|
|
1559
|
+
message: (type: string, file?: any) => string;
|
|
1488
1560
|
hint: string;
|
|
1489
1561
|
};
|
|
1490
1562
|
/**
|
|
@@ -1523,7 +1595,7 @@ export declare const ContentLoaderReturnsInvalidId: {
|
|
|
1523
1595
|
export declare const ContentEntryDataError: {
|
|
1524
1596
|
name: string;
|
|
1525
1597
|
title: string;
|
|
1526
|
-
message(collection: string, entryId: string, error: ZodError): string;
|
|
1598
|
+
message(collection: string, entryId: string, error: $ZodError): string;
|
|
1527
1599
|
hint: string;
|
|
1528
1600
|
};
|
|
1529
1601
|
/**
|
|
@@ -1774,50 +1846,6 @@ export declare const SessionStorageSaveError: {
|
|
|
1774
1846
|
message: (error: string, driver?: string) => string;
|
|
1775
1847
|
hint: string;
|
|
1776
1848
|
};
|
|
1777
|
-
/**
|
|
1778
|
-
* @docs
|
|
1779
|
-
* @see
|
|
1780
|
-
* - [Sessions](https://docs.astro.build/en/guides/sessions/)
|
|
1781
|
-
* @deprecated This error was removed in Astro 5.7, when the Sessions feature stopped being experimental.
|
|
1782
|
-
* @description
|
|
1783
|
-
* Your adapter must support server output to use sessions.
|
|
1784
|
-
*/
|
|
1785
|
-
export declare const SessionWithoutSupportedAdapterOutputError: {
|
|
1786
|
-
name: string;
|
|
1787
|
-
title: string;
|
|
1788
|
-
message: string;
|
|
1789
|
-
hint: string;
|
|
1790
|
-
};
|
|
1791
|
-
/**
|
|
1792
|
-
* @docs
|
|
1793
|
-
* @message The `experimental.session` flag was set to `true`, but no storage was configured. Either configure the storage manually or use an adapter that provides session storage.
|
|
1794
|
-
* @deprecated This error was removed in Astro 5.7, when the Sessions feature stopped being experimental.
|
|
1795
|
-
* @see
|
|
1796
|
-
* - [Sessions](https://docs.astro.build/en/guides/sessions/)
|
|
1797
|
-
* @description
|
|
1798
|
-
* Thrown when session storage is enabled but not configured.
|
|
1799
|
-
*/
|
|
1800
|
-
export declare const SessionConfigMissingError: {
|
|
1801
|
-
name: string;
|
|
1802
|
-
title: string;
|
|
1803
|
-
message: string;
|
|
1804
|
-
hint: string;
|
|
1805
|
-
};
|
|
1806
|
-
/**
|
|
1807
|
-
* @docs
|
|
1808
|
-
* @message Session config was provided without enabling the `experimental.session` flag
|
|
1809
|
-
* @deprecated This error was removed in Astro 5.7, when the Sessions feature stopped being experimental.
|
|
1810
|
-
* @see
|
|
1811
|
-
* - [Sessions](https://docs.astro.build/en/guides/sessions/)
|
|
1812
|
-
* @description
|
|
1813
|
-
* Thrown when session storage is configured but the `experimental.session` flag is not enabled.
|
|
1814
|
-
*/
|
|
1815
|
-
export declare const SessionConfigWithoutFlagError: {
|
|
1816
|
-
name: string;
|
|
1817
|
-
title: string;
|
|
1818
|
-
message: string;
|
|
1819
|
-
hint: string;
|
|
1820
|
-
};
|
|
1821
1849
|
/**
|
|
1822
1850
|
* @docs
|
|
1823
1851
|
* @message An error occurred while optimizing the SVG file with SVGO.
|
|
@@ -85,8 +85,8 @@ const GetStaticPathsExpectedParams = {
|
|
|
85
85
|
};
|
|
86
86
|
const GetStaticPathsInvalidRouteParam = {
|
|
87
87
|
name: "GetStaticPathsInvalidRouteParam",
|
|
88
|
-
title: "Invalid
|
|
89
|
-
message: (key, value, valueType) => `Invalid getStaticPaths route parameter for \`${key}\`. Expected
|
|
88
|
+
title: "Invalid route parameter returned by `getStaticPaths()`.",
|
|
89
|
+
message: (key, value, valueType) => `Invalid \`getStaticPaths()\` route parameter for \`${key}\`. Expected a string or undefined, received \`${valueType}\` (\`${value}\`)`,
|
|
90
90
|
hint: "See https://docs.astro.build/en/reference/routing-reference/#getstaticpaths for more information on getStaticPaths."
|
|
91
91
|
};
|
|
92
92
|
const GetStaticPathsRequired = {
|
|
@@ -372,6 +372,11 @@ const MissingMiddlewareForInternationalization = {
|
|
|
372
372
|
title: "Enabled manual internationalization routing without having a middleware.",
|
|
373
373
|
message: "Your configuration setting `i18n.routing: 'manual'` requires you to provide your own i18n `middleware` file."
|
|
374
374
|
};
|
|
375
|
+
const InvalidI18nMiddlewareConfiguration = {
|
|
376
|
+
name: "InvalidI18nMiddlewareConfiguration",
|
|
377
|
+
title: "Invalid internationalization middleware configuration",
|
|
378
|
+
message: "The option `redirectToDefaultLocale` can be enabled only when `prefixDefaultLocale` is also set to `true`, otherwise redirects might cause infinite loops. Enable the option `prefixDefaultLocale` to continue to use `redirectToDefaultLocale`, or ensure both are set to `false`."
|
|
379
|
+
};
|
|
375
380
|
const CantRenderPage = {
|
|
376
381
|
name: "CantRenderPage",
|
|
377
382
|
title: "Astro can't render the route.",
|
|
@@ -473,7 +478,12 @@ const FontFamilyNotFound = {
|
|
|
473
478
|
const CspNotEnabled = {
|
|
474
479
|
name: "CspNotEnabled",
|
|
475
480
|
title: "CSP feature isn't enabled",
|
|
476
|
-
message: "The `
|
|
481
|
+
message: "The `security.csp` configuration isn't enabled."
|
|
482
|
+
};
|
|
483
|
+
const UnavailableAstroGlobal = {
|
|
484
|
+
name: "UnavailableAstroGlobal",
|
|
485
|
+
title: "Unavailable Astro global in getStaticPaths()",
|
|
486
|
+
message: (name) => `The Astro global is not available in this scope. Please remove "Astro.${name}" from your getStaticPaths() function.`
|
|
477
487
|
};
|
|
478
488
|
const UnknownCSSError = {
|
|
479
489
|
name: "UnknownCSSError",
|
|
@@ -541,7 +551,7 @@ const GetEntryDeprecationError = {
|
|
|
541
551
|
name: "GetEntryDeprecationError",
|
|
542
552
|
title: "Invalid use of `getDataEntryById` or `getEntryBySlug` function.",
|
|
543
553
|
message: (collection, method) => `The \`${method}\` function is deprecated and cannot be used to query the "${collection}" collection. Use \`getEntry\` instead.`,
|
|
544
|
-
hint: "
|
|
554
|
+
hint: "See https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections for more information."
|
|
545
555
|
};
|
|
546
556
|
const InvalidContentEntryFrontmatterError = {
|
|
547
557
|
name: "InvalidContentEntryFrontmatterError",
|
|
@@ -551,7 +561,7 @@ const InvalidContentEntryFrontmatterError = {
|
|
|
551
561
|
`**${String(collection)} \u2192 ${String(
|
|
552
562
|
entryId
|
|
553
563
|
)}** frontmatter does not match collection schema.`,
|
|
554
|
-
|
|
564
|
+
error.message
|
|
555
565
|
].join("\n");
|
|
556
566
|
},
|
|
557
567
|
hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."
|
|
@@ -563,12 +573,30 @@ const InvalidContentEntryDataError = {
|
|
|
563
573
|
return [
|
|
564
574
|
`**${String(collection)} \u2192 ${String(entryId)}** data does not match collection schema.
|
|
565
575
|
`,
|
|
566
|
-
|
|
576
|
+
` **: ${error.message}`,
|
|
567
577
|
""
|
|
568
578
|
].join("\n");
|
|
569
579
|
},
|
|
570
580
|
hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."
|
|
571
581
|
};
|
|
582
|
+
const LegacyContentConfigError = {
|
|
583
|
+
name: "LegacyContentConfigError",
|
|
584
|
+
title: "Legacy content config file found.",
|
|
585
|
+
message: (filename) => `Found legacy content config file in "${filename}". Please move this file to "src/content.config.${filename.split(".").at(-1)}" and ensure each collection has a loader defined.`,
|
|
586
|
+
hint: "See https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections for more information on updating collections."
|
|
587
|
+
};
|
|
588
|
+
const ContentCollectionMissingLoader = {
|
|
589
|
+
name: "ContentCollectionMissingLoader",
|
|
590
|
+
title: "Content collection is missing a `loader` definition.",
|
|
591
|
+
message: (file = "your content config file") => `Collections must have a \`loader\` defined. Check your collection definitions in ${file}.`,
|
|
592
|
+
hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content loaders and https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections for more information on migrating from legacy collections."
|
|
593
|
+
};
|
|
594
|
+
const ContentCollectionInvalidType = {
|
|
595
|
+
name: "ContentCollectionInvalidType",
|
|
596
|
+
title: "Content collection has an invalid `type` field.",
|
|
597
|
+
message: (type, file = "your content config file") => `Invalid collection type "${type}". Remove the type from your collection definition in ${file}.`,
|
|
598
|
+
hint: "See https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections for more information on migrating from legacy collections."
|
|
599
|
+
};
|
|
572
600
|
const ContentLoaderReturnsInvalidId = {
|
|
573
601
|
name: "ContentLoaderReturnsInvalidId",
|
|
574
602
|
title: "Content loader returned an entry with an invalid `id`.",
|
|
@@ -587,7 +615,7 @@ const ContentEntryDataError = {
|
|
|
587
615
|
return [
|
|
588
616
|
`**${String(collection)} \u2192 ${String(entryId)}** data does not match collection schema.
|
|
589
617
|
`,
|
|
590
|
-
|
|
618
|
+
` **: ${error.message}`,
|
|
591
619
|
""
|
|
592
620
|
].join("\n");
|
|
593
621
|
},
|
|
@@ -714,24 +742,6 @@ const SessionStorageSaveError = {
|
|
|
714
742
|
message: (error, driver) => `Error when saving session data${driver ? ` with driver \`${driver}\`` : ""}. \`${error ?? ""}\``,
|
|
715
743
|
hint: "For more information, see https://docs.astro.build/en/guides/sessions/"
|
|
716
744
|
};
|
|
717
|
-
const SessionWithoutSupportedAdapterOutputError = {
|
|
718
|
-
name: "SessionWithoutSupportedAdapterOutputError",
|
|
719
|
-
title: "Sessions cannot be used with an adapter that doesn't support server output.",
|
|
720
|
-
message: 'Sessions require an adapter that supports server output. The adapter must set `"server"` in the `buildOutput` adapter feature.',
|
|
721
|
-
hint: 'Ensure your adapter supports `buildOutput: "server"`: https://docs.astro.build/en/reference/adapter-reference/#building-an-adapter'
|
|
722
|
-
};
|
|
723
|
-
const SessionConfigMissingError = {
|
|
724
|
-
name: "SessionConfigMissingError",
|
|
725
|
-
title: "Session storage was enabled but not configured.",
|
|
726
|
-
message: "The `experimental.session` flag was set to `true`, but no storage was configured. Either configure the storage manually or use an adapter that provides session storage",
|
|
727
|
-
hint: "For more information, see https://docs.astro.build/en/guides/sessions/"
|
|
728
|
-
};
|
|
729
|
-
const SessionConfigWithoutFlagError = {
|
|
730
|
-
name: "SessionConfigWithoutFlagError",
|
|
731
|
-
title: "Session flag not set",
|
|
732
|
-
message: "Session config was provided without enabling the `experimental.session` flag",
|
|
733
|
-
hint: "For more information, see https://docs.astro.build/en/guides/sessions/"
|
|
734
|
-
};
|
|
735
745
|
const CannotOptimizeSvg = {
|
|
736
746
|
name: "CannotOptimizeSvg",
|
|
737
747
|
title: "Cannot optimize SVG",
|
|
@@ -758,6 +768,8 @@ export {
|
|
|
758
768
|
ClientAddressNotAvailable,
|
|
759
769
|
ConfigLegacyKey,
|
|
760
770
|
ConfigNotFound,
|
|
771
|
+
ContentCollectionInvalidType,
|
|
772
|
+
ContentCollectionMissingLoader,
|
|
761
773
|
ContentCollectionTypeMismatchError,
|
|
762
774
|
ContentEntryDataError,
|
|
763
775
|
ContentLoaderInvalidDataError,
|
|
@@ -799,8 +811,10 @@ export {
|
|
|
799
811
|
InvalidGetStaticPathsEntry,
|
|
800
812
|
InvalidGetStaticPathsReturn,
|
|
801
813
|
InvalidGlob,
|
|
814
|
+
InvalidI18nMiddlewareConfiguration,
|
|
802
815
|
InvalidImageService,
|
|
803
816
|
InvalidPrerenderExport,
|
|
817
|
+
LegacyContentConfigError,
|
|
804
818
|
LiveContentConfigError,
|
|
805
819
|
LocalImageUsedWrongly,
|
|
806
820
|
LocalsNotAnObject,
|
|
@@ -838,12 +852,10 @@ export {
|
|
|
838
852
|
RewriteWithBodyUsed,
|
|
839
853
|
RouteNotFound,
|
|
840
854
|
ServerOnlyModule,
|
|
841
|
-
SessionConfigMissingError,
|
|
842
|
-
SessionConfigWithoutFlagError,
|
|
843
855
|
SessionStorageInitError,
|
|
844
856
|
SessionStorageSaveError,
|
|
845
|
-
SessionWithoutSupportedAdapterOutputError,
|
|
846
857
|
StaticClientAddressNotAvailable,
|
|
858
|
+
UnavailableAstroGlobal,
|
|
847
859
|
UnhandledRejection,
|
|
848
860
|
UnknownCLIError,
|
|
849
861
|
UnknownCSSError,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ZodError } from 'zod';
|
|
1
|
+
import type { $ZodError } from 'zod/v4/core';
|
|
2
2
|
interface ErrorProperties {
|
|
3
3
|
title?: string;
|
|
4
4
|
name: string;
|
|
@@ -58,11 +58,11 @@ export declare class AggregateError extends AstroError {
|
|
|
58
58
|
* Check if an error is a ZodError from an AstroConfig validation.
|
|
59
59
|
* Used to suppress formatting a ZodError if needed.
|
|
60
60
|
*/
|
|
61
|
-
export declare function isAstroConfigZodError(error: unknown): error is ZodError;
|
|
61
|
+
export declare function isAstroConfigZodError(error: unknown): error is $ZodError;
|
|
62
62
|
/**
|
|
63
63
|
* Track that a ZodError comes from an AstroConfig validation.
|
|
64
64
|
*/
|
|
65
|
-
export declare function trackAstroConfigZodError(error: ZodError): void;
|
|
65
|
+
export declare function trackAstroConfigZodError(error: $ZodError): void;
|
|
66
66
|
/**
|
|
67
67
|
* Generic object representing an error with all possible data
|
|
68
68
|
* Compatible with both Astro's and Vite's errors
|
|
@@ -754,7 +754,7 @@ function getOverlayCode() {
|
|
|
754
754
|
`;
|
|
755
755
|
}
|
|
756
756
|
function patchOverlay(code) {
|
|
757
|
-
return code.replace("
|
|
757
|
+
return code.replace("var ErrorOverlay", getOverlayCode() + "\nvar ViteErrorOverlay");
|
|
758
758
|
}
|
|
759
759
|
export {
|
|
760
760
|
patchOverlay
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ZodErrorMap } from 'zod';
|
|
2
|
-
export declare const errorMap: ZodErrorMap;
|
|
1
|
+
import type { $ZodErrorMap } from 'zod/v4/core';
|
|
2
|
+
export declare const errorMap: $ZodErrorMap;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const errorMap = (
|
|
2
|
-
const baseErrorPath = flattenErrorPath(
|
|
3
|
-
if (
|
|
1
|
+
const errorMap = (issue) => {
|
|
2
|
+
const baseErrorPath = flattenErrorPath(issue.path ?? []);
|
|
3
|
+
if (issue.code === "invalid_union") {
|
|
4
4
|
let typeOrLiteralErrByPath = /* @__PURE__ */ new Map();
|
|
5
|
-
for (const unionError of
|
|
6
|
-
if (unionError.code === "invalid_type"
|
|
5
|
+
for (const unionError of issue.errors.flat()) {
|
|
6
|
+
if (unionError.code === "invalid_type") {
|
|
7
7
|
const flattenedErrorPath = flattenErrorPath(unionError.path);
|
|
8
8
|
if (typeOrLiteralErrByPath.has(flattenedErrorPath)) {
|
|
9
9
|
typeOrLiteralErrByPath.get(flattenedErrorPath).expected.push(unionError.expected);
|
|
@@ -17,7 +17,7 @@ const errorMap = (baseError, ctx) => {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
const messages = [prefix(baseErrorPath, "Did not match union.")];
|
|
20
|
-
const details = [...typeOrLiteralErrByPath.entries()].filter(([, error]) => error.expected.length ===
|
|
20
|
+
const details = [...typeOrLiteralErrByPath.entries()].filter(([, error]) => error.expected.length === issue.errors.flat().length).map(
|
|
21
21
|
([key, error]) => key === baseErrorPath ? (
|
|
22
22
|
// Avoid printing the key again if it's a base error
|
|
23
23
|
`> ${getTypeOrLiteralMsg(error)}`
|
|
@@ -25,50 +25,52 @@ const errorMap = (baseError, ctx) => {
|
|
|
25
25
|
);
|
|
26
26
|
if (details.length === 0) {
|
|
27
27
|
const expectedShapes = [];
|
|
28
|
-
for (const
|
|
28
|
+
for (const unionErrors of issue.errors) {
|
|
29
29
|
const expectedShape = [];
|
|
30
|
-
for (const
|
|
31
|
-
if (
|
|
32
|
-
return errorMap(
|
|
30
|
+
for (const _issue of unionErrors) {
|
|
31
|
+
if (_issue.code === "invalid_union") {
|
|
32
|
+
return errorMap(_issue);
|
|
33
33
|
}
|
|
34
|
-
const relativePath = flattenErrorPath(
|
|
35
|
-
if ("expected" in
|
|
34
|
+
const relativePath = flattenErrorPath(_issue.path).replace(baseErrorPath, "").replace(leadingPeriod, "");
|
|
35
|
+
if ("expected" in _issue && typeof _issue.expected === "string") {
|
|
36
36
|
expectedShape.push(
|
|
37
|
-
relativePath ? `${relativePath}: ${
|
|
37
|
+
relativePath ? `${relativePath}: ${_issue.expected}` : _issue.expected
|
|
38
38
|
);
|
|
39
|
-
} else {
|
|
39
|
+
} else if ("values" in _issue) {
|
|
40
|
+
expectedShape.push(
|
|
41
|
+
..._issue.values.filter((v) => typeof v === "string").map((v) => `"${v}"`)
|
|
42
|
+
);
|
|
43
|
+
} else if (relativePath) {
|
|
40
44
|
expectedShape.push(relativePath);
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
if (expectedShape.length === 1 && !expectedShape[0]?.includes(":")) {
|
|
44
48
|
expectedShapes.push(expectedShape.join(""));
|
|
45
|
-
} else {
|
|
49
|
+
} else if (expectedShape.length > 0) {
|
|
46
50
|
expectedShapes.push(`{ ${expectedShape.join("; ")} }`);
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
if (expectedShapes.length) {
|
|
50
54
|
details.push("> Expected type `" + expectedShapes.join(" | ") + "`");
|
|
51
|
-
details.push("> Received `" + stringify(
|
|
55
|
+
details.push("> Received `" + stringify(issue.input) + "`");
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
return {
|
|
55
59
|
message: messages.concat(details).join("\n")
|
|
56
60
|
};
|
|
57
|
-
} else if (
|
|
61
|
+
} else if (issue.code === "invalid_type") {
|
|
58
62
|
return {
|
|
59
63
|
message: prefix(
|
|
60
64
|
baseErrorPath,
|
|
61
65
|
getTypeOrLiteralMsg({
|
|
62
|
-
code:
|
|
63
|
-
received:
|
|
64
|
-
expected: [
|
|
66
|
+
code: issue.code,
|
|
67
|
+
received: typeof issue.input,
|
|
68
|
+
expected: [issue.expected]
|
|
65
69
|
})
|
|
66
70
|
)
|
|
67
71
|
};
|
|
68
|
-
} else if (
|
|
69
|
-
return { message: prefix(baseErrorPath,
|
|
70
|
-
} else {
|
|
71
|
-
return { message: prefix(baseErrorPath, ctx.defaultError) };
|
|
72
|
+
} else if (issue.message) {
|
|
73
|
+
return { message: prefix(baseErrorPath, issue.message) };
|
|
72
74
|
}
|
|
73
75
|
};
|
|
74
76
|
const getTypeOrLiteralMsg = (error) => {
|
package/dist/core/messages.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedServerUrls } from 'vite';
|
|
2
|
-
import type { ZodError } from 'zod';
|
|
2
|
+
import type { $ZodError } from 'zod/v4/core';
|
|
3
3
|
import { type ErrorWithMetadata } from './errors/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Prestyled messages for the CLI. Used by astro CLI commands.
|
|
@@ -45,7 +45,7 @@ export declare function prerelease({ currentVersion }: {
|
|
|
45
45
|
export declare function success(message: string, tip?: string): string;
|
|
46
46
|
export declare function actionRequired(message: string): string;
|
|
47
47
|
export declare function cancelled(message: string, tip?: string): string;
|
|
48
|
-
export declare function formatConfigErrorMessage(err: ZodError): string;
|
|
48
|
+
export declare function formatConfigErrorMessage(err: $ZodError): string;
|
|
49
49
|
export declare function formatErrorMessage(err: ErrorWithMetadata, showFullStacktrace: boolean): string;
|
|
50
50
|
/** @deprecated Migrate to HelpDisplay */
|
|
51
51
|
export declare function printHelp({ commandName, headline, usage, tables, description, }: {
|
package/dist/core/messages.js
CHANGED
|
@@ -38,7 +38,7 @@ function serverStart({
|
|
|
38
38
|
host,
|
|
39
39
|
base
|
|
40
40
|
}) {
|
|
41
|
-
const version = "
|
|
41
|
+
const version = "6.0.0-alpha.1";
|
|
42
42
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
43
43
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
44
44
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -275,7 +275,7 @@ function printHelp({
|
|
|
275
275
|
message.push(
|
|
276
276
|
linebreak(),
|
|
277
277
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
278
|
-
`v${"
|
|
278
|
+
`v${"6.0.0-alpha.1"}`
|
|
279
279
|
)} ${headline}`
|
|
280
280
|
);
|
|
281
281
|
}
|
|
@@ -7,7 +7,7 @@ async function callMiddleware(onRequest, apiContext, responseFunction) {
|
|
|
7
7
|
responseFunctionPromise = responseFunction(apiContext, payload);
|
|
8
8
|
return responseFunctionPromise;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
const middlewarePromise = onRequest(apiContext, next);
|
|
11
11
|
return await Promise.resolve(middlewarePromise).then(async (value) => {
|
|
12
12
|
if (nextCalled) {
|
|
13
13
|
if (typeof value !== "undefined") {
|