@harlan-zw/nuxt-cloudflare 0.0.3 → 0.0.4

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 CHANGED
@@ -58,7 +58,7 @@ export default defineNuxtConfig({
58
58
 
59
59
  Cloudflare KV requires TTLs of at least 60 seconds.
60
60
 
61
- Workers Caching is separate from Nitro's KV-backed cache. Enabling it lets Cloudflare serve responses without invoking the Worker. Keep `crossVersion: false` for deploy isolation; choose `true` only when stale responses across deployments are acceptable and a purge path exists. An authored `nitro.cloudflare.wrangler.cache` block is preserved unless `nuxtCloudflare.workersCache` is set.
61
+ Workers Caching is separate from Nitro's KV-backed cache. Enabling it lets Cloudflare serve responses without invoking the Worker. Keep `crossVersion: false` for deploy isolation; choose `true` only when stale responses across deployments are acceptable and a purge path exists. An authored `nitro.cloudflare.wrangler.cache` block is preserved unless `nuxtCloudflare.workersCache` is set; omitted `cross_version_cache` is normalized to `false`.
62
62
 
63
63
  Smart Placement moves fetch handlers only when Cloudflare measures a faster location near upstream services. Assets-first delivery remains close to the user. Queue handlers, RPC methods, and named entrypoints are unaffected. An authored region, host, or hostname placement overrides the smart default.
64
64
 
@@ -187,7 +187,7 @@ const doctor = defineCommand({
187
187
  const main = defineCommand({
188
188
  meta: {
189
189
  name: "nuxt-cloudflare",
190
- version: "0.0.3",
190
+ version: "0.0.4",
191
191
  description: "Cloudflare deployment defaults and diagnostics for Nuxt"
192
192
  },
193
193
  subCommands: { doctor }
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.5.0"
6
6
  },
7
- "version": "0.0.3",
7
+ "version": "0.0.4",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
package/dist/wrangler.mjs CHANGED
@@ -60,6 +60,11 @@ function resolveWorkersCachePolicy(policy) {
60
60
  return { enabled: false, cross_version_cache: false };
61
61
  return { enabled: true, cross_version_cache: policy.crossVersion };
62
62
  }
63
+ function resolveAuthoredWorkersCache(cache) {
64
+ if (!cache)
65
+ return resolveWorkersCachePolicy({ _tag: "disabled" });
66
+ return { ...cache, cross_version_cache: cache.cross_version_cache ?? false };
67
+ }
63
68
  const WRANGLER_BINDING_CATEGORIES = [
64
69
  "data_blobs",
65
70
  "durable_objects",
@@ -139,7 +144,7 @@ function applyCloudflareDefaults(config, options = {}) {
139
144
  function applyEnvironmentDefaults(config, options, inherited = {}) {
140
145
  const compatibilityDate = config.compatibility_date ?? inherited.compatibility_date ?? options.compatibilityDate;
141
146
  const compatibilityFlags = unique([...config.compatibility_flags ?? inherited.compatibility_flags ?? [], "nodejs_compat"]);
142
- const cache = options.workersCache ? resolveWorkersCachePolicy(options.workersCache) : config.cache ?? inherited.cache ?? resolveWorkersCachePolicy({ _tag: "disabled" });
147
+ const cache = options.workersCache ? resolveWorkersCachePolicy(options.workersCache) : resolveAuthoredWorkersCache(config.cache ?? inherited.cache);
143
148
  const requiredSecrets = unique([...config.secrets?.required ?? [], ...options.requiredSecrets ?? []]);
144
149
  const logs = config.observability?.logs;
145
150
  const inheritedLogs = inherited.observability?.logs;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@harlan-zw/nuxt-cloudflare",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "description": "Opinionated Cloudflare deployment defaults and diagnostics for Nuxt.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",