astro 2.7.3 → 2.8.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 +0 -1
- package/dist/@types/astro.d.ts +48 -14
- package/dist/assets/image-endpoint.js +1 -1
- package/dist/assets/services/vendor/squoosh/codecs.js +0 -2
- package/dist/assets/vendor/image-size/types/tiff.js +1 -1
- package/dist/cli/index.js +54 -5
- package/dist/content/utils.d.ts +1 -1
- package/dist/content/utils.js +1 -1
- package/dist/core/app/index.js +4 -8
- package/dist/core/app/node.d.ts +1 -1
- package/dist/core/app/types.d.ts +2 -2
- package/dist/core/build/generate.d.ts +9 -1
- package/dist/core/build/generate.js +56 -67
- package/dist/core/build/index.d.ts +1 -1
- package/dist/core/build/index.js +19 -1
- package/dist/core/build/internal.d.ts +1 -0
- package/dist/core/build/plugins/index.js +2 -2
- package/dist/core/build/plugins/plugin-analyzer.js +1 -1
- package/dist/core/build/plugins/plugin-css.js +1 -1
- package/dist/core/build/plugins/plugin-middleware.d.ts +2 -2
- package/dist/core/build/plugins/plugin-middleware.js +20 -1
- package/dist/core/build/plugins/plugin-pages.js +6 -4
- package/dist/core/build/plugins/plugin-renderers.d.ts +2 -3
- package/dist/core/build/plugins/plugin-renderers.js +3 -4
- package/dist/core/build/plugins/plugin-ssr.js +8 -13
- package/dist/core/build/static-build.js +0 -3
- package/dist/core/compile/compile.js +0 -1
- package/dist/core/config/schema.d.ts +85 -73
- package/dist/core/config/schema.js +6 -4
- package/dist/core/constants.js +1 -1
- package/dist/core/cookies/cookies.js +4 -2
- package/dist/core/create-vite.js +2 -2
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/dev/restart.js +1 -1
- package/dist/core/endpoint/dev/index.d.ts +1 -2
- package/dist/core/endpoint/dev/index.js +2 -3
- package/dist/core/endpoint/index.d.ts +9 -4
- package/dist/core/endpoint/index.js +3 -3
- package/dist/core/errors/dev/utils.js +2 -2
- package/dist/core/errors/errors.d.ts +6 -6
- package/dist/core/errors/overlay.d.ts +1 -2
- package/dist/core/errors/overlay.js +3 -2
- package/dist/core/errors/utils.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/middleware/callMiddleware.js +0 -4
- package/dist/core/middleware/index.d.ts +31 -2
- package/dist/core/middleware/index.js +47 -1
- package/dist/core/module-loader/loader.d.ts +1 -0
- package/dist/core/render/context.d.ts +2 -6
- package/dist/core/render/context.js +4 -8
- package/dist/core/render/core.d.ts +2 -23
- package/dist/core/render/core.js +2 -74
- package/dist/core/render/dev/environment.js +1 -0
- package/dist/core/render/dev/index.d.ts +0 -2
- package/dist/core/render/dev/index.js +2 -2
- package/dist/core/render/dev/vite.js +7 -8
- package/dist/core/render/environment.d.ts +14 -8
- package/dist/core/render/environment.js +0 -19
- package/dist/core/render/index.d.ts +3 -2
- package/dist/core/render/index.js +3 -10
- package/dist/core/render/params-and-props.d.ts +13 -0
- package/dist/core/render/params-and-props.js +57 -0
- package/dist/core/render/result.d.ts +14 -4
- package/dist/core/render/result.js +10 -11
- package/dist/core/render/route-cache.d.ts +3 -2
- package/dist/core/render/route-cache.js +13 -7
- package/dist/core/routing/manifest/create.js +2 -22
- package/dist/events/error.js +6 -2
- package/dist/integrations/index.d.ts +8 -4
- package/dist/integrations/index.js +8 -8
- package/dist/runtime/client/visible.js +1 -2
- package/dist/runtime/client/visible.prebuilt.d.ts +1 -1
- package/dist/runtime/client/visible.prebuilt.js +1 -1
- package/dist/runtime/server/astro-global.js +1 -1
- package/dist/runtime/server/astro-island.js +2 -2
- package/dist/runtime/server/astro-island.prebuilt.d.ts +1 -1
- package/dist/runtime/server/astro-island.prebuilt.js +1 -1
- package/dist/runtime/server/endpoint.js +1 -1
- package/dist/runtime/server/hydration.d.ts +1 -1
- package/dist/runtime/server/jsx.js +2 -2
- package/dist/runtime/server/render/astro/instance.js +2 -2
- package/dist/runtime/server/render/component.js +1 -1
- package/dist/runtime/server/render/head.d.ts +3 -9
- package/dist/runtime/server/render/head.js +7 -10
- package/dist/runtime/server/render/page.d.ts +1 -1
- package/dist/runtime/server/render/page.js +9 -9
- package/dist/runtime/server/render/types.d.ts +0 -5
- package/dist/runtime/server/render/util.js +11 -3
- package/dist/runtime/server/scripts.js +1 -1
- package/dist/vite-plugin-astro/compile.js +2 -4
- package/dist/vite-plugin-astro/hmr.js +1 -1
- package/dist/vite-plugin-astro-postprocess/index.d.ts +1 -6
- package/dist/vite-plugin-astro-postprocess/index.js +1 -1
- package/dist/vite-plugin-astro-server/plugin.js +2 -2
- package/dist/vite-plugin-astro-server/route.js +18 -14
- package/dist/vite-plugin-head/index.d.ts +2 -6
- package/dist/vite-plugin-head/index.js +2 -4
- package/dist/vite-plugin-html/transform/escape.js +2 -2
- package/dist/vite-plugin-html/transform/slots.js +1 -1
- package/dist/vite-plugin-jsx/import-source.js +1 -1
- package/dist/vite-plugin-jsx/tag.d.ts +1 -1
- package/dist/vite-plugin-jsx/tag.js +1 -2
- package/dist/vite-plugin-markdown/content-entry-type.js +2 -3
- package/dist/vite-plugin-scanner/scan.js +1 -1
- package/dist/vite-plugin-scripts/index.js +1 -1
- package/dist/vite-plugin-ssr-manifest/index.js +1 -1
- package/package.json +2 -1
|
@@ -16,11 +16,11 @@ function registerAllPlugins({ internals, options, register }) {
|
|
|
16
16
|
register(pluginAliasResolve(internals));
|
|
17
17
|
register(pluginAnalyzer(internals));
|
|
18
18
|
register(pluginInternals(internals));
|
|
19
|
-
register(pluginRenderers(options
|
|
19
|
+
register(pluginRenderers(options));
|
|
20
20
|
register(pluginMiddleware(options, internals));
|
|
21
21
|
register(pluginPages(options, internals));
|
|
22
22
|
register(pluginCSS(options, internals));
|
|
23
|
-
register(astroHeadBuildPlugin(
|
|
23
|
+
register(astroHeadBuildPlugin(internals));
|
|
24
24
|
register(pluginPrerender(options, internals));
|
|
25
25
|
register(astroConfigBuildPlugin(options, internals));
|
|
26
26
|
register(pluginHoistedScripts(options, internals));
|
|
@@ -98,7 +98,7 @@ function vitePluginAnalyzer(internals) {
|
|
|
98
98
|
const ids = this.getModuleIds();
|
|
99
99
|
for (const id of ids) {
|
|
100
100
|
const info = this.getModuleInfo(id);
|
|
101
|
-
if (!
|
|
101
|
+
if (!((_a = info == null ? void 0 : info.meta) == null ? void 0 : _a.astro))
|
|
102
102
|
continue;
|
|
103
103
|
const astro = info.meta.astro;
|
|
104
104
|
const pageData = getPageDataByViteID(internals, id);
|
|
@@ -64,7 +64,7 @@ function rollupPluginAstroBuildCSS(options) {
|
|
|
64
64
|
});
|
|
65
65
|
},
|
|
66
66
|
async generateBundle(_outputOptions, bundle) {
|
|
67
|
-
for (const [
|
|
67
|
+
for (const [, chunk] of Object.entries(bundle)) {
|
|
68
68
|
if (chunk.type !== "chunk")
|
|
69
69
|
continue;
|
|
70
70
|
if ("viteMetadata" in chunk === false)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin as VitePlugin } from 'vite';
|
|
2
|
-
import type { BuildInternals } from '../internal
|
|
2
|
+
import type { BuildInternals } from '../internal';
|
|
3
3
|
import type { AstroBuildPlugin } from '../plugin';
|
|
4
4
|
import type { StaticBuildOptions } from '../types';
|
|
5
5
|
export declare const MIDDLEWARE_MODULE_ID = "@astro-middleware";
|
|
6
|
-
export declare function vitePluginMiddleware(opts: StaticBuildOptions,
|
|
6
|
+
export declare function vitePluginMiddleware(opts: StaticBuildOptions, internals: BuildInternals): VitePlugin;
|
|
7
7
|
export declare function pluginMiddleware(opts: StaticBuildOptions, internals: BuildInternals): AstroBuildPlugin;
|
|
@@ -2,7 +2,8 @@ import { MIDDLEWARE_PATH_SEGMENT_NAME } from "../../constants.js";
|
|
|
2
2
|
import { addRollupInput } from "../add-rollup-input.js";
|
|
3
3
|
const MIDDLEWARE_MODULE_ID = "@astro-middleware";
|
|
4
4
|
const EMPTY_MIDDLEWARE = "\0empty-middleware";
|
|
5
|
-
function vitePluginMiddleware(opts,
|
|
5
|
+
function vitePluginMiddleware(opts, internals) {
|
|
6
|
+
let resolvedMiddlewareId;
|
|
6
7
|
return {
|
|
7
8
|
name: "@astro/plugin-middleware",
|
|
8
9
|
options(options) {
|
|
@@ -14,6 +15,7 @@ function vitePluginMiddleware(opts, _internals) {
|
|
|
14
15
|
`${opts.settings.config.srcDir.pathname}/${MIDDLEWARE_PATH_SEGMENT_NAME}`
|
|
15
16
|
);
|
|
16
17
|
if (middlewareId) {
|
|
18
|
+
resolvedMiddlewareId = middlewareId.id;
|
|
17
19
|
return middlewareId.id;
|
|
18
20
|
} else {
|
|
19
21
|
return EMPTY_MIDDLEWARE;
|
|
@@ -26,6 +28,23 @@ function vitePluginMiddleware(opts, _internals) {
|
|
|
26
28
|
load(id) {
|
|
27
29
|
if (id === EMPTY_MIDDLEWARE) {
|
|
28
30
|
return "export const onRequest = undefined";
|
|
31
|
+
} else if (id === resolvedMiddlewareId) {
|
|
32
|
+
this.emitFile({
|
|
33
|
+
type: "chunk",
|
|
34
|
+
preserveSignature: "strict",
|
|
35
|
+
fileName: "middleware.mjs",
|
|
36
|
+
id
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
writeBundle(_, bundle) {
|
|
41
|
+
for (const [chunkName, chunk] of Object.entries(bundle)) {
|
|
42
|
+
if (chunk.type === "asset") {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (chunk.fileName === "middleware.mjs") {
|
|
46
|
+
internals.middlewareEntryPoint = new URL(chunkName, opts.settings.config.build.server);
|
|
47
|
+
}
|
|
29
48
|
}
|
|
30
49
|
}
|
|
31
50
|
};
|
|
@@ -50,10 +50,12 @@ function vitePluginPages(opts, internals) {
|
|
|
50
50
|
exports.push(`export { page }`);
|
|
51
51
|
imports.push(`import { renderers } from "${RENDERERS_MODULE_ID}";`);
|
|
52
52
|
exports.push(`export { renderers };`);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
if (!opts.settings.config.build.excludeMiddleware) {
|
|
54
|
+
const middlewareModule = await this.resolve(MIDDLEWARE_MODULE_ID);
|
|
55
|
+
if (middlewareModule) {
|
|
56
|
+
imports.push(`import { onRequest } from "${middlewareModule.id}";`);
|
|
57
|
+
exports.push(`export { onRequest };`);
|
|
58
|
+
}
|
|
57
59
|
}
|
|
58
60
|
return `${imports.join("\n")}${exports.join("\n")}`;
|
|
59
61
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Plugin as VitePlugin } from 'vite';
|
|
2
|
-
import type { BuildInternals } from '../internal.js';
|
|
3
2
|
import type { AstroBuildPlugin } from '../plugin';
|
|
4
3
|
import type { StaticBuildOptions } from '../types';
|
|
5
4
|
export declare const RENDERERS_MODULE_ID = "@astro-renderers";
|
|
6
5
|
export declare const RESOLVED_RENDERERS_MODULE_ID: string;
|
|
7
|
-
export declare function vitePluginRenderers(opts: StaticBuildOptions
|
|
8
|
-
export declare function pluginRenderers(opts: StaticBuildOptions
|
|
6
|
+
export declare function vitePluginRenderers(opts: StaticBuildOptions): VitePlugin;
|
|
7
|
+
export declare function pluginRenderers(opts: StaticBuildOptions): AstroBuildPlugin;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { addRollupInput } from "../add-rollup-input.js";
|
|
2
2
|
const RENDERERS_MODULE_ID = "@astro-renderers";
|
|
3
3
|
const RESOLVED_RENDERERS_MODULE_ID = `\0${RENDERERS_MODULE_ID}`;
|
|
4
|
-
|
|
5
|
-
function vitePluginRenderers(opts, _internals) {
|
|
4
|
+
function vitePluginRenderers(opts) {
|
|
6
5
|
return {
|
|
7
6
|
name: "@astro/plugin-renderers",
|
|
8
7
|
options(options) {
|
|
@@ -34,13 +33,13 @@ ${exports.join("\n")}`;
|
|
|
34
33
|
}
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
|
-
function pluginRenderers(opts
|
|
36
|
+
function pluginRenderers(opts) {
|
|
38
37
|
return {
|
|
39
38
|
build: "ssr",
|
|
40
39
|
hooks: {
|
|
41
40
|
"build:before": () => {
|
|
42
41
|
return {
|
|
43
|
-
vitePlugin: vitePluginRenderers(opts
|
|
42
|
+
vitePlugin: vitePluginRenderers(opts)
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
45
|
}
|
|
@@ -31,10 +31,7 @@ function vitePluginSSR(internals, adapter, options) {
|
|
|
31
31
|
},
|
|
32
32
|
async load(id) {
|
|
33
33
|
if (id === RESOLVED_SSR_VIRTUAL_MODULE_ID) {
|
|
34
|
-
const {
|
|
35
|
-
settings: { config },
|
|
36
|
-
allPages
|
|
37
|
-
} = options;
|
|
34
|
+
const { allPages } = options;
|
|
38
35
|
const imports = [];
|
|
39
36
|
const contents = [];
|
|
40
37
|
const exports = [];
|
|
@@ -66,7 +63,7 @@ function vitePluginSSR(internals, adapter, options) {
|
|
|
66
63
|
return void 0;
|
|
67
64
|
},
|
|
68
65
|
async generateBundle(_opts, bundle) {
|
|
69
|
-
for (const [
|
|
66
|
+
for (const [, chunk] of Object.entries(bundle)) {
|
|
70
67
|
if (chunk.type === "asset") {
|
|
71
68
|
internals.staticFiles.add(chunk.fileName);
|
|
72
69
|
}
|
|
@@ -111,7 +108,8 @@ function pluginSSR(options, internals) {
|
|
|
111
108
|
config: options.settings.config,
|
|
112
109
|
manifest,
|
|
113
110
|
logging: options.logging,
|
|
114
|
-
entryPoints: internals.entryPoints
|
|
111
|
+
entryPoints: internals.entryPoints,
|
|
112
|
+
middlewareEntryPoint: internals.middlewareEntryPoint
|
|
115
113
|
});
|
|
116
114
|
const code = injectManifest(manifest, internals.ssrEntryChunk);
|
|
117
115
|
mutate(internals.ssrEntryChunk, "server", code);
|
|
@@ -141,10 +139,6 @@ function vitePluginSSRSplit(internals, adapter, options) {
|
|
|
141
139
|
},
|
|
142
140
|
async load(id) {
|
|
143
141
|
if (id.startsWith(RESOLVED_SPLIT_MODULE_ID)) {
|
|
144
|
-
const {
|
|
145
|
-
settings: { config },
|
|
146
|
-
allPages
|
|
147
|
-
} = options;
|
|
148
142
|
const imports = [];
|
|
149
143
|
const contents = [];
|
|
150
144
|
const exports = [];
|
|
@@ -162,7 +156,7 @@ function vitePluginSSRSplit(internals, adapter, options) {
|
|
|
162
156
|
return void 0;
|
|
163
157
|
},
|
|
164
158
|
async generateBundle(_opts, bundle) {
|
|
165
|
-
for (const [
|
|
159
|
+
for (const [, chunk] of Object.entries(bundle)) {
|
|
166
160
|
if (chunk.type === "asset") {
|
|
167
161
|
internals.staticFiles.add(chunk.fileName);
|
|
168
162
|
}
|
|
@@ -213,9 +207,10 @@ function pluginSSRSplit(options, internals) {
|
|
|
213
207
|
config: options.settings.config,
|
|
214
208
|
manifest,
|
|
215
209
|
logging: options.logging,
|
|
216
|
-
entryPoints: internals.entryPoints
|
|
210
|
+
entryPoints: internals.entryPoints,
|
|
211
|
+
middlewareEntryPoint: internals.middlewareEntryPoint
|
|
217
212
|
});
|
|
218
|
-
for (const [
|
|
213
|
+
for (const [, chunk] of internals.ssrSplitEntryChunks) {
|
|
219
214
|
const code = injectManifest(manifest, chunk);
|
|
220
215
|
mutate(chunk, "server", code);
|
|
221
216
|
}
|
|
@@ -24,7 +24,6 @@ import { generatePages } from "./generate.js";
|
|
|
24
24
|
import { trackPageData } from "./internal.js";
|
|
25
25
|
import { createPluginContainer } from "./plugin.js";
|
|
26
26
|
import { registerAllPlugins } from "./plugins/index.js";
|
|
27
|
-
import { MIDDLEWARE_MODULE_ID } from "./plugins/plugin-middleware.js";
|
|
28
27
|
import { ASTRO_PAGE_RESOLVED_MODULE_ID } from "./plugins/plugin-pages.js";
|
|
29
28
|
import { RESOLVED_RENDERERS_MODULE_ID } from "./plugins/plugin-renderers.js";
|
|
30
29
|
import { RESOLVED_SPLIT_MODULE_ID, SSR_VIRTUAL_MODULE_ID } from "./plugins/plugin-ssr.js";
|
|
@@ -141,8 +140,6 @@ async function ssrBuild(opts, internals, input, container) {
|
|
|
141
140
|
);
|
|
142
141
|
} else if ((_b2 = chunkInfo.facadeModuleId) == null ? void 0 : _b2.startsWith(RESOLVED_SPLIT_MODULE_ID)) {
|
|
143
142
|
return makeSplitEntryPointFileName(chunkInfo.facadeModuleId, routes);
|
|
144
|
-
} else if (chunkInfo.facadeModuleId === MIDDLEWARE_MODULE_ID) {
|
|
145
|
-
return "middleware.mjs";
|
|
146
143
|
} else if (chunkInfo.facadeModuleId === SSR_VIRTUAL_MODULE_ID) {
|
|
147
144
|
return opts.settings.config.build.serverEntry;
|
|
148
145
|
} else if (chunkInfo.facadeModuleId === RESOLVED_RENDERERS_MODULE_ID) {
|
|
@@ -49,26 +49,29 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
49
49
|
redirects: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
50
50
|
inlineStylesheets: z.ZodDefault<z.ZodOptional<z.ZodEnum<["always", "auto", "never"]>>>;
|
|
51
51
|
split: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
52
|
+
excludeMiddleware: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
52
53
|
}, "strip", z.ZodTypeAny, {
|
|
53
54
|
assetsPrefix?: string | undefined;
|
|
54
|
-
server: URL;
|
|
55
55
|
format: "file" | "directory";
|
|
56
56
|
client: URL;
|
|
57
|
+
server: URL;
|
|
57
58
|
assets: string;
|
|
58
59
|
serverEntry: string;
|
|
59
60
|
redirects: boolean;
|
|
60
|
-
inlineStylesheets: "
|
|
61
|
+
inlineStylesheets: "always" | "never" | "auto";
|
|
61
62
|
split: boolean;
|
|
63
|
+
excludeMiddleware: boolean;
|
|
62
64
|
}, {
|
|
63
|
-
server?: string | undefined;
|
|
64
65
|
format?: "file" | "directory" | undefined;
|
|
65
66
|
client?: string | undefined;
|
|
67
|
+
server?: string | undefined;
|
|
66
68
|
assets?: string | undefined;
|
|
67
|
-
assetsPrefix?: string | undefined;
|
|
68
69
|
serverEntry?: string | undefined;
|
|
69
70
|
redirects?: boolean | undefined;
|
|
70
|
-
inlineStylesheets?: "
|
|
71
|
+
inlineStylesheets?: "always" | "never" | "auto" | undefined;
|
|
71
72
|
split?: boolean | undefined;
|
|
73
|
+
excludeMiddleware?: boolean | undefined;
|
|
74
|
+
assetsPrefix?: string | undefined;
|
|
72
75
|
}>>>;
|
|
73
76
|
server: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
74
77
|
open: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -77,19 +80,19 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
77
80
|
headers: z.ZodOptional<z.ZodType<OutgoingHttpHeaders, z.ZodTypeDef, OutgoingHttpHeaders>>;
|
|
78
81
|
}, "strip", z.ZodTypeAny, {
|
|
79
82
|
headers?: OutgoingHttpHeaders | undefined;
|
|
80
|
-
open: boolean;
|
|
81
83
|
host: string | boolean;
|
|
82
84
|
port: number;
|
|
85
|
+
open: boolean;
|
|
83
86
|
}, {
|
|
84
|
-
open?: boolean | undefined;
|
|
85
87
|
host?: string | boolean | undefined;
|
|
86
88
|
port?: number | undefined;
|
|
87
89
|
headers?: OutgoingHttpHeaders | undefined;
|
|
90
|
+
open?: boolean | undefined;
|
|
88
91
|
}>>>, {
|
|
89
92
|
headers?: OutgoingHttpHeaders | undefined;
|
|
90
|
-
open: boolean;
|
|
91
93
|
host: string | boolean;
|
|
92
94
|
port: number;
|
|
95
|
+
open: boolean;
|
|
93
96
|
}, unknown>;
|
|
94
97
|
redirects: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
95
98
|
image: z.ZodDefault<z.ZodObject<{
|
|
@@ -186,7 +189,14 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
186
189
|
name: string;
|
|
187
190
|
hooks: {};
|
|
188
191
|
} | undefined;
|
|
189
|
-
output: "
|
|
192
|
+
output: "server" | "static" | "hybrid";
|
|
193
|
+
server: {
|
|
194
|
+
headers?: OutgoingHttpHeaders | undefined;
|
|
195
|
+
host: string | boolean;
|
|
196
|
+
port: number;
|
|
197
|
+
open: boolean;
|
|
198
|
+
};
|
|
199
|
+
redirects: Record<string, string>;
|
|
190
200
|
root: URL;
|
|
191
201
|
srcDir: URL;
|
|
192
202
|
publicDir: URL;
|
|
@@ -194,29 +204,23 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
194
204
|
cacheDir: URL;
|
|
195
205
|
compressHTML: boolean;
|
|
196
206
|
base: string;
|
|
197
|
-
trailingSlash: "
|
|
198
|
-
server: {
|
|
199
|
-
headers?: OutgoingHttpHeaders | undefined;
|
|
200
|
-
open: boolean;
|
|
201
|
-
host: string | boolean;
|
|
202
|
-
port: number;
|
|
203
|
-
};
|
|
207
|
+
trailingSlash: "ignore" | "always" | "never";
|
|
204
208
|
scopedStyleStrategy: "where" | "class";
|
|
205
209
|
integrations: {
|
|
206
210
|
name: string;
|
|
207
211
|
hooks: {};
|
|
208
212
|
}[];
|
|
209
|
-
redirects: Record<string, string>;
|
|
210
213
|
build: {
|
|
211
214
|
assetsPrefix?: string | undefined;
|
|
212
|
-
server: URL;
|
|
213
215
|
format: "file" | "directory";
|
|
214
216
|
client: URL;
|
|
217
|
+
server: URL;
|
|
215
218
|
assets: string;
|
|
216
219
|
serverEntry: string;
|
|
217
220
|
redirects: boolean;
|
|
218
|
-
inlineStylesheets: "
|
|
221
|
+
inlineStylesheets: "always" | "never" | "auto";
|
|
219
222
|
split: boolean;
|
|
223
|
+
excludeMiddleware: boolean;
|
|
220
224
|
};
|
|
221
225
|
image: {
|
|
222
226
|
service: {
|
|
@@ -245,7 +249,9 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
245
249
|
};
|
|
246
250
|
legacy: {};
|
|
247
251
|
}, {
|
|
248
|
-
output?: "
|
|
252
|
+
output?: "server" | "static" | "hybrid" | undefined;
|
|
253
|
+
server?: unknown;
|
|
254
|
+
redirects?: Record<string, string> | undefined;
|
|
249
255
|
root?: string | undefined;
|
|
250
256
|
srcDir?: string | undefined;
|
|
251
257
|
publicDir?: string | undefined;
|
|
@@ -254,25 +260,24 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
254
260
|
site?: string | undefined;
|
|
255
261
|
compressHTML?: boolean | undefined;
|
|
256
262
|
base?: string | undefined;
|
|
257
|
-
trailingSlash?: "
|
|
258
|
-
server?: unknown;
|
|
263
|
+
trailingSlash?: "ignore" | "always" | "never" | undefined;
|
|
259
264
|
scopedStyleStrategy?: "where" | "class" | undefined;
|
|
260
265
|
adapter?: {
|
|
261
266
|
hooks?: {} | undefined;
|
|
262
267
|
name: string;
|
|
263
268
|
} | undefined;
|
|
264
269
|
integrations?: unknown;
|
|
265
|
-
redirects?: Record<string, string> | undefined;
|
|
266
270
|
build?: {
|
|
267
|
-
server?: string | undefined;
|
|
268
271
|
format?: "file" | "directory" | undefined;
|
|
269
272
|
client?: string | undefined;
|
|
273
|
+
server?: string | undefined;
|
|
270
274
|
assets?: string | undefined;
|
|
271
|
-
assetsPrefix?: string | undefined;
|
|
272
275
|
serverEntry?: string | undefined;
|
|
273
276
|
redirects?: boolean | undefined;
|
|
274
|
-
inlineStylesheets?: "
|
|
277
|
+
inlineStylesheets?: "always" | "never" | "auto" | undefined;
|
|
275
278
|
split?: boolean | undefined;
|
|
279
|
+
excludeMiddleware?: boolean | undefined;
|
|
280
|
+
assetsPrefix?: string | undefined;
|
|
276
281
|
} | undefined;
|
|
277
282
|
image?: {
|
|
278
283
|
service: {
|
|
@@ -303,6 +308,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
303
308
|
}>;
|
|
304
309
|
export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL): z.ZodEffects<z.ZodObject<{
|
|
305
310
|
output: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"server">, z.ZodLiteral<"hybrid">]>>>;
|
|
311
|
+
redirects: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
306
312
|
site: z.ZodOptional<z.ZodString>;
|
|
307
313
|
base: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
308
314
|
trailingSlash: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"always">, z.ZodLiteral<"never">, z.ZodLiteral<"ignore">]>>>;
|
|
@@ -330,7 +336,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
330
336
|
name: string;
|
|
331
337
|
hooks: {};
|
|
332
338
|
}[], unknown>;
|
|
333
|
-
redirects: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
334
339
|
image: z.ZodDefault<z.ZodObject<{
|
|
335
340
|
service: z.ZodObject<{
|
|
336
341
|
entrypoint: z.ZodUnion<[z.ZodLiteral<"astro/assets/services/sharp">, z.ZodLiteral<"astro/assets/services/squoosh">, z.ZodString]>;
|
|
@@ -435,26 +440,29 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
435
440
|
redirects: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
436
441
|
inlineStylesheets: z.ZodDefault<z.ZodOptional<z.ZodEnum<["always", "auto", "never"]>>>;
|
|
437
442
|
split: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
443
|
+
excludeMiddleware: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
438
444
|
}, "strip", z.ZodTypeAny, {
|
|
439
445
|
assetsPrefix?: string | undefined;
|
|
440
|
-
server: URL;
|
|
441
446
|
format: "file" | "directory";
|
|
442
447
|
client: URL;
|
|
448
|
+
server: URL;
|
|
443
449
|
assets: string;
|
|
444
450
|
serverEntry: string;
|
|
445
451
|
redirects: boolean;
|
|
446
|
-
inlineStylesheets: "
|
|
452
|
+
inlineStylesheets: "always" | "never" | "auto";
|
|
447
453
|
split: boolean;
|
|
454
|
+
excludeMiddleware: boolean;
|
|
448
455
|
}, {
|
|
449
|
-
server?: string | undefined;
|
|
450
456
|
format?: "file" | "directory" | undefined;
|
|
451
457
|
client?: string | undefined;
|
|
458
|
+
server?: string | undefined;
|
|
452
459
|
assets?: string | undefined;
|
|
453
|
-
assetsPrefix?: string | undefined;
|
|
454
460
|
serverEntry?: string | undefined;
|
|
455
461
|
redirects?: boolean | undefined;
|
|
456
|
-
inlineStylesheets?: "
|
|
462
|
+
inlineStylesheets?: "always" | "never" | "auto" | undefined;
|
|
457
463
|
split?: boolean | undefined;
|
|
464
|
+
excludeMiddleware?: boolean | undefined;
|
|
465
|
+
assetsPrefix?: string | undefined;
|
|
458
466
|
}>>>;
|
|
459
467
|
server: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
460
468
|
host: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>>;
|
|
@@ -464,21 +472,21 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
464
472
|
streaming: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
465
473
|
}, "strip", z.ZodTypeAny, {
|
|
466
474
|
headers?: OutgoingHttpHeaders | undefined;
|
|
467
|
-
open: boolean;
|
|
468
475
|
host: string | boolean;
|
|
469
476
|
port: number;
|
|
477
|
+
open: boolean;
|
|
470
478
|
streaming: boolean;
|
|
471
479
|
}, {
|
|
472
|
-
open?: boolean | undefined;
|
|
473
480
|
host?: string | boolean | undefined;
|
|
474
481
|
port?: number | undefined;
|
|
475
482
|
headers?: OutgoingHttpHeaders | undefined;
|
|
483
|
+
open?: boolean | undefined;
|
|
476
484
|
streaming?: boolean | undefined;
|
|
477
485
|
}>>>, {
|
|
478
486
|
headers?: OutgoingHttpHeaders | undefined;
|
|
479
|
-
open: boolean;
|
|
480
487
|
host: string | boolean;
|
|
481
488
|
port: number;
|
|
489
|
+
open: boolean;
|
|
482
490
|
streaming: boolean;
|
|
483
491
|
}, unknown>;
|
|
484
492
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -487,7 +495,15 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
487
495
|
name: string;
|
|
488
496
|
hooks: {};
|
|
489
497
|
} | undefined;
|
|
490
|
-
output: "
|
|
498
|
+
output: "server" | "static" | "hybrid";
|
|
499
|
+
server: {
|
|
500
|
+
headers?: OutgoingHttpHeaders | undefined;
|
|
501
|
+
host: string | boolean;
|
|
502
|
+
port: number;
|
|
503
|
+
open: boolean;
|
|
504
|
+
streaming: boolean;
|
|
505
|
+
};
|
|
506
|
+
redirects: Record<string, string>;
|
|
491
507
|
root: URL;
|
|
492
508
|
srcDir: URL;
|
|
493
509
|
publicDir: URL;
|
|
@@ -495,30 +511,23 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
495
511
|
cacheDir: URL;
|
|
496
512
|
compressHTML: boolean;
|
|
497
513
|
base: string;
|
|
498
|
-
trailingSlash: "
|
|
499
|
-
server: {
|
|
500
|
-
headers?: OutgoingHttpHeaders | undefined;
|
|
501
|
-
open: boolean;
|
|
502
|
-
host: string | boolean;
|
|
503
|
-
port: number;
|
|
504
|
-
streaming: boolean;
|
|
505
|
-
};
|
|
514
|
+
trailingSlash: "ignore" | "always" | "never";
|
|
506
515
|
scopedStyleStrategy: "where" | "class";
|
|
507
516
|
integrations: {
|
|
508
517
|
name: string;
|
|
509
518
|
hooks: {};
|
|
510
519
|
}[];
|
|
511
|
-
redirects: Record<string, string>;
|
|
512
520
|
build: {
|
|
513
521
|
assetsPrefix?: string | undefined;
|
|
514
|
-
server: URL;
|
|
515
522
|
format: "file" | "directory";
|
|
516
523
|
client: URL;
|
|
524
|
+
server: URL;
|
|
517
525
|
assets: string;
|
|
518
526
|
serverEntry: string;
|
|
519
527
|
redirects: boolean;
|
|
520
|
-
inlineStylesheets: "
|
|
528
|
+
inlineStylesheets: "always" | "never" | "auto";
|
|
521
529
|
split: boolean;
|
|
530
|
+
excludeMiddleware: boolean;
|
|
522
531
|
};
|
|
523
532
|
image: {
|
|
524
533
|
service: {
|
|
@@ -547,7 +556,9 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
547
556
|
};
|
|
548
557
|
legacy: {};
|
|
549
558
|
}, {
|
|
550
|
-
output?: "
|
|
559
|
+
output?: "server" | "static" | "hybrid" | undefined;
|
|
560
|
+
server?: unknown;
|
|
561
|
+
redirects?: Record<string, string> | undefined;
|
|
551
562
|
root?: string | undefined;
|
|
552
563
|
srcDir?: string | undefined;
|
|
553
564
|
publicDir?: string | undefined;
|
|
@@ -556,25 +567,24 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
556
567
|
site?: string | undefined;
|
|
557
568
|
compressHTML?: boolean | undefined;
|
|
558
569
|
base?: string | undefined;
|
|
559
|
-
trailingSlash?: "
|
|
560
|
-
server?: unknown;
|
|
570
|
+
trailingSlash?: "ignore" | "always" | "never" | undefined;
|
|
561
571
|
scopedStyleStrategy?: "where" | "class" | undefined;
|
|
562
572
|
adapter?: {
|
|
563
573
|
hooks?: {} | undefined;
|
|
564
574
|
name: string;
|
|
565
575
|
} | undefined;
|
|
566
576
|
integrations?: unknown;
|
|
567
|
-
redirects?: Record<string, string> | undefined;
|
|
568
577
|
build?: {
|
|
569
|
-
server?: string | undefined;
|
|
570
578
|
format?: "file" | "directory" | undefined;
|
|
571
579
|
client?: string | undefined;
|
|
580
|
+
server?: string | undefined;
|
|
572
581
|
assets?: string | undefined;
|
|
573
|
-
assetsPrefix?: string | undefined;
|
|
574
582
|
serverEntry?: string | undefined;
|
|
575
583
|
redirects?: boolean | undefined;
|
|
576
|
-
inlineStylesheets?: "
|
|
584
|
+
inlineStylesheets?: "always" | "never" | "auto" | undefined;
|
|
577
585
|
split?: boolean | undefined;
|
|
586
|
+
excludeMiddleware?: boolean | undefined;
|
|
587
|
+
assetsPrefix?: string | undefined;
|
|
578
588
|
} | undefined;
|
|
579
589
|
image?: {
|
|
580
590
|
service: {
|
|
@@ -608,7 +618,15 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
608
618
|
name: string;
|
|
609
619
|
hooks: {};
|
|
610
620
|
} | undefined;
|
|
611
|
-
output: "
|
|
621
|
+
output: "server" | "static" | "hybrid";
|
|
622
|
+
server: {
|
|
623
|
+
headers?: OutgoingHttpHeaders | undefined;
|
|
624
|
+
host: string | boolean;
|
|
625
|
+
port: number;
|
|
626
|
+
open: boolean;
|
|
627
|
+
streaming: boolean;
|
|
628
|
+
};
|
|
629
|
+
redirects: Record<string, string>;
|
|
612
630
|
root: URL;
|
|
613
631
|
srcDir: URL;
|
|
614
632
|
publicDir: URL;
|
|
@@ -616,30 +634,23 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
616
634
|
cacheDir: URL;
|
|
617
635
|
compressHTML: boolean;
|
|
618
636
|
base: string;
|
|
619
|
-
trailingSlash: "
|
|
620
|
-
server: {
|
|
621
|
-
headers?: OutgoingHttpHeaders | undefined;
|
|
622
|
-
open: boolean;
|
|
623
|
-
host: string | boolean;
|
|
624
|
-
port: number;
|
|
625
|
-
streaming: boolean;
|
|
626
|
-
};
|
|
637
|
+
trailingSlash: "ignore" | "always" | "never";
|
|
627
638
|
scopedStyleStrategy: "where" | "class";
|
|
628
639
|
integrations: {
|
|
629
640
|
name: string;
|
|
630
641
|
hooks: {};
|
|
631
642
|
}[];
|
|
632
|
-
redirects: Record<string, string>;
|
|
633
643
|
build: {
|
|
634
644
|
assetsPrefix?: string | undefined;
|
|
635
|
-
server: URL;
|
|
636
645
|
format: "file" | "directory";
|
|
637
646
|
client: URL;
|
|
647
|
+
server: URL;
|
|
638
648
|
assets: string;
|
|
639
649
|
serverEntry: string;
|
|
640
650
|
redirects: boolean;
|
|
641
|
-
inlineStylesheets: "
|
|
651
|
+
inlineStylesheets: "always" | "never" | "auto";
|
|
642
652
|
split: boolean;
|
|
653
|
+
excludeMiddleware: boolean;
|
|
643
654
|
};
|
|
644
655
|
image: {
|
|
645
656
|
service: {
|
|
@@ -668,7 +679,9 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
668
679
|
};
|
|
669
680
|
legacy: {};
|
|
670
681
|
}, {
|
|
671
|
-
output?: "
|
|
682
|
+
output?: "server" | "static" | "hybrid" | undefined;
|
|
683
|
+
server?: unknown;
|
|
684
|
+
redirects?: Record<string, string> | undefined;
|
|
672
685
|
root?: string | undefined;
|
|
673
686
|
srcDir?: string | undefined;
|
|
674
687
|
publicDir?: string | undefined;
|
|
@@ -677,25 +690,24 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
677
690
|
site?: string | undefined;
|
|
678
691
|
compressHTML?: boolean | undefined;
|
|
679
692
|
base?: string | undefined;
|
|
680
|
-
trailingSlash?: "
|
|
681
|
-
server?: unknown;
|
|
693
|
+
trailingSlash?: "ignore" | "always" | "never" | undefined;
|
|
682
694
|
scopedStyleStrategy?: "where" | "class" | undefined;
|
|
683
695
|
adapter?: {
|
|
684
696
|
hooks?: {} | undefined;
|
|
685
697
|
name: string;
|
|
686
698
|
} | undefined;
|
|
687
699
|
integrations?: unknown;
|
|
688
|
-
redirects?: Record<string, string> | undefined;
|
|
689
700
|
build?: {
|
|
690
|
-
server?: string | undefined;
|
|
691
701
|
format?: "file" | "directory" | undefined;
|
|
692
702
|
client?: string | undefined;
|
|
703
|
+
server?: string | undefined;
|
|
693
704
|
assets?: string | undefined;
|
|
694
|
-
assetsPrefix?: string | undefined;
|
|
695
705
|
serverEntry?: string | undefined;
|
|
696
706
|
redirects?: boolean | undefined;
|
|
697
|
-
inlineStylesheets?: "
|
|
707
|
+
inlineStylesheets?: "always" | "never" | "auto" | undefined;
|
|
698
708
|
split?: boolean | undefined;
|
|
709
|
+
excludeMiddleware?: boolean | undefined;
|
|
710
|
+
assetsPrefix?: string | undefined;
|
|
699
711
|
} | undefined;
|
|
700
712
|
image?: {
|
|
701
713
|
service: {
|