@vercel/node 5.9.7 → 5.9.9

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.
Files changed (2) hide show
  1. package/dist/index.js +305 -84
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -35441,7 +35441,7 @@ var require_resolve_uri_umd = __commonJS({
35441
35441
  }
35442
35442
  url.path = path;
35443
35443
  }
35444
- function resolve2(input, base) {
35444
+ function resolve3(input, base) {
35445
35445
  if (!input && !base)
35446
35446
  return "";
35447
35447
  const url = parseUrl(input);
@@ -35488,7 +35488,7 @@ var require_resolve_uri_umd = __commonJS({
35488
35488
  return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
35489
35489
  }
35490
35490
  }
35491
- return resolve2;
35491
+ return resolve3;
35492
35492
  });
35493
35493
  }
35494
35494
  });
@@ -35853,8 +35853,8 @@ var require_trace_mapping_umd = __commonJS({
35853
35853
  this.sources = sources;
35854
35854
  this.sourcesContent = sourcesContent;
35855
35855
  this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
35856
- const resolve2 = resolver(mapUrl, sourceRoot);
35857
- this.resolvedSources = sources.map(resolve2);
35856
+ const resolve3 = resolver(mapUrl, sourceRoot);
35857
+ this.resolvedSources = sources.map(resolve3);
35858
35858
  const { mappings } = parsed;
35859
35859
  if (typeof mappings === "string") {
35860
35860
  this._encoded = mappings;
@@ -44603,7 +44603,7 @@ var require_introspection = __commonJS({
44603
44603
  exports.isStatic = isStatic;
44604
44604
  exports.matchesPattern = matchesPattern;
44605
44605
  exports.referencesImport = referencesImport;
44606
- exports.resolve = resolve2;
44606
+ exports.resolve = resolve3;
44607
44607
  exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore;
44608
44608
  var _t = require_lib3();
44609
44609
  var {
@@ -44869,7 +44869,7 @@ var require_introspection = __commonJS({
44869
44869
  nodeMap.set(target.node, result);
44870
44870
  return result;
44871
44871
  }
44872
- function resolve2(dangerous, resolved) {
44872
+ function resolve3(dangerous, resolved) {
44873
44873
  return _resolve.call(this, dangerous, resolved) || this;
44874
44874
  }
44875
44875
  function _resolve(dangerous, resolved) {
@@ -49642,10 +49642,10 @@ var require_gensync = __commonJS({
49642
49642
  const items = Array.from(args[0]);
49643
49643
  return items.map((item) => evaluateSync(item));
49644
49644
  },
49645
- async: function(args, resolve2, reject) {
49645
+ async: function(args, resolve3, reject) {
49646
49646
  const items = Array.from(args[0]);
49647
49647
  if (items.length === 0) {
49648
- Promise.resolve().then(() => resolve2([]));
49648
+ Promise.resolve().then(() => resolve3([]));
49649
49649
  return;
49650
49650
  }
49651
49651
  let count = 0;
@@ -49657,7 +49657,7 @@ var require_gensync = __commonJS({
49657
49657
  results[i] = val;
49658
49658
  count += 1;
49659
49659
  if (count === results.length)
49660
- resolve2(results);
49660
+ resolve3(results);
49661
49661
  },
49662
49662
  reject
49663
49663
  );
@@ -49674,13 +49674,13 @@ var require_gensync = __commonJS({
49674
49674
  }
49675
49675
  return evaluateSync(items[0]);
49676
49676
  },
49677
- async: function(args, resolve2, reject) {
49677
+ async: function(args, resolve3, reject) {
49678
49678
  const items = Array.from(args[0]);
49679
49679
  if (items.length === 0) {
49680
49680
  throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY);
49681
49681
  }
49682
49682
  for (const item of items) {
49683
- evaluateAsync(item, resolve2, reject);
49683
+ evaluateAsync(item, resolve3, reject);
49684
49684
  }
49685
49685
  }
49686
49686
  })
@@ -49692,8 +49692,8 @@ var require_gensync = __commonJS({
49692
49692
  return evaluateSync(genFn.apply(this, args));
49693
49693
  },
49694
49694
  async: function(...args) {
49695
- return new Promise((resolve2, reject) => {
49696
- evaluateAsync(genFn.apply(this, args), resolve2, reject);
49695
+ return new Promise((resolve3, reject) => {
49696
+ evaluateAsync(genFn.apply(this, args), resolve3, reject);
49697
49697
  });
49698
49698
  },
49699
49699
  errback: function(...args) {
@@ -49791,18 +49791,18 @@ var require_gensync = __commonJS({
49791
49791
  sync: function(args) {
49792
49792
  return sync.apply(this, args);
49793
49793
  },
49794
- async: function(args, resolve2, reject) {
49794
+ async: function(args, resolve3, reject) {
49795
49795
  if (async) {
49796
- async.apply(this, args).then(resolve2, reject);
49796
+ async.apply(this, args).then(resolve3, reject);
49797
49797
  } else if (errback) {
49798
49798
  errback.call(this, ...args, (err, value2) => {
49799
49799
  if (err == null)
49800
- resolve2(value2);
49800
+ resolve3(value2);
49801
49801
  else
49802
49802
  reject(err);
49803
49803
  });
49804
49804
  } else {
49805
- resolve2(sync.apply(this, args));
49805
+ resolve3(sync.apply(this, args));
49806
49806
  }
49807
49807
  }
49808
49808
  });
@@ -49855,7 +49855,7 @@ var require_gensync = __commonJS({
49855
49855
  }
49856
49856
  return value2;
49857
49857
  }
49858
- function evaluateAsync(gen, resolve2, reject) {
49858
+ function evaluateAsync(gen, resolve3, reject) {
49859
49859
  (function step() {
49860
49860
  try {
49861
49861
  let value2;
@@ -49876,7 +49876,7 @@ var require_gensync = __commonJS({
49876
49876
  return;
49877
49877
  }
49878
49878
  }
49879
- return resolve2(value2);
49879
+ return resolve3(value2);
49880
49880
  } catch (err) {
49881
49881
  return reject(err);
49882
49882
  }
@@ -49964,7 +49964,7 @@ var require_async = __commonJS({
49964
49964
  };
49965
49965
  return data;
49966
49966
  }
49967
- function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
49967
+ function asyncGeneratorStep(gen, resolve3, reject, _next, _throw, key, arg) {
49968
49968
  try {
49969
49969
  var info = gen[key](arg);
49970
49970
  var value2 = info.value;
@@ -49973,7 +49973,7 @@ var require_async = __commonJS({
49973
49973
  return;
49974
49974
  }
49975
49975
  if (info.done) {
49976
- resolve2(value2);
49976
+ resolve3(value2);
49977
49977
  } else {
49978
49978
  Promise.resolve(value2).then(_next, _throw);
49979
49979
  }
@@ -49981,13 +49981,13 @@ var require_async = __commonJS({
49981
49981
  function _asyncToGenerator(fn) {
49982
49982
  return function() {
49983
49983
  var self2 = this, args = arguments;
49984
- return new Promise(function(resolve2, reject) {
49984
+ return new Promise(function(resolve3, reject) {
49985
49985
  var gen = fn.apply(self2, args);
49986
49986
  function _next(value2) {
49987
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value2);
49987
+ asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "next", value2);
49988
49988
  }
49989
49989
  function _throw(err) {
49990
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err);
49990
+ asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "throw", err);
49991
49991
  }
49992
49992
  _next(void 0);
49993
49993
  });
@@ -50361,8 +50361,8 @@ var require_caching = __commonJS({
50361
50361
  this.released = false;
50362
50362
  this.promise = void 0;
50363
50363
  this._resolve = void 0;
50364
- this.promise = new Promise((resolve2) => {
50365
- this._resolve = resolve2;
50364
+ this.promise = new Promise((resolve3) => {
50365
+ this._resolve = resolve3;
50366
50366
  });
50367
50367
  }
50368
50368
  release(value2) {
@@ -50395,7 +50395,7 @@ var require_fs = __commonJS({
50395
50395
  };
50396
50396
  return data;
50397
50397
  }
50398
- var readFile = exports.readFile = _gensync()({
50398
+ var readFile2 = exports.readFile = _gensync()({
50399
50399
  sync: _fs().readFileSync,
50400
50400
  errback: _fs().readFile
50401
50401
  });
@@ -51934,9 +51934,9 @@ var require_functional = __commonJS({
51934
51934
  };
51935
51935
  }
51936
51936
  } else {
51937
- let resolve2, reject;
51937
+ let resolve3, reject;
51938
51938
  resultP = new Promise((res, rej) => {
51939
- resolve2 = res;
51939
+ resolve3 = res;
51940
51940
  reject = rej;
51941
51941
  });
51942
51942
  try {
@@ -51946,7 +51946,7 @@ var require_functional = __commonJS({
51946
51946
  };
51947
51947
  resultP = null;
51948
51948
  if (promiseReferenced)
51949
- resolve2(result.value);
51949
+ resolve3(result.value);
51950
51950
  } catch (error) {
51951
51951
  result = {
51952
51952
  ok: false,
@@ -56088,7 +56088,7 @@ var require_node3 = __commonJS({
56088
56088
  }
56089
56089
  return module2.exports.parseConfig(fs.readFileSync(file));
56090
56090
  },
56091
- findConfigFile: function findConfigFile(from) {
56091
+ findConfigFile: function findConfigFile2(from) {
56092
56092
  return eachParent(
56093
56093
  from,
56094
56094
  function(dir) {
@@ -56531,7 +56531,7 @@ var require_browserslist = __commonJS({
56531
56531
  function isSupported(flags, withPartial) {
56532
56532
  return typeof flags === "string" && (flags.indexOf("y") >= 0 || withPartial && flags.indexOf("a") >= 0);
56533
56533
  }
56534
- function resolve2(queries, context) {
56534
+ function resolve3(queries, context) {
56535
56535
  return parseQueries(queries).reduce(function(result, node, index) {
56536
56536
  if (node.not && index === 0) {
56537
56537
  throw new BrowserslistError(
@@ -56627,7 +56627,7 @@ var require_browserslist = __commonJS({
56627
56627
  var cacheKey = JSON.stringify([queries, context]);
56628
56628
  if (cache[cacheKey])
56629
56629
  return cache[cacheKey];
56630
- var result = uniq(resolve2(queries, context)).sort(function(name1, name2) {
56630
+ var result = uniq(resolve3(queries, context)).sort(function(name1, name2) {
56631
56631
  name1 = name1.split(" ");
56632
56632
  name2 = name2.split(" ");
56633
56633
  if (name1[0] === name2[0]) {
@@ -57026,7 +57026,7 @@ var require_browserslist = __commonJS({
57026
57026
  suppressWarnings: true
57027
57027
  });
57028
57028
  }
57029
- return resolve2(bbmTransform(baselineVersions), context);
57029
+ return resolve3(bbmTransform(baselineVersions), context);
57030
57030
  }
57031
57031
  },
57032
57032
  popularity: {
@@ -57330,7 +57330,7 @@ var require_browserslist = __commonJS({
57330
57330
  matches: [],
57331
57331
  regexp: /^current\s+node$/i,
57332
57332
  select: function(context) {
57333
- return [env.currentNode(resolve2, context)];
57333
+ return [env.currentNode(resolve3, context)];
57334
57334
  }
57335
57335
  },
57336
57336
  maintained_node: {
@@ -57343,7 +57343,7 @@ var require_browserslist = __commonJS({
57343
57343
  }).map(function(key) {
57344
57344
  return "node " + key.slice(1);
57345
57345
  });
57346
- return resolve2(queries, context);
57346
+ return resolve3(queries, context);
57347
57347
  }
57348
57348
  },
57349
57349
  phantomjs_1_9: {
@@ -57404,14 +57404,14 @@ var require_browserslist = __commonJS({
57404
57404
  regexp: /^extends (.+)$/i,
57405
57405
  needsPath: true,
57406
57406
  select: function(context, node) {
57407
- return resolve2(env.loadQueries(context, node.config), context);
57407
+ return resolve3(env.loadQueries(context, node.config), context);
57408
57408
  }
57409
57409
  },
57410
57410
  defaults: {
57411
57411
  matches: [],
57412
57412
  regexp: /^defaults$/i,
57413
57413
  select: function(context) {
57414
- return resolve2(browserslist.defaults, context);
57414
+ return resolve3(browserslist.defaults, context);
57415
57415
  }
57416
57416
  },
57417
57417
  dead: {
@@ -57426,7 +57426,7 @@ var require_browserslist = __commonJS({
57426
57426
  "op_mob <= 12.1",
57427
57427
  "samsung 4"
57428
57428
  ];
57429
- return resolve2(dead, context);
57429
+ return resolve3(dead, context);
57430
57430
  }
57431
57431
  },
57432
57432
  unknown: {
@@ -60028,7 +60028,7 @@ var require_option_assertions = __commonJS({
60028
60028
  Object.defineProperty(exports, "__esModule", {
60029
60029
  value: true
60030
60030
  });
60031
- exports.access = access;
60031
+ exports.access = access2;
60032
60032
  exports.assertArray = assertArray;
60033
60033
  exports.assertAssumptions = assertAssumptions;
60034
60034
  exports.assertBabelrcSearch = assertBabelrcSearch;
@@ -60072,7 +60072,7 @@ var require_option_assertions = __commonJS({
60072
60072
  throw new Error(`Assertion failure: Unknown type ${loc.type}`);
60073
60073
  }
60074
60074
  }
60075
- function access(loc, name) {
60075
+ function access2(loc, name) {
60076
60076
  return {
60077
60077
  type: "access",
60078
60078
  name,
@@ -60110,7 +60110,7 @@ var require_option_assertions = __commonJS({
60110
60110
  throw new Error(`${msg(loc)} set but does not contain "name" property string`);
60111
60111
  }
60112
60112
  for (const prop of Object.keys(obj)) {
60113
- const propLoc = access(loc, prop);
60113
+ const propLoc = access2(loc, prop);
60114
60114
  const value3 = obj[prop];
60115
60115
  if (value3 != null && typeof value3 !== "boolean" && typeof value3 !== "string" && typeof value3 !== "number") {
60116
60116
  throw new Error(`${msg(propLoc)} must be null, undefined, a boolean, a string, or a number.`);
@@ -60157,7 +60157,7 @@ var require_option_assertions = __commonJS({
60157
60157
  }
60158
60158
  function assertIgnoreList(loc, value2) {
60159
60159
  const arr = assertArray(loc, value2);
60160
- arr == null || arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));
60160
+ arr == null || arr.forEach((item, i) => assertIgnoreItem(access2(loc, i), item));
60161
60161
  return arr;
60162
60162
  }
60163
60163
  function assertIgnoreItem(loc, value2) {
@@ -60173,7 +60173,7 @@ var require_option_assertions = __commonJS({
60173
60173
  if (Array.isArray(value2)) {
60174
60174
  value2.forEach((item, i) => {
60175
60175
  if (!checkValidTest(item)) {
60176
- throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);
60176
+ throw new Error(`${msg(access2(loc, i))} must be a string/Function/RegExp.`);
60177
60177
  }
60178
60178
  });
60179
60179
  } else if (!checkValidTest(value2)) {
@@ -60197,7 +60197,7 @@ var require_option_assertions = __commonJS({
60197
60197
  if (Array.isArray(value2)) {
60198
60198
  value2.forEach((item, i) => {
60199
60199
  if (!checkValidTest(item)) {
60200
- throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);
60200
+ throw new Error(`${msg(access2(loc, i))} must be a string/Function/RegExp.`);
60201
60201
  }
60202
60202
  });
60203
60203
  } else if (!checkValidTest(value2)) {
@@ -60208,7 +60208,7 @@ var require_option_assertions = __commonJS({
60208
60208
  function assertPluginList(loc, value2) {
60209
60209
  const arr = assertArray(loc, value2);
60210
60210
  if (arr) {
60211
- arr.forEach((item, i) => assertPluginItem(access(loc, i), item));
60211
+ arr.forEach((item, i) => assertPluginItem(access2(loc, i), item));
60212
60212
  }
60213
60213
  return arr;
60214
60214
  }
@@ -60220,17 +60220,17 @@ var require_option_assertions = __commonJS({
60220
60220
  if (value2.length > 3) {
60221
60221
  throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`);
60222
60222
  }
60223
- assertPluginTarget(access(loc, 0), value2[0]);
60223
+ assertPluginTarget(access2(loc, 0), value2[0]);
60224
60224
  if (value2.length > 1) {
60225
60225
  const opts = value2[1];
60226
60226
  if (opts !== void 0 && opts !== false && (typeof opts !== "object" || Array.isArray(opts) || opts === null)) {
60227
- throw new Error(`${msg(access(loc, 1))} must be an object, false, or undefined`);
60227
+ throw new Error(`${msg(access2(loc, 1))} must be an object, false, or undefined`);
60228
60228
  }
60229
60229
  }
60230
60230
  if (value2.length === 3) {
60231
60231
  const name = value2[2];
60232
60232
  if (name !== void 0 && typeof name !== "string") {
60233
- throw new Error(`${msg(access(loc, 2))} must be a string, or undefined`);
60233
+ throw new Error(`${msg(access2(loc, 2))} must be a string, or undefined`);
60234
60234
  }
60235
60235
  }
60236
60236
  } else {
@@ -60250,13 +60250,13 @@ var require_option_assertions = __commonJS({
60250
60250
  if (typeof value2 !== "object" || !value2 || Array.isArray(value2)) {
60251
60251
  throw new Error(`${msg(loc)} must be a string, an array of strings or an object`);
60252
60252
  }
60253
- const browsersLoc = access(loc, "browsers");
60254
- const esmodulesLoc = access(loc, "esmodules");
60253
+ const browsersLoc = access2(loc, "browsers");
60254
+ const esmodulesLoc = access2(loc, "esmodules");
60255
60255
  assertBrowsersList(browsersLoc, value2.browsers);
60256
60256
  assertBoolean(esmodulesLoc, value2.esmodules);
60257
60257
  for (const key of Object.keys(value2)) {
60258
60258
  const val = value2[key];
60259
- const subLoc = access(loc, key);
60259
+ const subLoc = access2(loc, key);
60260
60260
  if (key === "esmodules")
60261
60261
  assertBoolean(subLoc, val);
60262
60262
  else if (key === "browsers")
@@ -60293,7 +60293,7 @@ var require_option_assertions = __commonJS({
60293
60293
  } while (root.type !== "root");
60294
60294
  const inPreset = root.source === "preset";
60295
60295
  for (const name of Object.keys(value2)) {
60296
- const subLoc = access(loc, name);
60296
+ const subLoc = access2(loc, name);
60297
60297
  if (!_options.assumptionsNames.has(name)) {
60298
60298
  throw new Error(`${msg(subLoc)} is not a supported assumption.`);
60299
60299
  }
@@ -68977,7 +68977,7 @@ var require_module_types = __commonJS({
68977
68977
  var _rewriteStackTrace = require_rewrite_stack_trace();
68978
68978
  var _configError = require_config_error();
68979
68979
  var _transformFile = require_transform_file();
68980
- function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
68980
+ function asyncGeneratorStep(gen, resolve3, reject, _next, _throw, key, arg) {
68981
68981
  try {
68982
68982
  var info = gen[key](arg);
68983
68983
  var value2 = info.value;
@@ -68986,7 +68986,7 @@ var require_module_types = __commonJS({
68986
68986
  return;
68987
68987
  }
68988
68988
  if (info.done) {
68989
- resolve2(value2);
68989
+ resolve3(value2);
68990
68990
  } else {
68991
68991
  Promise.resolve(value2).then(_next, _throw);
68992
68992
  }
@@ -68994,13 +68994,13 @@ var require_module_types = __commonJS({
68994
68994
  function _asyncToGenerator(fn) {
68995
68995
  return function() {
68996
68996
  var self2 = this, args = arguments;
68997
- return new Promise(function(resolve2, reject) {
68997
+ return new Promise(function(resolve3, reject) {
68998
68998
  var gen = fn.apply(self2, args);
68999
68999
  function _next(value2) {
69000
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value2);
69000
+ asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "next", value2);
69001
69001
  }
69002
69002
  function _throw(err) {
69003
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err);
69003
+ asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "throw", err);
69004
69004
  }
69005
69005
  _next(void 0);
69006
69006
  });
@@ -69450,7 +69450,7 @@ var require_import_meta_resolve = __commonJS({
69450
69450
  value: true
69451
69451
  });
69452
69452
  exports.moduleResolve = moduleResolve;
69453
- exports.resolve = resolve2;
69453
+ exports.resolve = resolve3;
69454
69454
  function _assert() {
69455
69455
  const data = require("assert");
69456
69456
  _assert = function() {
@@ -70525,7 +70525,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
70525
70525
  })
70526
70526
  };
70527
70527
  }
70528
- function resolve2(specifier, parent) {
70528
+ function resolve3(specifier, parent) {
70529
70529
  if (!parent) {
70530
70530
  throw new Error("Please pass `parent`: `import-meta-resolve` cannot ponyfill that");
70531
70531
  }
@@ -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 spawn3 = childProcess.spawn;
71721
+ var spawn4 = 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 spawn3("pgrep", ["-P", parentPid]);
71746
+ return spawn4("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 spawn3("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]);
71753
+ return spawn4("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]);
71754
71754
  }, function() {
71755
71755
  killAll(tree, signal, callback);
71756
71756
  });
@@ -71834,7 +71834,7 @@ var require_dist2 = __commonJS({
71834
71834
  (function(once4) {
71835
71835
  function spread(emitter, name) {
71836
71836
  let c = null;
71837
- const p = new Promise((resolve2, reject) => {
71837
+ const p = new Promise((resolve3, reject) => {
71838
71838
  function cancel() {
71839
71839
  emitter.removeListener(name, onEvent);
71840
71840
  emitter.removeListener("error", onError);
@@ -71842,7 +71842,7 @@ var require_dist2 = __commonJS({
71842
71842
  }
71843
71843
  function onEvent(...args) {
71844
71844
  cancel();
71845
- resolve2(args);
71845
+ resolve3(args);
71846
71846
  }
71847
71847
  function onError(err) {
71848
71848
  cancel();
@@ -71889,7 +71889,10 @@ var import_build_utils5 = require("@vercel/build-utils");
71889
71889
  var import_static_config = require("@vercel/static-config");
71890
71890
 
71891
71891
  // src/typescript.ts
71892
+ var import_child_process = require("child_process");
71893
+ var import_promises = require("fs/promises");
71892
71894
  var import_module = require("module");
71895
+ var import_os = require("os");
71893
71896
  var import_path = require("path");
71894
71897
  var import_build_utils = require("@vercel/build-utils");
71895
71898
  var shouldDebug = false;
@@ -71940,6 +71943,218 @@ function cachedLookup(fn) {
71940
71943
  };
71941
71944
  }
71942
71945
  var require_ = (0, import_module.createRequire)(__filename);
71946
+ function hasLegacyCompilerApi(compiler) {
71947
+ if (typeof compiler !== "object" || compiler === null)
71948
+ return false;
71949
+ const ts = compiler;
71950
+ return ts.sys !== void 0 && typeof ts.transpileModule === "function" && typeof ts.createLanguageService === "function" && typeof ts.createDocumentRegistry === "function" && typeof ts.findConfigFile === "function" && typeof ts.readConfigFile === "function" && typeof ts.parseJsonConfigFileContent === "function";
71951
+ }
71952
+ async function pathExists(path) {
71953
+ try {
71954
+ await (0, import_promises.access)(path);
71955
+ return true;
71956
+ } catch {
71957
+ return false;
71958
+ }
71959
+ }
71960
+ async function findConfigFile(project, cwd) {
71961
+ let current = project ? (0, import_path.dirname)((0, import_path.resolve)(project)) : (0, import_path.resolve)(cwd);
71962
+ while (true) {
71963
+ const configFile = (0, import_path.join)(current, "tsconfig.json");
71964
+ if (await pathExists(configFile))
71965
+ return configFile;
71966
+ const parent = (0, import_path.dirname)(current);
71967
+ if (parent === current)
71968
+ return;
71969
+ current = parent;
71970
+ }
71971
+ }
71972
+ function getDefaultCompilerOptions(nodeVersionMajor = 12) {
71973
+ let target;
71974
+ if (nodeVersionMajor >= 16) {
71975
+ target = "ES2021";
71976
+ } else if (nodeVersionMajor >= 14) {
71977
+ target = "ES2020";
71978
+ } else {
71979
+ target = "ES2019";
71980
+ }
71981
+ return {
71982
+ target,
71983
+ module: "NodeNext",
71984
+ moduleResolution: "NodeNext",
71985
+ strict: false,
71986
+ esModuleInterop: true
71987
+ };
71988
+ }
71989
+ function registerNativeCompiler(options, cwd, compilerVersion) {
71990
+ const resolvePaths = [options.project || cwd];
71991
+ const packageJsonPath = require_.resolve("typescript/package.json", {
71992
+ paths: resolvePaths
71993
+ });
71994
+ const compilerPath = (0, import_promises.readFile)(packageJsonPath, "utf8").then((contents) => {
71995
+ const packageJson = JSON.parse(contents);
71996
+ const bin = typeof packageJson.bin === "string" ? packageJson.bin : packageJson.bin?.tsc;
71997
+ if (typeof bin !== "string") {
71998
+ throw new TypeError(
71999
+ `TypeScript ${compilerVersion} does not provide a compiler executable.`
72000
+ );
72001
+ }
72002
+ return (0, import_path.resolve)((0, import_path.dirname)(packageJsonPath), bin);
72003
+ });
72004
+ const configFile = findConfigFile(options.project, cwd);
72005
+ const rootDir = (0, import_path.resolve)(options.rootDir || cwd);
72006
+ const inputFiles = /* @__PURE__ */ new Set();
72007
+ const outputs = /* @__PURE__ */ new Map();
72008
+ let pendingEmit;
72009
+ function runCompiler(compiler, tempConfigFile) {
72010
+ return new Promise((resolvePromise, reject) => {
72011
+ const child = (0, import_child_process.spawn)(
72012
+ process.execPath,
72013
+ [compiler, "--project", tempConfigFile],
72014
+ {
72015
+ cwd,
72016
+ stdio: ["ignore", "pipe", "pipe"]
72017
+ }
72018
+ );
72019
+ const maxBuffer = 10 * 1024 * 1024;
72020
+ let outputSize = 0;
72021
+ let stdout = "";
72022
+ let stderr = "";
72023
+ child.stdout.setEncoding("utf8");
72024
+ child.stderr.setEncoding("utf8");
72025
+ child.stdout.on("data", (chunk) => {
72026
+ outputSize += Buffer.byteLength(chunk);
72027
+ if (outputSize > maxBuffer) {
72028
+ child.kill();
72029
+ reject(new Error("TypeScript compiler output exceeded 10 MB."));
72030
+ return;
72031
+ }
72032
+ stdout += chunk;
72033
+ });
72034
+ child.stderr.on("data", (chunk) => {
72035
+ outputSize += Buffer.byteLength(chunk);
72036
+ if (outputSize > maxBuffer) {
72037
+ child.kill();
72038
+ reject(new Error("TypeScript compiler output exceeded 10 MB."));
72039
+ return;
72040
+ }
72041
+ stderr += chunk;
72042
+ });
72043
+ child.on("error", reject);
72044
+ child.on("close", (status) => {
72045
+ resolvePromise({ status, stdout, stderr });
72046
+ });
72047
+ });
72048
+ }
72049
+ async function collectOutputs(directory) {
72050
+ await Promise.all(
72051
+ (await (0, import_promises.readdir)(directory, { withFileTypes: true })).map(async (entry) => {
72052
+ const filePath = (0, import_path.join)(directory, entry.name);
72053
+ if (entry.isDirectory()) {
72054
+ await collectOutputs(filePath);
72055
+ } else if (entry.name.endsWith(".map")) {
72056
+ const map = await (0, import_promises.readFile)(filePath, "utf8");
72057
+ const parsedMap = JSON.parse(map);
72058
+ const source = parsedMap.sources?.[0];
72059
+ if (typeof source !== "string")
72060
+ return;
72061
+ const sourcePath = (0, import_path.resolve)(
72062
+ (0, import_path.dirname)(filePath),
72063
+ parsedMap.sourceRoot || "",
72064
+ source
72065
+ );
72066
+ Object.assign(parsedMap, {
72067
+ file: (0, import_path.basename)(sourcePath),
72068
+ sources: [sourcePath]
72069
+ });
72070
+ delete parsedMap.sourceRoot;
72071
+ outputs.set(sourcePath, {
72072
+ code: await (0, import_promises.readFile)(filePath.slice(0, -4), "utf8"),
72073
+ map: parsedMap
72074
+ });
72075
+ }
72076
+ })
72077
+ );
72078
+ }
72079
+ async function emit() {
72080
+ const tempPath = await (0, import_promises.mkdtemp)((0, import_path.join)((0, import_os.tmpdir)(), "vercel-typescript-"));
72081
+ const outDir = (0, import_path.join)(tempPath, "output");
72082
+ const tempConfigFile = (0, import_path.join)(tempPath, "tsconfig.json");
72083
+ const [resolvedCompilerPath, resolvedConfigFile] = await Promise.all([
72084
+ compilerPath,
72085
+ configFile
72086
+ ]);
72087
+ const compilerOptions = {
72088
+ ...resolvedConfigFile ? void 0 : getDefaultCompilerOptions(options.nodeVersionMajor),
72089
+ sourceMap: true,
72090
+ inlineSourceMap: false,
72091
+ inlineSources: true,
72092
+ declaration: false,
72093
+ declarationMap: false,
72094
+ emitDeclarationOnly: false,
72095
+ noEmit: false,
72096
+ outDir,
72097
+ rootDir,
72098
+ incremental: false,
72099
+ composite: false,
72100
+ noCheck: !process.env.EXPERIMENTAL_NODE_TYPESCRIPT_ERRORS,
72101
+ rewriteRelativeImportExtensions: true
72102
+ };
72103
+ const config = {
72104
+ ...resolvedConfigFile ? { extends: resolvedConfigFile } : void 0,
72105
+ compilerOptions,
72106
+ files: Array.from(inputFiles),
72107
+ include: [],
72108
+ exclude: []
72109
+ };
72110
+ try {
72111
+ await (0, import_promises.writeFile)(tempConfigFile, JSON.stringify(config));
72112
+ const result = await runCompiler(resolvedCompilerPath, tempConfigFile);
72113
+ if (await pathExists(outDir))
72114
+ await collectOutputs(outDir);
72115
+ const diagnostics2 = [result.stdout, result.stderr].filter(Boolean).join("\n").trim();
72116
+ if (result.status !== 0) {
72117
+ if (process.env.EXPERIMENTAL_NODE_TYPESCRIPT_ERRORS) {
72118
+ throw new import_build_utils.NowBuildError({
72119
+ code: "NODE_TYPESCRIPT_ERROR",
72120
+ message: diagnostics2
72121
+ });
72122
+ }
72123
+ if (diagnostics2)
72124
+ console.error(diagnostics2);
72125
+ }
72126
+ } finally {
72127
+ await (0, import_promises.rm)(tempPath, { recursive: true, force: true });
72128
+ }
72129
+ }
72130
+ console.log(
72131
+ `Using the TypeScript ${compilerVersion} compiler executable for transpilation.`
72132
+ );
72133
+ return async (_code, fileName) => {
72134
+ const sourcePath = (0, import_path.resolve)(fileName);
72135
+ let output = outputs.get(sourcePath);
72136
+ inputFiles.add(sourcePath);
72137
+ let initiatedEmit = false;
72138
+ while (!output) {
72139
+ if (pendingEmit) {
72140
+ await pendingEmit;
72141
+ } else if (!initiatedEmit) {
72142
+ initiatedEmit = true;
72143
+ pendingEmit = emit().finally(() => {
72144
+ pendingEmit = void 0;
72145
+ });
72146
+ await pendingEmit;
72147
+ } else {
72148
+ break;
72149
+ }
72150
+ output = outputs.get(sourcePath);
72151
+ }
72152
+ if (!output) {
72153
+ throw new TypeError(`TypeScript did not emit an output for ${fileName}.`);
72154
+ }
72155
+ return output;
72156
+ };
72157
+ }
71943
72158
  var configFileToBuildMap = /* @__PURE__ */ new Map();
71944
72159
  function register(opts = {}) {
71945
72160
  const options = Object.assign({}, DEFAULTS, opts);
@@ -71961,16 +72176,21 @@ function register(opts = {}) {
71961
72176
  } catch (_e) {
71962
72177
  compiler = "typescript";
71963
72178
  }
71964
- const ts = require_(compiler);
72179
+ const loadedCompiler = require_(compiler);
72180
+ const loadedVersion = typeof loadedCompiler === "object" && loadedCompiler !== null && "version" in loadedCompiler && typeof loadedCompiler.version === "string" ? loadedCompiler.version : "unknown";
71965
72181
  if (compiler === "typescript") {
71966
72182
  console.log(
71967
- `Using built-in TypeScript ${ts.version} since "typescript" is missing from "devDependencies"`
72183
+ `Using built-in TypeScript ${loadedVersion} since "typescript" is missing from "devDependencies"`
71968
72184
  );
71969
72185
  } else {
71970
- console.log(`Using TypeScript ${ts.version} (local user-provided)`);
72186
+ console.log(`Using TypeScript ${loadedVersion} (local user-provided)`);
71971
72187
  }
72188
+ if (!hasLegacyCompilerApi(loadedCompiler)) {
72189
+ return registerNativeCompiler(options, cwd, loadedVersion);
72190
+ }
72191
+ const ts = loadedCompiler;
71972
72192
  const transformers = options.transformers || void 0;
71973
- const readFile = options.readFile || ts.sys.readFile;
72193
+ const readFile2 = options.readFile || ts.sys.readFile;
71974
72194
  const fileExists = options.fileExists || ts.sys.fileExists;
71975
72195
  const formatDiagnostics = process.stdout.isTTY || options.pretty ? ts.formatDiagnosticsWithColorAndContext : ts.formatDiagnostics;
71976
72196
  const diagnosticHost = {
@@ -72017,7 +72237,7 @@ function register(opts = {}) {
72017
72237
  return file;
72018
72238
  };
72019
72239
  const memoryCache = new MemoryCache(config.fileNames);
72020
- const cachedReadFile = cachedLookup(readFile);
72240
+ const cachedReadFile = cachedLookup(readFile2);
72021
72241
  const serviceHost = {
72022
72242
  getScriptFileNames: () => Array.from(memoryCache.fileVersions.keys()),
72023
72243
  getScriptVersion: (fileName) => {
@@ -72122,7 +72342,7 @@ This is usually the result of a faulty configuration or import. Make sure there
72122
72342
  let config = { compilerOptions: {} };
72123
72343
  const basePath = normalizeSlashes((0, import_path.dirname)(configFileName));
72124
72344
  if (configFileName) {
72125
- const result = ts.readConfigFile(configFileName, readFile);
72345
+ const result = ts.readConfigFile(configFileName, readFile2);
72126
72346
  if (result.error) {
72127
72347
  const errorResult = {
72128
72348
  errors: [result.error],
@@ -72447,7 +72667,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72447
72667
  }
72448
72668
  }
72449
72669
  let tsCompile;
72450
- function compileTypeScript(path, source) {
72670
+ async function compileTypeScript(path, source) {
72451
72671
  const relPath = (0, import_path3.relative)(baseDir, path);
72452
72672
  if (!tsCompile) {
72453
72673
  tsCompile = register({
@@ -72455,12 +72675,13 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72455
72675
  // The base is the same as root now.json dir
72456
72676
  project: path,
72457
72677
  // Resolve tsconfig.json from entrypoint dir
72678
+ rootDir: baseDir,
72458
72679
  files: true,
72459
72680
  // Include all files such as global `.d.ts`
72460
72681
  nodeVersionMajor: nodeVersion.major
72461
72682
  });
72462
72683
  }
72463
- const { code, map } = tsCompile(source, path);
72684
+ const { code, map } = await tsCompile(source, path);
72464
72685
  tsCompiled.add(relPath);
72465
72686
  preparedFiles[renameTStoJS(relPath) + ".map"] = new import_build_utils5.FileBlob({
72466
72687
  data: JSON.stringify(map)
@@ -72518,7 +72739,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
72518
72739
  }
72519
72740
  }
72520
72741
  if (fsPath.endsWith(".ts") && !fsPath.endsWith(".d.ts") || fsPath.endsWith(".tsx") || fsPath.endsWith(".mts") || fsPath.endsWith(".cts")) {
72521
- source = compileTypeScript(fsPath, source.toString());
72742
+ source = await compileTypeScript(fsPath, source.toString());
72522
72743
  }
72523
72744
  if (!entry) {
72524
72745
  entry = new import_build_utils5.FileBlob({ data: source, mode });
@@ -72914,25 +73135,25 @@ var import_ts_morph2 = require("ts-morph");
72914
73135
  // src/fork-dev-server.ts
72915
73136
  var import_once2 = __toESM(require_dist2());
72916
73137
  var import_build_utils8 = require("@vercel/build-utils");
72917
- var import_child_process2 = require("child_process");
73138
+ var import_child_process3 = require("child_process");
72918
73139
  var import_url = require("url");
72919
73140
  var import_path5 = require("path");
72920
73141
 
72921
73142
  // src/bun-helpers.ts
72922
73143
  var import_build_utils7 = require("@vercel/build-utils");
72923
- var import_child_process = require("child_process");
73144
+ var import_child_process2 = require("child_process");
72924
73145
  var import_once = __toESM(require_dist2());
72925
- var import_os = require("os");
73146
+ var import_os2 = require("os");
72926
73147
  var import_path4 = require("path");
72927
73148
  async function spawnAsync(command, args, options) {
72928
- const child = (0, import_child_process.spawn)(command, args, options);
73149
+ const child = (0, import_child_process2.spawn)(command, args, options);
72929
73150
  const [exitCode] = await import_once.default.spread(child, "close");
72930
73151
  return exitCode;
72931
73152
  }
72932
73153
  async function getOrCreateBunBinary() {
72933
73154
  const { platform } = process;
72934
73155
  const bunCommand = platform === "win32" ? "bun.exe" : "bun";
72935
- const installPath = (0, import_path4.join)((0, import_os.homedir)(), ".bun", "bin", bunCommand);
73156
+ const installPath = (0, import_path4.join)((0, import_os2.homedir)(), ".bun", "bin", bunCommand);
72936
73157
  try {
72937
73158
  const exitCode = await spawnAsync(bunCommand, ["--version"], {
72938
73159
  stdio: "ignore"
@@ -73008,7 +73229,7 @@ async function forkDevServer(options) {
73008
73229
  }),
73009
73230
  stdio: ["pipe", "pipe", "pipe"]
73010
73231
  };
73011
- child = (0, import_child_process2.spawn)(bun, ["--bun", devServerPath], spawnOptions);
73232
+ child = (0, import_child_process3.spawn)(bun, ["--bun", devServerPath], spawnOptions);
73012
73233
  let buffer = "";
73013
73234
  child.stdout?.on("data", (data) => {
73014
73235
  const output = data.toString();
@@ -73048,7 +73269,7 @@ async function forkDevServer(options) {
73048
73269
  }),
73049
73270
  stdio: options.printLogs ? "pipe" : void 0
73050
73271
  };
73051
- child = (0, import_child_process2.fork)(devServerPath, [], forkOptions);
73272
+ child = (0, import_child_process3.fork)(devServerPath, [], forkOptions);
73052
73273
  }
73053
73274
  if (options.printLogs) {
73054
73275
  child.stdout?.on("data", (data) => {
@@ -73283,12 +73504,12 @@ var startDevServer = async (opts) => {
73283
73504
  await treeKill(pid);
73284
73505
  }
73285
73506
  } else {
73286
- await new Promise((resolve2, reject) => {
73507
+ await new Promise((resolve3, reject) => {
73287
73508
  child.send("shutdown", (err) => {
73288
73509
  if (err) {
73289
- treeKill(pid).then(() => resolve2()).catch((killErr) => reject(killErr));
73510
+ treeKill(pid).then(() => resolve3()).catch((killErr) => reject(killErr));
73290
73511
  } else {
73291
- resolve2();
73512
+ resolve3();
73292
73513
  }
73293
73514
  });
73294
73515
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "5.9.7",
3
+ "version": "5.9.9",
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.3",
36
- "@vercel/error-utils": "2.2.1",
37
- "@vercel/static-config": "3.4.1"
35
+ "@vercel/build-utils": "14.0.5",
36
+ "@vercel/static-config": "3.4.1",
37
+ "@vercel/error-utils": "2.2.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@babel/core": "7.24.4",
@@ -46,7 +46,7 @@
46
46
  "@types/cookie": "0.3.3",
47
47
  "@types/etag": "1.8.0",
48
48
  "@types/mime-types": "2.1.4",
49
- "@vitest/expect": "1.4.0",
49
+ "@vitest/expect": "4.1.10",
50
50
  "content-type": "1.0.5",
51
51
  "cookie": "0.7.0",
52
52
  "cross-env": "7.0.3",
@@ -55,9 +55,9 @@
55
55
  "glob": "10.3.16",
56
56
  "source-map-support": "0.5.12",
57
57
  "tree-kill": "1.2.2",
58
- "vite": "^5.1.6",
59
- "vitest": "^2.0.1",
60
- "@vercel/functions": "3.9.1"
58
+ "vite": "^6.4.3",
59
+ "vitest": "^4.1.10",
60
+ "@vercel/functions": "3.9.3"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "node build.mjs",