@cloudflare/vite-plugin 1.36.0 → 1.36.2

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/index.mjs CHANGED
@@ -1503,7 +1503,7 @@ async function assertWranglerVersion() {
1503
1503
  * The default compatibility date to use when the user omits one.
1504
1504
  * This value is injected at build time and remains fixed for each release.
1505
1505
  */
1506
- const DEFAULT_COMPAT_DATE = "2026-05-05";
1506
+ const DEFAULT_COMPAT_DATE = "2026-05-07";
1507
1507
 
1508
1508
  //#endregion
1509
1509
  //#region ../../node_modules/.pnpm/@remix-run+node-fetch-server@0.8.0/node_modules/@remix-run/node-fetch-server/dist/node-fetch-server.js
@@ -32770,7 +32770,8 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
32770
32770
  "version_metadata",
32771
32771
  "logpush",
32772
32772
  "observability",
32773
- "limits"
32773
+ "limits",
32774
+ "cache"
32774
32775
  ]) && isValid2;
32775
32776
  isValid2 = validateVars(envName)(diagnostics, `${field}.vars`, previews.vars, void 0) && isValid2;
32776
32777
  isValid2 = validateDefines(envName)(diagnostics, `${field}.define`, previews.define, void 0) && isValid2;
@@ -32810,6 +32811,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
32810
32811
  isValid2 = validateOptionalProperty(diagnostics, `${field}.limits`, "cpu_ms", previews.limits.cpu_ms, "number") && isValid2;
32811
32812
  isValid2 = validateOptionalProperty(diagnostics, `${field}.limits`, "subrequests", previews.limits.subrequests, "number") && isValid2;
32812
32813
  }
32814
+ isValid2 = validateCache(diagnostics, `${field}.cache`, previews.cache, void 0) && isValid2;
32813
32815
  return isValid2;
32814
32816
  }, "validatePreviewsConfig");
32815
32817
  var validateMigrations = /* @__PURE__ */ __name((diagnostics, field, value) => {
@@ -48455,10 +48457,26 @@ function getLocalDevVarsForPreview(config, cloudflareEnv) {
48455
48457
  const dotDevDotVars = wrangler.unstable_getVarsForDev(config.configPath, void 0, {}, cloudflareEnv, false, config.secrets);
48456
48458
  const dotDevDotVarsEntries = Array.from(Object.entries(dotDevDotVars));
48457
48459
  if (dotDevDotVarsEntries.length > 0) return dotDevDotVarsEntries.map(([key, { value }]) => {
48458
- return `${key} = "${value?.toString().replaceAll(`"`, `\\"`)}"\n`;
48460
+ return `${key}=${quoteForDotenv(value?.toString() ?? "")}\n`;
48459
48461
  }).join("");
48460
48462
  }
48461
48463
  /**
48464
+ * Quote a value so that wrangler reads it back unchanged when it parses
48465
+ * `dist/<env>/.dev.vars` at preview time.
48466
+ *
48467
+ * Strategy: To quote the string pick the first quote character that does not
48468
+ * appear in the value (single → backtick → double). Throw if a value cannot
48469
+ * be losslessly serialized rather than silently corrupting it.
48470
+ *
48471
+ * @internal exported for tests
48472
+ */
48473
+ function quoteForDotenv(value) {
48474
+ if (!value.includes("'")) return `'${value}'`;
48475
+ if (!value.includes("`")) return `\`${value}\``;
48476
+ if (!value.includes("\"") && !/[\\\n\r]/.test(value)) return `"${value}"`;
48477
+ throw new Error("Unable to serialize value to .dev.vars: contains every supported quote character or unsafe escape sequence.");
48478
+ }
48479
+ /**
48462
48480
  * Returns `true` if the `changedFile` matches a `.dev.vars` or `.env` file.
48463
48481
  */
48464
48482
  function hasLocalDevVarsFileChanged({ configPaths, cloudflareEnv }, changedFilePath) {