@astrojs/cloudflare 13.0.0-beta.2 → 13.0.0-beta.4

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.
@@ -83,7 +83,7 @@ function serverStart({
83
83
  host,
84
84
  base
85
85
  }) {
86
- const version = "13.0.0-beta.2";
86
+ const version = "13.0.0-beta.4";
87
87
  const localPrefix = `${colors.dim("\u2503")} Local `;
88
88
  const networkPrefix = `${colors.dim("\u2503")} Network `;
89
89
  const emptyPrefix = " ".repeat(11);
package/dist/index.js CHANGED
@@ -119,7 +119,12 @@ function createIntegration(args) {
119
119
  } else if (environmentName === "client") {
120
120
  return {
121
121
  optimizeDeps: {
122
- include: ["astro/runtime/client/dev-toolbar/entrypoint.js"]
122
+ include: ["astro/runtime/client/dev-toolbar/entrypoint.js"],
123
+ // Workaround for https://github.com/vitejs/vite/issues/20867
124
+ // When dependencies are discovered mid-request (e.g. a linked package
125
+ // used with client:only), concurrent requests can fail with 504 because
126
+ // the dep optimizer's metadata object gets replaced during `await info.processing`.
127
+ ignoreOutdatedRequests: true
123
128
  }
124
129
  };
125
130
  }
package/dist/info.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Re-exports utilities for use by astro add CLI.
3
+ * This provides a resolvable path from the user's project.
4
+ */
5
+ export { getLocalWorkerdCompatibilityDate } from '@cloudflare/vite-plugin';
package/dist/info.js ADDED
@@ -0,0 +1,4 @@
1
+ import { getLocalWorkerdCompatibilityDate } from "@cloudflare/vite-plugin";
2
+ export {
3
+ getLocalWorkerdCompatibilityDate
4
+ };
@@ -5,5 +5,5 @@ declare global {
5
5
  var __ASTRO_IMAGES_BINDING_NAME: string;
6
6
  }
7
7
  type CfResponse = Awaited<ReturnType<Required<ExportedHandler<Env>>['fetch']>>;
8
- export declare function handle(...[request, env, context]: Parameters<Required<ExportedHandler<Env>>['fetch']>): Promise<CfResponse>;
8
+ export declare function handle(request: Request, env: Env, context: ExecutionContext): Promise<CfResponse>;
9
9
  export {};
@@ -4,7 +4,7 @@ import { createApp } from "astro/app/entrypoint";
4
4
  import { setGetEnv } from "astro/env/setup";
5
5
  import { createGetEnv } from "../utils/env.js";
6
6
  setGetEnv(createGetEnv(globalEnv));
7
- async function handle(...[request, env, context]) {
7
+ async function handle(request, env, context) {
8
8
  const app = createApp(import.meta.env.DEV);
9
9
  const { pathname } = new URL(request.url);
10
10
  if (env[sessionKVBindingName]) {
@@ -18,9 +18,7 @@ async function handle(...[request, env, context]) {
18
18
  }
19
19
  let routeData = void 0;
20
20
  if (app.isDev()) {
21
- const result = await app.devMatch(
22
- app.getPathnameFromRequest(request)
23
- );
21
+ const result = await app.devMatch(app.getPathnameFromRequest(request));
24
22
  if (result) {
25
23
  routeData = result.routeData;
26
24
  }
@@ -63,17 +61,14 @@ async function handle(...[request, env, context]) {
63
61
  }
64
62
  }
65
63
  });
66
- const response = await app.render(
67
- request,
68
- {
69
- routeData,
70
- locals,
71
- prerenderedErrorPageFetch: async (url) => {
72
- return env.ASSETS.fetch(url.replace(/\.html$/, ""));
73
- },
74
- clientAddress: request.headers.get("cf-connecting-ip") ?? void 0
75
- }
76
- );
64
+ const response = await app.render(request, {
65
+ routeData,
66
+ locals,
67
+ prerenderedErrorPageFetch: async (url) => {
68
+ return env.ASSETS.fetch(url.replace(/\.html$/, ""));
69
+ },
70
+ clientAddress: request.headers.get("cf-connecting-ip") ?? void 0
71
+ });
77
72
  if (app.setCookieHeaders) {
78
73
  for (const setCookieHeader of app.setCookieHeaders(response)) {
79
74
  response.headers.append("Set-Cookie", setCookieHeader);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/cloudflare",
3
3
  "description": "Deploy your site to Cloudflare Workers/Pages",
4
- "version": "13.0.0-beta.2",
4
+ "version": "13.0.0-beta.4",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -19,6 +19,7 @@
19
19
  "homepage": "https://docs.astro.build/en/guides/integrations-guide/cloudflare/",
20
20
  "exports": {
21
21
  ".": "./dist/index.js",
22
+ "./info": "./dist/info.js",
22
23
  "./entrypoints/server": "./dist/entrypoints/server.js",
23
24
  "./entrypoints/preview": "./dist/entrypoints/preview.js",
24
25
  "./entrypoints/server.js": "./dist/entrypoints/server.js",
@@ -34,24 +35,24 @@
34
35
  "types.d.ts"
35
36
  ],
36
37
  "dependencies": {
37
- "@cloudflare/vite-plugin": "^1.21.2",
38
+ "@cloudflare/vite-plugin": "^1.22.1",
38
39
  "dotenv": "^17.2.3",
39
40
  "piccolore": "^0.1.3",
40
41
  "tinyglobby": "^0.2.15",
41
42
  "vite": "^7.3.1",
42
- "@astrojs/internal-helpers": "0.7.5",
43
+ "@astrojs/internal-helpers": "0.8.0-beta.0",
43
44
  "@astrojs/underscore-redirects": "1.0.0"
44
45
  },
45
46
  "peerDependencies": {
46
47
  "astro": "^6.0.0-alpha.0",
47
- "wrangler": "^4.53.0"
48
+ "wrangler": "^4.61.1"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@cloudflare/workers-types": "^4.20260124.0",
51
52
  "cheerio": "1.1.2",
52
53
  "devalue": "^5.6.2",
53
54
  "rollup": "^4.55.1",
54
- "astro": "6.0.0-beta.4",
55
+ "astro": "6.0.0-beta.7",
55
56
  "astro-scripts": "0.0.14"
56
57
  },
57
58
  "publishConfig": {
package/types.d.ts CHANGED
@@ -1,22 +1,3 @@
1
- /**
2
- * Cloudflare Worker Request types
3
- * Extends the global Request object with Cloudflare-specific properties
4
- */
5
-
6
- declare global {
7
- interface Request {
8
- /**
9
- * Cloudflare-specific properties available on incoming requests
10
- * Contains metadata about the request such as:
11
- * - Geographic information (country, colo, timezone)
12
- * - TLS/Security details (cipher, protocol version)
13
- * - Bot Management scores
14
- * - Client information (ASN, TCP metrics)
15
- */
16
- readonly cf?: IncomingRequestCfProperties;
17
- }
18
- }
19
-
20
1
  type Runtime = import('./dist/index.d.ts').Runtime;
21
2
 
22
3
  declare namespace App {