@vercel/node 5.9.9 → 5.10.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.
@@ -597,8 +597,10 @@ import { readFileSync } from "fs";
597
597
  // src/utils.ts
598
598
  import { debug, streamToBuffer } from "@vercel/build-utils";
599
599
  import { extname } from "path";
600
- import { pathToRegexp as pathToRegexpCurrent } from "path-to-regexp";
601
- import { pathToRegexp as pathToRegexpUpdated } from "path-to-regexp-updated";
600
+ import {
601
+ getRegExpFromMatchers,
602
+ resolveMiddlewareMatcher
603
+ } from "@vercel/build-utils";
602
604
  var WAIT_UNTIL_TIMEOUT = 30;
603
605
  var waitUntilWarning = (entrypointPath, maxDuration) => `
604
606
  The function \`${entrypointPath.split("/").pop()}\` is still running after ${maxDuration}s.
package/dist/index.js CHANGED
@@ -32295,11 +32295,11 @@ var require_common = __commonJS({
32295
32295
  let enableOverride = null;
32296
32296
  let namespacesCache;
32297
32297
  let enabledCache;
32298
- function debug5(...args) {
32299
- if (!debug5.enabled) {
32298
+ function debug4(...args) {
32299
+ if (!debug4.enabled) {
32300
32300
  return;
32301
32301
  }
32302
- const self2 = debug5;
32302
+ const self2 = debug4;
32303
32303
  const curr = Number(/* @__PURE__ */ new Date());
32304
32304
  const ms = curr - (prevTime || curr);
32305
32305
  self2.diff = ms;
@@ -32329,12 +32329,12 @@ var require_common = __commonJS({
32329
32329
  const logFn = self2.log || createDebug.log;
32330
32330
  logFn.apply(self2, args);
32331
32331
  }
32332
- debug5.namespace = namespace;
32333
- debug5.useColors = createDebug.useColors();
32334
- debug5.color = createDebug.selectColor(namespace);
32335
- debug5.extend = extend;
32336
- debug5.destroy = createDebug.destroy;
32337
- Object.defineProperty(debug5, "enabled", {
32332
+ debug4.namespace = namespace;
32333
+ debug4.useColors = createDebug.useColors();
32334
+ debug4.color = createDebug.selectColor(namespace);
32335
+ debug4.extend = extend;
32336
+ debug4.destroy = createDebug.destroy;
32337
+ Object.defineProperty(debug4, "enabled", {
32338
32338
  enumerable: true,
32339
32339
  configurable: false,
32340
32340
  get: () => {
@@ -32352,9 +32352,9 @@ var require_common = __commonJS({
32352
32352
  }
32353
32353
  });
32354
32354
  if (typeof createDebug.init === "function") {
32355
- createDebug.init(debug5);
32355
+ createDebug.init(debug4);
32356
32356
  }
32357
- return debug5;
32357
+ return debug4;
32358
32358
  }
32359
32359
  function extend(namespace, delimiter) {
32360
32360
  const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
@@ -32891,11 +32891,11 @@ var require_node = __commonJS({
32891
32891
  function load() {
32892
32892
  return process.env.DEBUG;
32893
32893
  }
32894
- function init(debug5) {
32895
- debug5.inspectOpts = {};
32894
+ function init(debug4) {
32895
+ debug4.inspectOpts = {};
32896
32896
  const keys = Object.keys(exports.inspectOpts);
32897
32897
  for (let i = 0; i < keys.length; i++) {
32898
- debug5.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
32898
+ debug4.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
32899
32899
  }
32900
32900
  }
32901
32901
  module2.exports = require_common()(exports);
@@ -45447,7 +45447,7 @@ var require_path = __commonJS({
45447
45447
  var {
45448
45448
  validate
45449
45449
  } = _t;
45450
- var debug5 = _debug("babel");
45450
+ var debug4 = _debug("babel");
45451
45451
  var REMOVED = exports.REMOVED = 1 << 0;
45452
45452
  var SHOULD_STOP = exports.SHOULD_STOP = 1 << 1;
45453
45453
  var SHOULD_SKIP = exports.SHOULD_SKIP = 1 << 2;
@@ -45565,9 +45565,9 @@ var require_path = __commonJS({
45565
45565
  return parts.join(".");
45566
45566
  }
45567
45567
  debug(message) {
45568
- if (!debug5.enabled)
45568
+ if (!debug4.enabled)
45569
45569
  return;
45570
- debug5(`${this.getPathLocation()} ${this.type}: ${message}`);
45570
+ debug4(`${this.getPathLocation()} ${this.type}: ${message}`);
45571
45571
  }
45572
45572
  toString() {
45573
45573
  return (0, _generator.default)(this.node).code;
@@ -48096,15 +48096,15 @@ var require_lib11 = __commonJS({
48096
48096
  var require_semver = __commonJS({
48097
48097
  "../../node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.js"(exports, module2) {
48098
48098
  exports = module2.exports = SemVer;
48099
- var debug5;
48099
+ var debug4;
48100
48100
  if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
48101
- debug5 = function() {
48101
+ debug4 = function() {
48102
48102
  var args = Array.prototype.slice.call(arguments, 0);
48103
48103
  args.unshift("SEMVER");
48104
48104
  console.log.apply(console, args);
48105
48105
  };
48106
48106
  } else {
48107
- debug5 = function() {
48107
+ debug4 = function() {
48108
48108
  };
48109
48109
  }
48110
48110
  exports.SEMVER_SPEC_VERSION = "2.0.0";
@@ -48222,7 +48222,7 @@ var require_semver = __commonJS({
48222
48222
  tok("STAR");
48223
48223
  src[t.STAR] = "(<|>)?=?\\s*\\*";
48224
48224
  for (i = 0; i < R; i++) {
48225
- debug5(i, src[i]);
48225
+ debug4(i, src[i]);
48226
48226
  if (!re[i]) {
48227
48227
  re[i] = new RegExp(src[i]);
48228
48228
  safeRe[i] = new RegExp(makeSafeRe(src[i]));
@@ -48289,7 +48289,7 @@ var require_semver = __commonJS({
48289
48289
  if (!(this instanceof SemVer)) {
48290
48290
  return new SemVer(version2, options);
48291
48291
  }
48292
- debug5("SemVer", version2, options);
48292
+ debug4("SemVer", version2, options);
48293
48293
  this.options = options;
48294
48294
  this.loose = !!options.loose;
48295
48295
  var m = version2.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]);
@@ -48336,7 +48336,7 @@ var require_semver = __commonJS({
48336
48336
  return this.version;
48337
48337
  };
48338
48338
  SemVer.prototype.compare = function(other) {
48339
- debug5("SemVer.compare", this.version, this.options, other);
48339
+ debug4("SemVer.compare", this.version, this.options, other);
48340
48340
  if (!(other instanceof SemVer)) {
48341
48341
  other = new SemVer(other, this.options);
48342
48342
  }
@@ -48363,7 +48363,7 @@ var require_semver = __commonJS({
48363
48363
  do {
48364
48364
  var a = this.prerelease[i2];
48365
48365
  var b = other.prerelease[i2];
48366
- debug5("prerelease compare", i2, a, b);
48366
+ debug4("prerelease compare", i2, a, b);
48367
48367
  if (a === void 0 && b === void 0) {
48368
48368
  return 0;
48369
48369
  } else if (b === void 0) {
@@ -48385,7 +48385,7 @@ var require_semver = __commonJS({
48385
48385
  do {
48386
48386
  var a = this.build[i2];
48387
48387
  var b = other.build[i2];
48388
- debug5("prerelease compare", i2, a, b);
48388
+ debug4("prerelease compare", i2, a, b);
48389
48389
  if (a === void 0 && b === void 0) {
48390
48390
  return 0;
48391
48391
  } else if (b === void 0) {
@@ -48645,7 +48645,7 @@ var require_semver = __commonJS({
48645
48645
  return new Comparator(comp, options);
48646
48646
  }
48647
48647
  comp = comp.trim().split(/\s+/).join(" ");
48648
- debug5("comparator", comp, options);
48648
+ debug4("comparator", comp, options);
48649
48649
  this.options = options;
48650
48650
  this.loose = !!options.loose;
48651
48651
  this.parse(comp);
@@ -48654,7 +48654,7 @@ var require_semver = __commonJS({
48654
48654
  } else {
48655
48655
  this.value = this.operator + this.semver.version;
48656
48656
  }
48657
- debug5("comp", this);
48657
+ debug4("comp", this);
48658
48658
  }
48659
48659
  var ANY = {};
48660
48660
  Comparator.prototype.parse = function(comp) {
@@ -48677,7 +48677,7 @@ var require_semver = __commonJS({
48677
48677
  return this.value;
48678
48678
  };
48679
48679
  Comparator.prototype.test = function(version2) {
48680
- debug5("Comparator.test", version2, this.options.loose);
48680
+ debug4("Comparator.test", version2, this.options.loose);
48681
48681
  if (this.semver === ANY || version2 === ANY) {
48682
48682
  return true;
48683
48683
  }
@@ -48770,9 +48770,9 @@ var require_semver = __commonJS({
48770
48770
  var loose = this.options.loose;
48771
48771
  var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE];
48772
48772
  range = range.replace(hr, hyphenReplace);
48773
- debug5("hyphen replace", range);
48773
+ debug4("hyphen replace", range);
48774
48774
  range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace);
48775
- debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]);
48775
+ debug4("comparator trim", range, safeRe[t.COMPARATORTRIM]);
48776
48776
  range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace);
48777
48777
  range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace);
48778
48778
  range = range.split(/\s+/).join(" ");
@@ -48825,15 +48825,15 @@ var require_semver = __commonJS({
48825
48825
  });
48826
48826
  }
48827
48827
  function parseComparator(comp, options) {
48828
- debug5("comp", comp, options);
48828
+ debug4("comp", comp, options);
48829
48829
  comp = replaceCarets(comp, options);
48830
- debug5("caret", comp);
48830
+ debug4("caret", comp);
48831
48831
  comp = replaceTildes(comp, options);
48832
- debug5("tildes", comp);
48832
+ debug4("tildes", comp);
48833
48833
  comp = replaceXRanges(comp, options);
48834
- debug5("xrange", comp);
48834
+ debug4("xrange", comp);
48835
48835
  comp = replaceStars(comp, options);
48836
- debug5("stars", comp);
48836
+ debug4("stars", comp);
48837
48837
  return comp;
48838
48838
  }
48839
48839
  function isX(id) {
@@ -48847,7 +48847,7 @@ var require_semver = __commonJS({
48847
48847
  function replaceTilde(comp, options) {
48848
48848
  var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE];
48849
48849
  return comp.replace(r, function(_, M, m, p, pr) {
48850
- debug5("tilde", comp, _, M, m, p, pr);
48850
+ debug4("tilde", comp, _, M, m, p, pr);
48851
48851
  var ret;
48852
48852
  if (isX(M)) {
48853
48853
  ret = "";
@@ -48856,12 +48856,12 @@ var require_semver = __commonJS({
48856
48856
  } else if (isX(p)) {
48857
48857
  ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
48858
48858
  } else if (pr) {
48859
- debug5("replaceTilde pr", pr);
48859
+ debug4("replaceTilde pr", pr);
48860
48860
  ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
48861
48861
  } else {
48862
48862
  ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
48863
48863
  }
48864
- debug5("tilde return", ret);
48864
+ debug4("tilde return", ret);
48865
48865
  return ret;
48866
48866
  });
48867
48867
  }
@@ -48871,10 +48871,10 @@ var require_semver = __commonJS({
48871
48871
  }).join(" ");
48872
48872
  }
48873
48873
  function replaceCaret(comp, options) {
48874
- debug5("caret", comp, options);
48874
+ debug4("caret", comp, options);
48875
48875
  var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET];
48876
48876
  return comp.replace(r, function(_, M, m, p, pr) {
48877
- debug5("caret", comp, _, M, m, p, pr);
48877
+ debug4("caret", comp, _, M, m, p, pr);
48878
48878
  var ret;
48879
48879
  if (isX(M)) {
48880
48880
  ret = "";
@@ -48887,7 +48887,7 @@ var require_semver = __commonJS({
48887
48887
  ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
48888
48888
  }
48889
48889
  } else if (pr) {
48890
- debug5("replaceCaret pr", pr);
48890
+ debug4("replaceCaret pr", pr);
48891
48891
  if (M === "0") {
48892
48892
  if (m === "0") {
48893
48893
  ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
@@ -48898,7 +48898,7 @@ var require_semver = __commonJS({
48898
48898
  ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
48899
48899
  }
48900
48900
  } else {
48901
- debug5("no pr");
48901
+ debug4("no pr");
48902
48902
  if (M === "0") {
48903
48903
  if (m === "0") {
48904
48904
  ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
@@ -48909,12 +48909,12 @@ var require_semver = __commonJS({
48909
48909
  ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
48910
48910
  }
48911
48911
  }
48912
- debug5("caret return", ret);
48912
+ debug4("caret return", ret);
48913
48913
  return ret;
48914
48914
  });
48915
48915
  }
48916
48916
  function replaceXRanges(comp, options) {
48917
- debug5("replaceXRanges", comp, options);
48917
+ debug4("replaceXRanges", comp, options);
48918
48918
  return comp.split(/\s+/).map(function(comp2) {
48919
48919
  return replaceXRange(comp2, options);
48920
48920
  }).join(" ");
@@ -48923,7 +48923,7 @@ var require_semver = __commonJS({
48923
48923
  comp = comp.trim();
48924
48924
  var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE];
48925
48925
  return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
48926
- debug5("xRange", comp, ret, gtlt, M, m, p, pr);
48926
+ debug4("xRange", comp, ret, gtlt, M, m, p, pr);
48927
48927
  var xM = isX(M);
48928
48928
  var xm = xM || isX(m);
48929
48929
  var xp = xm || isX(p);
@@ -48967,12 +48967,12 @@ var require_semver = __commonJS({
48967
48967
  } else if (xp) {
48968
48968
  ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
48969
48969
  }
48970
- debug5("xRange return", ret);
48970
+ debug4("xRange return", ret);
48971
48971
  return ret;
48972
48972
  });
48973
48973
  }
48974
48974
  function replaceStars(comp, options) {
48975
- debug5("replaceStars", comp, options);
48975
+ debug4("replaceStars", comp, options);
48976
48976
  return comp.trim().replace(safeRe[t.STAR], "");
48977
48977
  }
48978
48978
  function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
@@ -49024,7 +49024,7 @@ var require_semver = __commonJS({
49024
49024
  }
49025
49025
  if (version2.prerelease.length && !options.includePrerelease) {
49026
49026
  for (i2 = 0; i2 < set.length; i2++) {
49027
- debug5(set[i2].semver);
49027
+ debug4(set[i2].semver);
49028
49028
  if (set[i2].semver === ANY) {
49029
49029
  continue;
49030
49030
  }
@@ -51909,9 +51909,9 @@ var require_functional = __commonJS({
51909
51909
  Object.defineProperty(exports, "__esModule", {
51910
51910
  value: true
51911
51911
  });
51912
- exports.once = once3;
51912
+ exports.once = once2;
51913
51913
  var _async = require_async();
51914
- function once3(fn) {
51914
+ function once2(fn) {
51915
51915
  let result;
51916
51916
  let resultP;
51917
51917
  let promiseReferenced = false;
@@ -60703,7 +60703,7 @@ var require_config_chain = __commonJS({
60703
60703
  var _index = require_files();
60704
60704
  var _caching = require_caching();
60705
60705
  var _configDescriptors = require_config_descriptors();
60706
- var debug5 = _debug()("babel:config:config-chain");
60706
+ var debug4 = _debug()("babel:config:config-chain");
60707
60707
  function* buildPresetChain(arg, context) {
60708
60708
  const chain = yield* buildPresetChainWalker(arg, context);
60709
60709
  if (!chain)
@@ -61118,7 +61118,7 @@ File already loaded following the config chain:
61118
61118
  if (ignore && matchesPatterns(context, ignore, dirname4)) {
61119
61119
  var _context$filename;
61120
61120
  const message = `No config is applied to "${(_context$filename = context.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname4}"`;
61121
- debug5(message);
61121
+ debug4(message);
61122
61122
  if (context.showConfig) {
61123
61123
  console.log(message);
61124
61124
  }
@@ -61127,7 +61127,7 @@ File already loaded following the config chain:
61127
61127
  if (only && !matchesPatterns(context, only, dirname4)) {
61128
61128
  var _context$filename2;
61129
61129
  const message = `No config is applied to "${(_context$filename2 = context.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname4}"`;
61130
- debug5(message);
61130
+ debug4(message);
61131
61131
  if (context.showConfig) {
61132
61132
  console.log(message);
61133
61133
  }
@@ -62737,7 +62737,7 @@ var require_normalize_file = __commonJS({
62737
62737
  file,
62738
62738
  traverseFast
62739
62739
  } = _t();
62740
- var debug5 = _debug()("babel:transform:file");
62740
+ var debug4 = _debug()("babel:transform:file");
62741
62741
  var INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
62742
62742
  var EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
62743
62743
  function* normalizeFile(pluginPasses, options, code, ast) {
@@ -62766,7 +62766,7 @@ var require_normalize_file = __commonJS({
62766
62766
  inputMap = _convertSourceMap().fromComment("//" + lastComment);
62767
62767
  } catch (err) {
62768
62768
  {
62769
- debug5("discarding unknown inline input sourcemap");
62769
+ debug4("discarding unknown inline input sourcemap");
62770
62770
  }
62771
62771
  }
62772
62772
  }
@@ -62779,10 +62779,10 @@ var require_normalize_file = __commonJS({
62779
62779
  const inputMapContent = _fs().readFileSync(_path().resolve(_path().dirname(options.filename), match[1]), "utf8");
62780
62780
  inputMap = _convertSourceMap().fromJSON(inputMapContent);
62781
62781
  } catch (err) {
62782
- debug5("discarding unknown file input sourcemap", err);
62782
+ debug4("discarding unknown file input sourcemap", err);
62783
62783
  }
62784
62784
  } else if (lastComment) {
62785
- debug5("discarding un-loadable file input sourcemap");
62785
+ debug4("discarding un-loadable file input sourcemap");
62786
62786
  }
62787
62787
  }
62788
62788
  }
@@ -69006,7 +69006,7 @@ var require_module_types = __commonJS({
69006
69006
  });
69007
69007
  };
69008
69008
  }
69009
- var debug5 = _debug()("babel:config:loading:files:module-types");
69009
+ var debug4 = _debug()("babel:config:loading:files:module-types");
69010
69010
  {
69011
69011
  try {
69012
69012
  import_ = require_import();
@@ -69090,7 +69090,7 @@ var require_module_types = __commonJS({
69090
69090
  var LOADING_CJS_FILES = /* @__PURE__ */ new Set();
69091
69091
  function loadCjsDefault(filepath) {
69092
69092
  if (LOADING_CJS_FILES.has(filepath)) {
69093
- debug5("Auto-ignoring usage of config %o.", filepath);
69093
+ debug4("Auto-ignoring usage of config %o.", filepath);
69094
69094
  return {};
69095
69095
  }
69096
69096
  let module3;
@@ -69201,7 +69201,7 @@ var require_configuration = __commonJS({
69201
69201
  var _configError = require_config_error();
69202
69202
  var fs = require_fs();
69203
69203
  var _rewriteStackTrace = require_rewrite_stack_trace();
69204
- var debug5 = _debug()("babel:config:loading:files:configuration");
69204
+ var debug4 = _debug()("babel:config:loading:files:configuration");
69205
69205
  var ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts"];
69206
69206
  var RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"];
69207
69207
  var BABELIGNORE_FILENAME = ".babelignore";
@@ -69329,7 +69329,7 @@ var require_configuration = __commonJS({
69329
69329
  const ignoreLoc = _path().join(loc, BABELIGNORE_FILENAME);
69330
69330
  ignore = yield* readIgnoreConfig(ignoreLoc);
69331
69331
  if (ignore) {
69332
- debug5("Found ignore %o from %o.", ignore.filepath, dirname4);
69332
+ debug4("Found ignore %o from %o.", ignore.filepath, dirname4);
69333
69333
  }
69334
69334
  }
69335
69335
  }
@@ -69353,7 +69353,7 @@ from ${dirname4}`);
69353
69353
  return config2 || previousConfig2;
69354
69354
  }, previousConfig);
69355
69355
  if (config) {
69356
- debug5("Found configuration %o from %o.", config.filepath, dirname4);
69356
+ debug4("Found configuration %o from %o.", config.filepath, dirname4);
69357
69357
  }
69358
69358
  return config;
69359
69359
  }
@@ -69374,7 +69374,7 @@ from ${dirname4}`);
69374
69374
  if (!conf) {
69375
69375
  throw new _configError.default(`Config file contains no configuration data`, filepath);
69376
69376
  }
69377
- debug5("Loaded config %o from %o.", name, dirname4);
69377
+ debug4("Loaded config %o from %o.", name, dirname4);
69378
69378
  return conf;
69379
69379
  }
69380
69380
  function readConfig(filepath, envName, caller) {
@@ -70585,7 +70585,7 @@ var require_plugins4 = __commonJS({
70585
70585
  };
70586
70586
  return data;
70587
70587
  }
70588
- var debug5 = _debug()("babel:config:loading:files:plugins");
70588
+ var debug4 = _debug()("babel:config:loading:files:plugins");
70589
70589
  var EXACT_RE = /^module:/;
70590
70590
  var BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/;
70591
70591
  var BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/;
@@ -70599,7 +70599,7 @@ var require_plugins4 = __commonJS({
70599
70599
  function* loadPlugin(name, dirname4) {
70600
70600
  const filepath = resolvePlugin(name, dirname4, yield* (0, _async.isAsync)());
70601
70601
  const value2 = yield* requireModule("plugin", filepath);
70602
- debug5("Loaded plugin %o from %o.", name, dirname4);
70602
+ debug4("Loaded plugin %o from %o.", name, dirname4);
70603
70603
  return {
70604
70604
  filepath,
70605
70605
  value: value2
@@ -70608,7 +70608,7 @@ var require_plugins4 = __commonJS({
70608
70608
  function* loadPreset(name, dirname4) {
70609
70609
  const filepath = resolvePreset(name, dirname4, yield* (0, _async.isAsync)());
70610
70610
  const value2 = yield* requireModule("preset", filepath);
70611
- debug5("Loaded preset %o from %o.", name, dirname4);
70611
+ debug4("Loaded preset %o from %o.", name, dirname4);
70612
70612
  return {
70613
70613
  filepath,
70614
70614
  value: value2
@@ -71718,7 +71718,7 @@ var require_tree_kill = __commonJS({
71718
71718
  "../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js"(exports, module2) {
71719
71719
  "use strict";
71720
71720
  var childProcess = require("child_process");
71721
- var spawn4 = childProcess.spawn;
71721
+ var spawn3 = childProcess.spawn;
71722
71722
  var exec = childProcess.exec;
71723
71723
  module2.exports = function(pid, signal, callback) {
71724
71724
  if (typeof signal === "function" && callback === void 0) {
@@ -71743,14 +71743,14 @@ var require_tree_kill = __commonJS({
71743
71743
  break;
71744
71744
  case "darwin":
71745
71745
  buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
71746
- return spawn4("pgrep", ["-P", parentPid]);
71746
+ return spawn3("pgrep", ["-P", parentPid]);
71747
71747
  }, function() {
71748
71748
  killAll(tree, signal, callback);
71749
71749
  });
71750
71750
  break;
71751
71751
  default:
71752
71752
  buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
71753
- return spawn4("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]);
71753
+ return spawn3("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]);
71754
71754
  }, function() {
71755
71755
  killAll(tree, signal, callback);
71756
71756
  });
@@ -71825,13 +71825,13 @@ var require_dist2 = __commonJS({
71825
71825
  "use strict";
71826
71826
  function noop() {
71827
71827
  }
71828
- function once3(emitter, name) {
71829
- const o = once3.spread(emitter, name);
71828
+ function once2(emitter, name) {
71829
+ const o = once2.spread(emitter, name);
71830
71830
  const r = o.then((args) => args[0]);
71831
71831
  r.cancel = o.cancel;
71832
71832
  return r;
71833
71833
  }
71834
- (function(once4) {
71834
+ (function(once3) {
71835
71835
  function spread(emitter, name) {
71836
71836
  let c = null;
71837
71837
  const p = new Promise((resolve3, reject) => {
@@ -71858,9 +71858,9 @@ var require_dist2 = __commonJS({
71858
71858
  p.cancel = c;
71859
71859
  return p;
71860
71860
  }
71861
- once4.spread = spread;
71862
- })(once3 || (once3 = {}));
71863
- module2.exports = once3;
71861
+ once3.spread = spread;
71862
+ })(once2 || (once2 = {}));
71863
+ module2.exports = once2;
71864
71864
  }
71865
71865
  });
71866
71866
 
@@ -71885,7 +71885,7 @@ var import_path3 = require("path");
71885
71885
  var import_ts_morph = require("ts-morph");
71886
71886
  var import_nft = require("@vercel/nft");
71887
71887
  var import_resolve_dependency = __toESM(require("@vercel/nft/out/resolve-dependency"));
71888
- var import_build_utils5 = require("@vercel/build-utils");
71888
+ var import_build_utils6 = require("@vercel/build-utils");
71889
71889
  var import_static_config = require("@vercel/static-config");
71890
71890
 
71891
71891
  // src/typescript.ts
@@ -72446,86 +72446,7 @@ var diagnostics = (0, import_build_utils2.createDiagnostics)("node");
72446
72446
  // src/utils.ts
72447
72447
  var import_build_utils4 = require("@vercel/build-utils");
72448
72448
  var import_path2 = require("path");
72449
- var import_path_to_regexp = require("path-to-regexp");
72450
- var import_path_to_regexp_updated = require("path-to-regexp-updated");
72451
- function cloneKeys(keys) {
72452
- if (typeof keys === "undefined") {
72453
- return void 0;
72454
- }
72455
- return keys.slice(0);
72456
- }
72457
- function compareKeys(left, right) {
72458
- const leftSerialized = typeof left === "undefined" ? "undefined" : left.toString();
72459
- const rightSerialized = typeof right === "undefined" ? "undefined" : right.toString();
72460
- return leftSerialized === rightSerialized;
72461
- }
72462
- function pathToRegexp(callerId, path, keys, options) {
72463
- const newKeys = cloneKeys(keys);
72464
- const currentRegExp = (0, import_path_to_regexp.pathToRegexp)(path, keys, options);
72465
- try {
72466
- const currentKeys = keys;
72467
- const newRegExp = (0, import_path_to_regexp_updated.pathToRegexp)(path, newKeys, options);
72468
- const isDiffRegExp = currentRegExp.toString() !== newRegExp.toString();
72469
- if (process.env.FORCE_PATH_TO_REGEXP_LOG || isDiffRegExp) {
72470
- const message = JSON.stringify({
72471
- path,
72472
- currentRegExp: currentRegExp.toString(),
72473
- newRegExp: newRegExp.toString()
72474
- });
72475
- console.error(`[vc] PATH TO REGEXP PATH DIFF @ #${callerId}: ${message}`);
72476
- }
72477
- const isDiffKeys = !compareKeys(keys, newKeys);
72478
- if (process.env.FORCE_PATH_TO_REGEXP_LOG || isDiffKeys) {
72479
- const message = JSON.stringify({
72480
- isDiffKeys,
72481
- currentKeys,
72482
- newKeys
72483
- });
72484
- console.error(`[vc] PATH TO REGEXP KEYS DIFF @ #${callerId}: ${message}`);
72485
- }
72486
- } catch (err) {
72487
- const error = err;
72488
- const message = JSON.stringify({
72489
- path,
72490
- error: error.message
72491
- });
72492
- console.error(`[vc] PATH TO REGEXP ERROR @ #${callerId}: ${message}`);
72493
- }
72494
- return currentRegExp;
72495
- }
72496
- function getRegExpFromMatchers(matcherOrMatchers) {
72497
- if (!matcherOrMatchers) {
72498
- return "^/.*$";
72499
- }
72500
- const matchers = Array.isArray(matcherOrMatchers) ? matcherOrMatchers : [matcherOrMatchers];
72501
- const regExps = matchers.flatMap(getRegExpFromMatcher).join("|");
72502
- return regExps;
72503
- }
72504
- function resolveMiddlewareMatcher(configuredMatcher, sourceMatcher, entrypoint) {
72505
- if (configuredMatcher !== void 0 && sourceMatcher !== void 0) {
72506
- throw new Error(
72507
- `${entrypoint}: \`proxy.matcher\` in vercel.json conflicts with \`config.matcher\` exported from the proxy entrypoint. Configure the matcher in only one location.`
72508
- );
72509
- }
72510
- return configuredMatcher ?? sourceMatcher;
72511
- }
72512
- function getRegExpFromMatcher(matcher, index, allMatchers) {
72513
- if (typeof matcher !== "string") {
72514
- throw new Error(
72515
- "Middleware's `config.matcher` must be a path matcher (string) or an array of path matchers (string[])"
72516
- );
72517
- }
72518
- if (!matcher.startsWith("/")) {
72519
- throw new Error(
72520
- `Middleware's \`config.matcher\` values must start with "/". Received: ${matcher}`
72521
- );
72522
- }
72523
- const regExps = [pathToRegexp("316", matcher).source];
72524
- if (matcher === "/" && !allMatchers.includes("/index")) {
72525
- regExps.push(pathToRegexp("491", "/index").source);
72526
- }
72527
- return regExps;
72528
- }
72449
+ var import_build_utils5 = require("@vercel/build-utils");
72529
72450
  function entrypointToOutputPath(entrypoint, zeroConfig) {
72530
72451
  if (zeroConfig) {
72531
72452
  const ext = (0, import_path2.extname)(entrypoint);
@@ -72575,9 +72496,9 @@ async function downloadInstallAndBundle({
72575
72496
  meta,
72576
72497
  considerBuildCommand
72577
72498
  }) {
72578
- const downloadedFiles = await (0, import_build_utils5.download)(files, workPath, meta);
72499
+ const downloadedFiles = await (0, import_build_utils6.download)(files, workPath, meta);
72579
72500
  const entrypointFsDirname = (0, import_path3.join)(workPath, (0, import_path3.dirname)(entrypoint));
72580
- const nodeVersion = await (0, import_build_utils5.getNodeVersion)(
72501
+ const nodeVersion = await (0, import_build_utils6.getNodeVersion)(
72581
72502
  entrypointFsDirname,
72582
72503
  void 0,
72583
72504
  config,
@@ -72589,11 +72510,12 @@ async function downloadInstallAndBundle({
72589
72510
  lockfileVersion,
72590
72511
  packageJsonPackageManager,
72591
72512
  turboSupportsCorepackHome
72592
- } = await (0, import_build_utils5.scanParentDirs)(entrypointFsDirname, true);
72593
- const spawnEnv = (0, import_build_utils5.getEnvForPackageManager)({
72513
+ } = await (0, import_build_utils6.scanParentDirs)(entrypointFsDirname, true);
72514
+ const spawnEnv = (0, import_build_utils6.getEnvForPackageManager)({
72594
72515
  cliType,
72595
72516
  lockfileVersion,
72596
72517
  packageJsonPackageManager,
72518
+ nodeVersion,
72597
72519
  env: process.env,
72598
72520
  turboSupportsCorepackHome,
72599
72521
  projectCreatedAt: config.projectSettings?.createdAt
@@ -72602,7 +72524,7 @@ async function downloadInstallAndBundle({
72602
72524
  if (typeof installCommand === "string" && considerBuildCommand) {
72603
72525
  if (installCommand.trim()) {
72604
72526
  console.log(`Running "install" command: \`${installCommand}\`...`);
72605
- await (0, import_build_utils5.execCommand)(installCommand, {
72527
+ await (0, import_build_utils6.execCommand)(installCommand, {
72606
72528
  env: spawnEnv,
72607
72529
  cwd: entrypointFsDirname
72608
72530
  });
@@ -72610,7 +72532,7 @@ async function downloadInstallAndBundle({
72610
72532
  console.log(`Skipping "install" command...`);
72611
72533
  }
72612
72534
  } else {
72613
- await (0, import_build_utils5.runNpmInstall)(
72535
+ await (0, import_build_utils6.runNpmInstall)(
72614
72536
  entrypointFsDirname,
72615
72537
  [],
72616
72538
  { env: spawnEnv },
@@ -72655,7 +72577,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72655
72577
  if (config.includeFiles) {
72656
72578
  const includeFiles = typeof config.includeFiles === "string" ? [config.includeFiles] : config.includeFiles;
72657
72579
  for (const pattern of includeFiles) {
72658
- const files = await (0, import_build_utils5.glob)(pattern, workPath);
72580
+ const files = await (0, import_build_utils6.glob)(pattern, workPath);
72659
72581
  await Promise.all(
72660
72582
  Object.values(files).map(async (entry) => {
72661
72583
  const { fsPath } = entry;
@@ -72683,14 +72605,14 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72683
72605
  }
72684
72606
  const { code, map } = await tsCompile(source, path);
72685
72607
  tsCompiled.add(relPath);
72686
- preparedFiles[renameTStoJS(relPath) + ".map"] = new import_build_utils5.FileBlob({
72608
+ preparedFiles[renameTStoJS(relPath) + ".map"] = new import_build_utils6.FileBlob({
72687
72609
  data: JSON.stringify(map)
72688
72610
  });
72689
72611
  source = code;
72690
72612
  shouldAddSourcemapSupport = true;
72691
72613
  return source;
72692
72614
  }
72693
- const isBun = (0, import_build_utils5.isBunVersion)(nodeVersion);
72615
+ const isBun = (0, import_build_utils6.isBunVersion)(nodeVersion);
72694
72616
  const conditions = isEdgeFunction ? ["edge-light", "browser", "module", "import", "require"] : isBun ? ["bun"] : void 0;
72695
72617
  const { fileList, esmFileList, warnings } = await (0, import_nft.nodeFileTrace)(
72696
72618
  [...inputFiles],
@@ -72720,18 +72642,18 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72720
72642
  let entry;
72721
72643
  let source = (0, import_fs.readFileSync)(fsPath);
72722
72644
  const { mode } = (0, import_fs.lstatSync)(fsPath);
72723
- if ((0, import_build_utils5.isSymbolicLink)(mode)) {
72724
- entry = new import_build_utils5.FileFsRef({ fsPath, mode });
72645
+ if ((0, import_build_utils6.isSymbolicLink)(mode)) {
72646
+ entry = new import_build_utils6.FileFsRef({ fsPath, mode });
72725
72647
  }
72726
72648
  if (isEdgeFunction && (0, import_path3.basename)(fsPath) === "package.json") {
72727
72649
  const pkgJson = JSON.parse(source.toString());
72728
72650
  for (const prop of ["browser", "module"]) {
72729
72651
  const val = pkgJson[prop];
72730
72652
  if (typeof val === "string") {
72731
- (0, import_build_utils5.debug)(`Using "${prop}" field in ${fsPath}`);
72653
+ (0, import_build_utils6.debug)(`Using "${prop}" field in ${fsPath}`);
72732
72654
  pkgJson.main = val;
72733
72655
  if (!entry) {
72734
- entry = new import_build_utils5.FileBlob({ data: source, mode });
72656
+ entry = new import_build_utils6.FileBlob({ data: source, mode });
72735
72657
  }
72736
72658
  source = JSON.stringify(pkgJson);
72737
72659
  break;
@@ -72742,7 +72664,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72742
72664
  source = await compileTypeScript(fsPath, source.toString());
72743
72665
  }
72744
72666
  if (!entry) {
72745
- entry = new import_build_utils5.FileBlob({ data: source, mode });
72667
+ entry = new import_build_utils6.FileBlob({ data: source, mode });
72746
72668
  }
72747
72669
  fsCache.set(relPath, entry);
72748
72670
  sourceCache.set(relPath, source);
@@ -72758,21 +72680,21 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72758
72680
  }
72759
72681
  );
72760
72682
  for (const warning of warnings) {
72761
- (0, import_build_utils5.debug)(`Warning from trace: ${warning.message}`);
72683
+ (0, import_build_utils6.debug)(`Warning from trace: ${warning.message}`);
72762
72684
  }
72763
72685
  for (const path of fileList) {
72764
72686
  let entry = fsCache.get(path);
72765
72687
  if (!entry) {
72766
72688
  const fsPath = (0, import_path3.resolve)(baseDir, path);
72767
72689
  const { mode } = (0, import_fs.lstatSync)(fsPath);
72768
- if ((0, import_build_utils5.isSymbolicLink)(mode)) {
72769
- entry = new import_build_utils5.FileFsRef({ fsPath, mode });
72690
+ if ((0, import_build_utils6.isSymbolicLink)(mode)) {
72691
+ entry = new import_build_utils6.FileFsRef({ fsPath, mode });
72770
72692
  } else {
72771
72693
  const source = (0, import_fs.readFileSync)(fsPath);
72772
- entry = new import_build_utils5.FileBlob({ data: source, mode });
72694
+ entry = new import_build_utils6.FileBlob({ data: source, mode });
72773
72695
  }
72774
72696
  }
72775
- if ((0, import_build_utils5.isSymbolicLink)(entry.mode) && entry.type === "FileFsRef") {
72697
+ if ((0, import_build_utils6.isSymbolicLink)(entry.mode) && entry.type === "FileFsRef") {
72776
72698
  const symlinkTarget = (0, import_path3.relative)(
72777
72699
  baseDir,
72778
72700
  (0, import_path3.resolve)((0, import_path3.dirname)(entry.fsPath), (0, import_fs.readlinkSync)(entry.fsPath))
@@ -72799,7 +72721,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72799
72721
  for (const path of esmPaths) {
72800
72722
  const pathDir = (0, import_path3.join)(workPath, (0, import_path3.dirname)(path));
72801
72723
  if (!pkgCache.has(pathDir)) {
72802
- const pathToPkg = await (0, import_build_utils5.walkParentDirs)({
72724
+ const pathToPkg = await (0, import_build_utils6.walkParentDirs)({
72803
72725
  base: workPath,
72804
72726
  start: pathDir,
72805
72727
  filename: "package.json"
@@ -72812,7 +72734,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72812
72734
  continue;
72813
72735
  }
72814
72736
  const filename = (0, import_path3.basename)(path);
72815
- const { data: source } = await import_build_utils5.FileBlob.fromStream({
72737
+ const { data: source } = await import_build_utils6.FileBlob.fromStream({
72816
72738
  stream: preparedFiles[path].toStream()
72817
72739
  });
72818
72740
  if (!meta.compiledToCommonJS) {
@@ -72824,12 +72746,12 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72824
72746
  console.log(`Compiling "${filename}" from ESM to CommonJS...`);
72825
72747
  const { code, map } = babelCompile(filename, String(source));
72826
72748
  shouldAddSourcemapSupport = true;
72827
- preparedFiles[path] = new import_build_utils5.FileBlob({
72749
+ preparedFiles[path] = new import_build_utils6.FileBlob({
72828
72750
  data: `${code}
72829
72751
  //# sourceMappingURL=${filename}.map`
72830
72752
  });
72831
72753
  delete map.sourcesContent;
72832
- preparedFiles[path + ".map"] = new import_build_utils5.FileBlob({
72754
+ preparedFiles[path + ".map"] = new import_build_utils6.FileBlob({
72833
72755
  data: JSON.stringify(map)
72834
72756
  });
72835
72757
  }
@@ -72889,7 +72811,7 @@ var build = async ({
72889
72811
  let entrypointPath = _entrypointPath;
72890
72812
  const projectBuildCommand = config.projectSettings?.buildCommand;
72891
72813
  if (projectBuildCommand && considerBuildCommand) {
72892
- await (0, import_build_utils5.execCommand)(projectBuildCommand, {
72814
+ await (0, import_build_utils6.execCommand)(projectBuildCommand, {
72893
72815
  // Yarn v2 PnP mode may be activated, so force
72894
72816
  // "node-modules" linker style
72895
72817
  env: {
@@ -72900,7 +72822,7 @@ var build = async ({
72900
72822
  });
72901
72823
  } else {
72902
72824
  const possibleScripts = considerBuildCommand ? ["vercel-build", "now-build", "build"] : ["vercel-build", "now-build"];
72903
- await (0, import_build_utils5.runPackageJsonScript)(
72825
+ await (0, import_build_utils6.runPackageJsonScript)(
72904
72826
  entrypointFsDirname,
72905
72827
  possibleScripts,
72906
72828
  { env: spawnEnv },
@@ -72940,9 +72862,9 @@ var build = async ({
72940
72862
  }
72941
72863
  checks({
72942
72864
  config,
72943
- isBun: (0, import_build_utils5.isBunVersion)(nodeVersion)
72865
+ isBun: (0, import_build_utils6.isBunVersion)(nodeVersion)
72944
72866
  });
72945
- (0, import_build_utils5.debug)("Tracing input files...");
72867
+ (0, import_build_utils6.debug)("Tracing input files...");
72946
72868
  const traceTime = Date.now();
72947
72869
  const { preparedFiles, shouldAddSourcemapSupport } = await compile2(
72948
72870
  workPath,
@@ -72953,18 +72875,18 @@ var build = async ({
72953
72875
  nodeVersion,
72954
72876
  isEdgeFunction
72955
72877
  );
72956
- (0, import_build_utils5.debug)(`Trace complete [${Date.now() - traceTime}ms]`);
72878
+ (0, import_build_utils6.debug)(`Trace complete [${Date.now() - traceTime}ms]`);
72957
72879
  let routes;
72958
72880
  let output;
72959
72881
  let handler = renameTStoJS((0, import_path3.relative)(baseDir, entrypointPath));
72960
72882
  const outputPath = entrypointToOutputPath(entrypoint, config.zeroConfig);
72961
72883
  if (isMiddleware) {
72962
- const matcher = resolveMiddlewareMatcher(
72884
+ const matcher = (0, import_build_utils5.resolveMiddlewareMatcher)(
72963
72885
  config.middlewareMatcher,
72964
72886
  staticConfig?.matcher,
72965
72887
  entrypoint
72966
72888
  );
72967
- const src = getRegExpFromMatchers(matcher);
72889
+ const src = (0, import_build_utils5.getRegExpFromMatchers)(matcher);
72968
72890
  const middlewareRawSrc = [];
72969
72891
  if (matcher) {
72970
72892
  if (Array.isArray(matcher)) {
@@ -73000,13 +72922,13 @@ var build = async ({
73000
72922
  }
73001
72923
  const filename = `shim${ext}`;
73002
72924
  const shimHandler = handlerDir === "." ? filename : (0, import_path3.join)(handlerDir, filename);
73003
- preparedFiles[shimHandler] = new import_build_utils5.FileBlob({
72925
+ preparedFiles[shimHandler] = new import_build_utils6.FileBlob({
73004
72926
  data: shim(handlerFilename)
73005
72927
  });
73006
72928
  handler = shimHandler;
73007
72929
  }
73008
72930
  if (isEdgeFunction) {
73009
- output = new import_build_utils5.EdgeFunction({
72931
+ output = new import_build_utils6.EdgeFunction({
73010
72932
  entrypoint: handler,
73011
72933
  files: preparedFiles,
73012
72934
  regions: staticConfig?.regions,
@@ -73024,7 +72946,7 @@ var build = async ({
73024
72946
  if (enableBundling) {
73025
72947
  const bundledHandlerName = "___vc_bundled_api_handler.js";
73026
72948
  const entrypointPrefix = (0, import_path3.relative)(baseDir, workPath).split(import_path3.sep).join("/");
73027
- preparedFiles[bundledHandlerName] = new import_build_utils5.FileBlob({
72949
+ preparedFiles[bundledHandlerName] = new import_build_utils6.FileBlob({
73028
72950
  data: (0, import_fs.readFileSync)(
73029
72951
  (0, import_path3.join)((0, import_path3.dirname)(__filename), "bundling-handler.js"),
73030
72952
  "utf8"
@@ -73067,7 +72989,7 @@ var build = async ({
73067
72989
  ];
73068
72990
  }
73069
72991
  }
73070
- output = new import_build_utils5.NodejsLambda({
72992
+ output = new import_build_utils6.NodejsLambda({
73071
72993
  files: preparedFiles,
73072
72994
  handler,
73073
72995
  experimentalAllowBundling: enableBundling || void 0,
@@ -73093,10 +73015,10 @@ var build = async ({
73093
73015
  lockfilePath,
73094
73016
  lockfileVersion,
73095
73017
  framework: config.framework ?? void 0,
73096
- serviceType: service ? (0, import_build_utils5.getReportedServiceType)(service) : void 0
73018
+ serviceType: service ? (0, import_build_utils6.getReportedServiceType)(service) : void 0
73097
73019
  });
73098
73020
  } catch (err) {
73099
- (0, import_build_utils5.debug)(
73021
+ (0, import_build_utils6.debug)(
73100
73022
  `Failed to write node manifest: ${err instanceof Error ? err.message : String(err)}`
73101
73023
  );
73102
73024
  }
@@ -73115,15 +73037,15 @@ function normalizeRequestedRegions(regions) {
73115
73037
  }
73116
73038
 
73117
73039
  // src/prepare-cache.ts
73118
- var import_build_utils6 = require("@vercel/build-utils");
73040
+ var import_build_utils7 = require("@vercel/build-utils");
73119
73041
  var prepareCache = ({ repoRootPath, workPath }) => {
73120
- return (0, import_build_utils6.glob)(import_build_utils6.defaultCachePathGlob, repoRootPath || workPath);
73042
+ return (0, import_build_utils7.glob)(import_build_utils7.defaultCachePathGlob, repoRootPath || workPath);
73121
73043
  };
73122
73044
 
73123
73045
  // src/start-dev-server.ts
73124
73046
  var import_module3 = require("module");
73125
73047
  var import_fs2 = require("fs");
73126
- var import_path6 = require("path");
73048
+ var import_path5 = require("path");
73127
73049
  var import_tree_kill = __toESM(require_tree_kill());
73128
73050
  var import_util = require("util");
73129
73051
  var import_stream = require("stream");
@@ -73133,92 +73055,16 @@ var import_static_config2 = require("@vercel/static-config");
73133
73055
  var import_ts_morph2 = require("ts-morph");
73134
73056
 
73135
73057
  // src/fork-dev-server.ts
73136
- var import_once2 = __toESM(require_dist2());
73058
+ var import_once = __toESM(require_dist2());
73137
73059
  var import_build_utils8 = require("@vercel/build-utils");
73138
- var import_child_process3 = require("child_process");
73139
- var import_url = require("url");
73140
- var import_path5 = require("path");
73141
-
73142
- // src/bun-helpers.ts
73143
- var import_build_utils7 = require("@vercel/build-utils");
73144
73060
  var import_child_process2 = require("child_process");
73145
- var import_once = __toESM(require_dist2());
73146
- var import_os2 = require("os");
73061
+ var import_url = require("url");
73147
73062
  var import_path4 = require("path");
73148
- async function spawnAsync(command, args, options) {
73149
- const child = (0, import_child_process2.spawn)(command, args, options);
73150
- const [exitCode] = await import_once.default.spread(child, "close");
73151
- return exitCode;
73152
- }
73153
- async function getOrCreateBunBinary() {
73154
- const { platform } = process;
73155
- const bunCommand = platform === "win32" ? "bun.exe" : "bun";
73156
- const installPath = (0, import_path4.join)((0, import_os2.homedir)(), ".bun", "bin", bunCommand);
73157
- try {
73158
- const exitCode = await spawnAsync(bunCommand, ["--version"], {
73159
- stdio: "ignore"
73160
- });
73161
- if (exitCode === 0) {
73162
- (0, import_build_utils7.debug)("Bun already installed and available in PATH");
73163
- return bunCommand;
73164
- }
73165
- } catch {
73166
- (0, import_build_utils7.debug)("Bun not found in PATH");
73167
- }
73168
- try {
73169
- const exitCode = await spawnAsync(installPath, ["--version"], {
73170
- stdio: "ignore"
73171
- });
73172
- if (exitCode === 0) {
73173
- (0, import_build_utils7.debug)("Bun already installed in default location");
73174
- return installPath;
73175
- }
73176
- } catch {
73177
- (0, import_build_utils7.debug)("Bun not found in default location");
73178
- }
73179
- console.log("Installing Bun...");
73180
- try {
73181
- let exitCode;
73182
- if (platform === "win32") {
73183
- exitCode = await spawnAsync(
73184
- "powershell",
73185
- ["-c", "irm bun.sh/install.ps1 | iex"],
73186
- { stdio: "inherit" }
73187
- );
73188
- } else {
73189
- exitCode = await spawnAsync(
73190
- "bash",
73191
- ["-c", "curl -fsSL https://bun.sh/install | bash"],
73192
- { stdio: "inherit" }
73193
- );
73194
- }
73195
- if (exitCode !== 0) {
73196
- throw new Error(`Installation script exited with code ${exitCode}`);
73197
- }
73198
- } catch (error) {
73199
- throw new Error(`Failed to install Bun: ${error}`);
73200
- }
73201
- try {
73202
- const exitCode = await spawnAsync(installPath, ["--version"], {
73203
- stdio: "ignore"
73204
- });
73205
- if (exitCode === 0) {
73206
- (0, import_build_utils7.debug)("Bun was installed successfully");
73207
- return installPath;
73208
- }
73209
- } catch {
73210
- }
73211
- throw new Error(
73212
- "Bun installation failed. Please install manually and try again."
73213
- );
73214
- }
73215
-
73216
- // src/fork-dev-server.ts
73217
73063
  async function forkDevServer(options) {
73218
- const devServerPath = options.devServerPath || (0, import_path5.join)(__dirname, "dev-server.mjs");
73064
+ const devServerPath = options.devServerPath || (0, import_path4.join)(__dirname, "dev-server.mjs");
73219
73065
  let child;
73220
73066
  if (options.runtime === "bun") {
73221
- const bun = await getOrCreateBunBinary();
73067
+ const bun = await (0, import_build_utils8.getOrCreateBunBinary)();
73222
73068
  const spawnOptions = {
73223
73069
  cwd: options.workPath,
73224
73070
  env: (0, import_build_utils8.cloneEnv)(process.env, options.meta.env, {
@@ -73229,7 +73075,7 @@ async function forkDevServer(options) {
73229
73075
  }),
73230
73076
  stdio: ["pipe", "pipe", "pipe"]
73231
73077
  };
73232
- child = (0, import_child_process3.spawn)(bun, ["--bun", devServerPath], spawnOptions);
73078
+ child = (0, import_child_process2.spawn)(bun, ["--bun", devServerPath], spawnOptions);
73233
73079
  let buffer = "";
73234
73080
  child.stdout?.on("data", (data) => {
73235
73081
  const output = data.toString();
@@ -73269,7 +73115,7 @@ async function forkDevServer(options) {
73269
73115
  }),
73270
73116
  stdio: options.printLogs ? "pipe" : void 0
73271
73117
  };
73272
- child = (0, import_child_process3.fork)(devServerPath, [], forkOptions);
73118
+ child = (0, import_child_process2.fork)(devServerPath, [], forkOptions);
73273
73119
  }
73274
73120
  if (options.printLogs) {
73275
73121
  child.stdout?.on("data", (data) => {
@@ -73288,8 +73134,8 @@ function checkForPid(path, process2) {
73288
73134
  }
73289
73135
  }
73290
73136
  async function readMessage(child) {
73291
- const onMessage = (0, import_once2.default)(child, "message");
73292
- const onExit = import_once2.default.spread(child, "close");
73137
+ const onMessage = (0, import_once.default)(child, "message");
73138
+ const onExit = import_once.default.spread(child, "close");
73293
73139
  const result = await Promise.race([
73294
73140
  onMessage.then((x) => {
73295
73141
  return { state: "message", value: x };
@@ -73357,7 +73203,7 @@ async function syncDependencies(workPath, onStdout, onStderr) {
73357
73203
  }
73358
73204
  var startDevServer = async (opts) => {
73359
73205
  const { entrypoint, workPath, config, meta = {}, publicDir } = opts;
73360
- const entrypointPath = (0, import_path6.join)(workPath, entrypoint);
73206
+ const entrypointPath = (0, import_path5.join)(workPath, entrypoint);
73361
73207
  if (meta.syncDependencies) {
73362
73208
  const gray = "\x1B[90m";
73363
73209
  const reset = "\x1B[0m";
@@ -73401,19 +73247,19 @@ var startDevServer = async (opts) => {
73401
73247
  }
73402
73248
  const runtime = bunVersion ? "bun" : "node";
73403
73249
  if (config.middleware === true && typeof meta.requestUrl === "string") {
73404
- const matcher = resolveMiddlewareMatcher(
73250
+ const matcher = (0, import_build_utils5.resolveMiddlewareMatcher)(
73405
73251
  config.middlewareMatcher,
73406
73252
  staticConfig?.matcher,
73407
73253
  entrypoint
73408
73254
  );
73409
- const matchers = new RegExp(getRegExpFromMatchers(matcher));
73255
+ const matchers = new RegExp((0, import_build_utils5.getRegExpFromMatchers)(matcher));
73410
73256
  const parsed = new URL(meta.requestUrl, "http://localhost");
73411
73257
  if (!matchers.test(parsed.pathname)) {
73412
73258
  return null;
73413
73259
  }
73414
73260
  }
73415
- const entryDir = (0, import_path6.dirname)(entrypointPath);
73416
- const ext = (0, import_path6.extname)(entrypoint);
73261
+ const entryDir = (0, import_path5.dirname)(entrypointPath);
73262
+ const ext = (0, import_path5.extname)(entrypoint);
73417
73263
  const pathToTsConfig = await (0, import_build_utils9.walkParentDirs)({
73418
73264
  base: workPath,
73419
73265
  start: entryDir,
@@ -73446,7 +73292,7 @@ var startDevServer = async (opts) => {
73446
73292
  ts = requireTypescript(compiler);
73447
73293
  }
73448
73294
  if (!ts) {
73449
- compiler = resolveTypescript((0, import_path6.join)(__dirname, ".."));
73295
+ compiler = resolveTypescript((0, import_path5.join)(__dirname, ".."));
73450
73296
  ts = requireTypescript(compiler);
73451
73297
  }
73452
73298
  if (pathToTsConfig) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "5.9.9",
3
+ "version": "5.10.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -32,9 +32,9 @@
32
32
  "tsx": "4.21.0",
33
33
  "typescript": "npm:typescript@5.9.3",
34
34
  "undici": "5.28.4",
35
- "@vercel/build-utils": "14.0.5",
35
+ "@vercel/error-utils": "2.2.1",
36
36
  "@vercel/static-config": "3.4.1",
37
- "@vercel/error-utils": "2.2.1"
37
+ "@vercel/build-utils": "14.1.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@babel/core": "7.24.4",