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

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.
@@ -1,7 +1,7 @@
1
1
  import { transform } from "../utils/image-binding-transform.js";
2
+ import { env } from "cloudflare:workers";
2
3
  const prerender = false;
3
4
  const GET = async (ctx) => {
4
- const { env } = await import("cloudflare:workers");
5
5
  return transform(ctx.request.url, env.IMAGES, env.ASSETS);
6
6
  };
7
7
  export {
@@ -83,7 +83,7 @@ function serverStart({
83
83
  host,
84
84
  base
85
85
  }) {
86
- const version = "13.0.0-beta.1";
86
+ const version = "13.0.0-beta.2";
87
87
  const localPrefix = `${colors.dim("\u2503")} Local `;
88
88
  const networkPrefix = `${colors.dim("\u2503")} Network `;
89
89
  const emptyPrefix = " ".repeat(11);
@@ -1,14 +1,9 @@
1
- import type { Response as CfResponse, ExecutionContext, ExportedHandlerFetchHandler } from '@cloudflare/workers-types';
2
- export type Env = {
3
- [key: string]: unknown;
4
- ASSETS: {
5
- fetch: (req: Request | string) => Promise<CfResponse>;
6
- };
7
- };
8
1
  export interface Runtime {
9
2
  cfContext: ExecutionContext;
10
3
  }
11
4
  declare global {
12
5
  var __ASTRO_IMAGES_BINDING_NAME: string;
13
6
  }
14
- export declare function handle(request: Parameters<ExportedHandlerFetchHandler>[0], env: Env, context: ExecutionContext): Promise<CfResponse>;
7
+ type CfResponse = Awaited<ReturnType<Required<ExportedHandler<Env>>['fetch']>>;
8
+ export declare function handle(...[request, env, context]: Parameters<Required<ExportedHandler<Env>>['fetch']>): Promise<CfResponse>;
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]) {
@@ -1,2 +1 @@
1
- import type { Fetcher, ImagesBinding } from '@cloudflare/workers-types';
2
- export declare function transform(rawUrl: string, images: ImagesBinding, assets: Fetcher): Promise<import("@cloudflare/workers-types").Response | Response>;
1
+ export declare function transform(rawUrl: string, images: ImagesBinding, assets: Fetcher): Promise<Response>;
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.1",
4
+ "version": "13.0.0-beta.2",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -34,12 +34,11 @@
34
34
  "types.d.ts"
35
35
  ],
36
36
  "dependencies": {
37
- "@cloudflare/vite-plugin": "^1.17.0",
38
- "@cloudflare/workers-types": "^4.20260116.0",
37
+ "@cloudflare/vite-plugin": "^1.21.2",
39
38
  "dotenv": "^17.2.3",
40
39
  "piccolore": "^0.1.3",
41
40
  "tinyglobby": "^0.2.15",
42
- "vite": "^7.1.12",
41
+ "vite": "^7.3.1",
43
42
  "@astrojs/internal-helpers": "0.7.5",
44
43
  "@astrojs/underscore-redirects": "1.0.0"
45
44
  },
@@ -48,10 +47,11 @@
48
47
  "wrangler": "^4.53.0"
49
48
  },
50
49
  "devDependencies": {
50
+ "@cloudflare/workers-types": "^4.20260124.0",
51
51
  "cheerio": "1.1.2",
52
52
  "devalue": "^5.6.2",
53
53
  "rollup": "^4.55.1",
54
- "astro": "6.0.0-beta.2",
54
+ "astro": "6.0.0-beta.4",
55
55
  "astro-scripts": "0.0.14"
56
56
  },
57
57
  "publishConfig": {
@@ -59,8 +59,8 @@
59
59
  },
60
60
  "scripts": {
61
61
  "dev": "astro-scripts dev \"src/**/*.ts\"",
62
- "build": "astro-scripts build \"src/**/*.ts\" && tsc",
62
+ "build": "astro-scripts build \"src/**/*.ts\" --clean-dts && tsc",
63
63
  "build:ci": "astro-scripts build \"src/**/*.ts\"",
64
- "test": "astro-scripts test \"test/**/*.test.js\""
64
+ "test": "astro-scripts test --force-exit \"test/**/*.test.js\""
65
65
  }
66
66
  }
package/types.d.ts CHANGED
@@ -3,8 +3,6 @@
3
3
  * Extends the global Request object with Cloudflare-specific properties
4
4
  */
5
5
 
6
- import type { IncomingRequestCfProperties } from '@cloudflare/workers-types';
7
-
8
6
  declare global {
9
7
  interface Request {
10
8
  /**
@@ -18,3 +16,9 @@ declare global {
18
16
  readonly cf?: IncomingRequestCfProperties;
19
17
  }
20
18
  }
19
+
20
+ type Runtime = import('./dist/index.d.ts').Runtime;
21
+
22
+ declare namespace App {
23
+ interface Locals extends Runtime {}
24
+ }