Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit f01979a

Browse files
committed
Use experimental release
1 parent 3d8f206 commit f01979a

File tree

50 files changed

+315
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+315
-146
lines changed

Diff for: packages/cloudflare/package.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
"url": "https://github.com/withastro/adapters.git",
1212
"directory": "packages/cloudflare"
1313
},
14-
"keywords": ["withastro", "astro-adapter"],
14+
"keywords": [
15+
"withastro",
16+
"astro-adapter"
17+
],
1518
"bugs": "https://github.com/withastro/adapters/issues",
1619
"homepage": "https://docs.astro.build/en/guides/integrations-guide/cloudflare/",
1720
"exports": {
@@ -22,7 +25,9 @@
2225
"./image-endpoint": "./dist/entrypoints/image-endpoint.js",
2326
"./package.json": "./package.json"
2427
},
25-
"files": ["dist"],
28+
"files": [
29+
"dist"
30+
],
2631
"scripts": {
2732
"build": "tsc",
2833
"test": "astro-scripts test \"test/**/*.test.js\""
@@ -40,7 +45,7 @@
4045
"wrangler": "^3.101.0"
4146
},
4247
"peerDependencies": {
43-
"astro": "^5.0.0"
48+
"astro": "0.0.0-sessions-20241205163205"
4449
},
4550
"devDependencies": {
4651
"@astrojs/test-utils": "workspace:*",
@@ -55,4 +60,4 @@
5560
"publishConfig": {
5661
"provenance": true
5762
}
58-
}
63+
}

Diff for: packages/cloudflare/test/fixtures/astro-dev-platform/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"private": true,
55
"dependencies": {
66
"@astrojs/cloudflare": "workspace:*",
7-
"astro": "^5.1.6"
7+
"astro": "0.0.0-sessions-20241205163205"
88
},
99
"devDependencies": {
1010
"wrangler": "^3.101.0"
1111
}
12-
}
12+
}

Diff for: packages/cloudflare/test/fixtures/astro-env/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"private": true,
55
"dependencies": {
66
"@astrojs/cloudflare": "workspace:*",
7-
"astro": "^5.1.6"
7+
"astro": "0.0.0-sessions-20241205163205"
88
},
99
"devDependencies": {
1010
"wrangler": "^3.101.0"
1111
}
12-
}
12+
}

Diff for: packages/cloudflare/test/fixtures/compile-image-service/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"private": true,
55
"dependencies": {
66
"@astrojs/cloudflare": "workspace:*",
7-
"astro": "^5.1.6"
7+
"astro": "0.0.0-sessions-20241205163205"
88
}
9-
}
9+
}

Diff for: packages/cloudflare/test/fixtures/external-image-service/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"private": true,
55
"dependencies": {
66
"@astrojs/cloudflare": "workspace:*",
7-
"astro": "^5.1.6"
7+
"astro": "0.0.0-sessions-20241205163205"
88
}
9-
}
9+
}

Diff for: packages/cloudflare/test/fixtures/module-loader/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"private": true,
55
"dependencies": {
66
"@astrojs/cloudflare": "workspace:*",
7-
"astro": "^5.1.6"
7+
"astro": "0.0.0-sessions-20241205163205"
88
}
9-
}
9+
}

Diff for: packages/cloudflare/test/fixtures/no-output/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"private": true,
55
"dependencies": {
66
"@astrojs/cloudflare": "workspace:*",
7-
"astro": "^5.1.6"
7+
"astro": "0.0.0-sessions-20241205163205"
88
}
9-
}
9+
}

Diff for: packages/cloudflare/test/fixtures/routes-json/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"private": true,
55
"dependencies": {
66
"@astrojs/cloudflare": "workspace:*",
7-
"astro": "^5.1.6"
7+
"astro": "0.0.0-sessions-20241205163205"
88
}
9-
}
9+
}

Diff for: packages/cloudflare/test/fixtures/with-solid-js/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"private": true,
55
"dependencies": {
66
"@astrojs/cloudflare": "workspace:*",
7-
"@astrojs/solid-js": "^5.0.2",
8-
"astro": "^5.1.6",
9-
"solid-js": "^1.9.4"
7+
"@astrojs/solid-js": "^4.4.2",
8+
"astro": "0.0.0-sessions-20241205163205",
9+
"solid-js": "^1.9.3"
1010
}
11-
}
11+
}

Diff for: packages/cloudflare/test/fixtures/with-svelte/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"private": true,
55
"dependencies": {
66
"@astrojs/cloudflare": "workspace:*",
7-
"@astrojs/svelte": "^7.0.3",
8-
"astro": "^5.1.6",
9-
"svelte": "^5.17.4"
7+
"@astrojs/svelte": "^7.0.1",
8+
"astro": "0.0.0-sessions-20241205163205",
9+
"svelte": "^5.6.0"
1010
}
11-
}
11+
}

Diff for: packages/cloudflare/test/fixtures/wrangler-preview-platform/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"private": true,
55
"dependencies": {
66
"@astrojs/cloudflare": "workspace:*",
7-
"astro": "^5.1.6"
7+
"astro": "0.0.0-sessions-20241205163205"
88
}
9-
}
9+
}

Diff for: packages/netlify/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444
"vite": "^6.0.7"
4545
},
4646
"peerDependencies": {
47-
"astro": "^5.0.0"
47+
"astro": "0.0.0-sessions-20241205163205"
4848
},
4949
"devDependencies": {
5050
"@astrojs/test-utils": "workspace:*",
5151
"@netlify/edge-functions": "^2.11.1",
5252
"@netlify/edge-handler-types": "^0.34.1",
53-
"@types/node": "^22.10.6",
54-
"astro": "^5.1.6",
53+
"@types/node": "^22.10.0",
54+
"astro": "0.0.0-sessions-20241205163205",
5555
"astro-scripts": "workspace:*",
5656
"cheerio": "1.0.0",
5757
"execa": "^8.0.1",

Diff for: packages/netlify/src/index.ts

+3-15
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,13 @@ export default function netlifyIntegration(
291291

292292
async function writeMiddleware(entrypoint: URL) {
293293
await mkdir(middlewareOutputDir(), { recursive: true });
294-
console.log(_config.experimental?.session);
295294
await writeFile(
296295
new URL('./entry.mjs', middlewareOutputDir()),
297296
/* ts */ `
298-
import { onRequest, getManifest } from "${fileURLToPath(entrypoint).replaceAll('\\', '/')}";
297+
import { onRequest } from "${fileURLToPath(entrypoint).replaceAll('\\', '/')}";
299298
import { createContext, trySerializeLocals } from 'astro/middleware';
300299
301300
export default async (request, context) => {
302-
const manifest = await getManifest();
303301
const ctx = createContext({
304302
request,
305303
params: {},
@@ -326,10 +324,6 @@ export default function netlifyIntegration(
326324
};
327325
const next = () => {
328326
const { netlify, ...otherLocals } = ctx.locals;
329-
const data = Reflect.get(ctx.session, "data");
330-
if(data) {
331-
request.headers.set("x-astro-session", trySerializeLocals(data));
332-
}
333327
request.headers.set("x-astro-locals", trySerializeLocals(otherLocals));
334328
request.headers.set("x-astro-middleware-secret", "${middlewareSecret}");
335329
return context.next();
@@ -358,14 +352,6 @@ export default function netlifyIntegration(
358352
path: args.path,
359353
external: true,
360354
}));
361-
build.onResolve({ filter: /^@astro-session-driver$/ }, async (args) => {
362-
const resolved = await build.resolve('unstorage/drivers/netlify-blobs', {
363-
kind: 'import-statement',
364-
resolveDir: args.resolveDir,
365-
});
366-
console.log(resolved);
367-
return resolved;
368-
});
369355
},
370356
},
371357
],
@@ -399,6 +385,8 @@ export default function netlifyIntegration(
399385
account: parseBase64JSON('x-nf-account-info') ?? {
400386
id: 'mock-netlify-account-id',
401387
},
388+
// TODO: this has type conflicts with @netlify/functions ^2.8.1
389+
// @ts-expect-error: this has type conflicts with @netlify/functions ^2.8.1
402390
deploy: {
403391
id:
404392
typeof req.headers['x-nf-deploy-id'] === 'string'

Diff for: packages/netlify/src/ssr-function.ts

+5-14
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,21 @@ export const createExports = (manifest: SSRManifest, { middlewareSecret }: Args)
3232

3333
Reflect.set(request, clientAddressSymbol, context.ip);
3434
let locals: Record<string, unknown> = {};
35-
let initialSessionData: Record<string, unknown> = {};
3635

3736
const astroLocalsHeader = request.headers.get('x-astro-locals');
38-
const astroSessionHeader = request.headers.get('x-astro-session');
3937
const middlewareSecretHeader = request.headers.get('x-astro-middleware-secret');
40-
// hide the secret from the rest of user and library code
41-
request.headers.delete('x-astro-middleware-secret');
42-
if (astroLocalsHeader || astroSessionHeader) {
38+
if (astroLocalsHeader) {
4339
if (middlewareSecretHeader !== middlewareSecret) {
4440
return new Response('Forbidden', { status: 403 });
4541
}
46-
47-
if (astroLocalsHeader) {
48-
locals = JSON.parse(astroLocalsHeader);
49-
}
50-
if (astroSessionHeader) {
51-
console.log('astroSessionHeader', astroSessionHeader);
52-
initialSessionData = JSON.parse(astroSessionHeader);
53-
}
42+
// hide the secret from the rest of user and library code
43+
request.headers.delete('x-astro-middleware-secret');
44+
locals = JSON.parse(astroLocalsHeader);
5445
}
5546

5647
locals.netlify = { context };
5748

58-
const response = await app.render(request, { routeData, locals, initialSessionData });
49+
const response = await app.render(request, { routeData, locals });
5950

6051
if (app.setCookieHeaders) {
6152
for (const setCookieHeader of app.setCookieHeaders(response)) {

Diff for: packages/netlify/test/hosted/hosted-astro-project/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
"@astrojs/netlify": "workspace:*",
1010
"astro": "^5.1.6"
1111
}
12-
}
12+
}

Diff for: packages/node/package.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
"url": "https://github.com/withastro/adapters.git",
1212
"directory": "packages/node"
1313
},
14-
"keywords": ["withastro", "astro-adapter"],
14+
"keywords": [
15+
"withastro",
16+
"astro-adapter"
17+
],
1518
"bugs": "https://github.com/withastro/adapters/issues",
1619
"homepage": "https://docs.astro.build/en/guides/integrations-guide/node/",
1720
"exports": {
@@ -20,7 +23,9 @@
2023
"./preview.js": "./dist/preview.js",
2124
"./package.json": "./package.json"
2225
},
23-
"files": ["dist"],
26+
"files": [
27+
"dist"
28+
],
2429
"scripts": {
2530
"build": "tsc",
2631
"test": "astro-scripts test \"test/**/*.test.js\""
@@ -30,7 +35,7 @@
3035
"server-destroy": "^1.0.1"
3136
},
3237
"peerDependencies": {
33-
"astro": "^5.0.0"
38+
"astro": "0.0.0-sessions-20241205163205"
3439
},
3540
"devDependencies": {
3641
"@astrojs/test-utils": "workspace:*",
@@ -46,4 +51,4 @@
4651
"publishConfig": {
4752
"provenance": true
4853
}
49-
}
54+
}

Diff for: packages/node/test/fixtures/api-route/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/bad-urls/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/encoded/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/errors/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/headers/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/locals/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/node-middleware/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/prerender-404-500/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"@astrojs/node": "workspace:*",
88
"astro": "^5.1.6"
99
}
10-
}
10+
}

Diff for: packages/node/test/fixtures/prerender/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/preview-headers/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/trailing-slash/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/url/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

Diff for: packages/node/test/fixtures/well-known-locations/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"@astrojs/node": "workspace:*",
77
"astro": "^5.1.6"
88
}
9-
}
9+
}

0 commit comments

Comments
 (0)