astro 6.2.0 → 6.2.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/dist/cli/infra/build-time-astro-version-provider.js +1 -1
- package/dist/content/content-layer.js +3 -3
- package/dist/core/config/schemas/base.d.ts +4 -4
- package/dist/core/config/schemas/base.js +7 -7
- package/dist/core/config/schemas/relative.d.ts +4 -7
- package/dist/core/config/schemas/relative.js +2 -3
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/zod-error-map.js +27 -0
- package/dist/core/messages/runtime.js +1 -1
- package/package.json +5 -5
|
@@ -192,7 +192,7 @@ ${contentConfig.error.message}`
|
|
|
192
192
|
logger.info("Content config changed");
|
|
193
193
|
shouldClear = true;
|
|
194
194
|
}
|
|
195
|
-
if (previousAstroVersion && previousAstroVersion !== "6.2.
|
|
195
|
+
if (previousAstroVersion && previousAstroVersion !== "6.2.1") {
|
|
196
196
|
logger.info("Astro version changed");
|
|
197
197
|
shouldClear = true;
|
|
198
198
|
}
|
|
@@ -200,8 +200,8 @@ ${contentConfig.error.message}`
|
|
|
200
200
|
logger.info("Clearing content store");
|
|
201
201
|
this.#store.clearAll();
|
|
202
202
|
}
|
|
203
|
-
if ("6.2.
|
|
204
|
-
this.#store.metaStore().set("astro-version", "6.2.
|
|
203
|
+
if ("6.2.1") {
|
|
204
|
+
this.#store.metaStore().set("astro-version", "6.2.1");
|
|
205
205
|
}
|
|
206
206
|
if (currentConfigDigest) {
|
|
207
207
|
this.#store.metaStore().set("content-config-digest", currentConfigDigest);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { RehypePlugin as _RehypePlugin, RemarkPlugin as _RemarkPlugin, RemarkRehype as _RemarkRehype, Smartypants as _Smartypants, ShikiConfig } from '@astrojs/markdown-remark';
|
|
1
2
|
import type { OutgoingHttpHeaders } from 'node:http';
|
|
2
|
-
import type { RehypePlugin as _RehypePlugin, RemarkPlugin as _RemarkPlugin, RemarkRehype as _RemarkRehype, ShikiConfig, Smartypants as _Smartypants } from '@astrojs/markdown-remark';
|
|
3
3
|
import * as z from 'zod/v4';
|
|
4
4
|
import type { ViteUserConfig } from '../../../types/public/config.js';
|
|
5
5
|
/** @lintignore */
|
|
@@ -103,10 +103,10 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
103
103
|
name: z.ZodString;
|
|
104
104
|
hooks: z.ZodDefault<z.ZodObject<{}, z.core.$loose>>;
|
|
105
105
|
}, z.core.$strip>>;
|
|
106
|
-
integrations: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.
|
|
106
|
+
integrations: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodArray<z.ZodObject<{
|
|
107
107
|
name: z.ZodString;
|
|
108
108
|
hooks: z.ZodDefault<z.ZodObject<{}, z.core.$loose>>;
|
|
109
|
-
}, z.core.$strip
|
|
109
|
+
}, z.core.$strip>>>>>;
|
|
110
110
|
build: z.ZodPrefault<z.ZodObject<{
|
|
111
111
|
format: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"file">, z.ZodLiteral<"directory">, z.ZodLiteral<"preserve">]>>>;
|
|
112
112
|
client: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<URL, string>>;
|
|
@@ -124,7 +124,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
124
124
|
}>>>;
|
|
125
125
|
concurrency: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
126
126
|
}, z.core.$strip>>;
|
|
127
|
-
server: z.ZodPipe<z.ZodTransform<any, unknown>, z.
|
|
127
|
+
server: z.ZodPrefault<z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodObject<{
|
|
128
128
|
open: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
129
129
|
host: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
130
130
|
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -2,11 +2,11 @@ import { markdownConfigDefaults, syntaxHighlightDefaults } from "@astrojs/markdo
|
|
|
2
2
|
import { bundledThemes } from "shiki";
|
|
3
3
|
import * as z from "zod/v4";
|
|
4
4
|
import { FontFamilySchema } from "../../../assets/fonts/config.js";
|
|
5
|
+
import { SvgOptimizerSchema } from "../../../assets/svg/config.js";
|
|
5
6
|
import { EnvSchema } from "../../../env/schema.js";
|
|
6
|
-
import { allowedDirectivesSchema, cspAlgorithmSchema, cspHashSchema } from "../../csp/config.js";
|
|
7
7
|
import { CacheSchema, RouteRulesSchema } from "../../cache/config.js";
|
|
8
|
+
import { allowedDirectivesSchema, cspAlgorithmSchema, cspHashSchema } from "../../csp/config.js";
|
|
8
9
|
import { SessionSchema } from "../../session/config.js";
|
|
9
|
-
import { SvgOptimizerSchema } from "../../../assets/svg/config.js";
|
|
10
10
|
const ASTRO_CONFIG_DEFAULTS = {
|
|
11
11
|
root: ".",
|
|
12
12
|
srcDir: "./src",
|
|
@@ -105,13 +105,13 @@ const AstroConfigSchema = z.object({
|
|
|
105
105
|
message: 'The `output: "hybrid"` option has been removed. Use `output: "static"` (the default) instead, which now behaves the same way.'
|
|
106
106
|
}),
|
|
107
107
|
scopedStyleStrategy: z.union([z.literal("where"), z.literal("class"), z.literal("attribute")]).optional().default("attribute"),
|
|
108
|
-
adapter: z.object({ name: z.string(), hooks: z.object({}).
|
|
108
|
+
adapter: z.object({ name: z.string(), hooks: z.object({}).loose().default({}) }).optional(),
|
|
109
109
|
integrations: z.preprocess(
|
|
110
110
|
// preprocess
|
|
111
111
|
(val) => Array.isArray(val) ? val.flat(Number.POSITIVE_INFINITY).filter(Boolean) : val,
|
|
112
112
|
// validate
|
|
113
|
-
z.array(z.object({ name: z.string(), hooks: z.object({}).
|
|
114
|
-
),
|
|
113
|
+
z.array(z.object({ name: z.string(), hooks: z.object({}).loose().default({}) }))
|
|
114
|
+
).optional().default(ASTRO_CONFIG_DEFAULTS.integrations),
|
|
115
115
|
build: z.object({
|
|
116
116
|
format: z.union([z.literal("file"), z.literal("directory"), z.literal("preserve")]).optional().default(ASTRO_CONFIG_DEFAULTS.build.format),
|
|
117
117
|
client: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.client).transform((val) => new URL(val)),
|
|
@@ -135,8 +135,8 @@ const AstroConfigSchema = z.object({
|
|
|
135
135
|
port: z.number().optional().default(ASTRO_CONFIG_DEFAULTS.server.port),
|
|
136
136
|
headers: z.custom().optional(),
|
|
137
137
|
allowedHosts: z.union([z.array(z.string()), z.literal(true)]).optional().default(ASTRO_CONFIG_DEFAULTS.server.allowedHosts)
|
|
138
|
-
})
|
|
139
|
-
),
|
|
138
|
+
})
|
|
139
|
+
).prefault({}),
|
|
140
140
|
redirects: z.record(
|
|
141
141
|
z.string(),
|
|
142
142
|
z.union([
|
|
@@ -10,10 +10,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
10
10
|
name: z.ZodString;
|
|
11
11
|
hooks: z.ZodDefault<z.ZodObject<{}, z.core.$loose>>;
|
|
12
12
|
}, z.core.$strip>>;
|
|
13
|
-
integrations: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.
|
|
13
|
+
integrations: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodArray<z.ZodObject<{
|
|
14
14
|
name: z.ZodString;
|
|
15
15
|
hooks: z.ZodDefault<z.ZodObject<{}, z.core.$loose>>;
|
|
16
|
-
}, z.core.$strip
|
|
16
|
+
}, z.core.$strip>>>>>;
|
|
17
17
|
redirects: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
18
18
|
status: z.ZodUnion<readonly [z.ZodLiteral<300>, z.ZodLiteral<301>, z.ZodLiteral<302>, z.ZodLiteral<303>, z.ZodLiteral<304>, z.ZodLiteral<307>, z.ZodLiteral<308>]>;
|
|
19
19
|
destination: z.ZodString;
|
|
@@ -437,14 +437,13 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
437
437
|
}>>>;
|
|
438
438
|
concurrency: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
439
439
|
}, z.core.$strip>>>;
|
|
440
|
-
server: z.ZodPipe<z.ZodTransform<any, unknown>, z.
|
|
440
|
+
server: z.ZodPrefault<z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodObject<{
|
|
441
441
|
open: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
442
442
|
host: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
443
443
|
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
444
444
|
headers: z.ZodOptional<z.ZodCustom<OutgoingHttpHeaders, OutgoingHttpHeaders>>;
|
|
445
|
-
streaming: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
446
445
|
allowedHosts: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<true>]>>>;
|
|
447
|
-
}, z.core.$strip
|
|
446
|
+
}, z.core.$strip>>>;
|
|
448
447
|
}, z.core.$strip>, z.ZodTransform<{
|
|
449
448
|
base: string;
|
|
450
449
|
trailingSlash: "never" | "ignore" | "always";
|
|
@@ -630,7 +629,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
630
629
|
open: string | boolean;
|
|
631
630
|
host: string | boolean;
|
|
632
631
|
port: number;
|
|
633
|
-
streaming: boolean;
|
|
634
632
|
allowedHosts: true | string[];
|
|
635
633
|
headers?: OutgoingHttpHeaders | undefined;
|
|
636
634
|
};
|
|
@@ -879,7 +877,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
879
877
|
open: string | boolean;
|
|
880
878
|
host: string | boolean;
|
|
881
879
|
port: number;
|
|
882
|
-
streaming: boolean;
|
|
883
880
|
allowedHosts: true | string[];
|
|
884
881
|
headers?: OutgoingHttpHeaders | undefined;
|
|
885
882
|
};
|
|
@@ -59,10 +59,9 @@ function createRelativeSchema(cmd, fileProtocolRoot) {
|
|
|
59
59
|
host: z.union([z.string(), z.boolean()]).optional().default(ASTRO_CONFIG_DEFAULTS.server.host),
|
|
60
60
|
port: z.number().optional().default(ASTRO_CONFIG_DEFAULTS.server.port),
|
|
61
61
|
headers: z.custom().optional(),
|
|
62
|
-
streaming: z.boolean().optional().default(true),
|
|
63
62
|
allowedHosts: z.union([z.array(z.string()), z.literal(true)]).optional().default(ASTRO_CONFIG_DEFAULTS.server.allowedHosts)
|
|
64
|
-
})
|
|
65
|
-
)
|
|
63
|
+
})
|
|
64
|
+
).prefault({})
|
|
66
65
|
}).transform((config) => {
|
|
67
66
|
if (config.outDir.toString() !== resolveDirAsUrl(ASTRO_CONFIG_DEFAULTS.outDir, fileProtocolRoot).toString()) {
|
|
68
67
|
const outDirPath = fileURLToPath(config.outDir);
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -37,7 +37,7 @@ async function dev(inlineConfig) {
|
|
|
37
37
|
await telemetry.record([]);
|
|
38
38
|
const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
|
|
39
39
|
const logger = restart.container.logger;
|
|
40
|
-
const currentVersion = "6.2.
|
|
40
|
+
const currentVersion = "6.2.1";
|
|
41
41
|
const isPrerelease = currentVersion.includes("-");
|
|
42
42
|
if (!isPrerelease) {
|
|
43
43
|
try {
|
|
@@ -24,6 +24,17 @@ const errorMap = (issue) => {
|
|
|
24
24
|
`> ${getTypeOrLiteralMsg(error)}`
|
|
25
25
|
) : `> ${prefix(key, getTypeOrLiteralMsg(error))}`
|
|
26
26
|
);
|
|
27
|
+
if (details.length === 0) {
|
|
28
|
+
if ("discriminator" in issue && issue.discriminator && "options" in issue) {
|
|
29
|
+
const options = issue.options;
|
|
30
|
+
if (Array.isArray(options)) {
|
|
31
|
+
details.push(
|
|
32
|
+
`> Expected \`${issue.discriminator}\` to be ${options.map((o) => `\`${stringify(o)}\``).join(" | ")}`
|
|
33
|
+
);
|
|
34
|
+
details.push("> Received `" + stringify(issue.input) + "`");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
27
38
|
if (details.length === 0) {
|
|
28
39
|
const expectedShapes = [];
|
|
29
40
|
for (const unionErrors of issue.errors) {
|
|
@@ -59,6 +70,22 @@ const errorMap = (issue) => {
|
|
|
59
70
|
return {
|
|
60
71
|
message: messages.concat(details).join("\n")
|
|
61
72
|
};
|
|
73
|
+
} else if (issue.code === "invalid_key") {
|
|
74
|
+
const keyIssues = issue.issues;
|
|
75
|
+
if (Array.isArray(keyIssues) && keyIssues.length > 0) {
|
|
76
|
+
const firstIssue = keyIssues[0];
|
|
77
|
+
const msg = firstIssue.message || "Invalid key in record";
|
|
78
|
+
return { message: prefix(baseErrorPath, msg) };
|
|
79
|
+
}
|
|
80
|
+
return { message: prefix(baseErrorPath, "Invalid key in record") };
|
|
81
|
+
} else if (issue.code === "invalid_element") {
|
|
82
|
+
const elementIssues = issue.issues;
|
|
83
|
+
if (Array.isArray(elementIssues) && elementIssues.length > 0) {
|
|
84
|
+
const firstIssue = elementIssues[0];
|
|
85
|
+
const msg = firstIssue.message || "Invalid element";
|
|
86
|
+
return { message: prefix(baseErrorPath, msg) };
|
|
87
|
+
}
|
|
88
|
+
return { message: prefix(baseErrorPath, "Invalid element") };
|
|
62
89
|
} else if (issue.code === "invalid_type") {
|
|
63
90
|
return {
|
|
64
91
|
message: prefix(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.1",
|
|
4
4
|
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "withastro",
|
|
@@ -158,8 +158,8 @@
|
|
|
158
158
|
"yargs-parser": "^22.0.0",
|
|
159
159
|
"zod": "^4.3.6",
|
|
160
160
|
"@astrojs/internal-helpers": "0.9.0",
|
|
161
|
-
"@astrojs/
|
|
162
|
-
"@astrojs/
|
|
161
|
+
"@astrojs/markdown-remark": "7.1.1",
|
|
162
|
+
"@astrojs/telemetry": "3.3.1"
|
|
163
163
|
},
|
|
164
164
|
"optionalDependencies": {
|
|
165
165
|
"sharp": "^0.34.0"
|
|
@@ -194,8 +194,8 @@
|
|
|
194
194
|
"undici": "^7.22.0",
|
|
195
195
|
"unified": "^11.0.5",
|
|
196
196
|
"vitest": "^4.1.0",
|
|
197
|
-
"
|
|
198
|
-
"
|
|
197
|
+
"@astrojs/check": "0.9.9",
|
|
198
|
+
"astro-scripts": "0.0.14"
|
|
199
199
|
},
|
|
200
200
|
"engines": {
|
|
201
201
|
"node": ">=22.12.0",
|