wrangler 4.4.0 → 4.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -55,14 +55,14 @@
55
55
  "esbuild": "0.24.2",
56
56
  "path-to-regexp": "6.3.0",
57
57
  "unenv": "2.0.0-rc.15",
58
- "workerd": "1.20250320.0",
58
+ "workerd": "1.20250321.0",
59
59
  "@cloudflare/kv-asset-handler": "0.4.0",
60
- "miniflare": "4.20250320.0"
60
+ "miniflare": "4.20250321.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@aws-sdk/client-s3": "^3.721.0",
64
64
  "@cloudflare/types": "6.18.4",
65
- "@cloudflare/workers-types": "^4.20250320.0",
65
+ "@cloudflare/workers-types": "^4.20250321.0",
66
66
  "@cspotcode/source-map-support": "0.8.1",
67
67
  "@iarna/toml": "^3.0.0",
68
68
  "@microsoft/api-extractor": "^7.47.0",
@@ -136,13 +136,13 @@
136
136
  "xxhash-wasm": "^1.0.1",
137
137
  "yargs": "^17.7.2",
138
138
  "@cloudflare/cli": "1.1.1",
139
- "@cloudflare/pages-shared": "^0.13.18",
140
139
  "@cloudflare/eslint-config-worker": "1.1.0",
141
- "@cloudflare/workers-shared": "0.17.0",
140
+ "@cloudflare/pages-shared": "^0.13.19",
141
+ "@cloudflare/workers-shared": "0.17.1",
142
142
  "@cloudflare/workers-tsconfig": "0.0.0"
143
143
  },
144
144
  "peerDependencies": {
145
- "@cloudflare/workers-types": "^4.20250320.0"
145
+ "@cloudflare/workers-types": "^4.20250321.0"
146
146
  },
147
147
  "peerDependenciesMeta": {
148
148
  "@cloudflare/workers-types": {
@@ -76441,13 +76441,14 @@ ${invalidHeaderRulesList}`
76441
76441
  }
76442
76442
  const rules = {};
76443
76443
  for (const rule of headers.rules) {
76444
- rules[rule.path] = {};
76444
+ const configuredRule = {};
76445
76445
  if (Object.keys(rule.headers).length) {
76446
- rules[rule.path].set = rule.headers;
76446
+ configuredRule.set = rule.headers;
76447
76447
  }
76448
76448
  if (rule.unsetHeaders.length) {
76449
- rules[rule.path].unset = rule.unsetHeaders;
76449
+ configuredRule.unset = rule.unsetHeaders;
76450
76450
  }
76451
+ rules[rule.path] = configuredRule;
76451
76452
  }
76452
76453
  return {
76453
76454
  headers: {
@@ -76598,26 +76599,29 @@ var init_validateURL = __esm({
76598
76599
  });
76599
76600
 
76600
76601
  // ../workers-shared/utils/configuration/parseHeaders.ts
76601
- function parseHeaders(input) {
76602
+ function parseHeaders(input, {
76603
+ maxRules = MAX_HEADER_RULES,
76604
+ maxLineLength = MAX_LINE_LENGTH
76605
+ } = {}) {
76602
76606
  const lines = input.split("\n");
76603
76607
  const rules = [];
76604
76608
  const invalid = [];
76605
76609
  let rule = void 0;
76606
76610
  for (let i5 = 0; i5 < lines.length; i5++) {
76607
- const line = lines[i5].trim();
76611
+ const line = (lines[i5] || "").trim();
76608
76612
  if (line.length === 0 || line.startsWith("#")) {
76609
76613
  continue;
76610
76614
  }
76611
- if (line.length > MAX_LINE_LENGTH) {
76615
+ if (line.length > maxLineLength) {
76612
76616
  invalid.push({
76613
- message: `Ignoring line ${i5 + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.`
76617
+ message: `Ignoring line ${i5 + 1} as it exceeds the maximum allowed length of ${maxLineLength}.`
76614
76618
  });
76615
76619
  continue;
76616
76620
  }
76617
76621
  if (LINE_IS_PROBABLY_A_PATH.test(line)) {
76618
- if (rules.length >= MAX_HEADER_RULES) {
76622
+ if (rules.length >= maxRules) {
76619
76623
  invalid.push({
76620
- message: `Maximum number of rules supported is ${MAX_HEADER_RULES}. Skipping remaining ${lines.length - i5} lines of file.`
76624
+ message: `Maximum number of rules supported is ${maxRules}. Skipping remaining ${lines.length - i5} lines of file.`
76621
76625
  });
76622
76626
  break;
76623
76627
  }
@@ -76675,7 +76679,7 @@ function parseHeaders(input) {
76675
76679
  continue;
76676
76680
  }
76677
76681
  const [rawName, ...rawValue] = line.split(HEADER_SEPARATOR);
76678
- const name2 = rawName.trim().toLowerCase();
76682
+ const name2 = (rawName || "").trim().toLowerCase();
76679
76683
  if (name2.includes(" ")) {
76680
76684
  invalid.push({
76681
76685
  line,
@@ -76745,7 +76749,11 @@ var init_parseHeaders = __esm({
76745
76749
  });
76746
76750
 
76747
76751
  // ../workers-shared/utils/configuration/parseRedirects.ts
76748
- function parseRedirects(input) {
76752
+ function parseRedirects(input, {
76753
+ maxStaticRules = MAX_STATIC_REDIRECT_RULES,
76754
+ maxDynamicRules = MAX_DYNAMIC_REDIRECT_RULES,
76755
+ maxLineLength = MAX_LINE_LENGTH
76756
+ } = {}) {
76749
76757
  const lines = input.split("\n");
76750
76758
  const rules = [];
76751
76759
  const seen_paths = /* @__PURE__ */ new Set();
@@ -76754,13 +76762,13 @@ function parseRedirects(input) {
76754
76762
  let dynamicRules = 0;
76755
76763
  let canCreateStaticRule = true;
76756
76764
  for (let i5 = 0; i5 < lines.length; i5++) {
76757
- const line = lines[i5].trim();
76765
+ const line = (lines[i5] || "").trim();
76758
76766
  if (line.length === 0 || line.startsWith("#")) {
76759
76767
  continue;
76760
76768
  }
76761
- if (line.length > MAX_LINE_LENGTH) {
76769
+ if (line.length > maxLineLength) {
76762
76770
  invalid.push({
76763
- message: `Ignoring line ${i5 + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.`
76771
+ message: `Ignoring line ${i5 + 1} as it exceeds the maximum allowed length of ${maxLineLength}.`
76764
76772
  });
76765
76773
  continue;
76766
76774
  }
@@ -76786,18 +76794,18 @@ function parseRedirects(input) {
76786
76794
  const from = fromResult[0];
76787
76795
  if (canCreateStaticRule && !from.match(SPLAT_REGEX) && !from.match(PLACEHOLDER_REGEX)) {
76788
76796
  staticRules += 1;
76789
- if (staticRules > MAX_STATIC_REDIRECT_RULES) {
76797
+ if (staticRules > maxStaticRules) {
76790
76798
  invalid.push({
76791
- message: `Maximum number of static rules supported is ${MAX_STATIC_REDIRECT_RULES}. Skipping line.`
76799
+ message: `Maximum number of static rules supported is ${maxStaticRules}. Skipping line.`
76792
76800
  });
76793
76801
  continue;
76794
76802
  }
76795
76803
  } else {
76796
76804
  dynamicRules += 1;
76797
76805
  canCreateStaticRule = false;
76798
- if (dynamicRules > MAX_DYNAMIC_REDIRECT_RULES) {
76806
+ if (dynamicRules > maxDynamicRules) {
76799
76807
  invalid.push({
76800
- message: `Maximum number of dynamic rules supported is ${MAX_DYNAMIC_REDIRECT_RULES}. Skipping remaining ${lines.length - i5} lines of file.`
76808
+ message: `Maximum number of dynamic rules supported is ${maxDynamicRules}. Skipping remaining ${lines.length - i5} lines of file.`
76801
76809
  });
76802
76810
  break;
76803
76811
  }
@@ -81177,7 +81185,7 @@ var import_undici3 = __toESM(require_undici());
81177
81185
 
81178
81186
  // package.json
81179
81187
  var name = "wrangler";
81180
- var version = "4.4.0";
81188
+ var version = "4.4.1";
81181
81189
 
81182
81190
  // src/environment-variables/misc-variables.ts
81183
81191
  init_import_meta_url();
@@ -112096,7 +112104,7 @@ async function getNetworkInput(args) {
112096
112104
  label: "Include IPv4",
112097
112105
  type: "confirm"
112098
112106
  });
112099
- return ipv4 === true ? { assign_ipv4: "predefined" /* PREDEFINED */ } : void 0;
112107
+ return ipv4 === true ? { assign_ipv4: "predefined" /* PREDEFINED */ } : { assign_ipv6: "predefined" /* PREDEFINED */ };
112100
112108
  }
112101
112109
  __name(getNetworkInput, "getNetworkInput");
112102
112110
 
@@ -112488,7 +112496,7 @@ async function createCommand2(args, config) {
112488
112496
  }
112489
112497
  const keysToAdd = args.allSshKeys ? (await pollSSHKeysUntilCondition(() => true)).map((key) => key.id) : [];
112490
112498
  const useIpv4 = args.ipv4 ?? config.cloudchamber.ipv4;
112491
- const network = useIpv4 === true ? { assign_ipv4: "predefined" /* PREDEFINED */ } : void 0;
112499
+ const network = useIpv4 === true ? { assign_ipv4: "predefined" /* PREDEFINED */ } : { assign_ipv6: "predefined" /* PREDEFINED */ };
112492
112500
  const deployment = await DeploymentsService.createDeploymentV2({
112493
112501
  image: body.image,
112494
112502
  location: body.location,
@@ -116713,9 +116721,13 @@ async function verifyWorkerMatchesCITag(accountId, workerName, configPath) {
116713
116721
  throw new FatalError(
116714
116722
  `The name in your ${configFileName(configPath)} file (${workerName}) must match the name of your Worker. Please update the name field in your ${configFileName(configPath)} file.`
116715
116723
  );
116724
+ } else if (e7 instanceof APIError) {
116725
+ throw new FatalError(
116726
+ "An error occurred while trying to validate that the Worker name matches what is expected by the build system.\n" + e7.message + "\n" + e7.notes.map((note) => note.text).join("\n")
116727
+ );
116716
116728
  } else {
116717
116729
  throw new FatalError(
116718
- "Wrangler cannot validate that your Worker name matches what is expected by the build system. Please retry the build."
116730
+ "Wrangler cannot validate that your Worker name matches what is expected by the build system. Please retry the build. If the problem persists, please contact support."
116719
116731
  );
116720
116732
  }
116721
116733
  }
@@ -123009,7 +123021,7 @@ var Handler14 = /* @__PURE__ */ __name(async (args) => {
123009
123021
  }
123010
123022
  if (args.env) {
123011
123023
  throw new FatalError(
123012
- "Pages does not support targeting an environment with the --env flag. Use the --branch flag to target your production or preview branch",
123024
+ "Pages does not support targeting an environment with the --env flag during local development.",
123013
123025
  1
123014
123026
  );
123015
123027
  }