astro 2.0.15 → 2.0.16
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/core/app/index.d.ts +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/cookies/response.d.ts +1 -1
- package/dist/core/cookies/response.js +2 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/vite-plugin-astro-server/response.js +10 -6
- package/dist/vite-plugin-head-propagation/index.js +4 -4
- package/package.json +4 -4
package/dist/core/app/index.d.ts
CHANGED
|
@@ -12,5 +12,5 @@ export declare class App {
|
|
|
12
12
|
removeBase(pathname: string): string;
|
|
13
13
|
match(request: Request, { matchNotFound }?: MatchOptions): RouteData | undefined;
|
|
14
14
|
render(request: Request, routeData?: RouteData): Promise<Response>;
|
|
15
|
-
setCookieHeaders(response: Response): Generator<string,
|
|
15
|
+
setCookieHeaders(response: Response): Generator<string, string[], unknown>;
|
|
16
16
|
}
|
package/dist/core/constants.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AstroCookies } from './cookies';
|
|
2
2
|
export declare function attachToResponse(response: Response, cookies: AstroCookies): void;
|
|
3
|
-
export declare function getSetCookiesFromResponse(response: Response): Generator<string,
|
|
3
|
+
export declare function getSetCookiesFromResponse(response: Response): Generator<string, string[]>;
|
|
@@ -13,11 +13,12 @@ function getFromResponse(response) {
|
|
|
13
13
|
function* getSetCookiesFromResponse(response) {
|
|
14
14
|
const cookies = getFromResponse(response);
|
|
15
15
|
if (!cookies) {
|
|
16
|
-
return;
|
|
16
|
+
return [];
|
|
17
17
|
}
|
|
18
18
|
for (const headerValue of cookies.headers()) {
|
|
19
19
|
yield headerValue;
|
|
20
20
|
}
|
|
21
|
+
return [];
|
|
21
22
|
}
|
|
22
23
|
export {
|
|
23
24
|
attachToResponse,
|
package/dist/core/dev/dev.js
CHANGED
|
@@ -31,7 +31,7 @@ async function dev(settings, options) {
|
|
|
31
31
|
isRestart: options.isRestart
|
|
32
32
|
})
|
|
33
33
|
);
|
|
34
|
-
const currentVersion = "2.0.
|
|
34
|
+
const currentVersion = "2.0.16";
|
|
35
35
|
if (currentVersion.includes("-")) {
|
|
36
36
|
warn(options.logging, null, msg.prerelease({ currentVersion }));
|
|
37
37
|
}
|
package/dist/core/messages.js
CHANGED
|
@@ -47,7 +47,7 @@ function serverStart({
|
|
|
47
47
|
base,
|
|
48
48
|
isRestart = false
|
|
49
49
|
}) {
|
|
50
|
-
const version = "2.0.
|
|
50
|
+
const version = "2.0.16";
|
|
51
51
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
52
52
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
53
53
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -233,7 +233,7 @@ function printHelp({
|
|
|
233
233
|
message.push(
|
|
234
234
|
linebreak(),
|
|
235
235
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
236
|
-
`v${"2.0.
|
|
236
|
+
`v${"2.0.16"}`
|
|
237
237
|
)} ${headline}`
|
|
238
238
|
);
|
|
239
239
|
}
|
|
@@ -38,13 +38,17 @@ function writeHtmlResponse(res, statusCode, html) {
|
|
|
38
38
|
}
|
|
39
39
|
async function writeWebResponse(res, webResponse) {
|
|
40
40
|
const { status, headers, body } = webResponse;
|
|
41
|
-
const _headers = Object.fromEntries(headers.entries());
|
|
42
|
-
if ("getSetCookie" in headers && typeof headers.getSetCookie === "function") {
|
|
43
|
-
_headers["set-cookie"] = headers.getSetCookie();
|
|
44
|
-
}
|
|
45
41
|
const setCookieHeaders = Array.from(getSetCookiesFromResponse(webResponse));
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
setCookieHeaders.forEach((cookie) => {
|
|
43
|
+
headers.append("set-cookie", cookie);
|
|
44
|
+
});
|
|
45
|
+
const _headers = Object.fromEntries(headers.entries());
|
|
46
|
+
if (headers.has("set-cookie")) {
|
|
47
|
+
if ("getSetCookie" in headers && typeof headers.getSetCookie === "function") {
|
|
48
|
+
_headers["set-cookie"] = headers.getSetCookie();
|
|
49
|
+
} else {
|
|
50
|
+
_headers["set-cookie"] = headers.get("set-cookie");
|
|
51
|
+
}
|
|
48
52
|
}
|
|
49
53
|
res.writeHead(status, _headers);
|
|
50
54
|
if (body) {
|
|
@@ -65,10 +65,10 @@ function astroHeadPropagationBuildPlugin(options, internals) {
|
|
|
65
65
|
for (const [info2] of walkParentInfos(id, this)) {
|
|
66
66
|
appendPropagation(info2);
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
const info = this.getModuleInfo(id);
|
|
69
|
+
if (info) {
|
|
70
|
+
appendPropagation(info);
|
|
71
|
+
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.16",
|
|
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",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"@astrojs/compiler": "^1.1.0",
|
|
89
89
|
"@astrojs/language-server": "^0.28.3",
|
|
90
90
|
"@astrojs/markdown-remark": "^2.0.1",
|
|
91
|
-
"@astrojs/telemetry": "^2.0.
|
|
92
|
-
"@astrojs/webapi": "^2.0.
|
|
91
|
+
"@astrojs/telemetry": "^2.0.1",
|
|
92
|
+
"@astrojs/webapi": "^2.0.2",
|
|
93
93
|
"@babel/core": "^7.18.2",
|
|
94
94
|
"@babel/generator": "^7.18.2",
|
|
95
95
|
"@babel/parser": "^7.18.4",
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"@types/send": "^0.17.1",
|
|
161
161
|
"@types/server-destroy": "^1.0.1",
|
|
162
162
|
"@types/unist": "^2.0.6",
|
|
163
|
-
"astro-scripts": "0.0.
|
|
163
|
+
"astro-scripts": "0.0.12",
|
|
164
164
|
"chai": "^4.3.6",
|
|
165
165
|
"cheerio": "^1.0.0-rc.11",
|
|
166
166
|
"eol": "^0.9.1",
|