astro 5.15.4 → 6.0.0-alpha.0
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 +2 -4
- package/components/ClientRouter.astro +0 -5
- package/dist/actions/runtime/utils.d.ts +2 -8
- package/dist/assets/build/remote.js +4 -14
- package/dist/assets/fonts/implementations/font-metrics-resolver.js +15 -9
- package/dist/assets/services/sharp.js +5 -6
- package/dist/assets/utils/index.d.ts +1 -5
- package/dist/assets/utils/index.js +1 -5
- package/dist/assets/utils/node/emitAsset.d.ts +0 -14
- package/dist/assets/utils/node/emitAsset.js +0 -50
- package/dist/assets/vite-plugin-assets.js +3 -8
- package/dist/cli/add/index.js +0 -2
- package/dist/cli/db/index.js +0 -2
- package/dist/cli/info/index.js +0 -2
- package/dist/cli/infra/build-time-astro-version-provider.js +1 -1
- package/dist/cli/preferences/index.js +0 -2
- package/dist/config/index.js +3 -12
- package/dist/container/index.d.ts +0 -1
- package/dist/container/index.js +0 -1
- package/dist/content/config.js +17 -13
- package/dist/content/content-layer.js +4 -6
- package/dist/content/data-store.d.ts +0 -2
- package/dist/content/loaders/glob.d.ts +0 -5
- package/dist/content/loaders/glob.js +3 -30
- package/dist/content/mutable-data-store.js +1 -14
- package/dist/content/runtime-assets.d.ts +1 -1
- package/dist/content/runtime-assets.js +3 -6
- package/dist/content/runtime.d.ts +19 -58
- package/dist/content/runtime.js +52 -218
- package/dist/content/server-listeners.js +25 -88
- package/dist/content/types-generator.d.ts +1 -6
- package/dist/content/types-generator.js +20 -116
- package/dist/content/utils.d.ts +31 -104
- package/dist/content/utils.js +48 -158
- package/dist/content/vite-plugin-content-imports.js +0 -4
- package/dist/content/vite-plugin-content-virtual-mod.js +3 -134
- package/dist/core/app/index.d.ts +1 -1
- package/dist/core/app/index.js +7 -10
- package/dist/core/app/node.d.ts +2 -8
- package/dist/core/app/node.js +4 -6
- package/dist/core/build/generate.js +0 -1
- package/dist/core/build/index.js +1 -4
- package/dist/core/build/internal.d.ts +1 -2
- package/dist/core/build/internal.js +0 -1
- package/dist/core/build/plugins/plugin-manifest.js +2 -4
- package/dist/core/compile/compile.js +0 -2
- package/dist/core/config/schemas/base.d.ts +4 -40
- package/dist/core/config/schemas/base.js +3 -16
- package/dist/core/config/schemas/refined.js +7 -0
- package/dist/core/config/schemas/relative.d.ts +5 -47
- package/dist/core/constants.d.ts +1 -0
- package/dist/core/constants.js +3 -1
- package/dist/core/create-vite.js +1 -4
- package/dist/core/dev/container.js +0 -2
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/dev/vite.js +1 -18
- package/dist/core/errors/errors-data.d.ts +68 -50
- package/dist/core/errors/errors-data.js +30 -24
- package/dist/core/errors/overlay.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/middleware/index.d.ts +1 -1
- package/dist/core/middleware/index.js +5 -9
- package/dist/core/preview/index.js +0 -2
- package/dist/core/render/params-and-props.js +0 -1
- package/dist/core/render/route-cache.d.ts +1 -2
- package/dist/core/render/route-cache.js +1 -2
- package/dist/core/render-context.d.ts +3 -3
- package/dist/core/render-context.js +13 -27
- package/dist/core/routing/manifest/create.js +1 -1
- package/dist/core/routing/params.js +5 -6
- 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 +0 -1
- package/dist/core/sync/index.js +2 -10
- package/dist/env/env-loader.d.ts +0 -1
- package/dist/env/env-loader.js +4 -17
- package/dist/env/vite-plugin-env.js +41 -45
- package/dist/i18n/index.js +0 -3
- package/dist/integrations/hooks.d.ts +1 -2
- package/dist/integrations/hooks.js +0 -27
- package/dist/prefetch/index.d.ts +0 -10
- package/dist/prefetch/index.js +1 -1
- package/dist/runtime/server/astro-global.d.ts +2 -2
- package/dist/runtime/server/astro-global.js +86 -24
- package/dist/transitions/vite-plugin-transitions.js +1 -4
- package/dist/types/astro.d.ts +2 -2
- package/dist/types/public/common.d.ts +1 -3
- package/dist/types/public/config.d.ts +4 -127
- package/dist/types/public/context.d.ts +18 -39
- package/dist/types/public/integrations.d.ts +0 -17
- package/dist/types/public/internal.d.ts +2 -2
- package/dist/virtual-modules/live-config.d.ts +0 -2
- package/dist/virtual-modules/live-config.js +0 -4
- package/dist/vite-plugin-markdown/index.js +0 -1
- package/package.json +8 -11
- package/templates/content/module.mjs +8 -63
- package/templates/content/types.d.ts +10 -69
- 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/polyfill.d.ts +0 -5
- package/dist/core/polyfill.js +0 -17
- package/dist/vite-plugin-astro-postprocess/index.d.ts +0 -2
- package/dist/vite-plugin-astro-postprocess/index.js +0 -48
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Rollup } from 'vite';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SSRResult } from '../../types/public/internal.js';
|
|
3
3
|
import type { PageBuildData, StylesheetAsset, ViteID } from './types.js';
|
|
4
4
|
export interface BuildInternals {
|
|
5
5
|
/**
|
|
@@ -68,7 +68,6 @@ export interface BuildInternals {
|
|
|
68
68
|
ssrEntryChunk?: Rollup.OutputChunk;
|
|
69
69
|
manifestEntryChunk?: Rollup.OutputChunk;
|
|
70
70
|
manifestFileName?: string;
|
|
71
|
-
entryPoints: Map<RouteData, URL>;
|
|
72
71
|
componentMetadata: SSRResult['componentMetadata'];
|
|
73
72
|
middlewareEntryPoint: URL | undefined;
|
|
74
73
|
astroActionsEntryPoint: URL | undefined;
|
|
@@ -16,7 +16,6 @@ function createBuildInternals() {
|
|
|
16
16
|
discoveredScripts: /* @__PURE__ */ new Set(),
|
|
17
17
|
staticFiles: /* @__PURE__ */ new Set(),
|
|
18
18
|
componentMetadata: /* @__PURE__ */ new Map(),
|
|
19
|
-
entryPoints: /* @__PURE__ */ new Map(),
|
|
20
19
|
prerenderOnlyChunks: [],
|
|
21
20
|
astroActionsEntryPoint: void 0,
|
|
22
21
|
middlewareEntryPoint: void 0,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
|
-
import { resolve as importMetaResolve } from "import-meta-resolve";
|
|
3
2
|
import { glob } from "tinyglobby";
|
|
4
3
|
import { builtinDrivers } from "unstorage";
|
|
5
4
|
import { getAssetsPrefix } from "../../../assets/utils/getAssetsPrefix.js";
|
|
@@ -37,10 +36,10 @@ function resolveSessionDriver(driver) {
|
|
|
37
36
|
}
|
|
38
37
|
try {
|
|
39
38
|
if (driver === "fs") {
|
|
40
|
-
return
|
|
39
|
+
return import.meta.resolve(builtinDrivers.fsLite, import.meta.url);
|
|
41
40
|
}
|
|
42
41
|
if (driver in builtinDrivers) {
|
|
43
|
-
return
|
|
42
|
+
return import.meta.resolve(builtinDrivers[driver], import.meta.url);
|
|
44
43
|
}
|
|
45
44
|
} catch {
|
|
46
45
|
return null;
|
|
@@ -115,7 +114,6 @@ function pluginManifest(options, internals) {
|
|
|
115
114
|
config: options.settings.config,
|
|
116
115
|
manifest,
|
|
117
116
|
logger: options.logger,
|
|
118
|
-
entryPoints: internals.entryPoints,
|
|
119
117
|
middlewareEntryPoint: shouldPassMiddlewareEntryPoint ? internals.middlewareEntryPoint : void 0
|
|
120
118
|
});
|
|
121
119
|
const code = injectManifest(manifest, internals.manifestEntryChunk);
|
|
@@ -27,14 +27,12 @@ async function compile({
|
|
|
27
27
|
resultScopedSlot: true,
|
|
28
28
|
transitionsAnimationURL: "astro/components/viewtransitions.css",
|
|
29
29
|
annotateSourceFile: viteConfig.command === "serve" && astroConfig.devToolbar && astroConfig.devToolbar.enabled && await preferences.get("devToolbar.enabled"),
|
|
30
|
-
renderScript: true,
|
|
31
30
|
preprocessStyle: createStylePreprocessor({
|
|
32
31
|
filename,
|
|
33
32
|
viteConfig,
|
|
34
33
|
cssPartialCompileResults,
|
|
35
34
|
cssTransformErrors
|
|
36
35
|
}),
|
|
37
|
-
experimentalScriptOrder: astroConfig.experimental.preserveScriptOrder ?? false,
|
|
38
36
|
async resolvePath(specifier) {
|
|
39
37
|
return resolvePath(specifier, filename);
|
|
40
38
|
}
|
|
@@ -56,9 +56,7 @@ export declare const ASTRO_CONFIG_DEFAULTS: {
|
|
|
56
56
|
integrations: never[];
|
|
57
57
|
markdown: Required<import("@astrojs/markdown-remark").AstroMarkdownOptions>;
|
|
58
58
|
vite: {};
|
|
59
|
-
legacy: {
|
|
60
|
-
collections: false;
|
|
61
|
-
};
|
|
59
|
+
legacy: {};
|
|
62
60
|
redirects: {};
|
|
63
61
|
security: {
|
|
64
62
|
checkOrigin: true;
|
|
@@ -72,11 +70,7 @@ export declare const ASTRO_CONFIG_DEFAULTS: {
|
|
|
72
70
|
experimental: {
|
|
73
71
|
clientPrerender: false;
|
|
74
72
|
contentIntellisense: false;
|
|
75
|
-
headingIdCompat: false;
|
|
76
|
-
preserveScriptOrder: false;
|
|
77
|
-
liveContentCollections: false;
|
|
78
73
|
csp: false;
|
|
79
|
-
staticImportMetaEnv: false;
|
|
80
74
|
chromeDevtoolsWorkspace: false;
|
|
81
75
|
failOnPrerenderConflict: false;
|
|
82
76
|
};
|
|
@@ -753,8 +747,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
753
747
|
experimental: z.ZodDefault<z.ZodObject<{
|
|
754
748
|
clientPrerender: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
755
749
|
contentIntellisense: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
756
|
-
headingIdCompat: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
757
|
-
preserveScriptOrder: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
758
750
|
fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
759
751
|
name: z.ZodString;
|
|
760
752
|
cssVariable: z.ZodString;
|
|
@@ -950,7 +942,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
950
942
|
variationSettings?: string | undefined;
|
|
951
943
|
unicodeRange?: [string, ...string[]] | undefined;
|
|
952
944
|
}>]>, "many">>;
|
|
953
|
-
liveContentCollections: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
954
945
|
csp: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodDefault<z.ZodOptional<z.ZodBoolean>>, z.ZodObject<{
|
|
955
946
|
algorithm: z.ZodDefault<z.ZodOptional<z.ZodEnum<["SHA-256", "SHA-384", "SHA-512"]>>>;
|
|
956
947
|
directives: z.ZodOptional<z.ZodArray<z.ZodType<`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`, z.ZodTypeDef, `base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`>, "many">>;
|
|
@@ -1002,15 +993,11 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1002
993
|
strictDynamic?: boolean | undefined;
|
|
1003
994
|
} | undefined;
|
|
1004
995
|
}>]>>>;
|
|
1005
|
-
staticImportMetaEnv: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1006
996
|
chromeDevtoolsWorkspace: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1007
997
|
failOnPrerenderConflict: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1008
998
|
}, "strict", z.ZodTypeAny, {
|
|
1009
999
|
clientPrerender: boolean;
|
|
1010
1000
|
contentIntellisense: boolean;
|
|
1011
|
-
headingIdCompat: boolean;
|
|
1012
|
-
preserveScriptOrder: boolean;
|
|
1013
|
-
liveContentCollections: boolean;
|
|
1014
1001
|
csp: boolean | {
|
|
1015
1002
|
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
1016
1003
|
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
@@ -1024,7 +1011,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1024
1011
|
strictDynamic?: boolean | undefined;
|
|
1025
1012
|
} | undefined;
|
|
1026
1013
|
};
|
|
1027
|
-
staticImportMetaEnv: boolean;
|
|
1028
1014
|
chromeDevtoolsWorkspace: boolean;
|
|
1029
1015
|
failOnPrerenderConflict: boolean;
|
|
1030
1016
|
fonts?: ({
|
|
@@ -1140,9 +1126,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1140
1126
|
})[] | undefined;
|
|
1141
1127
|
clientPrerender?: boolean | undefined;
|
|
1142
1128
|
contentIntellisense?: boolean | undefined;
|
|
1143
|
-
headingIdCompat?: boolean | undefined;
|
|
1144
|
-
preserveScriptOrder?: boolean | undefined;
|
|
1145
|
-
liveContentCollections?: boolean | undefined;
|
|
1146
1129
|
csp?: boolean | {
|
|
1147
1130
|
algorithm?: "SHA-256" | "SHA-384" | "SHA-512" | undefined;
|
|
1148
1131
|
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
@@ -1156,17 +1139,10 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1156
1139
|
strictDynamic?: boolean | undefined;
|
|
1157
1140
|
} | undefined;
|
|
1158
1141
|
} | undefined;
|
|
1159
|
-
staticImportMetaEnv?: boolean | undefined;
|
|
1160
1142
|
chromeDevtoolsWorkspace?: boolean | undefined;
|
|
1161
1143
|
failOnPrerenderConflict?: boolean | undefined;
|
|
1162
1144
|
}>>;
|
|
1163
|
-
legacy: z.ZodDefault<z.ZodObject<{
|
|
1164
|
-
collections: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1165
|
-
}, "strip", z.ZodTypeAny, {
|
|
1166
|
-
collections: boolean;
|
|
1167
|
-
}, {
|
|
1168
|
-
collections?: boolean | undefined;
|
|
1169
|
-
}>>;
|
|
1145
|
+
legacy: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
1170
1146
|
}, "strip", z.ZodTypeAny, {
|
|
1171
1147
|
outDir: URL;
|
|
1172
1148
|
root: URL;
|
|
@@ -1307,9 +1283,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1307
1283
|
experimental: {
|
|
1308
1284
|
clientPrerender: boolean;
|
|
1309
1285
|
contentIntellisense: boolean;
|
|
1310
|
-
headingIdCompat: boolean;
|
|
1311
|
-
preserveScriptOrder: boolean;
|
|
1312
|
-
liveContentCollections: boolean;
|
|
1313
1286
|
csp: boolean | {
|
|
1314
1287
|
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
1315
1288
|
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
@@ -1323,7 +1296,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1323
1296
|
strictDynamic?: boolean | undefined;
|
|
1324
1297
|
} | undefined;
|
|
1325
1298
|
};
|
|
1326
|
-
staticImportMetaEnv: boolean;
|
|
1327
1299
|
chromeDevtoolsWorkspace: boolean;
|
|
1328
1300
|
failOnPrerenderConflict: boolean;
|
|
1329
1301
|
fonts?: ({
|
|
@@ -1382,9 +1354,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1382
1354
|
optimizedFallbacks?: boolean | undefined;
|
|
1383
1355
|
})[] | undefined;
|
|
1384
1356
|
};
|
|
1385
|
-
legacy: {
|
|
1386
|
-
collections: boolean;
|
|
1387
|
-
};
|
|
1357
|
+
legacy: {};
|
|
1388
1358
|
session?: {
|
|
1389
1359
|
options?: Record<string, any> | undefined;
|
|
1390
1360
|
driver?: string | undefined;
|
|
@@ -1643,9 +1613,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1643
1613
|
})[] | undefined;
|
|
1644
1614
|
clientPrerender?: boolean | undefined;
|
|
1645
1615
|
contentIntellisense?: boolean | undefined;
|
|
1646
|
-
headingIdCompat?: boolean | undefined;
|
|
1647
|
-
preserveScriptOrder?: boolean | undefined;
|
|
1648
|
-
liveContentCollections?: boolean | undefined;
|
|
1649
1616
|
csp?: boolean | {
|
|
1650
1617
|
algorithm?: "SHA-256" | "SHA-384" | "SHA-512" | undefined;
|
|
1651
1618
|
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
@@ -1659,13 +1626,10 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1659
1626
|
strictDynamic?: boolean | undefined;
|
|
1660
1627
|
} | undefined;
|
|
1661
1628
|
} | undefined;
|
|
1662
|
-
staticImportMetaEnv?: boolean | undefined;
|
|
1663
1629
|
chromeDevtoolsWorkspace?: boolean | undefined;
|
|
1664
1630
|
failOnPrerenderConflict?: boolean | undefined;
|
|
1665
1631
|
} | undefined;
|
|
1666
|
-
legacy?: {
|
|
1667
|
-
collections?: boolean | undefined;
|
|
1668
|
-
} | undefined;
|
|
1632
|
+
legacy?: {} | undefined;
|
|
1669
1633
|
}>;
|
|
1670
1634
|
export type AstroConfigType = z.infer<typeof AstroConfigSchema>;
|
|
1671
1635
|
export {};
|
|
@@ -40,9 +40,7 @@ const ASTRO_CONFIG_DEFAULTS = {
|
|
|
40
40
|
integrations: [],
|
|
41
41
|
markdown: markdownConfigDefaults,
|
|
42
42
|
vite: {},
|
|
43
|
-
legacy: {
|
|
44
|
-
collections: false
|
|
45
|
-
},
|
|
43
|
+
legacy: {},
|
|
46
44
|
redirects: {},
|
|
47
45
|
security: {
|
|
48
46
|
checkOrigin: true,
|
|
@@ -56,11 +54,7 @@ const ASTRO_CONFIG_DEFAULTS = {
|
|
|
56
54
|
experimental: {
|
|
57
55
|
clientPrerender: false,
|
|
58
56
|
contentIntellisense: false,
|
|
59
|
-
headingIdCompat: false,
|
|
60
|
-
preserveScriptOrder: false,
|
|
61
|
-
liveContentCollections: false,
|
|
62
57
|
csp: false,
|
|
63
|
-
staticImportMetaEnv: false,
|
|
64
58
|
chromeDevtoolsWorkspace: false,
|
|
65
59
|
failOnPrerenderConflict: false
|
|
66
60
|
}
|
|
@@ -233,8 +227,7 @@ const AstroConfigSchema = z.object({
|
|
|
233
227
|
routing: z.literal("manual").or(
|
|
234
228
|
z.object({
|
|
235
229
|
prefixDefaultLocale: z.boolean().optional().default(false),
|
|
236
|
-
|
|
237
|
-
redirectToDefaultLocale: z.boolean().optional().default(true),
|
|
230
|
+
redirectToDefaultLocale: z.boolean().optional().default(false),
|
|
238
231
|
fallbackType: z.enum(["redirect", "rewrite"]).optional().default("redirect")
|
|
239
232
|
})
|
|
240
233
|
).optional().default({})
|
|
@@ -275,10 +268,7 @@ const AstroConfigSchema = z.object({
|
|
|
275
268
|
experimental: z.object({
|
|
276
269
|
clientPrerender: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.clientPrerender),
|
|
277
270
|
contentIntellisense: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.contentIntellisense),
|
|
278
|
-
headingIdCompat: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.headingIdCompat),
|
|
279
|
-
preserveScriptOrder: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.preserveScriptOrder),
|
|
280
271
|
fonts: z.array(z.union([localFontFamilySchema, remoteFontFamilySchema])).optional(),
|
|
281
|
-
liveContentCollections: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.liveContentCollections),
|
|
282
272
|
csp: z.union([
|
|
283
273
|
z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.csp),
|
|
284
274
|
z.object({
|
|
@@ -295,7 +285,6 @@ const AstroConfigSchema = z.object({
|
|
|
295
285
|
}).optional()
|
|
296
286
|
})
|
|
297
287
|
]).optional().default(ASTRO_CONFIG_DEFAULTS.experimental.csp),
|
|
298
|
-
staticImportMetaEnv: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.staticImportMetaEnv),
|
|
299
288
|
chromeDevtoolsWorkspace: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.chromeDevtoolsWorkspace),
|
|
300
289
|
failOnPrerenderConflict: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.failOnPrerenderConflict)
|
|
301
290
|
}).strict(
|
|
@@ -303,9 +292,7 @@ const AstroConfigSchema = z.object({
|
|
|
303
292
|
Check for incorrect spelling or outdated Astro version.
|
|
304
293
|
See https://docs.astro.build/en/reference/experimental-flags/ for a list of all current experiments.`
|
|
305
294
|
).default({}),
|
|
306
|
-
legacy: z.object({
|
|
307
|
-
collections: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.legacy.collections)
|
|
308
|
-
}).default({})
|
|
295
|
+
legacy: z.object({}).default({})
|
|
309
296
|
});
|
|
310
297
|
export {
|
|
311
298
|
ASTRO_CONFIG_DEFAULTS,
|
|
@@ -24,6 +24,13 @@ const AstroConfigRefinedSchema = z.custom().superRefine((config, ctx) => {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
if (config.i18n && typeof config.i18n.routing !== "string" && config.i18n.routing.prefixDefaultLocale === false && config.i18n.routing.redirectToDefaultLocale === true) {
|
|
28
|
+
ctx.addIssue({
|
|
29
|
+
code: z.ZodIssueCode.custom,
|
|
30
|
+
message: "The option `i18n.routing.redirectToDefaultLocale` can be used only when `i18n.routing.prefixDefaultLocale` is set to `true`, otherwise redirects might cause infinite loops. Remove the option `i18n.routing.redirectToDefaultLocale`, or change its value to `false`.",
|
|
31
|
+
path: ["i18n", "routing", "redirectToDefaultLocale"]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
27
34
|
if (config.outDir.toString().startsWith(config.publicDir.toString())) {
|
|
28
35
|
ctx.addIssue({
|
|
29
36
|
code: z.ZodIssueCode.custom,
|
|
@@ -600,8 +600,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
600
600
|
experimental: z.ZodDefault<z.ZodObject<{
|
|
601
601
|
clientPrerender: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
602
602
|
contentIntellisense: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
603
|
-
headingIdCompat: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
604
|
-
preserveScriptOrder: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
605
603
|
fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
606
604
|
name: z.ZodString;
|
|
607
605
|
cssVariable: z.ZodString;
|
|
@@ -797,7 +795,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
797
795
|
variationSettings?: string | undefined;
|
|
798
796
|
unicodeRange?: [string, ...string[]] | undefined;
|
|
799
797
|
}>]>, "many">>;
|
|
800
|
-
liveContentCollections: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
801
798
|
csp: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodDefault<z.ZodOptional<z.ZodBoolean>>, z.ZodObject<{
|
|
802
799
|
algorithm: z.ZodDefault<z.ZodOptional<z.ZodEnum<["SHA-256", "SHA-384", "SHA-512"]>>>;
|
|
803
800
|
directives: z.ZodOptional<z.ZodArray<z.ZodType<`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`, z.ZodTypeDef, `base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`>, "many">>;
|
|
@@ -849,15 +846,11 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
849
846
|
strictDynamic?: boolean | undefined;
|
|
850
847
|
} | undefined;
|
|
851
848
|
}>]>>>;
|
|
852
|
-
staticImportMetaEnv: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
853
849
|
chromeDevtoolsWorkspace: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
854
850
|
failOnPrerenderConflict: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
855
851
|
}, "strict", z.ZodTypeAny, {
|
|
856
852
|
clientPrerender: boolean;
|
|
857
853
|
contentIntellisense: boolean;
|
|
858
|
-
headingIdCompat: boolean;
|
|
859
|
-
preserveScriptOrder: boolean;
|
|
860
|
-
liveContentCollections: boolean;
|
|
861
854
|
csp: boolean | {
|
|
862
855
|
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
863
856
|
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
@@ -871,7 +864,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
871
864
|
strictDynamic?: boolean | undefined;
|
|
872
865
|
} | undefined;
|
|
873
866
|
};
|
|
874
|
-
staticImportMetaEnv: boolean;
|
|
875
867
|
chromeDevtoolsWorkspace: boolean;
|
|
876
868
|
failOnPrerenderConflict: boolean;
|
|
877
869
|
fonts?: ({
|
|
@@ -987,9 +979,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
987
979
|
})[] | undefined;
|
|
988
980
|
clientPrerender?: boolean | undefined;
|
|
989
981
|
contentIntellisense?: boolean | undefined;
|
|
990
|
-
headingIdCompat?: boolean | undefined;
|
|
991
|
-
preserveScriptOrder?: boolean | undefined;
|
|
992
|
-
liveContentCollections?: boolean | undefined;
|
|
993
982
|
csp?: boolean | {
|
|
994
983
|
algorithm?: "SHA-256" | "SHA-384" | "SHA-512" | undefined;
|
|
995
984
|
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
@@ -1003,17 +992,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1003
992
|
strictDynamic?: boolean | undefined;
|
|
1004
993
|
} | undefined;
|
|
1005
994
|
} | undefined;
|
|
1006
|
-
staticImportMetaEnv?: boolean | undefined;
|
|
1007
995
|
chromeDevtoolsWorkspace?: boolean | undefined;
|
|
1008
996
|
failOnPrerenderConflict?: boolean | undefined;
|
|
1009
997
|
}>>;
|
|
1010
|
-
legacy: z.ZodDefault<z.ZodObject<{
|
|
1011
|
-
collections: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1012
|
-
}, "strip", z.ZodTypeAny, {
|
|
1013
|
-
collections: boolean;
|
|
1014
|
-
}, {
|
|
1015
|
-
collections?: boolean | undefined;
|
|
1016
|
-
}>>;
|
|
998
|
+
legacy: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
1017
999
|
} & {
|
|
1018
1000
|
root: z.ZodEffects<z.ZodDefault<z.ZodString>, import("url").URL, string | undefined>;
|
|
1019
1001
|
srcDir: z.ZodEffects<z.ZodDefault<z.ZodString>, import("url").URL, string | undefined>;
|
|
@@ -1232,9 +1214,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1232
1214
|
experimental: {
|
|
1233
1215
|
clientPrerender: boolean;
|
|
1234
1216
|
contentIntellisense: boolean;
|
|
1235
|
-
headingIdCompat: boolean;
|
|
1236
|
-
preserveScriptOrder: boolean;
|
|
1237
|
-
liveContentCollections: boolean;
|
|
1238
1217
|
csp: boolean | {
|
|
1239
1218
|
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
1240
1219
|
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
@@ -1248,7 +1227,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1248
1227
|
strictDynamic?: boolean | undefined;
|
|
1249
1228
|
} | undefined;
|
|
1250
1229
|
};
|
|
1251
|
-
staticImportMetaEnv: boolean;
|
|
1252
1230
|
chromeDevtoolsWorkspace: boolean;
|
|
1253
1231
|
failOnPrerenderConflict: boolean;
|
|
1254
1232
|
fonts?: ({
|
|
@@ -1307,9 +1285,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1307
1285
|
optimizedFallbacks?: boolean | undefined;
|
|
1308
1286
|
})[] | undefined;
|
|
1309
1287
|
};
|
|
1310
|
-
legacy: {
|
|
1311
|
-
collections: boolean;
|
|
1312
|
-
};
|
|
1288
|
+
legacy: {};
|
|
1313
1289
|
session?: {
|
|
1314
1290
|
options?: Record<string, any> | undefined;
|
|
1315
1291
|
driver?: string | undefined;
|
|
@@ -1568,9 +1544,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1568
1544
|
})[] | undefined;
|
|
1569
1545
|
clientPrerender?: boolean | undefined;
|
|
1570
1546
|
contentIntellisense?: boolean | undefined;
|
|
1571
|
-
headingIdCompat?: boolean | undefined;
|
|
1572
|
-
preserveScriptOrder?: boolean | undefined;
|
|
1573
|
-
liveContentCollections?: boolean | undefined;
|
|
1574
1547
|
csp?: boolean | {
|
|
1575
1548
|
algorithm?: "SHA-256" | "SHA-384" | "SHA-512" | undefined;
|
|
1576
1549
|
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
@@ -1584,13 +1557,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1584
1557
|
strictDynamic?: boolean | undefined;
|
|
1585
1558
|
} | undefined;
|
|
1586
1559
|
} | undefined;
|
|
1587
|
-
staticImportMetaEnv?: boolean | undefined;
|
|
1588
1560
|
chromeDevtoolsWorkspace?: boolean | undefined;
|
|
1589
1561
|
failOnPrerenderConflict?: boolean | undefined;
|
|
1590
1562
|
} | undefined;
|
|
1591
|
-
legacy?: {
|
|
1592
|
-
collections?: boolean | undefined;
|
|
1593
|
-
} | undefined;
|
|
1563
|
+
legacy?: {} | undefined;
|
|
1594
1564
|
}>, {
|
|
1595
1565
|
outDir: import("url").URL;
|
|
1596
1566
|
root: import("url").URL;
|
|
@@ -1732,9 +1702,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1732
1702
|
experimental: {
|
|
1733
1703
|
clientPrerender: boolean;
|
|
1734
1704
|
contentIntellisense: boolean;
|
|
1735
|
-
headingIdCompat: boolean;
|
|
1736
|
-
preserveScriptOrder: boolean;
|
|
1737
|
-
liveContentCollections: boolean;
|
|
1738
1705
|
csp: boolean | {
|
|
1739
1706
|
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
1740
1707
|
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
@@ -1748,7 +1715,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1748
1715
|
strictDynamic?: boolean | undefined;
|
|
1749
1716
|
} | undefined;
|
|
1750
1717
|
};
|
|
1751
|
-
staticImportMetaEnv: boolean;
|
|
1752
1718
|
chromeDevtoolsWorkspace: boolean;
|
|
1753
1719
|
failOnPrerenderConflict: boolean;
|
|
1754
1720
|
fonts?: ({
|
|
@@ -1807,9 +1773,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1807
1773
|
optimizedFallbacks?: boolean | undefined;
|
|
1808
1774
|
})[] | undefined;
|
|
1809
1775
|
};
|
|
1810
|
-
legacy: {
|
|
1811
|
-
collections: boolean;
|
|
1812
|
-
};
|
|
1776
|
+
legacy: {};
|
|
1813
1777
|
session?: {
|
|
1814
1778
|
options?: Record<string, any> | undefined;
|
|
1815
1779
|
driver?: string | undefined;
|
|
@@ -2068,9 +2032,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2068
2032
|
})[] | undefined;
|
|
2069
2033
|
clientPrerender?: boolean | undefined;
|
|
2070
2034
|
contentIntellisense?: boolean | undefined;
|
|
2071
|
-
headingIdCompat?: boolean | undefined;
|
|
2072
|
-
preserveScriptOrder?: boolean | undefined;
|
|
2073
|
-
liveContentCollections?: boolean | undefined;
|
|
2074
2035
|
csp?: boolean | {
|
|
2075
2036
|
algorithm?: "SHA-256" | "SHA-384" | "SHA-512" | undefined;
|
|
2076
2037
|
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
@@ -2084,11 +2045,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2084
2045
|
strictDynamic?: boolean | undefined;
|
|
2085
2046
|
} | undefined;
|
|
2086
2047
|
} | undefined;
|
|
2087
|
-
staticImportMetaEnv?: boolean | undefined;
|
|
2088
2048
|
chromeDevtoolsWorkspace?: boolean | undefined;
|
|
2089
2049
|
failOnPrerenderConflict?: boolean | undefined;
|
|
2090
2050
|
} | undefined;
|
|
2091
|
-
legacy?: {
|
|
2092
|
-
collections?: boolean | undefined;
|
|
2093
|
-
} | undefined;
|
|
2051
|
+
legacy?: {} | undefined;
|
|
2094
2052
|
}>;
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const ASTRO_VERSION: string;
|
|
2
|
+
export declare const ASTRO_GENERATOR: string;
|
|
2
3
|
/**
|
|
3
4
|
* The name for the header used to help rerouting behavior.
|
|
4
5
|
* When set to "no", astro will NOT try to reroute an error response to the corresponding error page, which is the default behavior that can sometimes lead to loops.
|
package/dist/core/constants.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const ASTRO_VERSION = "
|
|
1
|
+
const ASTRO_VERSION = "6.0.0-alpha.0";
|
|
2
|
+
const ASTRO_GENERATOR = `Astro v${ASTRO_VERSION}`;
|
|
2
3
|
const REROUTE_DIRECTIVE_HEADER = "X-Astro-Reroute";
|
|
3
4
|
const REWRITE_DIRECTIVE_HEADER_KEY = "X-Astro-Rewrite";
|
|
4
5
|
const REWRITE_DIRECTIVE_HEADER_VALUE = "yes";
|
|
@@ -24,6 +25,7 @@ const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [
|
|
|
24
25
|
];
|
|
25
26
|
const MIDDLEWARE_PATH_SEGMENT_NAME = "middleware";
|
|
26
27
|
export {
|
|
28
|
+
ASTRO_GENERATOR,
|
|
27
29
|
ASTRO_VERSION,
|
|
28
30
|
DEFAULT_404_COMPONENT,
|
|
29
31
|
MIDDLEWARE_PATH_SEGMENT_NAME,
|
package/dist/core/create-vite.js
CHANGED
|
@@ -22,7 +22,6 @@ import astroDevToolbar from "../toolbar/vite-plugin-dev-toolbar.js";
|
|
|
22
22
|
import astroTransitions from "../transitions/vite-plugin-transitions.js";
|
|
23
23
|
import { vitePluginAdapterConfig } from "../vite-plugin-adapter-config/index.js";
|
|
24
24
|
import astroVitePlugin from "../vite-plugin-astro/index.js";
|
|
25
|
-
import astroPostprocessVitePlugin from "../vite-plugin-astro-postprocess/index.js";
|
|
26
25
|
import { vitePluginAstroServer } from "../vite-plugin-astro-server/index.js";
|
|
27
26
|
import configAliasVitePlugin from "../vite-plugin-config-alias/index.js";
|
|
28
27
|
import vitePluginFileURL from "../vite-plugin-fileurl/index.js";
|
|
@@ -88,8 +87,7 @@ async function createVite(commandConfig, { settings, logger, mode, command, fs =
|
|
|
88
87
|
const srcDirPattern = convertPathToPattern(fileURLToPath(settings.config.srcDir));
|
|
89
88
|
const envLoader = createEnvLoader({
|
|
90
89
|
mode,
|
|
91
|
-
config: settings.config
|
|
92
|
-
useStatic: settings.config.experimental.staticImportMetaEnv
|
|
90
|
+
config: settings.config
|
|
93
91
|
});
|
|
94
92
|
const commonConfig = {
|
|
95
93
|
// Tell Vite not to combine config from vite.config.js with our provided inline config
|
|
@@ -121,7 +119,6 @@ async function createVite(commandConfig, { settings, logger, mode, command, fs =
|
|
|
121
119
|
vitePluginAdapterConfig(settings),
|
|
122
120
|
markdownVitePlugin({ settings, logger }),
|
|
123
121
|
htmlVitePlugin(),
|
|
124
|
-
astroPostprocessVitePlugin(),
|
|
125
122
|
astroIntegrationsContainerPlugin({ settings, logger }),
|
|
126
123
|
astroScriptsPageSSRPlugin({ settings }),
|
|
127
124
|
astroHeadPlugin(),
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
} from "../../integrations/hooks.js";
|
|
9
9
|
import { createDevelopmentManifest } from "../../vite-plugin-astro-server/plugin.js";
|
|
10
10
|
import { createVite } from "../create-vite.js";
|
|
11
|
-
import { apply as applyPolyfill } from "../polyfill.js";
|
|
12
11
|
import { createRoutesList } from "../routing/index.js";
|
|
13
12
|
import { syncInternal } from "../sync/index.js";
|
|
14
13
|
import { warnMissingAdapter } from "./adapter-validation.js";
|
|
@@ -19,7 +18,6 @@ async function createContainer({
|
|
|
19
18
|
settings,
|
|
20
19
|
fs = nodeFs
|
|
21
20
|
}) {
|
|
22
|
-
applyPolyfill();
|
|
23
21
|
settings = await runHookConfigSetup({
|
|
24
22
|
settings,
|
|
25
23
|
command: "dev",
|
package/dist/core/dev/dev.js
CHANGED
|
@@ -22,7 +22,7 @@ async function dev(inlineConfig) {
|
|
|
22
22
|
await telemetry.record([]);
|
|
23
23
|
const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
|
|
24
24
|
const logger = restart.container.logger;
|
|
25
|
-
const currentVersion = "
|
|
25
|
+
const currentVersion = "6.0.0-alpha.0";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
|
@@ -2,7 +2,7 @@ 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
7
|
import { getDocsForError, renderErrorMarkdown } from "./utils.js";
|
|
8
8
|
function enhanceViteSSRError({
|
|
@@ -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
|
}
|