@astrojs/cloudflare 13.1.10 → 13.2.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.
@@ -87,7 +87,7 @@ function serverStart({
87
87
  host,
88
88
  base
89
89
  }) {
90
- const version = "13.1.10";
90
+ const version = "13.2.1";
91
91
  const localPrefix = `${colors.dim("\u2503")} Local `;
92
92
  const networkPrefix = `${colors.dim("\u2503")} Network `;
93
93
  const emptyPrefix = " ".repeat(11);
@@ -1,15 +1,15 @@
1
- import type { PluginConfig } from '@cloudflare/vite-plugin';
1
+ import type { WorkerConfig } from '@cloudflare/vite-plugin';
2
2
  export declare const DEFAULT_SESSION_KV_BINDING_NAME = "SESSION";
3
3
  export declare const DEFAULT_IMAGES_BINDING_NAME = "IMAGES";
4
4
  export declare const DEFAULT_ASSETS_BINDING_NAME = "ASSETS";
5
5
  interface CloudflareConfigOptions {
6
- sessionKVBindingName: string | undefined;
6
+ sessionKVBindingName?: string | undefined;
7
7
  needsSessionKVBinding?: boolean;
8
- imagesBindingName: string | false | undefined;
8
+ imagesBindingName?: string | false | undefined;
9
9
  }
10
10
  /**
11
11
  * Returns a config customizer that sets up the Astro Cloudflare defaults.
12
12
  * Sets the main entrypoint and adds bindings for auto-provisioning.
13
13
  */
14
- export declare function cloudflareConfigCustomizer(options: CloudflareConfigOptions): PluginConfig['config'];
14
+ export declare function cloudflareConfigCustomizer(options?: CloudflareConfigOptions): (config: Partial<WorkerConfig>) => Partial<WorkerConfig>;
15
15
  export {};
package/dist/wrangler.js CHANGED
@@ -1,31 +1,40 @@
1
1
  const DEFAULT_SESSION_KV_BINDING_NAME = "SESSION";
2
2
  const DEFAULT_IMAGES_BINDING_NAME = "IMAGES";
3
3
  const DEFAULT_ASSETS_BINDING_NAME = "ASSETS";
4
+ const DEFAULT_COMPATIBILITY_DATE = "2026-04-15";
4
5
  function cloudflareConfigCustomizer(options) {
5
6
  const sessionKVBindingName = options?.sessionKVBindingName ?? DEFAULT_SESSION_KV_BINDING_NAME;
6
7
  const needsSessionKVBinding = options?.needsSessionKVBinding ?? true;
7
8
  const imagesBindingName = options?.imagesBindingName === false ? void 0 : options?.imagesBindingName ?? DEFAULT_IMAGES_BINDING_NAME;
8
- return (config) => {
9
- const hasSessionBinding = config.kv_namespaces?.some(
10
- (kv) => kv.binding === sessionKVBindingName
11
- );
12
- const hasImagesBinding = config.images?.binding !== void 0;
9
+ const customizer = (config) => {
10
+ const getNonInheritableBindings = (nonInheritableConfig) => {
11
+ const hasSessionBinding = nonInheritableConfig?.kv_namespaces?.some(
12
+ (kv) => kv.binding === sessionKVBindingName
13
+ );
14
+ const hasImagesBinding = nonInheritableConfig?.images?.binding !== void 0;
15
+ return {
16
+ kv_namespaces: !needsSessionKVBinding || hasSessionBinding ? void 0 : [
17
+ {
18
+ binding: sessionKVBindingName
19
+ }
20
+ ],
21
+ images: hasImagesBinding || !imagesBindingName ? void 0 : {
22
+ binding: imagesBindingName
23
+ }
24
+ };
25
+ };
13
26
  const hasAssetsBinding = config.assets?.binding !== void 0;
14
27
  return {
28
+ ...getNonInheritableBindings(config),
29
+ compatibility_date: config.compatibility_date ?? DEFAULT_COMPATIBILITY_DATE,
15
30
  main: config.main ?? "@astrojs/cloudflare/entrypoints/server",
16
- kv_namespaces: !needsSessionKVBinding || hasSessionBinding ? void 0 : [
17
- {
18
- binding: sessionKVBindingName
19
- }
20
- ],
21
- images: hasImagesBinding || !imagesBindingName ? void 0 : {
22
- binding: imagesBindingName
23
- },
24
31
  assets: hasAssetsBinding ? void 0 : {
25
32
  binding: DEFAULT_ASSETS_BINDING_NAME
26
- }
33
+ },
34
+ previews: getNonInheritableBindings(config.previews)
27
35
  };
28
36
  };
37
+ return customizer;
29
38
  }
30
39
  export {
31
40
  DEFAULT_ASSETS_BINDING_NAME,
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.10",
4
+ "version": "13.2.1",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -35,23 +35,23 @@
35
35
  "types.d.ts"
36
36
  ],
37
37
  "dependencies": {
38
- "@cloudflare/vite-plugin": "^1.25.6",
38
+ "@cloudflare/vite-plugin": "^1.32.3",
39
39
  "piccolore": "^0.1.3",
40
40
  "tinyglobby": "^0.2.15",
41
- "vite": "^7.3.1",
42
- "@astrojs/internal-helpers": "0.8.0",
41
+ "vite": "^7.3.2",
42
+ "@astrojs/internal-helpers": "0.9.0",
43
43
  "@astrojs/underscore-redirects": "1.0.3"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "astro": "^6.0.0",
47
- "wrangler": "^4.61.1"
47
+ "wrangler": "^4.83.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@cloudflare/workers-types": "^4.20260228.0",
51
51
  "@types/node": "^25.2.2",
52
52
  "cheerio": "1.2.0",
53
53
  "devalue": "^5.6.3",
54
- "astro": "6.1.7",
54
+ "astro": "6.1.9",
55
55
  "astro-scripts": "0.0.14"
56
56
  },
57
57
  "publishConfig": {
@@ -61,6 +61,7 @@
61
61
  "dev": "astro-scripts dev \"src/**/*.ts\"",
62
62
  "build": "astro-scripts build \"src/**/*.ts\" --clean-dts && tsc",
63
63
  "build:ci": "astro-scripts build \"src/**/*.ts\"",
64
- "test": "astro-scripts test --force-exit \"test/**/*.test.js\""
64
+ "test": "astro-scripts test --force-exit \"test/**/*.test.ts\"",
65
+ "typecheck:tests": "tsc --build tsconfig.test.json"
65
66
  }
66
67
  }