@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 +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/module.json +1 -1
- package/dist/wrangler.mjs +6 -1
- package/package.json +1 -1
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
|
|
package/dist/cli/index.mjs
CHANGED
|
@@ -187,7 +187,7 @@ const doctor = defineCommand({
|
|
|
187
187
|
const main = defineCommand({
|
|
188
188
|
meta: {
|
|
189
189
|
name: "nuxt-cloudflare",
|
|
190
|
-
version: "0.0.
|
|
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
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
|
|
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;
|