diff options
Diffstat (limited to 'packages/integrations/node')
5 files changed, 32 insertions, 16 deletions
diff --git a/packages/integrations/node/CHANGELOG.md b/packages/integrations/node/CHANGELOG.md index 4b455aeae..e4cf76b85 100644 --- a/packages/integrations/node/CHANGELOG.md +++ b/packages/integrations/node/CHANGELOG.md @@ -1,5 +1,24 @@ # @astrojs/node +## 7.0.0-beta.1 + +### Major Changes + +- [#9199](https://github.com/withastro/astro/pull/9199) [`49aa215a0`](https://github.com/withastro/astro/commit/49aa215a01ee1c4805316c85bb0aea6cfbc25a31) Thanks [@lilnasy](https://github.com/lilnasy)! - The internals of the integration have been updated to support Astro 4.0. Make sure to upgrade your Astro version as Astro 3.0 is no longer supported. + +## 7.0.0-beta.0 + +### Patch Changes + +- Updated dependencies [[`abf601233`](https://github.com/withastro/astro/commit/abf601233f8188d118a8cb063c777478d8d9f1a3), [`6201bbe96`](https://github.com/withastro/astro/commit/6201bbe96c2a083fb201e4a43a9bd88499821a3e), [`cdabf6ef0`](https://github.com/withastro/astro/commit/cdabf6ef02be7220fd2b6bdcef924ceca089381e), [`1c48ed286`](https://github.com/withastro/astro/commit/1c48ed286538ab9e354eca4e4dcd7c6385c96721), [`37697a2c5`](https://github.com/withastro/astro/commit/37697a2c5511572dc29c0a4ea46f90c2f62be8e6), [`bd0c2e9ae`](https://github.com/withastro/astro/commit/bd0c2e9ae3389a9d3085050c1e8134ae98dff299), [`0fe3a7ed5`](https://github.com/withastro/astro/commit/0fe3a7ed5d7bb1a9fce1623e84ba14104b51223c), [`710be505c`](https://github.com/withastro/astro/commit/710be505c9ddf416e77a75343d8cae9c497d72c6), [`153a5abb9`](https://github.com/withastro/astro/commit/153a5abb905042ac68b712514dc9ec387d3e6b17)]: + - astro@4.0.0-beta.0 + +## 6.1.0 + +### Minor Changes + +- [#9125](https://github.com/withastro/astro/pull/9125) [`8f1d50957`](https://github.com/withastro/astro/commit/8f1d509574f5ee5d77816a13d89ce452dce403ff) Thanks [@matthewp](https://github.com/matthewp)! - Automatically sets immutable cache headers for assets served from the `/_astro` directory. + ## 6.1.0 ### Minor Changes diff --git a/packages/integrations/node/package.json b/packages/integrations/node/package.json index 8f5d88285..9981db3c5 100644 --- a/packages/integrations/node/package.json +++ b/packages/integrations/node/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/node", "description": "Deploy your site to a Node.js server", - "version": "6.1.0", + "version": "7.0.0-beta.1", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", @@ -37,12 +37,12 @@ "server-destroy": "^1.0.1" }, "peerDependencies": { - "astro": "^3.0.0" + "astro": "^4.0.0-beta.0" }, "devDependencies": { "@types/node": "^18.17.8", - "@types/send": "^0.17.1", - "@types/server-destroy": "^1.0.1", + "@types/send": "^0.17.4", + "@types/server-destroy": "^1.0.3", "astro": "workspace:*", "astro-scripts": "workspace:*", "chai": "^4.3.7", diff --git a/packages/integrations/node/src/createOutgoingHttpHeaders.ts b/packages/integrations/node/src/createOutgoingHttpHeaders.ts index 781a74de6..44bbf81ca 100644 --- a/packages/integrations/node/src/createOutgoingHttpHeaders.ts +++ b/packages/integrations/node/src/createOutgoingHttpHeaders.ts @@ -23,8 +23,7 @@ export const createOutgoingHttpHeaders = ( // if there is > 1 set-cookie header, we have to fix it to be an array of values if (headers.has('set-cookie')) { - // @ts-expect-error - const cookieHeaders = headers.getSetCookie() as string[]; + const cookieHeaders = headers.getSetCookie(); if (cookieHeaders.length > 1) { // the Headers.entries() API already normalized all header names to lower case so we can safely index this as 'set-cookie' nodeHeaders['set-cookie'] = cookieHeaders; diff --git a/packages/integrations/node/src/nodeMiddleware.ts b/packages/integrations/node/src/nodeMiddleware.ts index 4fd0a4bc2..0b9381f1d 100644 --- a/packages/integrations/node/src/nodeMiddleware.ts +++ b/packages/integrations/node/src/nodeMiddleware.ts @@ -30,10 +30,10 @@ export default function (app: NodeApp, mode: Options['mode']) { } try { - const route = app.match(req); - if (route) { + const routeData = app.match(req); + if (routeData) { try { - const response = await app.render(req, route, locals); + const response = await app.render(req, { routeData, locals }); await writeWebResponse(app, res, response); } catch (err: unknown) { if (next) { diff --git a/packages/integrations/node/test/fixtures/node-middleware/src/pages/ssr.ts b/packages/integrations/node/test/fixtures/node-middleware/src/pages/ssr.ts index 93543190f..423db341a 100644 --- a/packages/integrations/node/test/fixtures/node-middleware/src/pages/ssr.ts +++ b/packages/integrations/node/test/fixtures/node-middleware/src/pages/ssr.ts @@ -1,9 +1,7 @@ -export async function get() { +export async function GET() { let number = Math.random(); - return { - body: JSON.stringify({ - number, - message: `Here's a random number: ${number}`, - }), - }; + return Response.json({ + number, + message: `Here's a random number: ${number}`, + }); } |