@astrojs/cloudflare 13.0.0-beta.0 → 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.
- package/dist/entrypoints/image-transform-endpoint.js +1 -1
- package/dist/entrypoints/preview.js +1 -1
- package/dist/index.js +4 -2
- package/dist/utils/handler.d.ts +3 -8
- package/dist/utils/handler.js +1 -1
- package/dist/utils/image-binding-transform.d.ts +1 -2
- package/package.json +11 -11
- package/types.d.ts +6 -2
|
@@ -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.
|
|
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);
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,7 @@ function createIntegration(args) {
|
|
|
59
59
|
build: {
|
|
60
60
|
client: new URL(`./client/`, config.outDir),
|
|
61
61
|
server: new URL("./_worker.js/", config.outDir),
|
|
62
|
-
serverEntry: "index.js",
|
|
62
|
+
serverEntry: config.build.serverEntry ?? "index.js",
|
|
63
63
|
redirects: false
|
|
64
64
|
},
|
|
65
65
|
session,
|
|
@@ -111,7 +111,8 @@ function createIntegration(args) {
|
|
|
111
111
|
"unstorage/drivers/cloudflare-kv-binding",
|
|
112
112
|
"astro:*",
|
|
113
113
|
"virtual:astro:*",
|
|
114
|
-
"virtual:astro-cloudflare:*"
|
|
114
|
+
"virtual:astro-cloudflare:*",
|
|
115
|
+
"virtual:@astrojs/*"
|
|
115
116
|
]
|
|
116
117
|
}
|
|
117
118
|
};
|
|
@@ -173,6 +174,7 @@ function createIntegration(args) {
|
|
|
173
174
|
edgeMiddleware: false,
|
|
174
175
|
buildOutput: "server"
|
|
175
176
|
},
|
|
177
|
+
entryType: "self",
|
|
176
178
|
previewEntrypoint: "@astrojs/cloudflare/entrypoints/preview",
|
|
177
179
|
supportedAstroFeatures: {
|
|
178
180
|
serverOutput: "stable",
|
package/dist/utils/handler.d.ts
CHANGED
|
@@ -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
|
-
|
|
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 {};
|
package/dist/utils/handler.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
4
|
+
"version": "13.0.0-beta.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -34,24 +34,24 @@
|
|
|
34
34
|
"types.d.ts"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@cloudflare/vite-plugin": "^1.
|
|
38
|
-
"@cloudflare/workers-types": "^4.20251121.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
|
|
43
|
-
"@astrojs/
|
|
44
|
-
"@astrojs/
|
|
41
|
+
"vite": "^7.3.1",
|
|
42
|
+
"@astrojs/internal-helpers": "0.7.5",
|
|
43
|
+
"@astrojs/underscore-redirects": "1.0.0"
|
|
45
44
|
},
|
|
46
45
|
"peerDependencies": {
|
|
47
46
|
"astro": "^6.0.0-alpha.0",
|
|
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
|
-
"devalue": "^5.6.
|
|
53
|
-
"rollup": "^4.
|
|
54
|
-
"astro": "6.0.0-beta.
|
|
52
|
+
"devalue": "^5.6.2",
|
|
53
|
+
"rollup": "^4.55.1",
|
|
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
|
+
}
|