astro 5.5.4 → 5.5.6
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/actions/noop-actions.d.ts +2 -0
- package/dist/actions/noop-actions.js +6 -0
- package/dist/actions/runtime/utils.d.ts +8 -2
- package/dist/cli/add/index.js +1 -1
- package/dist/content/content-layer.js +3 -3
- package/dist/core/app/index.js +6 -1
- package/dist/core/app/types.d.ts +1 -1
- package/dist/core/base-pipeline.d.ts +2 -2
- package/dist/core/base-pipeline.js +3 -2
- package/dist/core/build/generate.js +3 -2
- package/dist/core/build/plugins/plugin-ssr.js +1 -2
- package/dist/core/constants.js +1 -1
- package/dist/core/cookies/cookies.d.ts +2 -1
- package/dist/core/cookies/cookies.js +12 -9
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/errors-data.d.ts +1 -1
- package/dist/core/errors/errors-data.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/render-context.js +5 -2
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.js +12 -0
- package/dist/i18n/utils.js +7 -11
- package/dist/types/public/context.d.ts +1 -1
- package/package.json +11 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { APIContext } from '../../types/public/context.js';
|
|
1
|
+
import type { APIContext, AstroSharedContext } from '../../types/public/context.js';
|
|
2
2
|
import type { SerializedActionResult } from './virtual/shared.js';
|
|
3
3
|
export type ActionPayload = {
|
|
4
4
|
actionResult: SerializedActionResult;
|
|
@@ -10,7 +10,13 @@ export type Locals = {
|
|
|
10
10
|
export declare const ACTION_API_CONTEXT_SYMBOL: unique symbol;
|
|
11
11
|
export declare const formContentTypes: string[];
|
|
12
12
|
export declare function hasContentType(contentType: string, expected: string[]): boolean;
|
|
13
|
-
export type ActionAPIContext =
|
|
13
|
+
export type ActionAPIContext = Pick<APIContext, 'rewrite' | 'request' | 'url' | 'isPrerendered' | 'locals' | 'clientAddress' | 'cookies' | 'currentLocale' | 'generator' | 'routePattern' | 'site' | 'params' | 'preferredLocale' | 'preferredLocaleList' | 'originPathname' | 'session'> & {
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated
|
|
16
|
+
* The use of `rewrite` in Actions is deprecated
|
|
17
|
+
*/
|
|
18
|
+
rewrite: AstroSharedContext['rewrite'];
|
|
19
|
+
};
|
|
14
20
|
export type MaybePromise<T> = T | Promise<T>;
|
|
15
21
|
/**
|
|
16
22
|
* Used to preserve the input schema type in the error object.
|
package/dist/cli/add/index.js
CHANGED
|
@@ -143,7 +143,7 @@ async function add(names, { flags }) {
|
|
|
143
143
|
logger.info(
|
|
144
144
|
"SKIP_FORMAT",
|
|
145
145
|
`
|
|
146
|
-
@
|
|
146
|
+
@tailwindcss/vite requires additional configuration. Please refer to https://docs.astro.build/en/guides/integrations-guide/tailwind/`
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
149
|
} else {
|
|
@@ -153,7 +153,7 @@ ${contentConfig.error.message}`);
|
|
|
153
153
|
logger.info("Content config changed");
|
|
154
154
|
shouldClear = true;
|
|
155
155
|
}
|
|
156
|
-
if (previousAstroVersion && previousAstroVersion !== "5.5.
|
|
156
|
+
if (previousAstroVersion && previousAstroVersion !== "5.5.6") {
|
|
157
157
|
logger.info("Astro version changed");
|
|
158
158
|
shouldClear = true;
|
|
159
159
|
}
|
|
@@ -161,8 +161,8 @@ ${contentConfig.error.message}`);
|
|
|
161
161
|
logger.info("Clearing content store");
|
|
162
162
|
this.#store.clearAll();
|
|
163
163
|
}
|
|
164
|
-
if ("5.5.
|
|
165
|
-
await this.#store.metaStore().set("astro-version", "5.5.
|
|
164
|
+
if ("5.5.6") {
|
|
165
|
+
await this.#store.metaStore().set("astro-version", "5.5.6");
|
|
166
166
|
}
|
|
167
167
|
if (currentConfigDigest) {
|
|
168
168
|
await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
|
package/dist/core/app/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { collapseDuplicateTrailingSlashes, hasFileExtension } from "@astrojs/internal-helpers/path";
|
|
2
2
|
import { normalizeTheLocale } from "../../i18n/index.js";
|
|
3
3
|
import {
|
|
4
|
+
DEFAULT_404_COMPONENT,
|
|
4
5
|
REROUTABLE_STATUS_CODES,
|
|
5
6
|
REROUTE_DIRECTIVE_HEADER,
|
|
6
7
|
clientAddressSymbol,
|
|
@@ -36,7 +37,6 @@ class App {
|
|
|
36
37
|
#baseWithoutTrailingSlash;
|
|
37
38
|
#pipeline;
|
|
38
39
|
#adapterLogger;
|
|
39
|
-
#renderOptionsDeprecationWarningShown = false;
|
|
40
40
|
constructor(manifest, streaming = true) {
|
|
41
41
|
this.#manifest = manifest;
|
|
42
42
|
this.#manifestData = {
|
|
@@ -234,6 +234,11 @@ class App {
|
|
|
234
234
|
this.#logger.debug("router", "Astro matched the following route for " + request.url);
|
|
235
235
|
this.#logger.debug("router", "RouteData:\n" + routeData);
|
|
236
236
|
}
|
|
237
|
+
if (!routeData) {
|
|
238
|
+
routeData = this.#manifestData.routes.find(
|
|
239
|
+
(route) => route.component === "404.astro" || route.component === DEFAULT_404_COMPONENT
|
|
240
|
+
);
|
|
241
|
+
}
|
|
237
242
|
if (!routeData) {
|
|
238
243
|
this.#logger.debug("router", "Astro hasn't found routes that match " + request.url);
|
|
239
244
|
this.#logger.debug("router", "Here's the available routes:\n", this.#manifestData);
|
package/dist/core/app/types.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export type SSRManifest = {
|
|
|
67
67
|
key: Promise<CryptoKey>;
|
|
68
68
|
i18n: SSRManifestI18n | undefined;
|
|
69
69
|
middleware?: () => Promise<AstroMiddlewareInstance> | AstroMiddlewareInstance;
|
|
70
|
-
actions?: SSRActions;
|
|
70
|
+
actions?: () => Promise<SSRActions> | SSRActions;
|
|
71
71
|
checkOrigin: boolean;
|
|
72
72
|
sessionConfig?: ResolvedSessionConfig<any>;
|
|
73
73
|
cacheDir: string | URL;
|
|
@@ -51,7 +51,7 @@ export declare abstract class Pipeline {
|
|
|
51
51
|
route: string;
|
|
52
52
|
component: string;
|
|
53
53
|
}[];
|
|
54
|
-
readonly actions: SSRActions | undefined;
|
|
54
|
+
readonly actions: (() => Promise<SSRActions> | SSRActions) | undefined;
|
|
55
55
|
readonly internalMiddleware: MiddlewareHandler[];
|
|
56
56
|
resolvedMiddleware: MiddlewareHandler | undefined;
|
|
57
57
|
resolvedActions: SSRActions | undefined;
|
|
@@ -81,7 +81,7 @@ export declare abstract class Pipeline {
|
|
|
81
81
|
matchesComponent(filePath: URL): boolean;
|
|
82
82
|
route: string;
|
|
83
83
|
component: string;
|
|
84
|
-
}[], actions?: SSRActions | undefined);
|
|
84
|
+
}[], actions?: (() => Promise<SSRActions> | SSRActions) | undefined);
|
|
85
85
|
abstract headElements(routeData: RouteData): Promise<HeadElements> | HeadElements;
|
|
86
86
|
abstract componentMetadata(routeData: RouteData): Promise<SSRResult['componentMetadata']> | void;
|
|
87
87
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NOOP_ACTIONS_MOD } from "../actions/noop-actions.js";
|
|
1
2
|
import { createI18nMiddleware } from "../i18n/middleware.js";
|
|
2
3
|
import { createOriginCheckMiddleware } from "./app/middlewares.js";
|
|
3
4
|
import { ActionNotFoundError } from "./errors/errors-data.js";
|
|
@@ -63,9 +64,9 @@ class Pipeline {
|
|
|
63
64
|
if (this.resolvedActions) {
|
|
64
65
|
return this.resolvedActions;
|
|
65
66
|
} else if (this.actions) {
|
|
66
|
-
return this.actions;
|
|
67
|
+
return await this.actions();
|
|
67
68
|
}
|
|
68
|
-
return
|
|
69
|
+
return NOOP_ACTIONS_MOD;
|
|
69
70
|
}
|
|
70
71
|
async getAction(path) {
|
|
71
72
|
const pathKeys = path.split(".").map((key) => decodeURIComponent(key));
|
|
@@ -3,6 +3,7 @@ import os from "node:os";
|
|
|
3
3
|
import { bgGreen, black, blue, bold, dim, green, magenta, red, yellow } from "kleur/colors";
|
|
4
4
|
import PLimit from "p-limit";
|
|
5
5
|
import PQueue from "p-queue";
|
|
6
|
+
import { NOOP_ACTIONS_MOD } from "../../actions/noop-actions.js";
|
|
6
7
|
import {
|
|
7
8
|
generateImagesForPath,
|
|
8
9
|
getStaticImageList,
|
|
@@ -44,7 +45,7 @@ async function generatePages(options, internals) {
|
|
|
44
45
|
const renderersEntryUrl = new URL("renderers.mjs", baseDirectory);
|
|
45
46
|
const renderers = await import(renderersEntryUrl.toString());
|
|
46
47
|
const middleware = internals.middlewareEntryPoint ? await import(internals.middlewareEntryPoint.toString()).then((mod) => mod.onRequest) : NOOP_MIDDLEWARE_FN;
|
|
47
|
-
const actions = internals.astroActionsEntryPoint ? await import(internals.astroActionsEntryPoint.toString()).then((mod) => mod) :
|
|
48
|
+
const actions = internals.astroActionsEntryPoint ? await import(internals.astroActionsEntryPoint.toString()).then((mod) => mod) : NOOP_ACTIONS_MOD;
|
|
48
49
|
manifest = createBuildManifest(
|
|
49
50
|
options.settings,
|
|
50
51
|
internals,
|
|
@@ -405,7 +406,7 @@ function createBuildManifest(settings, internals, renderers, middleware, actions
|
|
|
405
406
|
onRequest: middleware
|
|
406
407
|
};
|
|
407
408
|
},
|
|
408
|
-
actions,
|
|
409
|
+
actions: () => actions,
|
|
409
410
|
checkOrigin: (settings.config.security?.checkOrigin && settings.buildOutput === "server") ?? false,
|
|
410
411
|
key
|
|
411
412
|
};
|
|
@@ -139,7 +139,6 @@ function generateSSRCode(adapter, middlewareId) {
|
|
|
139
139
|
const edgeMiddleware = adapter?.adapterFeatures?.edgeMiddleware ?? false;
|
|
140
140
|
const imports = [
|
|
141
141
|
`import { renderers } from '${RENDERERS_MODULE_ID}';`,
|
|
142
|
-
`import * as actions from '${ASTRO_ACTIONS_INTERNAL_MODULE_ID}';`,
|
|
143
142
|
`import * as serverEntrypointModule from '${ADAPTER_VIRTUAL_MODULE_ID}';`,
|
|
144
143
|
`import { manifest as defaultManifest } from '${SSR_MANIFEST_VIRTUAL_MODULE_ID}';`,
|
|
145
144
|
`import { serverIslandMap } from '${VIRTUAL_ISLAND_MAP_ID}';`
|
|
@@ -150,7 +149,7 @@ function generateSSRCode(adapter, middlewareId) {
|
|
|
150
149
|
` pageMap,`,
|
|
151
150
|
` serverIslandMap,`,
|
|
152
151
|
` renderers,`,
|
|
153
|
-
` actions,`,
|
|
152
|
+
` actions: () => import("${ASTRO_ACTIONS_INTERNAL_MODULE_ID}"),`,
|
|
154
153
|
` middleware: ${edgeMiddleware ? "undefined" : `() => import("${middlewareId}")`}`,
|
|
155
154
|
`});`,
|
|
156
155
|
`const _args = ${adapter.args ? JSON.stringify(adapter.args, null, 4) : "undefined"};`,
|
package/dist/core/constants.js
CHANGED
|
@@ -45,9 +45,10 @@ declare class AstroCookies implements AstroCookiesInterface {
|
|
|
45
45
|
* Astro.cookies.has(key) returns a boolean indicating whether this cookie is either
|
|
46
46
|
* part of the initial request or set via Astro.cookies.set(key)
|
|
47
47
|
* @param key The cookie to check for.
|
|
48
|
+
* @param _options This parameter is no longer used.
|
|
48
49
|
* @returns
|
|
49
50
|
*/
|
|
50
|
-
has(key: string,
|
|
51
|
+
has(key: string, _options?: AstroCookieGetOptions): boolean;
|
|
51
52
|
/**
|
|
52
53
|
* Astro.cookies.set(key, value) is used to set a cookie's value. If provided
|
|
53
54
|
* an object it will be stringified via JSON.stringify(value). Additionally you
|
|
@@ -3,6 +3,7 @@ import { AstroError, AstroErrorData } from "../errors/index.js";
|
|
|
3
3
|
const DELETED_EXPIRATION = /* @__PURE__ */ new Date(0);
|
|
4
4
|
const DELETED_VALUE = "deleted";
|
|
5
5
|
const responseSentSymbol = Symbol.for("astro.responseSent");
|
|
6
|
+
const identity = (value) => value;
|
|
6
7
|
class AstroCookie {
|
|
7
8
|
constructor(value) {
|
|
8
9
|
this.value = value;
|
|
@@ -73,11 +74,12 @@ class AstroCookies {
|
|
|
73
74
|
return void 0;
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
const
|
|
77
|
+
const decode = options?.decode ?? decodeURIComponent;
|
|
78
|
+
const values = this.#ensureParsed();
|
|
77
79
|
if (key in values) {
|
|
78
80
|
const value = values[key];
|
|
79
81
|
if (value) {
|
|
80
|
-
return new AstroCookie(value);
|
|
82
|
+
return new AstroCookie(decode(value));
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -85,15 +87,16 @@ class AstroCookies {
|
|
|
85
87
|
* Astro.cookies.has(key) returns a boolean indicating whether this cookie is either
|
|
86
88
|
* part of the initial request or set via Astro.cookies.set(key)
|
|
87
89
|
* @param key The cookie to check for.
|
|
90
|
+
* @param _options This parameter is no longer used.
|
|
88
91
|
* @returns
|
|
89
92
|
*/
|
|
90
|
-
has(key,
|
|
93
|
+
has(key, _options) {
|
|
91
94
|
if (this.#outgoing?.has(key)) {
|
|
92
95
|
let [, , isSetValue] = this.#outgoing.get(key);
|
|
93
96
|
return isSetValue;
|
|
94
97
|
}
|
|
95
|
-
const values = this.#ensureParsed(
|
|
96
|
-
return
|
|
98
|
+
const values = this.#ensureParsed();
|
|
99
|
+
return values[key] !== void 0;
|
|
97
100
|
}
|
|
98
101
|
/**
|
|
99
102
|
* Astro.cookies.set(key, value) is used to set a cookie's value. If provided
|
|
@@ -170,9 +173,9 @@ class AstroCookies {
|
|
|
170
173
|
cookies.#consumed = true;
|
|
171
174
|
return cookies.headers();
|
|
172
175
|
}
|
|
173
|
-
#ensureParsed(
|
|
176
|
+
#ensureParsed() {
|
|
174
177
|
if (!this.#requestValues) {
|
|
175
|
-
this.#parse(
|
|
178
|
+
this.#parse();
|
|
176
179
|
}
|
|
177
180
|
if (!this.#requestValues) {
|
|
178
181
|
this.#requestValues = {};
|
|
@@ -185,12 +188,12 @@ class AstroCookies {
|
|
|
185
188
|
}
|
|
186
189
|
return this.#outgoing;
|
|
187
190
|
}
|
|
188
|
-
#parse(
|
|
191
|
+
#parse() {
|
|
189
192
|
const raw = this.#request.headers.get("cookie");
|
|
190
193
|
if (!raw) {
|
|
191
194
|
return;
|
|
192
195
|
}
|
|
193
|
-
this.#requestValues = parse(raw,
|
|
196
|
+
this.#requestValues = parse(raw, { decode: identity });
|
|
194
197
|
}
|
|
195
198
|
}
|
|
196
199
|
export {
|
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.5.
|
|
25
|
+
const currentVersion = "5.5.6";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
|
@@ -16,7 +16,7 @@ const ClientAddressNotAvailable = {
|
|
|
16
16
|
const PrerenderClientAddressNotAvailable = {
|
|
17
17
|
name: "PrerenderClientAddressNotAvailable",
|
|
18
18
|
title: "`Astro.clientAddress` cannot be used inside prerendered routes.",
|
|
19
|
-
message: `\`Astro.clientAddress\` cannot be used inside prerendered
|
|
19
|
+
message: (name) => `\`Astro.clientAddress\` cannot be used inside prerendered route ${name}`
|
|
20
20
|
};
|
|
21
21
|
const StaticClientAddressNotAvailable = {
|
|
22
22
|
name: "StaticClientAddressNotAvailable",
|
package/dist/core/messages.js
CHANGED
|
@@ -38,7 +38,7 @@ function serverStart({
|
|
|
38
38
|
host,
|
|
39
39
|
base
|
|
40
40
|
}) {
|
|
41
|
-
const version = "5.5.
|
|
41
|
+
const version = "5.5.6";
|
|
42
42
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
43
43
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
44
44
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -282,7 +282,7 @@ function printHelp({
|
|
|
282
282
|
message.push(
|
|
283
283
|
linebreak(),
|
|
284
284
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
285
|
-
`v${"5.5.
|
|
285
|
+
`v${"5.5.6"}`
|
|
286
286
|
)} ${headline}`
|
|
287
287
|
);
|
|
288
288
|
}
|
|
@@ -238,7 +238,7 @@ class RenderContext {
|
|
|
238
238
|
reroutePayload,
|
|
239
239
|
this.request
|
|
240
240
|
);
|
|
241
|
-
if (this.pipeline.serverLike
|
|
241
|
+
if (this.pipeline.serverLike && !this.routeData.prerender && routeData.prerender) {
|
|
242
242
|
throw new AstroError({
|
|
243
243
|
...ForbiddenRewrite,
|
|
244
244
|
message: ForbiddenRewrite.message(this.pathname, pathname, routeData.component),
|
|
@@ -463,7 +463,10 @@ class RenderContext {
|
|
|
463
463
|
getClientAddress() {
|
|
464
464
|
const { pipeline, request, routeData, clientAddress } = this;
|
|
465
465
|
if (routeData.prerender) {
|
|
466
|
-
throw new AstroError(
|
|
466
|
+
throw new AstroError({
|
|
467
|
+
...AstroErrorData.PrerenderClientAddressNotAvailable,
|
|
468
|
+
message: AstroErrorData.PrerenderClientAddressNotAvailable.message(routeData.component)
|
|
469
|
+
});
|
|
467
470
|
}
|
|
468
471
|
if (clientAddress) {
|
|
469
472
|
return clientAddress;
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -78,6 +78,7 @@ export declare function normalizeTheLocale(locale: string): string;
|
|
|
78
78
|
* Returns an array of only locales, by picking the `code`
|
|
79
79
|
* @param locales
|
|
80
80
|
*/
|
|
81
|
+
export declare function getAllCodes(locales: Locales): string[];
|
|
81
82
|
export declare function toCodes(locales: Locales): string[];
|
|
82
83
|
/**
|
|
83
84
|
* It returns the array of paths
|
package/dist/i18n/index.js
CHANGED
|
@@ -132,6 +132,17 @@ function getLocaleByPath(path, locales) {
|
|
|
132
132
|
function normalizeTheLocale(locale) {
|
|
133
133
|
return locale.replaceAll("_", "-").toLowerCase();
|
|
134
134
|
}
|
|
135
|
+
function getAllCodes(locales) {
|
|
136
|
+
const result = [];
|
|
137
|
+
for (const loopLocale of locales) {
|
|
138
|
+
if (typeof loopLocale === "string") {
|
|
139
|
+
result.push(loopLocale);
|
|
140
|
+
} else {
|
|
141
|
+
result.push(...loopLocale.codes);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
135
146
|
function toCodes(locales) {
|
|
136
147
|
return locales.map((loopLocale) => {
|
|
137
148
|
if (typeof loopLocale === "string") {
|
|
@@ -258,6 +269,7 @@ function createMiddleware(i18nManifest, base, trailingSlash, format) {
|
|
|
258
269
|
}
|
|
259
270
|
export {
|
|
260
271
|
createMiddleware,
|
|
272
|
+
getAllCodes,
|
|
261
273
|
getLocaleAbsoluteUrl,
|
|
262
274
|
getLocaleAbsoluteUrlList,
|
|
263
275
|
getLocaleByPath,
|
package/dist/i18n/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAllCodes, normalizeTheLocale } from "./index.js";
|
|
2
2
|
function parseLocale(header) {
|
|
3
3
|
if (header === "*") {
|
|
4
4
|
return [{ locale: header, qualityValue: void 0 }];
|
|
@@ -35,7 +35,7 @@ function parseLocale(header) {
|
|
|
35
35
|
return result;
|
|
36
36
|
}
|
|
37
37
|
function sortAndFilterLocales(browserLocaleList, locales) {
|
|
38
|
-
const normalizedLocales =
|
|
38
|
+
const normalizedLocales = getAllCodes(locales).map(normalizeTheLocale);
|
|
39
39
|
return browserLocaleList.filter((browserLocale) => {
|
|
40
40
|
if (browserLocale.locale !== "*") {
|
|
41
41
|
return normalizedLocales.includes(normalizeTheLocale(browserLocale.locale));
|
|
@@ -59,11 +59,13 @@ function computePreferredLocale(request, locales) {
|
|
|
59
59
|
if (typeof currentLocale === "string") {
|
|
60
60
|
if (normalizeTheLocale(currentLocale) === normalizeTheLocale(firstResult.locale)) {
|
|
61
61
|
result = currentLocale;
|
|
62
|
+
break;
|
|
62
63
|
}
|
|
63
64
|
} else {
|
|
64
65
|
for (const currentCode of currentLocale.codes) {
|
|
65
66
|
if (normalizeTheLocale(currentCode) === normalizeTheLocale(firstResult.locale)) {
|
|
66
|
-
result =
|
|
67
|
+
result = currentCode;
|
|
68
|
+
break;
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
}
|
|
@@ -78,13 +80,7 @@ function computePreferredLocaleList(request, locales) {
|
|
|
78
80
|
if (acceptHeader) {
|
|
79
81
|
const browserLocaleList = sortAndFilterLocales(parseLocale(acceptHeader), locales);
|
|
80
82
|
if (browserLocaleList.length === 1 && browserLocaleList.at(0).locale === "*") {
|
|
81
|
-
return locales
|
|
82
|
-
if (typeof locale === "string") {
|
|
83
|
-
return locale;
|
|
84
|
-
} else {
|
|
85
|
-
return locale.codes.at(0);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
83
|
+
return getAllCodes(locales);
|
|
88
84
|
} else if (browserLocaleList.length > 0) {
|
|
89
85
|
for (const browserLocale of browserLocaleList) {
|
|
90
86
|
for (const loopLocale of locales) {
|
|
@@ -95,7 +91,7 @@ function computePreferredLocaleList(request, locales) {
|
|
|
95
91
|
} else {
|
|
96
92
|
for (const code of loopLocale.codes) {
|
|
97
93
|
if (code === browserLocale.locale) {
|
|
98
|
-
result.push(
|
|
94
|
+
result.push(code);
|
|
99
95
|
}
|
|
100
96
|
}
|
|
101
97
|
}
|
|
@@ -229,7 +229,7 @@ export interface AstroGlobalPartial {
|
|
|
229
229
|
*/
|
|
230
230
|
generator: string;
|
|
231
231
|
}
|
|
232
|
-
interface AstroSharedContext<Props extends Record<string, any> = Record<string, any>, RouteParams extends Record<string, string | undefined> = Record<string, string | undefined>> {
|
|
232
|
+
export interface AstroSharedContext<Props extends Record<string, any> = Record<string, any>, RouteParams extends Record<string, string | undefined> = Record<string, string | undefined>> {
|
|
233
233
|
/**
|
|
234
234
|
* The address (usually IP address) of the user.
|
|
235
235
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.6",
|
|
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",
|
|
@@ -136,12 +136,12 @@
|
|
|
136
136
|
"neotraverse": "^0.6.18",
|
|
137
137
|
"p-limit": "^6.2.0",
|
|
138
138
|
"p-queue": "^8.1.0",
|
|
139
|
-
"package-manager-detector": "^1.
|
|
139
|
+
"package-manager-detector": "^1.1.0",
|
|
140
140
|
"picomatch": "^4.0.2",
|
|
141
141
|
"prompts": "^2.4.2",
|
|
142
142
|
"rehype": "^13.0.2",
|
|
143
143
|
"semver": "^7.7.1",
|
|
144
|
-
"shiki": "^3.
|
|
144
|
+
"shiki": "^3.2.1",
|
|
145
145
|
"tinyexec": "^0.3.2",
|
|
146
146
|
"tinyglobby": "^0.2.12",
|
|
147
147
|
"tsconfck": "^3.1.5",
|
|
@@ -149,13 +149,13 @@
|
|
|
149
149
|
"unist-util-visit": "^5.0.0",
|
|
150
150
|
"unstorage": "^1.15.0",
|
|
151
151
|
"vfile": "^6.0.3",
|
|
152
|
-
"vite": "^6.2.
|
|
152
|
+
"vite": "^6.2.4",
|
|
153
153
|
"vitefu": "^1.0.6",
|
|
154
154
|
"xxhash-wasm": "^1.1.0",
|
|
155
155
|
"yargs-parser": "^21.1.1",
|
|
156
156
|
"yocto-spinner": "^0.2.1",
|
|
157
157
|
"zod": "^3.24.2",
|
|
158
|
-
"zod-to-json-schema": "^3.24.
|
|
158
|
+
"zod-to-json-schema": "^3.24.5",
|
|
159
159
|
"zod-to-ts": "^1.2.0",
|
|
160
160
|
"@astrojs/internal-helpers": "0.6.1",
|
|
161
161
|
"@astrojs/markdown-remark": "6.3.1",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
},
|
|
167
167
|
"devDependencies": {
|
|
168
168
|
"@astrojs/check": "^0.9.4",
|
|
169
|
-
"@playwright/test": "^1.51.
|
|
169
|
+
"@playwright/test": "^1.51.1",
|
|
170
170
|
"@types/aria-query": "^5.0.4",
|
|
171
171
|
"@types/common-ancestor-path": "^1.0.2",
|
|
172
172
|
"@types/cssesc": "^3.0.2",
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
"@types/js-yaml": "^4.0.9",
|
|
180
180
|
"@types/picomatch": "^3.0.2",
|
|
181
181
|
"@types/prompts": "^2.4.9",
|
|
182
|
-
"@types/semver": "^7.
|
|
182
|
+
"@types/semver": "^7.7.0",
|
|
183
183
|
"@types/yargs-parser": "^21.0.3",
|
|
184
184
|
"cheerio": "1.0.0",
|
|
185
185
|
"eol": "^0.10.0",
|
|
@@ -194,11 +194,11 @@
|
|
|
194
194
|
"rehype-slug": "^6.0.0",
|
|
195
195
|
"rehype-toc": "^3.0.2",
|
|
196
196
|
"remark-code-titles": "^0.1.2",
|
|
197
|
-
"rollup": "^4.
|
|
198
|
-
"sass": "^1.
|
|
199
|
-
"undici": "^7.
|
|
197
|
+
"rollup": "^4.37.0",
|
|
198
|
+
"sass": "^1.86.0",
|
|
199
|
+
"undici": "^7.5.0",
|
|
200
200
|
"unified": "^11.0.5",
|
|
201
|
-
"vitest": "^3.0.
|
|
201
|
+
"vitest": "^3.0.9",
|
|
202
202
|
"astro-scripts": "0.0.14"
|
|
203
203
|
},
|
|
204
204
|
"engines": {
|