@astrojs/cloudflare 13.0.0-beta.9 → 13.0.1
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/README.md +1 -1
- package/dist/entrypoints/preview.js +1 -1
- package/dist/index.js +7 -8
- package/dist/prerenderer.js +1 -0
- package/dist/utils/handler.js +2 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @astrojs/cloudflare
|
|
2
2
|
|
|
3
|
-
An SSR adapter for use with Cloudflare Pages Functions targets. Write your code in Astro/
|
|
3
|
+
An SSR adapter for use with Cloudflare Pages Functions targets. Write your code in Astro/JavaScript and deploy to Cloudflare Pages.
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
@@ -80,7 +80,7 @@ function serverStart({
|
|
|
80
80
|
host,
|
|
81
81
|
base
|
|
82
82
|
}) {
|
|
83
|
-
const version = "13.0.
|
|
83
|
+
const version = "13.0.1";
|
|
84
84
|
const localPrefix = `${colors.dim("\u2503")} Local `;
|
|
85
85
|
const networkPrefix = `${colors.dim("\u2503")} Network `;
|
|
86
86
|
const emptyPrefix = " ".repeat(11);
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createReadStream, existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { appendFile,
|
|
2
|
+
import { appendFile, stat } from "node:fs/promises";
|
|
3
3
|
import { createInterface } from "node:readline/promises";
|
|
4
4
|
import { removeLeadingForwardSlash } from "@astrojs/internal-helpers/path";
|
|
5
5
|
import { createRedirectsFromAstroRoutes, printAsRedirects } from "@astrojs/underscore-redirects";
|
|
@@ -122,7 +122,6 @@ function createIntegration({
|
|
|
122
122
|
"astro > zod/v4",
|
|
123
123
|
"astro > zod/v4/core",
|
|
124
124
|
"astro > clsx",
|
|
125
|
-
"astro > cssesc",
|
|
126
125
|
"astro > cookie",
|
|
127
126
|
"astro > devalue",
|
|
128
127
|
"astro > @oslojs/encoding",
|
|
@@ -130,9 +129,11 @@ function createIntegration({
|
|
|
130
129
|
"astro > unstorage",
|
|
131
130
|
"astro > neotraverse/modern",
|
|
132
131
|
"astro > piccolore",
|
|
132
|
+
"astro > picomatch",
|
|
133
133
|
"astro/app",
|
|
134
134
|
"astro/assets",
|
|
135
|
-
"astro/compiler-runtime"
|
|
135
|
+
"astro/compiler-runtime",
|
|
136
|
+
"astro/app/entrypoint/dev"
|
|
136
137
|
],
|
|
137
138
|
exclude: [
|
|
138
139
|
"unstorage/drivers/cloudflare-kv-binding",
|
|
@@ -205,8 +206,9 @@ function createIntegration({
|
|
|
205
206
|
setAdapter({
|
|
206
207
|
name: "@astrojs/cloudflare",
|
|
207
208
|
adapterFeatures: {
|
|
208
|
-
|
|
209
|
-
|
|
209
|
+
buildOutput: "server",
|
|
210
|
+
middlewareMode: "classic",
|
|
211
|
+
preserveBuildClientDir: true
|
|
210
212
|
},
|
|
211
213
|
entrypointResolution: "auto",
|
|
212
214
|
previewEntrypoint: "@astrojs/cloudflare/entrypoints/preview",
|
|
@@ -316,9 +318,6 @@ function createIntegration({
|
|
|
316
318
|
logger.error("Failed to write _redirects file");
|
|
317
319
|
}
|
|
318
320
|
}
|
|
319
|
-
if (_isFullyStatic) {
|
|
320
|
-
await rm(_config.build.server, { recursive: true, force: true });
|
|
321
|
-
}
|
|
322
321
|
delete process.env.CLOUDFLARE_VITE_BUILD;
|
|
323
322
|
}
|
|
324
323
|
}
|
package/dist/prerenderer.js
CHANGED
package/dist/utils/handler.js
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
isStaticImagesRequest,
|
|
16
16
|
handleStaticImagesRequest
|
|
17
17
|
} from "./prerender.js";
|
|
18
|
+
import { getValidatedIpFromHeader } from "@astrojs/internal-helpers/request";
|
|
18
19
|
setGetEnv(createGetEnv(globalEnv));
|
|
19
20
|
const app = createApp();
|
|
20
21
|
async function handle(request, env, context) {
|
|
@@ -94,7 +95,7 @@ async function handle(request, env, context) {
|
|
|
94
95
|
prerenderedErrorPageFetch: async (url) => {
|
|
95
96
|
return env.ASSETS.fetch(url.replace(/\.html$/, ""));
|
|
96
97
|
},
|
|
97
|
-
clientAddress: request.headers.get("cf-connecting-ip")
|
|
98
|
+
clientAddress: getValidatedIpFromHeader(request.headers.get("cf-connecting-ip"))
|
|
98
99
|
});
|
|
99
100
|
if (app.setCookieHeaders) {
|
|
100
101
|
for (const setCookieHeader of app.setCookieHeaders(response)) {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/cloudflare",
|
|
3
3
|
"description": "Deploy your site to Cloudflare Workers",
|
|
4
|
-
"version": "13.0.
|
|
4
|
+
"version": "13.0.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/withastro/astro.git",
|
|
11
|
+
"url": "git+https://github.com/withastro/astro.git",
|
|
12
12
|
"directory": "packages/integrations/cloudflare"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"types.d.ts"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@cloudflare/vite-plugin": "^1.25.
|
|
38
|
+
"@cloudflare/vite-plugin": "^1.25.6",
|
|
39
39
|
"piccolore": "^0.1.3",
|
|
40
40
|
"tinyglobby": "^0.2.15",
|
|
41
41
|
"vite": "^7.3.1",
|
|
42
|
-
"@astrojs/internal-helpers": "0.8.0
|
|
43
|
-
"@astrojs/underscore-redirects": "1.0.
|
|
42
|
+
"@astrojs/internal-helpers": "0.8.0",
|
|
43
|
+
"@astrojs/underscore-redirects": "1.0.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"astro": "^6.0.0-alpha.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@types/node": "^25.2.2",
|
|
52
52
|
"cheerio": "1.2.0",
|
|
53
53
|
"devalue": "^5.6.3",
|
|
54
|
-
"astro": "6.0.0
|
|
54
|
+
"astro": "6.0.0",
|
|
55
55
|
"astro-scripts": "0.0.14"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|