wrangler 3.57.0 → 3.57.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": "3.57.0",
3
+ "version": "3.57.1",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -182,8 +182,8 @@
182
182
  "yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
183
183
  "@cloudflare/cli": "1.1.1",
184
184
  "@cloudflare/eslint-config-worker": "1.1.0",
185
- "@cloudflare/pages-shared": "^0.11.36",
186
- "@cloudflare/workers-tsconfig": "0.0.0"
185
+ "@cloudflare/workers-tsconfig": "0.0.0",
186
+ "@cloudflare/pages-shared": "^0.11.37"
187
187
  },
188
188
  "optionalDependencies": {
189
189
  "fsevents": "~2.3.2"
@@ -105878,8 +105878,9 @@ function constructRedirects({
105878
105878
  redirects,
105879
105879
  logger: logger3
105880
105880
  }) {
105881
- if (!redirects)
105881
+ if (!redirects) {
105882
105882
  return {};
105883
+ }
105883
105884
  const num_valid = redirects.rules.length;
105884
105885
  const num_invalid = redirects.invalid.length;
105885
105886
  logger3.log(
@@ -105930,8 +105931,9 @@ function constructHeaders({
105930
105931
  headers,
105931
105932
  logger: logger3
105932
105933
  }) {
105933
- if (!headers)
105934
+ if (!headers) {
105934
105935
  return {};
105936
+ }
105935
105937
  const num_valid = headers.rules.length;
105936
105938
  const num_invalid = headers.invalid.length;
105937
105939
  logger3.log(
@@ -105969,8 +105971,9 @@ function constructHeaders({
105969
105971
  function constructWebAnalytics({
105970
105972
  webAnalyticsToken
105971
105973
  }) {
105972
- if (!webAnalyticsToken)
105974
+ if (!webAnalyticsToken) {
105973
105975
  return {};
105976
+ }
105974
105977
  return {
105975
105978
  analytics: {
105976
105979
  version: ANALYTICS_VERSION,
@@ -106012,8 +106015,9 @@ var init_validateURL = __esm({
106012
106015
  "../pages-shared/metadata-generator/validateURL.ts"() {
106013
106016
  init_import_meta_url();
106014
106017
  extractPathname = /* @__PURE__ */ __name((path67 = "/", includeSearch, includeHash) => {
106015
- if (!path67.startsWith("/"))
106018
+ if (!path67.startsWith("/")) {
106016
106019
  path67 = `/${path67}`;
106020
+ }
106017
106021
  const url4 = new URL(`//${path67}`, "relative://");
106018
106022
  return `${url4.pathname}${includeSearch ? url4.search : ""}${includeHash ? url4.hash : ""}`;
106019
106023
  }, "extractPathname");
@@ -106023,11 +106027,12 @@ var init_validateURL = __esm({
106023
106027
  validateUrl = /* @__PURE__ */ __name((token, onlyRelative = false, disallowPorts = false, includeSearch = false, includeHash = false) => {
106024
106028
  const host = URL_REGEX.exec(token);
106025
106029
  if (host && host.groups && host.groups.host) {
106026
- if (onlyRelative)
106030
+ if (onlyRelative) {
106027
106031
  return [
106028
106032
  void 0,
106029
106033
  `Only relative URLs are allowed. Skipping absolute URL ${token}.`
106030
106034
  ];
106035
+ }
106031
106036
  if (disallowPorts && host.groups.host.match(HOST_WITH_PORT_REGEX)) {
106032
106037
  return [
106033
106038
  void 0,
@@ -106043,8 +106048,9 @@ var init_validateURL = __esm({
106043
106048
  void 0
106044
106049
  ];
106045
106050
  } else {
106046
- if (!token.startsWith("/") && onlyRelative)
106051
+ if (!token.startsWith("/") && onlyRelative) {
106047
106052
  token = `/${token}`;
106053
+ }
106048
106054
  const path67 = PATH_REGEX.exec(token);
106049
106055
  if (path67) {
106050
106056
  try {
@@ -106071,8 +106077,9 @@ function parseHeaders(input) {
106071
106077
  let rule = void 0;
106072
106078
  for (let i = 0; i < lines.length; i++) {
106073
106079
  const line = lines[i].trim();
106074
- if (line.length === 0 || line.startsWith("#"))
106080
+ if (line.length === 0 || line.startsWith("#")) {
106075
106081
  continue;
106082
+ }
106076
106083
  if (line.length > MAX_LINE_LENGTH) {
106077
106084
  invalid.push({
106078
106085
  message: `Ignoring line ${i + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.`
@@ -106219,8 +106226,9 @@ function parseRedirects(input) {
106219
106226
  let canCreateStaticRule = true;
106220
106227
  for (let i = 0; i < lines.length; i++) {
106221
106228
  const line = lines[i].trim();
106222
- if (line.length === 0 || line.startsWith("#"))
106229
+ if (line.length === 0 || line.startsWith("#")) {
106223
106230
  continue;
106231
+ }
106224
106232
  if (line.length > MAX_LINE_LENGTH) {
106225
106233
  invalid.push({
106226
106234
  message: `Ignoring line ${i + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.`
@@ -139347,8 +139355,9 @@ var init_rulesEngine = __esm({
139347
139355
  return str;
139348
139356
  }, "replacer");
139349
139357
  generateRulesMatcher = /* @__PURE__ */ __name((rules, replacerFn = (match) => match) => {
139350
- if (!rules)
139358
+ if (!rules) {
139351
139359
  return () => [];
139360
+ }
139352
139361
  const compiledRules = Object.entries(rules).map(([rule, match]) => {
139353
139362
  const crossHost = rule.startsWith("https://");
139354
139363
  rule = rule.split("*").map(escapeRegex).join("(?<splat>.*)");
@@ -139574,38 +139583,44 @@ async function generateHandler({
139574
139583
  const earlyHintsLinkHeader = earlyHintsResponse.headers.get("Link");
139575
139584
  if (earlyHintsLinkHeader) {
139576
139585
  headers.set("Link", earlyHintsLinkHeader);
139577
- if (setMetrics)
139586
+ if (setMetrics) {
139578
139587
  setMetrics({ earlyHintsResult: "used-hit" });
139588
+ }
139579
139589
  } else {
139580
- if (setMetrics)
139590
+ if (setMetrics) {
139581
139591
  setMetrics({ earlyHintsResult: "notused-hit" });
139592
+ }
139582
139593
  }
139583
139594
  } else {
139584
- if (setMetrics)
139595
+ if (setMetrics) {
139585
139596
  setMetrics({ earlyHintsResult: "notused-miss" });
139597
+ }
139586
139598
  const clonedResponse = response.clone();
139587
139599
  if (waitUntil) {
139588
139600
  waitUntil(
139589
139601
  (async () => {
139590
139602
  try {
139591
139603
  const links = [];
139592
- const transformedResponse = new HTMLRewriter().on("link[rel~=preconnect],link[rel~=preload]", {
139593
- element(element) {
139594
- for (const [attributeName] of element.attributes) {
139595
- if (!ALLOWED_EARLY_HINT_LINK_ATTRIBUTES.includes(
139596
- attributeName.toLowerCase()
139597
- )) {
139598
- return;
139604
+ const transformedResponse = new HTMLRewriter().on(
139605
+ "link[rel~=preconnect],link[rel~=preload],link[rel~=modulepreload]",
139606
+ {
139607
+ element(element) {
139608
+ for (const [attributeName] of element.attributes) {
139609
+ if (!ALLOWED_EARLY_HINT_LINK_ATTRIBUTES.includes(
139610
+ attributeName.toLowerCase()
139611
+ )) {
139612
+ return;
139613
+ }
139614
+ }
139615
+ const href = element.getAttribute("href") || void 0;
139616
+ const rel = element.getAttribute("rel") || void 0;
139617
+ const as = element.getAttribute("as") || void 0;
139618
+ if (href && !href.startsWith("data:") && rel) {
139619
+ links.push({ href, rel, as });
139599
139620
  }
139600
- }
139601
- const href = element.getAttribute("href") || void 0;
139602
- const rel = element.getAttribute("rel") || void 0;
139603
- const as = element.getAttribute("as") || void 0;
139604
- if (href && !href.startsWith("data:") && rel) {
139605
- links.push({ href, rel, as });
139606
139621
  }
139607
139622
  }
139608
- }).transform(clonedResponse);
139623
+ ).transform(clonedResponse);
139609
139624
  await transformedResponse.text();
139610
139625
  links.forEach(({ href, rel, as }) => {
139611
139626
  let link = `<${href}>; rel="${rel}"`;
@@ -139634,8 +139649,9 @@ async function generateHandler({
139634
139649
  }
139635
139650
  }
139636
139651
  } else {
139637
- if (setMetrics)
139652
+ if (setMetrics) {
139638
139653
  setMetrics({ earlyHintsResult: "disabled" });
139654
+ }
139639
139655
  }
139640
139656
  const headersMatcher = generateRulesMatcher(
139641
139657
  headerRules,
@@ -139822,8 +139838,9 @@ async function generateHandler({
139822
139838
  logError(err);
139823
139839
  }
139824
139840
  } else {
139825
- if (setMetrics)
139841
+ if (setMetrics) {
139826
139842
  setMetrics({ preservationCacheResult: "disabled" });
139843
+ }
139827
139844
  }
139828
139845
  let cwd2 = pathname;
139829
139846
  while (cwd2) {
@@ -139874,13 +139891,15 @@ function isPreview(url4) {
139874
139891
  }
139875
139892
  function isPreservationCacheResponseExpiring(response) {
139876
139893
  const ageHeader = response.headers.get("age");
139877
- if (!ageHeader)
139894
+ if (!ageHeader) {
139878
139895
  return false;
139896
+ }
139879
139897
  try {
139880
139898
  const age = parseInt(ageHeader);
139881
139899
  const jitter = Math.floor(Math.random() * 43200);
139882
- if (age > CACHE_PRESERVATION_WRITE_FREQUENCY + jitter)
139900
+ if (age > CACHE_PRESERVATION_WRITE_FREQUENCY + jitter) {
139883
139901
  return true;
139902
+ }
139884
139903
  } catch {
139885
139904
  return false;
139886
139905
  }
@@ -152627,7 +152646,7 @@ init_import_meta_url();
152627
152646
  init_import_meta_url();
152628
152647
 
152629
152648
  // package.json
152630
- var version = "3.57.0";
152649
+ var version = "3.57.1";
152631
152650
  var package_default = {
152632
152651
  name: "wrangler",
152633
152652
  version,
@@ -162322,6 +162341,9 @@ function handleRuntimeStdio(stdout2, stderr2) {
162322
162341
  },
162323
162342
  isWarning(chunk) {
162324
162343
  return /\.c\+\+:\d+: warning:/.test(chunk);
162344
+ },
162345
+ isCodeMovedWarning(chunk) {
162346
+ return /CODE_MOVED for unknown code block/.test(chunk);
162325
162347
  }
162326
162348
  };
162327
162349
  stdout2.on("data", (chunk) => {
@@ -162348,6 +162370,7 @@ function handleRuntimeStdio(stdout2, stderr2) {
162348
162370
  logger.debug(chunk);
162349
162371
  } else if (classifiers.isWarning(chunk)) {
162350
162372
  logger.warn(chunk);
162373
+ } else if (classifiers.isCodeMovedWarning(chunk)) {
162351
162374
  } else {
162352
162375
  logger.error(getSourceMappedString(chunk));
162353
162376
  }
@@ -183543,9 +183566,12 @@ To silence this warning, pass in --commit-dirty=true`
183543
183566
  const logs = await fetchResult(
183544
183567
  `/accounts/${accountId}/pages/projects/${projectName}/deployments/${deploymentResponse.id}/history/logs?size=10000000`
183545
183568
  );
183546
- const failureMessage = logs.data[logs.total - 1].line;
183547
- logger.error(failureMessage.replace("Error:", "").trim());
183548
- logger.log("\u274C Deployment failed!");
183569
+ const failureMessage = logs.data[logs.total - 1].line.replace("Error:", "").trim();
183570
+ throw new FatalError(
183571
+ `Deployment failed!
183572
+ ${failureMessage}`,
183573
+ 1
183574
+ );
183549
183575
  } else {
183550
183576
  logger.log(
183551
183577
  `\u2728 Deployment complete! However, we couldn't ascertain the final status of your deployment.
@@ -186639,7 +186665,7 @@ function createBody2(args) {
186639
186665
  settings: {
186640
186666
  batch_size: args.batchSize,
186641
186667
  max_retries: args.messageRetries,
186642
- max_wait_time_ms: args.batchTimeout ? 1e3 * args.batchTimeout : void 0,
186668
+ max_wait_time_ms: args.batchTimeout !== void 0 ? 1e3 * args.batchTimeout : void 0,
186643
186669
  max_concurrency: args.maxConcurrency,
186644
186670
  retry_delay: args.retryDelaySecs
186645
186671
  },
@@ -203197,7 +203223,7 @@ async function updateQueueConsumers(config) {
203197
203223
  settings: {
203198
203224
  batch_size: consumer.max_batch_size,
203199
203225
  max_retries: consumer.max_retries,
203200
- max_wait_time_ms: consumer.max_batch_timeout ? 1e3 * consumer.max_batch_timeout : void 0,
203226
+ max_wait_time_ms: consumer.max_batch_timeout !== void 0 ? 1e3 * consumer.max_batch_timeout : void 0,
203201
203227
  max_concurrency: consumer.max_concurrency,
203202
203228
  retry_delay: consumer.retry_delay
203203
203229
  }
@@ -204762,11 +204788,6 @@ function DevSession(props) {
204762
204788
  "Queues are currently in Beta and are not supported in wrangler dev remote mode."
204763
204789
  );
204764
204790
  }
204765
- if (props.local && props.bindings.hyperdrive?.length) {
204766
- logger.warn(
204767
- "Hyperdrive does not currently support 'wrangler dev' in local mode at this stage of the beta. Use the '--remote' flag to test a Hyperdrive configuration before deploying."
204768
- );
204769
- }
204770
204791
  const announceAndOnReady = /* @__PURE__ */ __name(async (finalIp, finalPort, proxyData) => {
204771
204792
  const { proxyWorker } = await devEnv.proxy.ready.promise;
204772
204793
  const url4 = await proxyWorker.ready;