astro 5.16.7 → 5.16.8
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/assets/vite-plugin-assets.js +4 -4
- package/dist/cli/infra/build-time-astro-version-provider.js +1 -1
- package/dist/content/content-layer.js +3 -3
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/routing/manifest/create.js +9 -6
- package/dist/runtime/client/dev-toolbar/apps/audit/rules/perf.js +1 -0
- package/dist/vite-plugin-astro-server/base.js +3 -2
- package/dist/vite-plugin-astro-server/request.js +3 -0
- package/dist/vite-plugin-astro-server/response.js +4 -6
- package/package.json +5 -5
|
@@ -110,12 +110,12 @@ function assets({ fs, settings, sync, logger }) {
|
|
|
110
110
|
import * as fontsMod from 'virtual:astro:assets/fonts/internal';
|
|
111
111
|
import { createGetFontData } from "astro/assets/fonts/runtime";
|
|
112
112
|
|
|
113
|
-
export const viteFSConfig = ${JSON.stringify(resolvedConfig.server.fs
|
|
114
|
-
|
|
113
|
+
export const viteFSConfig = ${JSON.stringify(resolvedConfig.server.fs ?? {})};
|
|
114
|
+
|
|
115
115
|
export const safeModulePaths = new Set(${JSON.stringify(
|
|
116
116
|
// @ts-expect-error safeModulePaths is internal to Vite
|
|
117
|
-
Array.from(resolvedConfig.safeModulePaths)
|
|
118
|
-
)}
|
|
117
|
+
Array.from(resolvedConfig.safeModulePaths ?? [])
|
|
118
|
+
)});
|
|
119
119
|
|
|
120
120
|
const assetQueryParams = ${settings.adapter?.client?.assetQueryParams ? `new URLSearchParams(${JSON.stringify(
|
|
121
121
|
Array.from(settings.adapter.client.assetQueryParams.entries())
|
|
@@ -164,7 +164,7 @@ ${contentConfig.error.message}`);
|
|
|
164
164
|
logger.info("Content config changed");
|
|
165
165
|
shouldClear = true;
|
|
166
166
|
}
|
|
167
|
-
if (previousAstroVersion && previousAstroVersion !== "5.16.
|
|
167
|
+
if (previousAstroVersion && previousAstroVersion !== "5.16.8") {
|
|
168
168
|
logger.info("Astro version changed");
|
|
169
169
|
shouldClear = true;
|
|
170
170
|
}
|
|
@@ -172,8 +172,8 @@ ${contentConfig.error.message}`);
|
|
|
172
172
|
logger.info("Clearing content store");
|
|
173
173
|
this.#store.clearAll();
|
|
174
174
|
}
|
|
175
|
-
if ("5.16.
|
|
176
|
-
await this.#store.metaStore().set("astro-version", "5.16.
|
|
175
|
+
if ("5.16.8") {
|
|
176
|
+
await this.#store.metaStore().set("astro-version", "5.16.8");
|
|
177
177
|
}
|
|
178
178
|
if (currentConfigDigest) {
|
|
179
179
|
await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
|
package/dist/core/constants.js
CHANGED
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 = "5.16.
|
|
25
|
+
const currentVersion = "5.16.8";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
package/dist/core/messages.js
CHANGED
|
@@ -38,7 +38,7 @@ function serverStart({
|
|
|
38
38
|
host,
|
|
39
39
|
base
|
|
40
40
|
}) {
|
|
41
|
-
const version = "5.16.
|
|
41
|
+
const version = "5.16.8";
|
|
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${"5.16.
|
|
278
|
+
`v${"5.16.8"}`
|
|
279
279
|
)} ${headline}`
|
|
280
280
|
);
|
|
281
281
|
}
|
|
@@ -66,6 +66,7 @@ function createFileBasedRoutes({ settings, cwd, fsMod }, logger) {
|
|
|
66
66
|
...SUPPORTED_MARKDOWN_FILE_EXTENSIONS,
|
|
67
67
|
...settings.pageExtensions
|
|
68
68
|
]);
|
|
69
|
+
const invalidPotentialPages = /* @__PURE__ */ new Set([".tsx", ".jsx", ".vue", ".svelte"]);
|
|
69
70
|
const validEndpointExtensions = /* @__PURE__ */ new Set([".js", ".ts"]);
|
|
70
71
|
const localFs = fsMod ?? nodeFs;
|
|
71
72
|
const prerender = getPrerenderDefault(settings.config);
|
|
@@ -85,12 +86,14 @@ function createFileBasedRoutes({ settings, cwd, fsMod }, logger) {
|
|
|
85
86
|
continue;
|
|
86
87
|
}
|
|
87
88
|
if (!isDir && !validPageExtensions.has(ext) && !validEndpointExtensions.has(ext)) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
if (invalidPotentialPages.has(ext)) {
|
|
90
|
+
logger.warn(
|
|
91
|
+
null,
|
|
92
|
+
`Unsupported file type ${colors.bold(
|
|
93
|
+
resolved
|
|
94
|
+
)} found in pages directory. Only Astro files can be used as pages. Prefix filename with an underscore (\`_\`) to ignore this warning, or move the file outside of the pages directory.`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
94
97
|
continue;
|
|
95
98
|
}
|
|
96
99
|
const segment = isDir ? basename : name;
|
|
@@ -6,6 +6,7 @@ const perf = [
|
|
|
6
6
|
message: "This image could be replaced with the Image component to improve performance.",
|
|
7
7
|
selector: "img:not([data-image-component])",
|
|
8
8
|
async match(element) {
|
|
9
|
+
if (element.closest("astro-island")) return false;
|
|
9
10
|
const src = element.getAttribute("src");
|
|
10
11
|
if (!src) return false;
|
|
11
12
|
if (src.startsWith("data:")) return false;
|
|
@@ -6,8 +6,9 @@ import { notFoundTemplate, subpathNotUsedTemplate } from "../template/4xx.js";
|
|
|
6
6
|
import { writeHtmlResponse } from "./response.js";
|
|
7
7
|
function baseMiddleware(settings, logger) {
|
|
8
8
|
const { config } = settings;
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const base = config.base || "/";
|
|
10
|
+
const site = config.site ? new URL(base, config.site) : void 0;
|
|
11
|
+
const devRootURL = new URL(base, "http://localhost");
|
|
11
12
|
const devRoot = site ? site.pathname : devRootURL.pathname;
|
|
12
13
|
const devRootReplacement = devRoot.endsWith("/") ? "/" : "";
|
|
13
14
|
return function devBaseMiddleware(req, res, next) {
|
|
@@ -27,6 +27,9 @@ async function handleRequest({
|
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
if (config.trailingSlash === "never" && pathname === "/" && config.base !== "/") {
|
|
31
|
+
pathname = "";
|
|
32
|
+
}
|
|
30
33
|
url.pathname = removeTrailingForwardSlash(config.base) + pathname;
|
|
31
34
|
if (config.trailingSlash === "never") {
|
|
32
35
|
url.pathname = removeTrailingForwardSlash(url.pathname);
|
|
@@ -43,13 +43,11 @@ function writeRedirectResponse(res, statusCode, location) {
|
|
|
43
43
|
}
|
|
44
44
|
async function writeWebResponse(res, webResponse) {
|
|
45
45
|
const { status, headers, body, statusText } = webResponse;
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
res.setHeader("set-cookie", setCookieHeaders);
|
|
49
|
-
}
|
|
46
|
+
const setCookiesFromResponse = Array.from(getSetCookiesFromResponse(webResponse));
|
|
47
|
+
const setCookieHeaders = [...setCookiesFromResponse, ...headers.getSetCookie()];
|
|
50
48
|
const _headers = Object.fromEntries(headers.entries());
|
|
51
|
-
if (
|
|
52
|
-
_headers["set-cookie"] =
|
|
49
|
+
if (setCookieHeaders.length) {
|
|
50
|
+
_headers["set-cookie"] = setCookieHeaders;
|
|
53
51
|
}
|
|
54
52
|
if (!(res instanceof Http2ServerResponse)) {
|
|
55
53
|
res.statusMessage = statusText;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "5.16.
|
|
3
|
+
"version": "5.16.8",
|
|
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",
|
|
@@ -154,9 +154,9 @@
|
|
|
154
154
|
"zod": "^3.25.76",
|
|
155
155
|
"zod-to-json-schema": "^3.25.1",
|
|
156
156
|
"zod-to-ts": "^1.2.0",
|
|
157
|
+
"@astrojs/internal-helpers": "0.7.5",
|
|
157
158
|
"@astrojs/markdown-remark": "6.3.10",
|
|
158
|
-
"@astrojs/telemetry": "3.3.0"
|
|
159
|
-
"@astrojs/internal-helpers": "0.7.5"
|
|
159
|
+
"@astrojs/telemetry": "3.3.0"
|
|
160
160
|
},
|
|
161
161
|
"optionalDependencies": {
|
|
162
162
|
"sharp": "^0.34.0"
|
|
@@ -195,8 +195,8 @@
|
|
|
195
195
|
"undici": "^6.22.0",
|
|
196
196
|
"unified": "^11.0.5",
|
|
197
197
|
"vitest": "^3.2.4",
|
|
198
|
-
"
|
|
199
|
-
"
|
|
198
|
+
"@astrojs/check": "0.9.6",
|
|
199
|
+
"astro-scripts": "0.0.14"
|
|
200
200
|
},
|
|
201
201
|
"engines": {
|
|
202
202
|
"node": "18.20.8 || ^20.3.0 || >=22.0.0",
|