Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Nov 28, 2024
2 parents 0ba7a39 + 967a2bf commit 21d79c8
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 46 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-bottles-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': patch
---

Inherits `platformProxy` option types from `wrangler`
5 changes: 5 additions & 0 deletions .changeset/odd-kiwis-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': minor
---

Add support for Node 22 on Vercel serverless
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- next
- legacy

defaults:
run:
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@
"@astrojs/check": "^0.9.4",
"@biomejs/biome": "1.9.4",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.9",
"@types/node": "^20.17.4",
"@changesets/cli": "^2.27.10",
"@types/node": "^22.10.0",
"esbuild": "^0.24.0",
"eslint": "^9.13.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-regexp": "^2.7.0",
"only-allow": "^1.2.1",
"prettier": "^3.3.3",
"prettier": "^3.4.1",
"prettier-plugin-astro": "^0.14.1",
"turbo": "^2.2.3",
"typescript": "^5.6.3",
"typescript-eslint": "^8.12.2"
"turbo": "^2.3.3",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0"
}
}
14 changes: 7 additions & 7 deletions packages/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@
"dependencies": {
"@astrojs/internal-helpers": "0.4.1",
"@astrojs/underscore-redirects": "^0.4.0-alpha.0",
"@cloudflare/workers-types": "^4.20241022.0",
"@cloudflare/workers-types": "^4.20241112.0",
"@inox-tools/astro-when": "^0.2.4",
"esbuild": "^0.24.0",
"estree-walker": "^3.0.3",
"magic-string": "^0.30.12",
"miniflare": "^3.20241022.0",
"magic-string": "^0.30.14",
"miniflare": "^3.20241106.1",
"tiny-glob": "^0.2.9",
"wrangler": "^3.84.0"
"wrangler": "^3.91.0"
},
"peerDependencies": {
"astro": "^5.0.0"
},
"devDependencies": {
"@astrojs/test-utils": "workspace:*",
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0-alpha.15",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0",
"execa": "^8.0.1",
"fast-glob": "^3.3.2",
"rollup": "^4.24.3",
"rollup": "^4.27.4",
"strip-ansi": "^7.1.0",
"vite": "6.0.0-beta.2"
"vite": "6.0.1"
},
"publishConfig": {
"provenance": true
Expand Down
20 changes: 3 additions & 17 deletions packages/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { createRedirectsFromAstroRoutes } from '@astrojs/underscore-redirects';
import astroWhen from '@inox-tools/astro-when';
import { AstroError } from 'astro/errors';
import { getPlatformProxy } from 'wrangler';
import { type GetPlatformProxyOptions, getPlatformProxy } from 'wrangler';
import {
type CloudflareModulePluginExtra,
cloudflareModuleLoader,
Expand Down Expand Up @@ -53,15 +53,9 @@ export type Options = {
/**
* Proxy configuration for the platform.
*/
platformProxy?: {
platformProxy?: GetPlatformProxyOptions & {
/** Toggle the proxy. Default `undefined`, which equals to `true`. */
enabled?: boolean;
/** Path to the configuration file. Default `wrangler.toml`. */
configPath?: string;
/** Enable experimental support for JSON configuration. Default `false`. */
experimentalJsonConfig?: boolean;
/** Configuration persistence settings. Default '.wrangler/state/v3' */
persist?: boolean | { path: string };
};

/**
Expand Down Expand Up @@ -91,14 +85,6 @@ function setProcessEnv(config: AstroConfig, env: Record<string, unknown>) {
}
}

function createPlatformProxy(platformProxy: Options['platformProxy']) {
return getPlatformProxy({
configPath: platformProxy?.configPath,
experimentalJsonConfig: platformProxy?.experimentalJsonConfig ?? false,
persist: platformProxy?.persist ?? true,
});
}

export default function createIntegration(args?: Options): AstroIntegration {
let _config: AstroConfig;

Expand Down Expand Up @@ -180,7 +166,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
},
'astro:server:setup': async ({ server }) => {
if ((args?.platformProxy?.enabled ?? true) === true) {
const platformProxy = await createPlatformProxy(args?.platformProxy);
const platformProxy = await getPlatformProxy(args?.platformProxy);

setProcessEnv(_config, platformProxy.env);

Expand Down
12 changes: 6 additions & 6 deletions packages/netlify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@
"@astrojs/internal-helpers": "0.4.1",
"@astrojs/underscore-redirects": "^0.4.0-alpha.0",
"@netlify/functions": "^2.8.0",
"@vercel/nft": "^0.27.5",
"@vercel/nft": "^0.27.6",
"esbuild": "^0.24.0",
"vite": "6.0.0"
"vite": "6.0.1"
},
"peerDependencies": {
"astro": "^5.0.0"
},
"devDependencies": {
"@astrojs/test-utils": "workspace:*",
"@netlify/edge-functions": "^2.11.0",
"@netlify/edge-functions": "^2.11.1",
"@netlify/edge-handler-types": "^0.34.1",
"@types/node": "^20.17.4",
"astro": "^5.0.0-alpha.8",
"@types/node": "^22.10.0",
"astro": "^5.0.0-alpha.15",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0",
"execa": "^8.0.1",
"fast-glob": "^3.3.2",
"strip-ansi": "^7.1.0",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"astro": {
"external": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"dependencies": {
"@astrojs/netlify": "workspace:*",
"astro": "^5.0.0-alpha.8"
"astro": "^5.0.0-alpha.15"
}
}
4 changes: 2 additions & 2 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
},
"devDependencies": {
"@astrojs/test-utils": "workspace:*",
"@types/node": "^18.19.62",
"@types/node": "^22.10.0",
"@types/send": "^0.17.4",
"@types/server-destroy": "^1.0.4",
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0-alpha.15",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0",
"express": "^4.21.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"keywords": [],
"dependencies": {
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0-alpha.15",
"execa": "^8.0.1",
"fast-glob": "^3.3.2",
"strip-ansi": "^7.1.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
},
"dependencies": {
"@astrojs/internal-helpers": "^0.4.1",
"@vercel/analytics": "^1.3.2",
"@vercel/analytics": "^1.4.1",
"@vercel/edge": "^1.1.2",
"@vercel/nft": "^0.27.5",
"@vercel/nft": "^0.27.6",
"esbuild": "^0.24.0",
"fast-glob": "^3.3.2"
},
Expand All @@ -48,7 +48,7 @@
},
"devDependencies": {
"@astrojs/test-utils": "workspace:*",
"astro": "^5.0.0-alpha.8",
"astro": "^5.0.0-alpha.15",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0"
},
Expand Down

0 comments on commit 21d79c8

Please sign in to comment.