@cloudflare/vite-plugin 1.35.0 → 1.36.0

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-04-30";
1506
+ const DEFAULT_COMPAT_DATE = "2026-05-05";
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
@@ -31264,7 +31264,6 @@ var validateStreamingTailConsumers = /* @__PURE__ */ __name((diagnostics, field,
31264
31264
  function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDispatchNamespace, preserveOriginalMain, envName = "top level", topLevelEnv, useServiceEnvironments, rawConfig) {
31265
31265
  deprecated(diagnostics, rawEnv, "node_compat", `The "node_compat" field is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`, true, "Removed", "error");
31266
31266
  experimental(diagnostics, rawEnv, "unsafe");
31267
- experimental(diagnostics, rawEnv, "secrets");
31268
31267
  const route = normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv);
31269
31268
  const account_id = inheritableInWranglerEnvironments(diagnostics, useServiceEnvironments, topLevelEnv, mutateEmptyStringAccountIDValue(diagnostics, rawEnv), "account_id", isString$2, void 0, void 0);
31270
31269
  const routes = validateRoutes(diagnostics, topLevelEnv, rawEnv);
@@ -32764,6 +32763,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
32764
32763
  "secrets_store_secrets",
32765
32764
  "artifacts",
32766
32765
  "unsafe_hello_world",
32766
+ "flagship",
32767
32767
  "worker_loaders",
32768
32768
  "ratelimits",
32769
32769
  "vpc_services",
@@ -32799,6 +32799,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
32799
32799
  isValid2 = validateBindingArray(envName, validateSecretsStoreSecretBinding)(diagnostics, `${field}.secrets_store_secrets`, previews.secrets_store_secrets, void 0) && isValid2;
32800
32800
  isValid2 = validateBindingArray(envName, validateArtifactsBinding)(diagnostics, `${field}.artifacts`, previews.artifacts, void 0) && isValid2;
32801
32801
  isValid2 = validateBindingArray(envName, validateHelloWorldBinding)(diagnostics, `${field}.unsafe_hello_world`, previews.unsafe_hello_world, void 0) && isValid2;
32802
+ isValid2 = validateBindingArray(envName, validateFlagshipBinding)(diagnostics, `${field}.flagship`, previews.flagship, void 0) && isValid2;
32802
32803
  isValid2 = validateBindingArray(envName, validateWorkerLoaderBinding)(diagnostics, `${field}.worker_loaders`, previews.worker_loaders, void 0) && isValid2;
32803
32804
  isValid2 = validateBindingArray(envName, validateRateLimitBinding)(diagnostics, `${field}.ratelimits`, previews.ratelimits, void 0) && isValid2;
32804
32805
  isValid2 = validateBindingArray(envName, validateVpcServiceBinding)(diagnostics, `${field}.vpc_services`, previews.vpc_services, void 0) && isValid2;
@@ -42598,6 +42599,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
42598
42599
  const rules = [];
42599
42600
  const invalid = [];
42600
42601
  let rule = void 0;
42602
+ let skipUntilNextPath = false;
42601
42603
  for (let i$1 = 0; i$1 < lines.length; i$1++) {
42602
42604
  const line = (lines[i$1] || "").trim();
42603
42605
  if (line.length === 0 || line.startsWith("#")) continue;
@@ -42606,6 +42608,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
42606
42608
  continue;
42607
42609
  }
42608
42610
  if (LINE_IS_PROBABLY_A_PATH.test(line)) {
42611
+ skipUntilNextPath = false;
42609
42612
  if (rules.length >= maxRules) {
42610
42613
  invalid.push({ message: `Maximum number of rules supported is ${maxRules}. Skipping remaining ${lines.length - i$1} lines of file.` });
42611
42614
  break;
@@ -42628,6 +42631,18 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
42628
42631
  message: pathError
42629
42632
  });
42630
42633
  rule = void 0;
42634
+ skipUntilNextPath = true;
42635
+ continue;
42636
+ }
42637
+ const wildcardError = validateNoMultipleWildcards(path$2);
42638
+ if (wildcardError) {
42639
+ invalid.push({
42640
+ line,
42641
+ lineNumber: i$1 + 1,
42642
+ message: wildcardError
42643
+ });
42644
+ rule = void 0;
42645
+ skipUntilNextPath = true;
42631
42646
  continue;
42632
42647
  }
42633
42648
  rule = {
@@ -42638,6 +42653,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
42638
42653
  };
42639
42654
  continue;
42640
42655
  }
42656
+ if (skipUntilNextPath) continue;
42641
42657
  if (!line.includes(HEADER_SEPARATOR)) {
42642
42658
  if (!rule) invalid.push({
42643
42659
  line,
@@ -42707,6 +42723,18 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
42707
42723
  function isValidRule(rule) {
42708
42724
  return Object.keys(rule.headers).length > 0 || rule.unsetHeaders.length > 0;
42709
42725
  }
42726
+ /**
42727
+ * At runtime, `*` wildcards are converted to `:splat` placeholders. This means
42728
+ * a path with multiple wildcards, or a wildcard combined with an explicit
42729
+ * `:splat` placeholder, would result in duplicate `:splat` parameters which is
42730
+ * unsupported.
42731
+ */
42732
+ function validateNoMultipleWildcards(path$2) {
42733
+ const wildcardCount = (path$2.match(SPLAT_REGEX) ?? []).length;
42734
+ const hasSplatPlaceholder = /:splat(?!\w)/.test(path$2);
42735
+ if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$2}.`;
42736
+ if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path$2}.`;
42737
+ }
42710
42738
 
42711
42739
  //#endregion
42712
42740
  //#region ../workers-shared/utils/configuration/parseRedirects.ts
@@ -48489,7 +48517,10 @@ const configPlugin = createPlugin("config", (ctx) => {
48489
48517
  fs: { deny: [...[
48490
48518
  ".env",
48491
48519
  ".env.*",
48492
- "*.{crt,pem}",
48520
+ ".npmrc",
48521
+ ".yarnrc",
48522
+ ".yarnrc.yml",
48523
+ "*.{crt,pem,key,pfx,p12,p8,jks}",
48493
48524
  "**/.git/**",
48494
48525
  ".dev.vars",
48495
48526
  ".dev.vars.*",