@astrojs/cloudflare 13.1.0 → 13.1.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/dist/entrypoints/preview.js +1 -1
- package/dist/index.js +27 -1
- package/dist/utils/image-config.js +7 -0
- package/package.json +3 -3
|
@@ -87,7 +87,7 @@ function serverStart({
|
|
|
87
87
|
host,
|
|
88
88
|
base
|
|
89
89
|
}) {
|
|
90
|
-
const version = "13.1.
|
|
90
|
+
const version = "13.1.1";
|
|
91
91
|
const localPrefix = `${colors.dim("\u2503")} Local `;
|
|
92
92
|
const networkPrefix = `${colors.dim("\u2503")} Network `;
|
|
93
93
|
const emptyPrefix = " ".repeat(11);
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,23 @@ function usesCloudflareKVSessionDriver(session) {
|
|
|
32
32
|
const entrypoint = typeof driver.entrypoint === "string" ? driver.entrypoint : driver.entrypoint.toString();
|
|
33
33
|
return entrypoint === CLOUDFLARE_KV_SESSION_DRIVER_ENTRYPOINT || entrypoint.endsWith("cloudflare-kv-binding");
|
|
34
34
|
}
|
|
35
|
+
function hasContentCollectionsConfig(srcDir) {
|
|
36
|
+
const contentConfigPaths = [
|
|
37
|
+
"content.config.mjs",
|
|
38
|
+
"content.config.js",
|
|
39
|
+
"content.config.mts",
|
|
40
|
+
"content.config.ts",
|
|
41
|
+
"content/config.mjs",
|
|
42
|
+
"content/config.js",
|
|
43
|
+
"content/config.mts",
|
|
44
|
+
"content/config.ts",
|
|
45
|
+
"live.config.mjs",
|
|
46
|
+
"live.config.js",
|
|
47
|
+
"live.config.mts",
|
|
48
|
+
"live.config.ts"
|
|
49
|
+
];
|
|
50
|
+
return contentConfigPaths.some((configPath) => existsSync(new URL(`./${configPath}`, srcDir)));
|
|
51
|
+
}
|
|
35
52
|
function createIntegration({
|
|
36
53
|
imageService,
|
|
37
54
|
sessionKVBindingName = DEFAULT_SESSION_KV_BINDING_NAME,
|
|
@@ -77,6 +94,8 @@ function createIntegration({
|
|
|
77
94
|
}
|
|
78
95
|
const needsSessionKVBinding = usesCloudflareKVSessionDriver(session);
|
|
79
96
|
const needsImagesBindingForDev = isCompile && command === "dev";
|
|
97
|
+
const usesContentCollections = hasContentCollectionsConfig(config.srcDir);
|
|
98
|
+
const prebundleContentRuntime = command === "dev" && usesContentCollections;
|
|
80
99
|
cfPluginConfig = {
|
|
81
100
|
config: cloudflareConfigCustomizer({
|
|
82
101
|
needsSessionKVBinding,
|
|
@@ -137,6 +156,7 @@ function createIntegration({
|
|
|
137
156
|
return {
|
|
138
157
|
optimizeDeps: {
|
|
139
158
|
include: [
|
|
159
|
+
"@astrojs/cloudflare/image-service-workerd",
|
|
140
160
|
"astro",
|
|
141
161
|
"astro/runtime/**",
|
|
142
162
|
"astro > html-escaper",
|
|
@@ -154,8 +174,14 @@ function createIntegration({
|
|
|
154
174
|
"astro > picomatch",
|
|
155
175
|
"astro/app",
|
|
156
176
|
"astro/assets",
|
|
177
|
+
"astro/assets/runtime",
|
|
178
|
+
"astro/assets/utils/inferRemoteSize.js",
|
|
179
|
+
"astro/assets/fonts/runtime.js",
|
|
180
|
+
...prebundleContentRuntime ? ["astro/content/runtime"] : [],
|
|
157
181
|
"astro/compiler-runtime",
|
|
158
|
-
"astro/
|
|
182
|
+
"astro/jsx-runtime",
|
|
183
|
+
"astro/app/entrypoint/dev",
|
|
184
|
+
"astro/virtual-modules/middleware.js"
|
|
159
185
|
],
|
|
160
186
|
exclude: [
|
|
161
187
|
"unstorage/drivers/cloudflare-kv-binding",
|
|
@@ -27,6 +27,13 @@ function setImageConfig(service, config, command, logger) {
|
|
|
27
27
|
endpoint: command === "dev" ? GENERIC_ENDPOINT : CLOUDFLARE_PASSTHROUGH_ENDPOINT
|
|
28
28
|
};
|
|
29
29
|
case "cloudflare":
|
|
30
|
+
if (command === "dev") {
|
|
31
|
+
return {
|
|
32
|
+
...config,
|
|
33
|
+
service: passthroughImageService(),
|
|
34
|
+
endpoint: GENERIC_ENDPOINT
|
|
35
|
+
};
|
|
36
|
+
}
|
|
30
37
|
return {
|
|
31
38
|
...config,
|
|
32
39
|
service: { entrypoint: "@astrojs/cloudflare/image-service" }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/cloudflare",
|
|
3
3
|
"description": "Deploy your site to Cloudflare Workers",
|
|
4
|
-
"version": "13.1.
|
|
4
|
+
"version": "13.1.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"@types/node": "^25.2.2",
|
|
53
53
|
"cheerio": "1.2.0",
|
|
54
54
|
"devalue": "^5.6.3",
|
|
55
|
-
"astro
|
|
56
|
-
"astro": "
|
|
55
|
+
"astro": "6.0.4",
|
|
56
|
+
"astro-scripts": "0.0.14"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"provenance": true
|