@vercel/node 5.0.2 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -33,157 +33,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/@tootallnate+once@1.1.2/node_modules/@tootallnate/once/dist/index.js
37
- var require_dist = __commonJS({
38
- "../../node_modules/.pnpm/@tootallnate+once@1.1.2/node_modules/@tootallnate/once/dist/index.js"(exports, module2) {
39
- "use strict";
40
- function noop() {
41
- }
42
- function once3(emitter, name) {
43
- const o = once3.spread(emitter, name);
44
- const r = o.then((args) => args[0]);
45
- r.cancel = o.cancel;
46
- return r;
47
- }
48
- (function(once4) {
49
- function spread(emitter, name) {
50
- let c = null;
51
- const p = new Promise((resolve2, reject) => {
52
- function cancel() {
53
- emitter.removeListener(name, onEvent);
54
- emitter.removeListener("error", onError);
55
- p.cancel = noop;
56
- }
57
- function onEvent(...args) {
58
- cancel();
59
- resolve2(args);
60
- }
61
- function onError(err) {
62
- cancel();
63
- reject(err);
64
- }
65
- c = cancel;
66
- emitter.on(name, onEvent);
67
- emitter.on("error", onError);
68
- });
69
- if (!c) {
70
- throw new TypeError("Could not get `cancel()` function");
71
- }
72
- p.cancel = c;
73
- return p;
74
- }
75
- once4.spread = spread;
76
- })(once3 || (once3 = {}));
77
- module2.exports = once3;
78
- }
79
- });
80
-
81
- // ../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js
82
- var require_tree_kill = __commonJS({
83
- "../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js"(exports, module2) {
84
- "use strict";
85
- var childProcess = require("child_process");
86
- var spawn2 = childProcess.spawn;
87
- var exec = childProcess.exec;
88
- module2.exports = function(pid, signal, callback) {
89
- if (typeof signal === "function" && callback === void 0) {
90
- callback = signal;
91
- signal = void 0;
92
- }
93
- pid = parseInt(pid);
94
- if (Number.isNaN(pid)) {
95
- if (callback) {
96
- return callback(new Error("pid must be a number"));
97
- } else {
98
- throw new Error("pid must be a number");
99
- }
100
- }
101
- var tree = {};
102
- var pidsToProcess = {};
103
- tree[pid] = [];
104
- pidsToProcess[pid] = 1;
105
- switch (process.platform) {
106
- case "win32":
107
- exec("taskkill /pid " + pid + " /T /F", callback);
108
- break;
109
- case "darwin":
110
- buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
111
- return spawn2("pgrep", ["-P", parentPid]);
112
- }, function() {
113
- killAll(tree, signal, callback);
114
- });
115
- break;
116
- default:
117
- buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
118
- return spawn2("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]);
119
- }, function() {
120
- killAll(tree, signal, callback);
121
- });
122
- break;
123
- }
124
- };
125
- function killAll(tree, signal, callback) {
126
- var killed = {};
127
- try {
128
- Object.keys(tree).forEach(function(pid) {
129
- tree[pid].forEach(function(pidpid) {
130
- if (!killed[pidpid]) {
131
- killPid(pidpid, signal);
132
- killed[pidpid] = 1;
133
- }
134
- });
135
- if (!killed[pid]) {
136
- killPid(pid, signal);
137
- killed[pid] = 1;
138
- }
139
- });
140
- } catch (err) {
141
- if (callback) {
142
- return callback(err);
143
- } else {
144
- throw err;
145
- }
146
- }
147
- if (callback) {
148
- return callback();
149
- }
150
- }
151
- function killPid(pid, signal) {
152
- try {
153
- process.kill(parseInt(pid, 10), signal);
154
- } catch (err) {
155
- if (err.code !== "ESRCH")
156
- throw err;
157
- }
158
- }
159
- function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesList, cb) {
160
- var ps = spawnChildProcessesList(parentPid);
161
- var allData = "";
162
- ps.stdout.on("data", function(data) {
163
- var data = data.toString("ascii");
164
- allData += data;
165
- });
166
- var onClose = function(code) {
167
- delete pidsToProcess[parentPid];
168
- if (code != 0) {
169
- if (Object.keys(pidsToProcess).length == 0) {
170
- cb();
171
- }
172
- return;
173
- }
174
- allData.match(/\d+/g).forEach(function(pid) {
175
- pid = parseInt(pid, 10);
176
- tree[parentPid].push(pid);
177
- tree[pid] = [];
178
- pidsToProcess[pid] = 1;
179
- buildProcessTree(pid, tree, pidsToProcess, spawnChildProcessesList, cb);
180
- });
181
- };
182
- ps.on("close", onClose);
183
- }
184
- }
185
- });
186
-
187
36
  // ../../node_modules/.pnpm/@babel+types@7.26.3/node_modules/@babel/types/lib/utils/shallowEqual.js
188
37
  var require_shallowEqual = __commonJS({
189
38
  "../../node_modules/.pnpm/@babel+types@7.26.3/node_modules/@babel/types/lib/utils/shallowEqual.js"(exports) {
@@ -36616,7 +36465,7 @@ var require_sourcemap_codec_umd = __commonJS({
36616
36465
  intToChar[i] = c;
36617
36466
  charToInt[c] = i;
36618
36467
  }
36619
- function decodeInteger(reader, relative3) {
36468
+ function decodeInteger(reader, relative4) {
36620
36469
  let value2 = 0;
36621
36470
  let shift = 0;
36622
36471
  let integer = 0;
@@ -36631,10 +36480,10 @@ var require_sourcemap_codec_umd = __commonJS({
36631
36480
  if (shouldNegate) {
36632
36481
  value2 = -2147483648 | -value2;
36633
36482
  }
36634
- return relative3 + value2;
36483
+ return relative4 + value2;
36635
36484
  }
36636
- function encodeInteger(builder, num, relative3) {
36637
- let delta = num - relative3;
36485
+ function encodeInteger(builder, num, relative4) {
36486
+ let delta = num - relative4;
36638
36487
  delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
36639
36488
  do {
36640
36489
  let clamped = delta & 31;
@@ -37144,7 +36993,7 @@ var require_resolve_uri_umd = __commonJS({
37144
36993
  }
37145
36994
  url2.path = path;
37146
36995
  }
37147
- function resolve2(input, base) {
36996
+ function resolve3(input, base) {
37148
36997
  if (!input && !base)
37149
36998
  return "";
37150
36999
  const url2 = parseUrl(input);
@@ -37191,7 +37040,7 @@ var require_resolve_uri_umd = __commonJS({
37191
37040
  return url2.scheme + "//" + url2.user + url2.host + url2.port + url2.path + queryHash;
37192
37041
  }
37193
37042
  }
37194
- return resolve2;
37043
+ return resolve3;
37195
37044
  });
37196
37045
  }
37197
37046
  });
@@ -37203,7 +37052,7 @@ var require_trace_mapping_umd = __commonJS({
37203
37052
  typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports, require_sourcemap_codec_umd(), require_resolve_uri_umd()) : typeof define === "function" && define.amd ? define(["exports", "@jridgewell/sourcemap-codec", "@jridgewell/resolve-uri"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.traceMapping = {}, global2.sourcemapCodec, global2.resolveURI));
37204
37053
  })(exports, function(exports2, sourcemapCodec, resolveUri) {
37205
37054
  "use strict";
37206
- function resolve2(input, base) {
37055
+ function resolve3(input, base) {
37207
37056
  if (base && !base.endsWith("/"))
37208
37057
  base += "/";
37209
37058
  return resolveUri(input, base);
@@ -37455,8 +37304,8 @@ var require_trace_mapping_umd = __commonJS({
37455
37304
  this.sources = sources;
37456
37305
  this.sourcesContent = sourcesContent;
37457
37306
  this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
37458
- const from = resolve2(sourceRoot || "", stripFilename(mapUrl));
37459
- this.resolvedSources = sources.map((s) => resolve2(s || "", from));
37307
+ const from = resolve3(sourceRoot || "", stripFilename(mapUrl));
37308
+ this.resolvedSources = sources.map((s) => resolve3(s || "", from));
37460
37309
  const { mappings } = parsed;
37461
37310
  if (typeof mappings === "string") {
37462
37311
  this._encoded = mappings;
@@ -46079,7 +45928,7 @@ var require_introspection = __commonJS({
46079
45928
  exports.isStatic = isStatic;
46080
45929
  exports.matchesPattern = matchesPattern;
46081
45930
  exports.referencesImport = referencesImport;
46082
- exports.resolve = resolve2;
45931
+ exports.resolve = resolve3;
46083
45932
  exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore;
46084
45933
  var _t = require_lib3();
46085
45934
  var {
@@ -46349,7 +46198,7 @@ var require_introspection = __commonJS({
46349
46198
  nodeMap.set(target.node, result);
46350
46199
  return result;
46351
46200
  }
46352
- function resolve2(dangerous, resolved) {
46201
+ function resolve3(dangerous, resolved) {
46353
46202
  return _resolve.call(this, dangerous, resolved) || this;
46354
46203
  }
46355
46204
  function _resolve(dangerous, resolved) {
@@ -51112,10 +50961,10 @@ var require_gensync = __commonJS({
51112
50961
  const items = Array.from(args[0]);
51113
50962
  return items.map((item) => evaluateSync(item));
51114
50963
  },
51115
- async: function(args, resolve2, reject) {
50964
+ async: function(args, resolve3, reject) {
51116
50965
  const items = Array.from(args[0]);
51117
50966
  if (items.length === 0) {
51118
- Promise.resolve().then(() => resolve2([]));
50967
+ Promise.resolve().then(() => resolve3([]));
51119
50968
  return;
51120
50969
  }
51121
50970
  let count = 0;
@@ -51127,7 +50976,7 @@ var require_gensync = __commonJS({
51127
50976
  results[i] = val;
51128
50977
  count += 1;
51129
50978
  if (count === results.length)
51130
- resolve2(results);
50979
+ resolve3(results);
51131
50980
  },
51132
50981
  reject
51133
50982
  );
@@ -51144,13 +50993,13 @@ var require_gensync = __commonJS({
51144
50993
  }
51145
50994
  return evaluateSync(items[0]);
51146
50995
  },
51147
- async: function(args, resolve2, reject) {
50996
+ async: function(args, resolve3, reject) {
51148
50997
  const items = Array.from(args[0]);
51149
50998
  if (items.length === 0) {
51150
50999
  throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY);
51151
51000
  }
51152
51001
  for (const item of items) {
51153
- evaluateAsync(item, resolve2, reject);
51002
+ evaluateAsync(item, resolve3, reject);
51154
51003
  }
51155
51004
  }
51156
51005
  })
@@ -51162,8 +51011,8 @@ var require_gensync = __commonJS({
51162
51011
  return evaluateSync(genFn.apply(this, args));
51163
51012
  },
51164
51013
  async: function(...args) {
51165
- return new Promise((resolve2, reject) => {
51166
- evaluateAsync(genFn.apply(this, args), resolve2, reject);
51014
+ return new Promise((resolve3, reject) => {
51015
+ evaluateAsync(genFn.apply(this, args), resolve3, reject);
51167
51016
  });
51168
51017
  },
51169
51018
  errback: function(...args) {
@@ -51261,18 +51110,18 @@ var require_gensync = __commonJS({
51261
51110
  sync: function(args) {
51262
51111
  return sync.apply(this, args);
51263
51112
  },
51264
- async: function(args, resolve2, reject) {
51113
+ async: function(args, resolve3, reject) {
51265
51114
  if (async) {
51266
- async.apply(this, args).then(resolve2, reject);
51115
+ async.apply(this, args).then(resolve3, reject);
51267
51116
  } else if (errback) {
51268
51117
  errback.call(this, ...args, (err, value2) => {
51269
51118
  if (err == null)
51270
- resolve2(value2);
51119
+ resolve3(value2);
51271
51120
  else
51272
51121
  reject(err);
51273
51122
  });
51274
51123
  } else {
51275
- resolve2(sync.apply(this, args));
51124
+ resolve3(sync.apply(this, args));
51276
51125
  }
51277
51126
  }
51278
51127
  });
@@ -51325,7 +51174,7 @@ var require_gensync = __commonJS({
51325
51174
  }
51326
51175
  return value2;
51327
51176
  }
51328
- function evaluateAsync(gen, resolve2, reject) {
51177
+ function evaluateAsync(gen, resolve3, reject) {
51329
51178
  (function step() {
51330
51179
  try {
51331
51180
  let value2;
@@ -51346,7 +51195,7 @@ var require_gensync = __commonJS({
51346
51195
  return;
51347
51196
  }
51348
51197
  }
51349
- return resolve2(value2);
51198
+ return resolve3(value2);
51350
51199
  } catch (err) {
51351
51200
  return reject(err);
51352
51201
  }
@@ -51434,7 +51283,7 @@ var require_async = __commonJS({
51434
51283
  };
51435
51284
  return data;
51436
51285
  }
51437
- function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
51286
+ function asyncGeneratorStep(gen, resolve3, reject, _next, _throw, key, arg) {
51438
51287
  try {
51439
51288
  var info = gen[key](arg);
51440
51289
  var value2 = info.value;
@@ -51443,7 +51292,7 @@ var require_async = __commonJS({
51443
51292
  return;
51444
51293
  }
51445
51294
  if (info.done) {
51446
- resolve2(value2);
51295
+ resolve3(value2);
51447
51296
  } else {
51448
51297
  Promise.resolve(value2).then(_next, _throw);
51449
51298
  }
@@ -51451,13 +51300,13 @@ var require_async = __commonJS({
51451
51300
  function _asyncToGenerator(fn) {
51452
51301
  return function() {
51453
51302
  var self2 = this, args = arguments;
51454
- return new Promise(function(resolve2, reject) {
51303
+ return new Promise(function(resolve3, reject) {
51455
51304
  var gen = fn.apply(self2, args);
51456
51305
  function _next(value2) {
51457
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value2);
51306
+ asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "next", value2);
51458
51307
  }
51459
51308
  function _throw(err) {
51460
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err);
51309
+ asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "throw", err);
51461
51310
  }
51462
51311
  _next(void 0);
51463
51312
  });
@@ -51831,8 +51680,8 @@ var require_caching = __commonJS({
51831
51680
  this.released = false;
51832
51681
  this.promise = void 0;
51833
51682
  this._resolve = void 0;
51834
- this.promise = new Promise((resolve2) => {
51835
- this._resolve = resolve2;
51683
+ this.promise = new Promise((resolve3) => {
51684
+ this._resolve = resolve3;
51836
51685
  });
51837
51686
  }
51838
51687
  release(value2) {
@@ -52088,16 +51937,16 @@ var require_package = __commonJS({
52088
51937
  let pkg = null;
52089
51938
  const directories = [];
52090
51939
  let isPackage = true;
52091
- let dirname3 = _path().dirname(filepath);
52092
- while (!pkg && _path().basename(dirname3) !== "node_modules") {
52093
- directories.push(dirname3);
52094
- pkg = yield* readConfigPackage(_path().join(dirname3, PACKAGE_FILENAME));
52095
- const nextLoc = _path().dirname(dirname3);
52096
- if (dirname3 === nextLoc) {
51940
+ let dirname4 = _path().dirname(filepath);
51941
+ while (!pkg && _path().basename(dirname4) !== "node_modules") {
51942
+ directories.push(dirname4);
51943
+ pkg = yield* readConfigPackage(_path().join(dirname4, PACKAGE_FILENAME));
51944
+ const nextLoc = _path().dirname(dirname4);
51945
+ if (dirname4 === nextLoc) {
52097
51946
  isPackage = false;
52098
51947
  break;
52099
51948
  }
52100
- dirname3 = nextLoc;
51949
+ dirname4 = nextLoc;
52101
51950
  }
52102
51951
  return {
52103
51952
  filepath,
@@ -53404,9 +53253,9 @@ var require_functional = __commonJS({
53404
53253
  };
53405
53254
  }
53406
53255
  } else {
53407
- let resolve2, reject;
53256
+ let resolve3, reject;
53408
53257
  resultP = new Promise((res, rej) => {
53409
- resolve2 = res;
53258
+ resolve3 = res;
53410
53259
  reject = rej;
53411
53260
  });
53412
53261
  try {
@@ -53416,7 +53265,7 @@ var require_functional = __commonJS({
53416
53265
  };
53417
53266
  resultP = null;
53418
53267
  if (promiseReferenced)
53419
- resolve2(result.value);
53268
+ resolve3(result.value);
53420
53269
  } catch (error) {
53421
53270
  result = {
53422
53271
  ok: false,
@@ -54598,7 +54447,7 @@ var require_browserslist = __commonJS({
54598
54447
  function isSupported(flags, withPartial) {
54599
54448
  return typeof flags === "string" && (flags.indexOf("y") >= 0 || withPartial && flags.indexOf("a") >= 0);
54600
54449
  }
54601
- function resolve2(queries, context) {
54450
+ function resolve3(queries, context) {
54602
54451
  return parse(QUERIES, queries).reduce(function(result, node, index) {
54603
54452
  if (node.not && index === 0) {
54604
54453
  throw new BrowserslistError(
@@ -54687,7 +54536,7 @@ var require_browserslist = __commonJS({
54687
54536
  var cacheKey = JSON.stringify([queries, context]);
54688
54537
  if (cache[cacheKey])
54689
54538
  return cache[cacheKey];
54690
- var result = uniq(resolve2(queries, context)).sort(function(name1, name2) {
54539
+ var result = uniq(resolve3(queries, context)).sort(function(name1, name2) {
54691
54540
  name1 = name1.split(" ");
54692
54541
  name2 = name2.split(" ");
54693
54542
  if (name1[0] === name2[0]) {
@@ -55291,7 +55140,7 @@ var require_browserslist = __commonJS({
55291
55140
  matches: [],
55292
55141
  regexp: /^current\s+node$/i,
55293
55142
  select: function(context) {
55294
- return [env.currentNode(resolve2, context)];
55143
+ return [env.currentNode(resolve3, context)];
55295
55144
  }
55296
55145
  },
55297
55146
  maintained_node: {
@@ -55304,7 +55153,7 @@ var require_browserslist = __commonJS({
55304
55153
  }).map(function(key) {
55305
55154
  return "node " + key.slice(1);
55306
55155
  });
55307
- return resolve2(queries, context);
55156
+ return resolve3(queries, context);
55308
55157
  }
55309
55158
  },
55310
55159
  phantomjs_1_9: {
@@ -55363,14 +55212,14 @@ var require_browserslist = __commonJS({
55363
55212
  matches: ["config"],
55364
55213
  regexp: /^extends (.+)$/i,
55365
55214
  select: function(context, node) {
55366
- return resolve2(env.loadQueries(context, node.config), context);
55215
+ return resolve3(env.loadQueries(context, node.config), context);
55367
55216
  }
55368
55217
  },
55369
55218
  defaults: {
55370
55219
  matches: [],
55371
55220
  regexp: /^defaults$/i,
55372
55221
  select: function(context) {
55373
- return resolve2(browserslist.defaults, context);
55222
+ return resolve3(browserslist.defaults, context);
55374
55223
  }
55375
55224
  },
55376
55225
  dead: {
@@ -55385,7 +55234,7 @@ var require_browserslist = __commonJS({
55385
55234
  "op_mob <= 12.1",
55386
55235
  "samsung 4"
55387
55236
  ];
55388
- return resolve2(dead, context);
55237
+ return resolve3(dead, context);
55389
55238
  }
55390
55239
  },
55391
55240
  unknown: {
@@ -57659,44 +57508,44 @@ var require_config_descriptors = __commonJS({
57659
57508
  function* handlerOf(value2) {
57660
57509
  return value2;
57661
57510
  }
57662
- function optionsWithResolvedBrowserslistConfigFile(options, dirname3) {
57511
+ function optionsWithResolvedBrowserslistConfigFile(options, dirname4) {
57663
57512
  if (typeof options.browserslistConfigFile === "string") {
57664
- options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname3);
57513
+ options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname4);
57665
57514
  }
57666
57515
  return options;
57667
57516
  }
57668
- function createCachedDescriptors(dirname3, options, alias) {
57517
+ function createCachedDescriptors(dirname4, options, alias) {
57669
57518
  const {
57670
57519
  plugins,
57671
57520
  presets,
57672
57521
  passPerPreset
57673
57522
  } = options;
57674
57523
  return {
57675
- options: optionsWithResolvedBrowserslistConfigFile(options, dirname3),
57676
- plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname3)(alias) : () => handlerOf([]),
57677
- presets: presets ? () => createCachedPresetDescriptors(presets, dirname3)(alias)(!!passPerPreset) : () => handlerOf([])
57524
+ options: optionsWithResolvedBrowserslistConfigFile(options, dirname4),
57525
+ plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname4)(alias) : () => handlerOf([]),
57526
+ presets: presets ? () => createCachedPresetDescriptors(presets, dirname4)(alias)(!!passPerPreset) : () => handlerOf([])
57678
57527
  };
57679
57528
  }
57680
- function createUncachedDescriptors(dirname3, options, alias) {
57529
+ function createUncachedDescriptors(dirname4, options, alias) {
57681
57530
  return {
57682
- options: optionsWithResolvedBrowserslistConfigFile(options, dirname3),
57683
- plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname3, alias)),
57684
- presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname3, alias, !!options.passPerPreset))
57531
+ options: optionsWithResolvedBrowserslistConfigFile(options, dirname4),
57532
+ plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname4, alias)),
57533
+ presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname4, alias, !!options.passPerPreset))
57685
57534
  };
57686
57535
  }
57687
57536
  var PRESET_DESCRIPTOR_CACHE = /* @__PURE__ */ new WeakMap();
57688
57537
  var createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
57689
- const dirname3 = cache.using((dir) => dir);
57538
+ const dirname4 = cache.using((dir) => dir);
57690
57539
  return (0, _caching.makeStrongCacheSync)((alias) => (0, _caching.makeStrongCache)(function* (passPerPreset) {
57691
- const descriptors = yield* createPresetDescriptors(items, dirname3, alias, passPerPreset);
57540
+ const descriptors = yield* createPresetDescriptors(items, dirname4, alias, passPerPreset);
57692
57541
  return descriptors.map((desc) => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
57693
57542
  }));
57694
57543
  });
57695
57544
  var PLUGIN_DESCRIPTOR_CACHE = /* @__PURE__ */ new WeakMap();
57696
57545
  var createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
57697
- const dirname3 = cache.using((dir) => dir);
57546
+ const dirname4 = cache.using((dir) => dir);
57698
57547
  return (0, _caching.makeStrongCache)(function* (alias) {
57699
- const descriptors = yield* createPluginDescriptors(items, dirname3, alias);
57548
+ const descriptors = yield* createPluginDescriptors(items, dirname4, alias);
57700
57549
  return descriptors.map((desc) => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
57701
57550
  });
57702
57551
  });
@@ -57727,14 +57576,14 @@ var require_config_descriptors = __commonJS({
57727
57576
  }
57728
57577
  return desc;
57729
57578
  }
57730
- function* createPresetDescriptors(items, dirname3, alias, passPerPreset) {
57731
- return yield* createDescriptors("preset", items, dirname3, alias, passPerPreset);
57579
+ function* createPresetDescriptors(items, dirname4, alias, passPerPreset) {
57580
+ return yield* createDescriptors("preset", items, dirname4, alias, passPerPreset);
57732
57581
  }
57733
- function* createPluginDescriptors(items, dirname3, alias) {
57734
- return yield* createDescriptors("plugin", items, dirname3, alias);
57582
+ function* createPluginDescriptors(items, dirname4, alias) {
57583
+ return yield* createDescriptors("plugin", items, dirname4, alias);
57735
57584
  }
57736
- function* createDescriptors(type, items, dirname3, alias, ownPass) {
57737
- const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname3, {
57585
+ function* createDescriptors(type, items, dirname4, alias, ownPass) {
57586
+ const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname4, {
57738
57587
  type,
57739
57588
  alias: `${alias}$${index}`,
57740
57589
  ownPass: !!ownPass
@@ -57742,7 +57591,7 @@ var require_config_descriptors = __commonJS({
57742
57591
  assertNoDuplicates(descriptors);
57743
57592
  return descriptors;
57744
57593
  }
57745
- function* createDescriptor(pair, dirname3, {
57594
+ function* createDescriptor(pair, dirname4, {
57746
57595
  type,
57747
57596
  alias,
57748
57597
  ownPass
@@ -57772,7 +57621,7 @@ var require_config_descriptors = __commonJS({
57772
57621
  ({
57773
57622
  filepath,
57774
57623
  value: value2
57775
- } = yield* resolver(value2, dirname3));
57624
+ } = yield* resolver(value2, dirname4));
57776
57625
  file = {
57777
57626
  request,
57778
57627
  resolved: filepath
@@ -57799,7 +57648,7 @@ var require_config_descriptors = __commonJS({
57799
57648
  alias: filepath || alias,
57800
57649
  value: value2,
57801
57650
  options,
57802
- dirname: dirname3,
57651
+ dirname: dirname4,
57803
57652
  ownPass,
57804
57653
  file
57805
57654
  };
@@ -57846,10 +57695,10 @@ var require_item = __commonJS({
57846
57695
  return new ConfigItem(desc);
57847
57696
  }
57848
57697
  function* createConfigItem(value2, {
57849
- dirname: dirname3 = ".",
57698
+ dirname: dirname4 = ".",
57850
57699
  type
57851
57700
  } = {}) {
57852
- const descriptor = yield* (0, _configDescriptors.createDescriptor)(value2, _path().resolve(dirname3), {
57701
+ const descriptor = yield* (0, _configDescriptors.createDescriptor)(value2, _path().resolve(dirname4), {
57853
57702
  type,
57854
57703
  alias: "programmatic item"
57855
57704
  });
@@ -58476,8 +58325,8 @@ var require_pattern_to_regex = __commonJS({
58476
58325
  function escapeRegExp(string) {
58477
58326
  return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
58478
58327
  }
58479
- function pathToPattern(pattern, dirname3) {
58480
- const parts = _path().resolve(dirname3, pattern).split(_path().sep);
58328
+ function pathToPattern(pattern, dirname4) {
58329
+ const parts = _path().resolve(dirname4, pattern).split(_path().sep);
58481
58330
  return new RegExp(["^", ...parts.map((part, i) => {
58482
58331
  const last = i === parts.length - 1;
58483
58332
  if (part === "**")
@@ -58829,10 +58678,10 @@ var require_config_chain = __commonJS({
58829
58678
  });
58830
58679
  }
58831
58680
  function buildRootDescriptors({
58832
- dirname: dirname3,
58681
+ dirname: dirname4,
58833
58682
  options
58834
58683
  }, alias, descriptors) {
58835
- return descriptors(dirname3, options, alias);
58684
+ return descriptors(dirname4, options, alias);
58836
58685
  }
58837
58686
  function buildProgrammaticLogger(_, context, baseLogger) {
58838
58687
  var _context$caller;
@@ -58845,25 +58694,25 @@ var require_config_chain = __commonJS({
58845
58694
  });
58846
58695
  }
58847
58696
  function buildEnvDescriptors({
58848
- dirname: dirname3,
58697
+ dirname: dirname4,
58849
58698
  options
58850
58699
  }, alias, descriptors, envName) {
58851
58700
  var _options$env;
58852
58701
  const opts = (_options$env = options.env) == null ? void 0 : _options$env[envName];
58853
- return opts ? descriptors(dirname3, opts, `${alias}.env["${envName}"]`) : null;
58702
+ return opts ? descriptors(dirname4, opts, `${alias}.env["${envName}"]`) : null;
58854
58703
  }
58855
58704
  function buildOverrideDescriptors({
58856
- dirname: dirname3,
58705
+ dirname: dirname4,
58857
58706
  options
58858
58707
  }, alias, descriptors, index) {
58859
58708
  var _options$overrides;
58860
58709
  const opts = (_options$overrides = options.overrides) == null ? void 0 : _options$overrides[index];
58861
58710
  if (!opts)
58862
58711
  throw new Error("Assertion failure - missing override");
58863
- return descriptors(dirname3, opts, `${alias}.overrides[${index}]`);
58712
+ return descriptors(dirname4, opts, `${alias}.overrides[${index}]`);
58864
58713
  }
58865
58714
  function buildOverrideEnvDescriptors({
58866
- dirname: dirname3,
58715
+ dirname: dirname4,
58867
58716
  options
58868
58717
  }, alias, descriptors, index, envName) {
58869
58718
  var _options$overrides2, _override$env;
@@ -58871,7 +58720,7 @@ var require_config_chain = __commonJS({
58871
58720
  if (!override)
58872
58721
  throw new Error("Assertion failure - missing override");
58873
58722
  const opts = (_override$env = override.env) == null ? void 0 : _override$env[envName];
58874
- return opts ? descriptors(dirname3, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null;
58723
+ return opts ? descriptors(dirname4, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null;
58875
58724
  }
58876
58725
  function makeChainWalker({
58877
58726
  root,
@@ -58882,18 +58731,18 @@ var require_config_chain = __commonJS({
58882
58731
  }) {
58883
58732
  return function* chainWalker(input, context, files = /* @__PURE__ */ new Set(), baseLogger) {
58884
58733
  const {
58885
- dirname: dirname3
58734
+ dirname: dirname4
58886
58735
  } = input;
58887
58736
  const flattenedConfigs = [];
58888
58737
  const rootOpts = root(input);
58889
- if (configIsApplicable(rootOpts, dirname3, context, input.filepath)) {
58738
+ if (configIsApplicable(rootOpts, dirname4, context, input.filepath)) {
58890
58739
  flattenedConfigs.push({
58891
58740
  config: rootOpts,
58892
58741
  envName: void 0,
58893
58742
  index: void 0
58894
58743
  });
58895
58744
  const envOpts = env(input, context.envName);
58896
- if (envOpts && configIsApplicable(envOpts, dirname3, context, input.filepath)) {
58745
+ if (envOpts && configIsApplicable(envOpts, dirname4, context, input.filepath)) {
58897
58746
  flattenedConfigs.push({
58898
58747
  config: envOpts,
58899
58748
  envName: context.envName,
@@ -58902,14 +58751,14 @@ var require_config_chain = __commonJS({
58902
58751
  }
58903
58752
  (rootOpts.options.overrides || []).forEach((_, index) => {
58904
58753
  const overrideOps = overrides(input, index);
58905
- if (configIsApplicable(overrideOps, dirname3, context, input.filepath)) {
58754
+ if (configIsApplicable(overrideOps, dirname4, context, input.filepath)) {
58906
58755
  flattenedConfigs.push({
58907
58756
  config: overrideOps,
58908
58757
  index,
58909
58758
  envName: void 0
58910
58759
  });
58911
58760
  const overrideEnvOpts = overridesEnv(input, index, context.envName);
58912
- if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname3, context, input.filepath)) {
58761
+ if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname4, context, input.filepath)) {
58913
58762
  flattenedConfigs.push({
58914
58763
  config: overrideEnvOpts,
58915
58764
  index,
@@ -58926,7 +58775,7 @@ var require_config_chain = __commonJS({
58926
58775
  only
58927
58776
  }
58928
58777
  }
58929
- }) => shouldIgnore(context, ignore, only, dirname3))) {
58778
+ }) => shouldIgnore(context, ignore, only, dirname4))) {
58930
58779
  return null;
58931
58780
  }
58932
58781
  const chain = emptyChain();
@@ -58936,7 +58785,7 @@ var require_config_chain = __commonJS({
58936
58785
  index,
58937
58786
  envName
58938
58787
  } of flattenedConfigs) {
58939
- if (!(yield* mergeExtendsChain(chain, config.options, dirname3, context, files, baseLogger))) {
58788
+ if (!(yield* mergeExtendsChain(chain, config.options, dirname4, context, files, baseLogger))) {
58940
58789
  return null;
58941
58790
  }
58942
58791
  logger(config, index, envName);
@@ -58945,10 +58794,10 @@ var require_config_chain = __commonJS({
58945
58794
  return chain;
58946
58795
  };
58947
58796
  }
58948
- function* mergeExtendsChain(chain, opts, dirname3, context, files, baseLogger) {
58797
+ function* mergeExtendsChain(chain, opts, dirname4, context, files, baseLogger) {
58949
58798
  if (opts.extends === void 0)
58950
58799
  return true;
58951
- const file = yield* (0, _index.loadConfig)(opts.extends, dirname3, context.envName, context.caller);
58800
+ const file = yield* (0, _index.loadConfig)(opts.extends, dirname4, context.envName, context.caller);
58952
58801
  if (files.has(file)) {
58953
58802
  throw new Error(`Configuration cycle detected loading ${file.filepath}.
58954
58803
  File already loaded following the config chain:
@@ -59043,12 +58892,12 @@ File already loaded following the config chain:
59043
58892
  }
59044
58893
  function configIsApplicable({
59045
58894
  options
59046
- }, dirname3, context, configName) {
59047
- return (options.test === void 0 || configFieldIsApplicable(context, options.test, dirname3, configName)) && (options.include === void 0 || configFieldIsApplicable(context, options.include, dirname3, configName)) && (options.exclude === void 0 || !configFieldIsApplicable(context, options.exclude, dirname3, configName));
58895
+ }, dirname4, context, configName) {
58896
+ return (options.test === void 0 || configFieldIsApplicable(context, options.test, dirname4, configName)) && (options.include === void 0 || configFieldIsApplicable(context, options.include, dirname4, configName)) && (options.exclude === void 0 || !configFieldIsApplicable(context, options.exclude, dirname4, configName));
59048
58897
  }
59049
- function configFieldIsApplicable(context, test, dirname3, configName) {
58898
+ function configFieldIsApplicable(context, test, dirname4, configName) {
59050
58899
  const patterns = Array.isArray(test) ? test : [test];
59051
- return matchesPatterns(context, patterns, dirname3, configName);
58900
+ return matchesPatterns(context, patterns, dirname4, configName);
59052
58901
  }
59053
58902
  function ignoreListReplacer(_key, value2) {
59054
58903
  if (value2 instanceof RegExp) {
@@ -59056,19 +58905,19 @@ File already loaded following the config chain:
59056
58905
  }
59057
58906
  return value2;
59058
58907
  }
59059
- function shouldIgnore(context, ignore, only, dirname3) {
59060
- if (ignore && matchesPatterns(context, ignore, dirname3)) {
58908
+ function shouldIgnore(context, ignore, only, dirname4) {
58909
+ if (ignore && matchesPatterns(context, ignore, dirname4)) {
59061
58910
  var _context$filename;
59062
- 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 "${dirname3}"`;
58911
+ 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}"`;
59063
58912
  debug4(message);
59064
58913
  if (context.showConfig) {
59065
58914
  console.log(message);
59066
58915
  }
59067
58916
  return true;
59068
58917
  }
59069
- if (only && !matchesPatterns(context, only, dirname3)) {
58918
+ if (only && !matchesPatterns(context, only, dirname4)) {
59070
58919
  var _context$filename2;
59071
- 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 "${dirname3}"`;
58920
+ 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}"`;
59072
58921
  debug4(message);
59073
58922
  if (context.showConfig) {
59074
58923
  console.log(message);
@@ -59077,13 +58926,13 @@ File already loaded following the config chain:
59077
58926
  }
59078
58927
  return false;
59079
58928
  }
59080
- function matchesPatterns(context, patterns, dirname3, configName) {
59081
- return patterns.some((pattern) => matchPattern(pattern, dirname3, context.filename, context, configName));
58929
+ function matchesPatterns(context, patterns, dirname4, configName) {
58930
+ return patterns.some((pattern) => matchPattern(pattern, dirname4, context.filename, context, configName));
59082
58931
  }
59083
- function matchPattern(pattern, dirname3, pathToTest, context, configName) {
58932
+ function matchPattern(pattern, dirname4, pathToTest, context, configName) {
59084
58933
  if (typeof pattern === "function") {
59085
58934
  return !!(0, _rewriteStackTrace.endHiddenCallStack)(pattern)(pathToTest, {
59086
- dirname: dirname3,
58935
+ dirname: dirname4,
59087
58936
  envName: context.envName,
59088
58937
  caller: context.caller
59089
58938
  });
@@ -59092,7 +58941,7 @@ File already loaded following the config chain:
59092
58941
  throw new _configError.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName);
59093
58942
  }
59094
58943
  if (typeof pattern === "string") {
59095
- pattern = (0, _patternToRegex.default)(pattern, dirname3);
58944
+ pattern = (0, _patternToRegex.default)(pattern, dirname4);
59096
58945
  }
59097
58946
  return pattern.test(pathToTest);
59098
58947
  }
@@ -59530,7 +59379,7 @@ var require_full = __commonJS({
59530
59379
  var makeDescriptorLoader = (apiFactory) => (0, _caching.makeWeakCache)(function* ({
59531
59380
  value: value2,
59532
59381
  options,
59533
- dirname: dirname3,
59382
+ dirname: dirname4,
59534
59383
  alias
59535
59384
  }, cache) {
59536
59385
  if (options === false)
@@ -59542,7 +59391,7 @@ var require_full = __commonJS({
59542
59391
  const factory = (0, _async.maybeAsync)(value2, `You appear to be using an async plugin/preset, but Babel has been called synchronously`);
59543
59392
  const api = Object.assign({}, context, apiFactory(cache, externalDependencies));
59544
59393
  try {
59545
- item = yield* factory(api, options, dirname3);
59394
+ item = yield* factory(api, options, dirname4);
59546
59395
  } catch (e) {
59547
59396
  if (alias) {
59548
59397
  e.message += ` (While processing: ${JSON.stringify(alias)})`;
@@ -59571,7 +59420,7 @@ var require_full = __commonJS({
59571
59420
  return {
59572
59421
  value: item,
59573
59422
  options,
59574
- dirname: dirname3,
59423
+ dirname: dirname4,
59575
59424
  alias,
59576
59425
  externalDependencies: (0, _deepArray.finalize)(externalDependencies)
59577
59426
  };
@@ -59581,7 +59430,7 @@ var require_full = __commonJS({
59581
59430
  var instantiatePlugin = (0, _caching.makeWeakCache)(function* ({
59582
59431
  value: value2,
59583
59432
  options,
59584
- dirname: dirname3,
59433
+ dirname: dirname4,
59585
59434
  alias,
59586
59435
  externalDependencies
59587
59436
  }, cache) {
@@ -59596,7 +59445,7 @@ var require_full = __commonJS({
59596
59445
  alias: `${alias}$inherits`,
59597
59446
  value: plugin.inherits,
59598
59447
  options,
59599
- dirname: dirname3
59448
+ dirname: dirname4
59600
59449
  };
59601
59450
  const inherits = yield* (0, _async.forwardAsync)(loadPluginDescriptor, (run) => {
59602
59451
  return cache.invalidate((data) => run(inheritsDescriptor, data));
@@ -59643,14 +59492,14 @@ var require_full = __commonJS({
59643
59492
  };
59644
59493
  var instantiatePreset = (0, _caching.makeWeakCacheSync)(({
59645
59494
  value: value2,
59646
- dirname: dirname3,
59495
+ dirname: dirname4,
59647
59496
  alias,
59648
59497
  externalDependencies
59649
59498
  }) => {
59650
59499
  return {
59651
59500
  options: (0, _options.validate)("preset", value2),
59652
59501
  alias,
59653
- dirname: dirname3,
59502
+ dirname: dirname4,
59654
59503
  externalDependencies
59655
59504
  };
59656
59505
  });
@@ -61247,7 +61096,7 @@ var require_lib15 = __commonJS({
61247
61096
  });
61248
61097
  }
61249
61098
  function declare(builder) {
61250
- return (api, options, dirname3) => {
61099
+ return (api, options, dirname4) => {
61251
61100
  var _clonedApi2;
61252
61101
  let clonedApi;
61253
61102
  for (const name of Object.keys(apiPolyfills)) {
@@ -61257,7 +61106,7 @@ var require_lib15 = __commonJS({
61257
61106
  (_clonedApi = clonedApi) != null ? _clonedApi : clonedApi = copyApiObject(api);
61258
61107
  clonedApi[name] = apiPolyfills[name](clonedApi);
61259
61108
  }
61260
- return builder((_clonedApi2 = clonedApi) != null ? _clonedApi2 : api, options || {}, dirname3);
61109
+ return builder((_clonedApi2 = clonedApi) != null ? _clonedApi2 : api, options || {}, dirname4);
61261
61110
  };
61262
61111
  }
61263
61112
  var declarePreset = exports.declarePreset = declare;
@@ -66961,7 +66810,7 @@ var require_module_types = __commonJS({
66961
66810
  var _rewriteStackTrace = require_rewrite_stack_trace();
66962
66811
  var _configError = require_config_error();
66963
66812
  var _transformFile = require_transform_file();
66964
- function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
66813
+ function asyncGeneratorStep(gen, resolve3, reject, _next, _throw, key, arg) {
66965
66814
  try {
66966
66815
  var info = gen[key](arg);
66967
66816
  var value2 = info.value;
@@ -66970,7 +66819,7 @@ var require_module_types = __commonJS({
66970
66819
  return;
66971
66820
  }
66972
66821
  if (info.done) {
66973
- resolve2(value2);
66822
+ resolve3(value2);
66974
66823
  } else {
66975
66824
  Promise.resolve(value2).then(_next, _throw);
66976
66825
  }
@@ -66978,13 +66827,13 @@ var require_module_types = __commonJS({
66978
66827
  function _asyncToGenerator(fn) {
66979
66828
  return function() {
66980
66829
  var self2 = this, args = arguments;
66981
- return new Promise(function(resolve2, reject) {
66830
+ return new Promise(function(resolve3, reject) {
66982
66831
  var gen = fn.apply(self2, args);
66983
66832
  function _next(value2) {
66984
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value2);
66833
+ asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "next", value2);
66985
66834
  }
66986
66835
  function _throw(err) {
66987
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err);
66836
+ asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "throw", err);
66988
66837
  }
66989
66838
  _next(void 0);
66990
66839
  });
@@ -67286,24 +67135,24 @@ var require_configuration = __commonJS({
67286
67135
  };
67287
67136
  });
67288
67137
  function findConfigUpwards(rootDir) {
67289
- let dirname3 = rootDir;
67138
+ let dirname4 = rootDir;
67290
67139
  for (; ; ) {
67291
67140
  for (const filename of ROOT_CONFIG_FILENAMES) {
67292
- if (_fs().existsSync(_path().join(dirname3, filename))) {
67293
- return dirname3;
67141
+ if (_fs().existsSync(_path().join(dirname4, filename))) {
67142
+ return dirname4;
67294
67143
  }
67295
67144
  }
67296
- const nextDir = _path().dirname(dirname3);
67297
- if (dirname3 === nextDir)
67145
+ const nextDir = _path().dirname(dirname4);
67146
+ if (dirname4 === nextDir)
67298
67147
  break;
67299
- dirname3 = nextDir;
67148
+ dirname4 = nextDir;
67300
67149
  }
67301
67150
  return null;
67302
67151
  }
67303
67152
  function* findRelativeConfig(packageData, envName, caller) {
67304
67153
  let config = null;
67305
67154
  let ignore = null;
67306
- const dirname3 = _path().dirname(packageData.filepath);
67155
+ const dirname4 = _path().dirname(packageData.filepath);
67307
67156
  for (const loc of packageData.directories) {
67308
67157
  if (!config) {
67309
67158
  var _packageData$pkg;
@@ -67313,7 +67162,7 @@ var require_configuration = __commonJS({
67313
67162
  const ignoreLoc = _path().join(loc, BABELIGNORE_FILENAME);
67314
67163
  ignore = yield* readIgnoreConfig(ignoreLoc);
67315
67164
  if (ignore) {
67316
- debug4("Found ignore %o from %o.", ignore.filepath, dirname3);
67165
+ debug4("Found ignore %o from %o.", ignore.filepath, dirname4);
67317
67166
  }
67318
67167
  }
67319
67168
  }
@@ -67322,26 +67171,26 @@ var require_configuration = __commonJS({
67322
67171
  ignore
67323
67172
  };
67324
67173
  }
67325
- function findRootConfig(dirname3, envName, caller) {
67326
- return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname3, envName, caller);
67174
+ function findRootConfig(dirname4, envName, caller) {
67175
+ return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname4, envName, caller);
67327
67176
  }
67328
- function* loadOneConfig(names, dirname3, envName, caller, previousConfig = null) {
67329
- const configs = yield* _gensync().all(names.map((filename) => readConfig(_path().join(dirname3, filename), envName, caller)));
67177
+ function* loadOneConfig(names, dirname4, envName, caller, previousConfig = null) {
67178
+ const configs = yield* _gensync().all(names.map((filename) => readConfig(_path().join(dirname4, filename), envName, caller)));
67330
67179
  const config = configs.reduce((previousConfig2, config2) => {
67331
67180
  if (config2 && previousConfig2) {
67332
67181
  throw new _configError.default(`Multiple configuration files found. Please remove one:
67333
67182
  - ${_path().basename(previousConfig2.filepath)}
67334
67183
  - ${config2.filepath}
67335
- from ${dirname3}`);
67184
+ from ${dirname4}`);
67336
67185
  }
67337
67186
  return config2 || previousConfig2;
67338
67187
  }, previousConfig);
67339
67188
  if (config) {
67340
- debug4("Found configuration %o from %o.", config.filepath, dirname3);
67189
+ debug4("Found configuration %o from %o.", config.filepath, dirname4);
67341
67190
  }
67342
67191
  return config;
67343
67192
  }
67344
- function* loadConfig(name, dirname3, envName, caller) {
67193
+ function* loadConfig(name, dirname4, envName, caller) {
67345
67194
  const filepath = (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
67346
67195
  paths: [b]
67347
67196
  }, M = require("module")) => {
@@ -67352,13 +67201,13 @@ from ${dirname3}`);
67352
67201
  f.code = "MODULE_NOT_FOUND";
67353
67202
  throw f;
67354
67203
  })(name, {
67355
- paths: [dirname3]
67204
+ paths: [dirname4]
67356
67205
  });
67357
67206
  const conf = yield* readConfig(filepath, envName, caller);
67358
67207
  if (!conf) {
67359
67208
  throw new _configError.default(`Config file contains no configuration data`, filepath);
67360
67209
  }
67361
- debug4("Loaded config %o from %o.", name, dirname3);
67210
+ debug4("Loaded config %o from %o.", name, dirname4);
67362
67211
  return conf;
67363
67212
  }
67364
67213
  function readConfig(filepath, envName, caller) {
@@ -67376,10 +67225,10 @@ from ${dirname3}`);
67376
67225
  return readConfigJSON5(filepath);
67377
67226
  }
67378
67227
  }
67379
- function* resolveShowConfigPath(dirname3) {
67228
+ function* resolveShowConfigPath(dirname4) {
67380
67229
  const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;
67381
67230
  if (targetPath != null) {
67382
- const absolutePath = _path().resolve(dirname3, targetPath);
67231
+ const absolutePath = _path().resolve(dirname4, targetPath);
67383
67232
  const stats = yield* fs.stat(absolutePath);
67384
67233
  if (!stats.isFile()) {
67385
67234
  throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`);
@@ -67434,7 +67283,7 @@ var require_import_meta_resolve = __commonJS({
67434
67283
  value: true
67435
67284
  });
67436
67285
  exports.moduleResolve = moduleResolve;
67437
- exports.resolve = resolve2;
67286
+ exports.resolve = resolve3;
67438
67287
  function _assert() {
67439
67288
  const data = require("assert");
67440
67289
  _assert = function() {
@@ -68509,7 +68358,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
68509
68358
  })
68510
68359
  };
68511
68360
  }
68512
- function resolve2(specifier, parent) {
68361
+ function resolve3(specifier, parent) {
68513
68362
  if (!parent) {
68514
68363
  throw new Error("Please pass `parent`: `import-meta-resolve` cannot ponyfill that");
68515
68364
  }
@@ -68580,19 +68429,19 @@ var require_plugins4 = __commonJS({
68580
68429
  var OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
68581
68430
  var resolvePlugin = exports.resolvePlugin = resolveStandardizedName.bind(null, "plugin");
68582
68431
  var resolvePreset = exports.resolvePreset = resolveStandardizedName.bind(null, "preset");
68583
- function* loadPlugin(name, dirname3) {
68584
- const filepath = resolvePlugin(name, dirname3, yield* (0, _async.isAsync)());
68432
+ function* loadPlugin(name, dirname4) {
68433
+ const filepath = resolvePlugin(name, dirname4, yield* (0, _async.isAsync)());
68585
68434
  const value2 = yield* requireModule("plugin", filepath);
68586
- debug4("Loaded plugin %o from %o.", name, dirname3);
68435
+ debug4("Loaded plugin %o from %o.", name, dirname4);
68587
68436
  return {
68588
68437
  filepath,
68589
68438
  value: value2
68590
68439
  };
68591
68440
  }
68592
- function* loadPreset(name, dirname3) {
68593
- const filepath = resolvePreset(name, dirname3, yield* (0, _async.isAsync)());
68441
+ function* loadPreset(name, dirname4) {
68442
+ const filepath = resolvePreset(name, dirname4, yield* (0, _async.isAsync)());
68594
68443
  const value2 = yield* requireModule("preset", filepath);
68595
- debug4("Loaded preset %o from %o.", name, dirname3);
68444
+ debug4("Loaded preset %o from %o.", name, dirname4);
68596
68445
  return {
68597
68446
  filepath,
68598
68447
  value: value2
@@ -68645,9 +68494,9 @@ to your top-level package.json.
68645
68494
  `;
68646
68495
  throw error;
68647
68496
  }
68648
- function tryRequireResolve(id, dirname3) {
68497
+ function tryRequireResolve(id, dirname4) {
68649
68498
  try {
68650
- if (dirname3) {
68499
+ if (dirname4) {
68651
68500
  return {
68652
68501
  error: null,
68653
68502
  value: (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
@@ -68660,7 +68509,7 @@ to your top-level package.json.
68660
68509
  f.code = "MODULE_NOT_FOUND";
68661
68510
  throw f;
68662
68511
  })(id, {
68663
- paths: [dirname3]
68512
+ paths: [dirname4]
68664
68513
  })
68665
68514
  };
68666
68515
  } else {
@@ -68689,16 +68538,16 @@ to your top-level package.json.
68689
68538
  };
68690
68539
  }
68691
68540
  }
68692
- function resolveStandardizedNameForRequire(type, name, dirname3) {
68541
+ function resolveStandardizedNameForRequire(type, name, dirname4) {
68693
68542
  const it = resolveAlternativesHelper(type, name);
68694
68543
  let res = it.next();
68695
68544
  while (!res.done) {
68696
- res = it.next(tryRequireResolve(res.value, dirname3));
68545
+ res = it.next(tryRequireResolve(res.value, dirname4));
68697
68546
  }
68698
68547
  return res.value;
68699
68548
  }
68700
- function resolveStandardizedNameForImport(type, name, dirname3) {
68701
- const parentUrl = (0, _url().pathToFileURL)(_path().join(dirname3, "./babel-virtual-resolve-base.js")).href;
68549
+ function resolveStandardizedNameForImport(type, name, dirname4) {
68550
+ const parentUrl = (0, _url().pathToFileURL)(_path().join(dirname4, "./babel-virtual-resolve-base.js")).href;
68702
68551
  const it = resolveAlternativesHelper(type, name);
68703
68552
  let res = it.next();
68704
68553
  while (!res.done) {
@@ -68706,21 +68555,21 @@ to your top-level package.json.
68706
68555
  }
68707
68556
  return (0, _url().fileURLToPath)(res.value);
68708
68557
  }
68709
- function resolveStandardizedName(type, name, dirname3, resolveESM) {
68558
+ function resolveStandardizedName(type, name, dirname4, resolveESM) {
68710
68559
  if (!_moduleTypes.supportsESM || !resolveESM) {
68711
- return resolveStandardizedNameForRequire(type, name, dirname3);
68560
+ return resolveStandardizedNameForRequire(type, name, dirname4);
68712
68561
  }
68713
68562
  try {
68714
- const resolved = resolveStandardizedNameForImport(type, name, dirname3);
68563
+ const resolved = resolveStandardizedNameForImport(type, name, dirname4);
68715
68564
  if (!(0, _fs().existsSync)(resolved)) {
68716
- throw Object.assign(new Error(`Could not resolve "${name}" in file ${dirname3}.`), {
68565
+ throw Object.assign(new Error(`Could not resolve "${name}" in file ${dirname4}.`), {
68717
68566
  type: "MODULE_NOT_FOUND"
68718
68567
  });
68719
68568
  }
68720
68569
  return resolved;
68721
68570
  } catch (e) {
68722
68571
  try {
68723
- return resolveStandardizedNameForRequire(type, name, dirname3);
68572
+ return resolveStandardizedNameForRequire(type, name, dirname4);
68724
68573
  } catch (e2) {
68725
68574
  if (e.type === "MODULE_NOT_FOUND")
68726
68575
  throw e;
@@ -69701,27 +69550,177 @@ var init_babel = __esm({
69701
69550
  }
69702
69551
  });
69703
69552
 
69553
+ // ../../node_modules/.pnpm/@tootallnate+once@1.1.2/node_modules/@tootallnate/once/dist/index.js
69554
+ var require_dist = __commonJS({
69555
+ "../../node_modules/.pnpm/@tootallnate+once@1.1.2/node_modules/@tootallnate/once/dist/index.js"(exports, module2) {
69556
+ "use strict";
69557
+ function noop() {
69558
+ }
69559
+ function once3(emitter, name) {
69560
+ const o = once3.spread(emitter, name);
69561
+ const r = o.then((args) => args[0]);
69562
+ r.cancel = o.cancel;
69563
+ return r;
69564
+ }
69565
+ (function(once4) {
69566
+ function spread(emitter, name) {
69567
+ let c = null;
69568
+ const p = new Promise((resolve3, reject) => {
69569
+ function cancel() {
69570
+ emitter.removeListener(name, onEvent);
69571
+ emitter.removeListener("error", onError);
69572
+ p.cancel = noop;
69573
+ }
69574
+ function onEvent(...args) {
69575
+ cancel();
69576
+ resolve3(args);
69577
+ }
69578
+ function onError(err) {
69579
+ cancel();
69580
+ reject(err);
69581
+ }
69582
+ c = cancel;
69583
+ emitter.on(name, onEvent);
69584
+ emitter.on("error", onError);
69585
+ });
69586
+ if (!c) {
69587
+ throw new TypeError("Could not get `cancel()` function");
69588
+ }
69589
+ p.cancel = c;
69590
+ return p;
69591
+ }
69592
+ once4.spread = spread;
69593
+ })(once3 || (once3 = {}));
69594
+ module2.exports = once3;
69595
+ }
69596
+ });
69597
+
69598
+ // ../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js
69599
+ var require_tree_kill = __commonJS({
69600
+ "../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js"(exports, module2) {
69601
+ "use strict";
69602
+ var childProcess = require("child_process");
69603
+ var spawn2 = childProcess.spawn;
69604
+ var exec = childProcess.exec;
69605
+ module2.exports = function(pid, signal, callback) {
69606
+ if (typeof signal === "function" && callback === void 0) {
69607
+ callback = signal;
69608
+ signal = void 0;
69609
+ }
69610
+ pid = parseInt(pid);
69611
+ if (Number.isNaN(pid)) {
69612
+ if (callback) {
69613
+ return callback(new Error("pid must be a number"));
69614
+ } else {
69615
+ throw new Error("pid must be a number");
69616
+ }
69617
+ }
69618
+ var tree = {};
69619
+ var pidsToProcess = {};
69620
+ tree[pid] = [];
69621
+ pidsToProcess[pid] = 1;
69622
+ switch (process.platform) {
69623
+ case "win32":
69624
+ exec("taskkill /pid " + pid + " /T /F", callback);
69625
+ break;
69626
+ case "darwin":
69627
+ buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
69628
+ return spawn2("pgrep", ["-P", parentPid]);
69629
+ }, function() {
69630
+ killAll(tree, signal, callback);
69631
+ });
69632
+ break;
69633
+ default:
69634
+ buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
69635
+ return spawn2("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]);
69636
+ }, function() {
69637
+ killAll(tree, signal, callback);
69638
+ });
69639
+ break;
69640
+ }
69641
+ };
69642
+ function killAll(tree, signal, callback) {
69643
+ var killed = {};
69644
+ try {
69645
+ Object.keys(tree).forEach(function(pid) {
69646
+ tree[pid].forEach(function(pidpid) {
69647
+ if (!killed[pidpid]) {
69648
+ killPid(pidpid, signal);
69649
+ killed[pidpid] = 1;
69650
+ }
69651
+ });
69652
+ if (!killed[pid]) {
69653
+ killPid(pid, signal);
69654
+ killed[pid] = 1;
69655
+ }
69656
+ });
69657
+ } catch (err) {
69658
+ if (callback) {
69659
+ return callback(err);
69660
+ } else {
69661
+ throw err;
69662
+ }
69663
+ }
69664
+ if (callback) {
69665
+ return callback();
69666
+ }
69667
+ }
69668
+ function killPid(pid, signal) {
69669
+ try {
69670
+ process.kill(parseInt(pid, 10), signal);
69671
+ } catch (err) {
69672
+ if (err.code !== "ESRCH")
69673
+ throw err;
69674
+ }
69675
+ }
69676
+ function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesList, cb) {
69677
+ var ps = spawnChildProcessesList(parentPid);
69678
+ var allData = "";
69679
+ ps.stdout.on("data", function(data) {
69680
+ var data = data.toString("ascii");
69681
+ allData += data;
69682
+ });
69683
+ var onClose = function(code) {
69684
+ delete pidsToProcess[parentPid];
69685
+ if (code != 0) {
69686
+ if (Object.keys(pidsToProcess).length == 0) {
69687
+ cb();
69688
+ }
69689
+ return;
69690
+ }
69691
+ allData.match(/\d+/g).forEach(function(pid) {
69692
+ pid = parseInt(pid, 10);
69693
+ tree[parentPid].push(pid);
69694
+ tree[pid] = [];
69695
+ pidsToProcess[pid] = 1;
69696
+ buildProcessTree(pid, tree, pidsToProcess, spawnChildProcessesList, cb);
69697
+ });
69698
+ };
69699
+ ps.on("close", onClose);
69700
+ }
69701
+ }
69702
+ });
69703
+
69704
69704
  // src/index.ts
69705
69705
  var src_exports = {};
69706
69706
  __export(src_exports, {
69707
69707
  build: () => build,
69708
69708
  prepareCache: () => prepareCache,
69709
- shouldServe: () => import_build_utils4.shouldServe,
69709
+ shouldServe: () => import_build_utils7.shouldServe,
69710
69710
  startDevServer: () => startDevServer,
69711
69711
  version: () => version
69712
69712
  });
69713
69713
  module.exports = __toCommonJS(src_exports);
69714
+
69715
+ // src/build.ts
69714
69716
  var import_error_utils = require("@vercel/error-utils");
69715
- var import_url2 = __toESM(require("url"));
69716
- var import_child_process2 = require("child_process");
69717
69717
  var import_module2 = require("module");
69718
69718
  var import_fs = require("fs");
69719
- var import_path4 = require("path");
69719
+ var import_path3 = require("path");
69720
69720
  var import_ts_morph = require("ts-morph");
69721
- var import_once2 = __toESM(require_dist());
69722
69721
  var import_nft = require("@vercel/nft");
69723
69722
  var import_resolve_dependency = __toESM(require("@vercel/nft/out/resolve-dependency"));
69724
- var import_build_utils4 = require("@vercel/build-utils");
69723
+ var import_build_utils3 = require("@vercel/build-utils");
69725
69724
  var import_static_config = require("@vercel/static-config");
69726
69725
 
69727
69726
  // src/typescript.ts
@@ -70038,7 +70037,38 @@ function filterDiagnostics(diagnostics, ignore) {
70038
70037
  // src/utils.ts
70039
70038
  var import_build_utils2 = require("@vercel/build-utils");
70040
70039
  var import_path_to_regexp = require("path-to-regexp");
70040
+ var import_path_to_regexp_updated = require("path-to-regexp-updated");
70041
70041
  var import_path2 = require("path");
70042
+ function pathToRegexp(callerId, path, keys, options) {
70043
+ const currentRegExp = (0, import_path_to_regexp.pathToRegexp)(path, keys, options);
70044
+ try {
70045
+ const currentKeys = keys;
70046
+ const newKeys = [];
70047
+ const newRegExp = (0, import_path_to_regexp_updated.pathToRegexp)(path, newKeys, options);
70048
+ const isDiffRegExp = currentRegExp.toString() !== newRegExp.toString();
70049
+ if (process.env.FORCE_PATH_TO_REGEXP_LOG || isDiffRegExp) {
70050
+ const message = JSON.stringify({
70051
+ path,
70052
+ currentRegExp: currentRegExp.toString(),
70053
+ newRegExp: newRegExp.toString()
70054
+ });
70055
+ console.error(`[vc] PATH TO REGEXP PATH DIFF @ #${callerId}: ${message}`);
70056
+ }
70057
+ const isDiffKeys = keys?.toString() !== newKeys?.toString();
70058
+ if (process.env.FORCE_PATH_TO_REGEXP_LOG || isDiffKeys) {
70059
+ const message = JSON.stringify({
70060
+ isDiffKeys,
70061
+ currentKeys,
70062
+ newKeys
70063
+ });
70064
+ console.error(`[vc] PATH TO REGEXP KEYS DIFF @ #${callerId}: ${message}`);
70065
+ }
70066
+ } catch (err) {
70067
+ const error = err;
70068
+ console.error(`[vc] PATH TO REGEXP ERROR @ #${callerId}: ${error.message}`);
70069
+ }
70070
+ return currentRegExp;
70071
+ }
70042
70072
  var WAIT_UNTIL_TIMEOUT_MS = 10 * 1e3;
70043
70073
  function getRegExpFromMatchers(matcherOrMatchers) {
70044
70074
  if (!matcherOrMatchers) {
@@ -70059,9 +70089,9 @@ function getRegExpFromMatcher(matcher, index, allMatchers) {
70059
70089
  `Middleware's \`config.matcher\` values must start with "/". Received: ${matcher}`
70060
70090
  );
70061
70091
  }
70062
- const regExps = [(0, import_path_to_regexp.pathToRegexp)(matcher).source];
70092
+ const regExps = [pathToRegexp("316", matcher).source];
70063
70093
  if (matcher === "/" && !allMatchers.includes("/index")) {
70064
- regExps.push((0, import_path_to_regexp.pathToRegexp)("/index").source);
70094
+ regExps.push(pathToRegexp("491", "/index").source);
70065
70095
  }
70066
70096
  return regExps;
70067
70097
  }
@@ -70100,84 +70130,9 @@ function validateConfiguredRuntime(runtime, entrypoint) {
70100
70130
  }
70101
70131
  }
70102
70132
 
70103
- // src/fork-dev-server.ts
70104
- var import_once = __toESM(require_dist());
70105
- var import_build_utils3 = require("@vercel/build-utils");
70106
- var import_child_process = require("child_process");
70107
- var import_url = require("url");
70108
- var import_path3 = require("path");
70109
- function forkDevServer(options) {
70110
- let nodeOptions = process.env.NODE_OPTIONS || "";
70111
- if (!nodeOptions.includes("--no-warnings")) {
70112
- nodeOptions += " --no-warnings";
70113
- }
70114
- const tsNodePath = options.require_.resolve("ts-node");
70115
- const esmLoader = (0, import_url.pathToFileURL)((0, import_path3.join)(tsNodePath, "..", "..", "esm.mjs"));
70116
- const cjsLoader = (0, import_path3.join)(tsNodePath, "..", "..", "register", "index.js");
70117
- const devServerPath = options.devServerPath || (0, import_path3.join)(__dirname, "dev-server.mjs");
70118
- if (options.maybeTranspile) {
70119
- if (options.isTypeScript) {
70120
- nodeOptions = `--require ${cjsLoader} --loader ${esmLoader} ${nodeOptions || ""}`;
70121
- } else {
70122
- if (options.isEsm) {
70123
- } else {
70124
- nodeOptions = `--require ${cjsLoader} ${nodeOptions || ""}`;
70125
- }
70126
- }
70127
- }
70128
- const forkOptions = {
70129
- cwd: options.workPath,
70130
- execArgv: [],
70131
- env: (0, import_build_utils3.cloneEnv)(process.env, options.meta.env, {
70132
- VERCEL_DEV_ENTRYPOINT: options.entrypoint,
70133
- VERCEL_DEV_CONFIG: JSON.stringify(options.config),
70134
- VERCEL_DEV_BUILD_ENV: JSON.stringify(options.meta.buildEnv || {}),
70135
- TS_NODE_TRANSPILE_ONLY: "1",
70136
- TS_NODE_COMPILER_OPTIONS: options.tsConfig?.compilerOptions ? JSON.stringify(options.tsConfig.compilerOptions) : void 0,
70137
- NODE_OPTIONS: nodeOptions
70138
- }),
70139
- stdio: options.printLogs ? "pipe" : void 0
70140
- };
70141
- const child = (0, import_child_process.fork)(devServerPath, [], forkOptions);
70142
- if (options.printLogs) {
70143
- child.stdout?.on("data", (data) => {
70144
- console.log(`stdout: ${data}`);
70145
- });
70146
- child.stderr?.on("data", (data) => {
70147
- console.error(`stderr: ${data}`);
70148
- });
70149
- }
70150
- checkForPid(devServerPath, child);
70151
- return child;
70152
- }
70153
- function checkForPid(path, process2) {
70154
- if (!process2.pid) {
70155
- throw new Error(`Child Process has no "pid" when forking: "${path}"`);
70156
- }
70157
- }
70158
- async function readMessage(child) {
70159
- const onMessage = (0, import_once.default)(child, "message");
70160
- const onExit = import_once.default.spread(child, "close");
70161
- const result = await Promise.race([
70162
- onMessage.then((x) => {
70163
- return { state: "message", value: x };
70164
- }),
70165
- onExit.then((v) => {
70166
- return { state: "exit", value: v };
70167
- })
70168
- ]);
70169
- onExit.cancel();
70170
- onMessage.cancel();
70171
- return result;
70172
- }
70173
-
70174
- // src/index.ts
70175
- var import_tree_kill = __toESM(require_tree_kill());
70176
- var import_util = require("util");
70133
+ // src/build.ts
70177
70134
  var require_2 = (0, import_module2.createRequire)(__filename);
70178
- var tscPath = (0, import_path4.resolve)((0, import_path4.dirname)(require_2.resolve("typescript")), "../bin/tsc");
70179
70135
  var libPathRegEx = /^node_modules|[\/\\]node_modules[\/\\]/;
70180
- var treeKill = (0, import_util.promisify)(import_tree_kill.default);
70181
70136
  async function downloadInstallAndBundle({
70182
70137
  files,
70183
70138
  entrypoint,
@@ -70185,16 +70140,16 @@ async function downloadInstallAndBundle({
70185
70140
  config,
70186
70141
  meta
70187
70142
  }) {
70188
- const downloadedFiles = await (0, import_build_utils4.download)(files, workPath, meta);
70189
- const entrypointFsDirname = (0, import_path4.join)(workPath, (0, import_path4.dirname)(entrypoint));
70190
- const nodeVersion = await (0, import_build_utils4.getNodeVersion)(
70143
+ const downloadedFiles = await (0, import_build_utils3.download)(files, workPath, meta);
70144
+ const entrypointFsDirname = (0, import_path3.join)(workPath, (0, import_path3.dirname)(entrypoint));
70145
+ const nodeVersion = await (0, import_build_utils3.getNodeVersion)(
70191
70146
  entrypointFsDirname,
70192
70147
  void 0,
70193
70148
  config,
70194
70149
  meta
70195
70150
  );
70196
- const spawnOpts = (0, import_build_utils4.getSpawnOptions)(meta, nodeVersion);
70197
- await (0, import_build_utils4.runNpmInstall)(entrypointFsDirname, [], spawnOpts, meta, nodeVersion);
70151
+ const spawnOpts = (0, import_build_utils3.getSpawnOptions)(meta, nodeVersion);
70152
+ await (0, import_build_utils3.runNpmInstall)(entrypointFsDirname, [], spawnOpts, meta, nodeVersion);
70198
70153
  const entrypointPath = downloadedFiles[entrypoint].fsPath;
70199
70154
  return { entrypointPath, entrypointFsDirname, nodeVersion, spawnOpts };
70200
70155
  }
@@ -70218,11 +70173,11 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
70218
70173
  if (config.includeFiles) {
70219
70174
  const includeFiles = typeof config.includeFiles === "string" ? [config.includeFiles] : config.includeFiles;
70220
70175
  for (const pattern of includeFiles) {
70221
- const files = await (0, import_build_utils4.glob)(pattern, workPath);
70176
+ const files = await (0, import_build_utils3.glob)(pattern, workPath);
70222
70177
  await Promise.all(
70223
70178
  Object.values(files).map(async (entry) => {
70224
70179
  const { fsPath } = entry;
70225
- const relPath = (0, import_path4.relative)(baseDir, fsPath);
70180
+ const relPath = (0, import_path3.relative)(baseDir, fsPath);
70226
70181
  fsCache.set(relPath, entry);
70227
70182
  preparedFiles[relPath] = entry;
70228
70183
  })
@@ -70231,7 +70186,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
70231
70186
  }
70232
70187
  let tsCompile;
70233
70188
  function compileTypeScript(path, source) {
70234
- const relPath = (0, import_path4.relative)(baseDir, path);
70189
+ const relPath = (0, import_path3.relative)(baseDir, path);
70235
70190
  if (!tsCompile) {
70236
70191
  tsCompile = register({
70237
70192
  basePath: workPath,
@@ -70245,7 +70200,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
70245
70200
  }
70246
70201
  const { code, map } = tsCompile(source, path);
70247
70202
  tsCompiled.add(relPath);
70248
- preparedFiles[renameTStoJS(relPath) + ".map"] = new import_build_utils4.FileBlob({
70203
+ preparedFiles[renameTStoJS(relPath) + ".map"] = new import_build_utils3.FileBlob({
70249
70204
  data: JSON.stringify(map)
70250
70205
  });
70251
70206
  source = code;
@@ -70272,7 +70227,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
70272
70227
  },
70273
70228
  ignore: config.excludeFiles,
70274
70229
  async readFile(fsPath) {
70275
- const relPath = (0, import_path4.relative)(baseDir, fsPath);
70230
+ const relPath = (0, import_path3.relative)(baseDir, fsPath);
70276
70231
  const cached = sourceCache.get(relPath);
70277
70232
  if (typeof cached !== "undefined")
70278
70233
  return cached;
@@ -70280,18 +70235,18 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
70280
70235
  let entry;
70281
70236
  let source = (0, import_fs.readFileSync)(fsPath);
70282
70237
  const { mode } = (0, import_fs.lstatSync)(fsPath);
70283
- if ((0, import_build_utils4.isSymbolicLink)(mode)) {
70284
- entry = new import_build_utils4.FileFsRef({ fsPath, mode });
70238
+ if ((0, import_build_utils3.isSymbolicLink)(mode)) {
70239
+ entry = new import_build_utils3.FileFsRef({ fsPath, mode });
70285
70240
  }
70286
- if (isEdgeFunction && (0, import_path4.basename)(fsPath) === "package.json") {
70241
+ if (isEdgeFunction && (0, import_path3.basename)(fsPath) === "package.json") {
70287
70242
  const pkgJson = JSON.parse(source.toString());
70288
70243
  for (const prop of ["browser", "module"]) {
70289
70244
  const val = pkgJson[prop];
70290
70245
  if (typeof val === "string") {
70291
- (0, import_build_utils4.debug)(`Using "${prop}" field in ${fsPath}`);
70246
+ (0, import_build_utils3.debug)(`Using "${prop}" field in ${fsPath}`);
70292
70247
  pkgJson.main = val;
70293
70248
  if (!entry) {
70294
- entry = new import_build_utils4.FileBlob({ data: source, mode });
70249
+ entry = new import_build_utils3.FileBlob({ data: source, mode });
70295
70250
  }
70296
70251
  source = JSON.stringify(pkgJson);
70297
70252
  break;
@@ -70302,7 +70257,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
70302
70257
  source = compileTypeScript(fsPath, source.toString());
70303
70258
  }
70304
70259
  if (!entry) {
70305
- entry = new import_build_utils4.FileBlob({ data: source, mode });
70260
+ entry = new import_build_utils3.FileBlob({ data: source, mode });
70306
70261
  }
70307
70262
  fsCache.set(relPath, entry);
70308
70263
  sourceCache.set(relPath, source);
@@ -70318,27 +70273,27 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
70318
70273
  }
70319
70274
  );
70320
70275
  for (const warning of warnings) {
70321
- (0, import_build_utils4.debug)(`Warning from trace: ${warning.message}`);
70276
+ (0, import_build_utils3.debug)(`Warning from trace: ${warning.message}`);
70322
70277
  }
70323
70278
  for (const path of fileList) {
70324
70279
  let entry = fsCache.get(path);
70325
70280
  if (!entry) {
70326
- const fsPath = (0, import_path4.resolve)(baseDir, path);
70281
+ const fsPath = (0, import_path3.resolve)(baseDir, path);
70327
70282
  const { mode } = (0, import_fs.lstatSync)(fsPath);
70328
- if ((0, import_build_utils4.isSymbolicLink)(mode)) {
70329
- entry = new import_build_utils4.FileFsRef({ fsPath, mode });
70283
+ if ((0, import_build_utils3.isSymbolicLink)(mode)) {
70284
+ entry = new import_build_utils3.FileFsRef({ fsPath, mode });
70330
70285
  } else {
70331
70286
  const source = (0, import_fs.readFileSync)(fsPath);
70332
- entry = new import_build_utils4.FileBlob({ data: source, mode });
70287
+ entry = new import_build_utils3.FileBlob({ data: source, mode });
70333
70288
  }
70334
70289
  }
70335
- if ((0, import_build_utils4.isSymbolicLink)(entry.mode) && entry.type === "FileFsRef") {
70336
- const symlinkTarget = (0, import_path4.relative)(
70290
+ if ((0, import_build_utils3.isSymbolicLink)(entry.mode) && entry.type === "FileFsRef") {
70291
+ const symlinkTarget = (0, import_path3.relative)(
70337
70292
  baseDir,
70338
- (0, import_path4.resolve)((0, import_path4.dirname)(entry.fsPath), (0, import_fs.readlinkSync)(entry.fsPath))
70293
+ (0, import_path3.resolve)((0, import_path3.dirname)(entry.fsPath), (0, import_fs.readlinkSync)(entry.fsPath))
70339
70294
  );
70340
- if (!symlinkTarget.startsWith(".." + import_path4.sep) && !fileList.has(symlinkTarget)) {
70341
- const stats = (0, import_fs.statSync)((0, import_path4.resolve)(baseDir, symlinkTarget));
70295
+ if (!symlinkTarget.startsWith(".." + import_path3.sep) && !fileList.has(symlinkTarget)) {
70296
+ const stats = (0, import_fs.statSync)((0, import_path3.resolve)(baseDir, symlinkTarget));
70342
70297
  if (stats.isFile()) {
70343
70298
  fileList.add(symlinkTarget);
70344
70299
  }
@@ -70357,9 +70312,9 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
70357
70312
  if (babelCompileEnabled && esmPaths.length) {
70358
70313
  const babelCompile = (await Promise.resolve().then(() => (init_babel(), babel_exports))).compile;
70359
70314
  for (const path of esmPaths) {
70360
- const pathDir = (0, import_path4.join)(workPath, (0, import_path4.dirname)(path));
70315
+ const pathDir = (0, import_path3.join)(workPath, (0, import_path3.dirname)(path));
70361
70316
  if (!pkgCache.has(pathDir)) {
70362
- const pathToPkg = await (0, import_build_utils4.walkParentDirs)({
70317
+ const pathToPkg = await (0, import_build_utils3.walkParentDirs)({
70363
70318
  base: workPath,
70364
70319
  start: pathDir,
70365
70320
  filename: "package.json"
@@ -70371,8 +70326,8 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
70371
70326
  if (pkg.type === "module" && path.endsWith(".js")) {
70372
70327
  continue;
70373
70328
  }
70374
- const filename = (0, import_path4.basename)(path);
70375
- const { data: source } = await import_build_utils4.FileBlob.fromStream({
70329
+ const filename = (0, import_path3.basename)(path);
70330
+ const { data: source } = await import_build_utils3.FileBlob.fromStream({
70376
70331
  stream: preparedFiles[path].toStream()
70377
70332
  });
70378
70333
  if (!meta.compiledToCommonJS) {
@@ -70384,12 +70339,12 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
70384
70339
  console.log(`Compiling "${filename}" from ESM to CommonJS...`);
70385
70340
  const { code, map } = babelCompile(filename, String(source));
70386
70341
  shouldAddSourcemapSupport = true;
70387
- preparedFiles[path] = new import_build_utils4.FileBlob({
70342
+ preparedFiles[path] = new import_build_utils3.FileBlob({
70388
70343
  data: `${code}
70389
70344
  //# sourceMappingURL=${filename}.map`
70390
70345
  });
70391
70346
  delete map.sourcesContent;
70392
- preparedFiles[path + ".map"] = new import_build_utils4.FileBlob({
70347
+ preparedFiles[path + ".map"] = new import_build_utils3.FileBlob({
70393
70348
  data: JSON.stringify(map)
70394
70349
  });
70395
70350
  }
@@ -70404,12 +70359,11 @@ function getAWSLambdaHandler(entrypoint, config) {
70404
70359
  return config.awsLambdaHandler;
70405
70360
  }
70406
70361
  if (process.env.NODEJS_AWS_HANDLER_NAME) {
70407
- const { dir, name } = (0, import_path4.parse)(entrypoint);
70408
- return `${dir}${dir ? import_path4.sep : ""}${name}.${process.env.NODEJS_AWS_HANDLER_NAME}`;
70362
+ const { dir, name } = (0, import_path3.parse)(entrypoint);
70363
+ return `${dir}${dir ? import_path3.sep : ""}${name}.${process.env.NODEJS_AWS_HANDLER_NAME}`;
70409
70364
  }
70410
70365
  return "";
70411
70366
  }
70412
- var version = 3;
70413
70367
  var build = async ({
70414
70368
  files,
70415
70369
  entrypoint,
@@ -70427,7 +70381,7 @@ var build = async ({
70427
70381
  config,
70428
70382
  meta
70429
70383
  });
70430
- await (0, import_build_utils4.runPackageJsonScript)(
70384
+ await (0, import_build_utils3.runPackageJsonScript)(
70431
70385
  entrypointFsDirname,
70432
70386
  // Don't consider "build" script since its intended for frontend code
70433
70387
  ["vercel-build", "now-build"],
@@ -70442,7 +70396,7 @@ var build = async ({
70442
70396
  if (runtime) {
70443
70397
  isEdgeFunction = isEdgeRuntime(runtime);
70444
70398
  }
70445
- (0, import_build_utils4.debug)("Tracing input files...");
70399
+ (0, import_build_utils3.debug)("Tracing input files...");
70446
70400
  const traceTime = Date.now();
70447
70401
  const { preparedFiles, shouldAddSourcemapSupport } = await compile2(
70448
70402
  workPath,
@@ -70453,10 +70407,10 @@ var build = async ({
70453
70407
  nodeVersion,
70454
70408
  isEdgeFunction
70455
70409
  );
70456
- (0, import_build_utils4.debug)(`Trace complete [${Date.now() - traceTime}ms]`);
70410
+ (0, import_build_utils3.debug)(`Trace complete [${Date.now() - traceTime}ms]`);
70457
70411
  let routes;
70458
70412
  let output;
70459
- const handler = renameTStoJS((0, import_path4.relative)(baseDir, entrypointPath));
70413
+ const handler = renameTStoJS((0, import_path3.relative)(baseDir, entrypointPath));
70460
70414
  const outputPath = entrypointToOutputPath(entrypoint, config.zeroConfig);
70461
70415
  if (isMiddleware) {
70462
70416
  if (!isEdgeFunction) {
@@ -70484,7 +70438,7 @@ var build = async ({
70484
70438
  ];
70485
70439
  }
70486
70440
  if (isEdgeFunction) {
70487
- output = new import_build_utils4.EdgeFunction({
70441
+ output = new import_build_utils3.EdgeFunction({
70488
70442
  entrypoint: handler,
70489
70443
  files: preparedFiles,
70490
70444
  regions: staticConfig?.regions,
@@ -70493,7 +70447,7 @@ var build = async ({
70493
70447
  } else {
70494
70448
  const shouldAddHelpers = !(config.helpers === false || process.env.NODEJS_HELPERS === "0");
70495
70449
  const supportsResponseStreaming = (staticConfig?.supportsResponseStreaming ?? staticConfig?.experimentalResponseStreaming) === true ? true : void 0;
70496
- output = new import_build_utils4.NodejsLambda({
70450
+ output = new import_build_utils3.NodejsLambda({
70497
70451
  files: preparedFiles,
70498
70452
  handler,
70499
70453
  runtime: nodeVersion.runtime,
@@ -70506,34 +70460,127 @@ var build = async ({
70506
70460
  }
70507
70461
  return { routes, output };
70508
70462
  };
70463
+
70464
+ // src/prepare-cache.ts
70465
+ var import_build_utils4 = require("@vercel/build-utils");
70509
70466
  var prepareCache = ({ repoRootPath, workPath }) => {
70510
70467
  return (0, import_build_utils4.glob)("**/node_modules/**", repoRootPath || workPath);
70511
70468
  };
70469
+
70470
+ // src/start-dev-server.ts
70471
+ var import_once2 = __toESM(require_dist());
70472
+ var import_url2 = __toESM(require("url"));
70473
+ var import_module3 = require("module");
70474
+ var import_fs2 = require("fs");
70475
+ var import_path5 = require("path");
70476
+ var import_child_process2 = require("child_process");
70477
+ var import_tree_kill = __toESM(require_tree_kill());
70478
+ var import_util = require("util");
70479
+ var import_build_utils6 = require("@vercel/build-utils");
70480
+ var import_error_utils2 = require("@vercel/error-utils");
70481
+ var import_static_config2 = require("@vercel/static-config");
70482
+ var import_ts_morph2 = require("ts-morph");
70483
+
70484
+ // src/fork-dev-server.ts
70485
+ var import_once = __toESM(require_dist());
70486
+ var import_build_utils5 = require("@vercel/build-utils");
70487
+ var import_child_process = require("child_process");
70488
+ var import_url = require("url");
70489
+ var import_path4 = require("path");
70490
+ function forkDevServer(options) {
70491
+ let nodeOptions = process.env.NODE_OPTIONS || "";
70492
+ if (!nodeOptions.includes("--no-warnings")) {
70493
+ nodeOptions += " --no-warnings";
70494
+ }
70495
+ const tsNodePath = options.require_.resolve("ts-node");
70496
+ const esmLoader = (0, import_url.pathToFileURL)((0, import_path4.join)(tsNodePath, "..", "..", "esm.mjs"));
70497
+ const cjsLoader = (0, import_path4.join)(tsNodePath, "..", "..", "register", "index.js");
70498
+ const devServerPath = options.devServerPath || (0, import_path4.join)(__dirname, "dev-server.mjs");
70499
+ if (options.maybeTranspile) {
70500
+ if (options.isTypeScript) {
70501
+ nodeOptions = `--require ${cjsLoader} --loader ${esmLoader} ${nodeOptions || ""}`;
70502
+ } else {
70503
+ if (options.isEsm) {
70504
+ } else {
70505
+ nodeOptions = `--require ${cjsLoader} ${nodeOptions || ""}`;
70506
+ }
70507
+ }
70508
+ }
70509
+ const forkOptions = {
70510
+ cwd: options.workPath,
70511
+ execArgv: [],
70512
+ env: (0, import_build_utils5.cloneEnv)(process.env, options.meta.env, {
70513
+ VERCEL_DEV_ENTRYPOINT: options.entrypoint,
70514
+ VERCEL_DEV_CONFIG: JSON.stringify(options.config),
70515
+ VERCEL_DEV_BUILD_ENV: JSON.stringify(options.meta.buildEnv || {}),
70516
+ TS_NODE_TRANSPILE_ONLY: "1",
70517
+ TS_NODE_COMPILER_OPTIONS: options.tsConfig?.compilerOptions ? JSON.stringify(options.tsConfig.compilerOptions) : void 0,
70518
+ NODE_OPTIONS: nodeOptions
70519
+ }),
70520
+ stdio: options.printLogs ? "pipe" : void 0
70521
+ };
70522
+ const child = (0, import_child_process.fork)(devServerPath, [], forkOptions);
70523
+ if (options.printLogs) {
70524
+ child.stdout?.on("data", (data) => {
70525
+ console.log(`stdout: ${data}`);
70526
+ });
70527
+ child.stderr?.on("data", (data) => {
70528
+ console.error(`stderr: ${data}`);
70529
+ });
70530
+ }
70531
+ checkForPid(devServerPath, child);
70532
+ return child;
70533
+ }
70534
+ function checkForPid(path, process2) {
70535
+ if (!process2.pid) {
70536
+ throw new Error(`Child Process has no "pid" when forking: "${path}"`);
70537
+ }
70538
+ }
70539
+ async function readMessage(child) {
70540
+ const onMessage = (0, import_once.default)(child, "message");
70541
+ const onExit = import_once.default.spread(child, "close");
70542
+ const result = await Promise.race([
70543
+ onMessage.then((x) => {
70544
+ return { state: "message", value: x };
70545
+ }),
70546
+ onExit.then((v) => {
70547
+ return { state: "exit", value: v };
70548
+ })
70549
+ ]);
70550
+ onExit.cancel();
70551
+ onMessage.cancel();
70552
+ return result;
70553
+ }
70554
+
70555
+ // src/start-dev-server.ts
70556
+ var require_3 = (0, import_module3.createRequire)(__filename);
70557
+ var treeKill = (0, import_util.promisify)(import_tree_kill.default);
70558
+ var tscPath = (0, import_path5.resolve)((0, import_path5.dirname)(require_3.resolve("typescript")), "../bin/tsc");
70512
70559
  var startDevServer = async (opts) => {
70513
70560
  const { entrypoint, workPath, config, meta = {} } = opts;
70514
- const entrypointPath = (0, import_path4.join)(workPath, entrypoint);
70561
+ const entrypointPath = (0, import_path5.join)(workPath, entrypoint);
70515
70562
  if (config.middleware === true && typeof meta.requestUrl === "string") {
70516
- const project = new import_ts_morph.Project();
70517
- const staticConfig = (0, import_static_config.getConfig)(project, entrypointPath);
70563
+ const project = new import_ts_morph2.Project();
70564
+ const staticConfig = (0, import_static_config2.getConfig)(project, entrypointPath);
70518
70565
  const matchers = new RegExp(getRegExpFromMatchers(staticConfig?.matcher));
70519
70566
  const parsed = import_url2.default.parse(meta.requestUrl, true);
70520
70567
  if (typeof parsed.pathname !== "string" || !matchers.test(parsed.pathname)) {
70521
70568
  return null;
70522
70569
  }
70523
70570
  }
70524
- const entryDir = (0, import_path4.dirname)(entrypointPath);
70525
- const ext = (0, import_path4.extname)(entrypoint);
70526
- const pathToTsConfig = await (0, import_build_utils4.walkParentDirs)({
70571
+ const entryDir = (0, import_path5.dirname)(entrypointPath);
70572
+ const ext = (0, import_path5.extname)(entrypoint);
70573
+ const pathToTsConfig = await (0, import_build_utils6.walkParentDirs)({
70527
70574
  base: workPath,
70528
70575
  start: entryDir,
70529
70576
  filename: "tsconfig.json"
70530
70577
  });
70531
- const pathToPkg = await (0, import_build_utils4.walkParentDirs)({
70578
+ const pathToPkg = await (0, import_build_utils6.walkParentDirs)({
70532
70579
  base: workPath,
70533
70580
  start: entryDir,
70534
70581
  filename: "package.json"
70535
70582
  });
70536
- const pkg = pathToPkg ? require_2(pathToPkg) : {};
70583
+ const pkg = pathToPkg ? require_3(pathToPkg) : {};
70537
70584
  const isTypeScript = [".ts", ".tsx", ".mts", ".cts"].includes(ext);
70538
70585
  const maybeTranspile = isTypeScript || ![".cjs", ".mjs"].includes(ext);
70539
70586
  const isEsm = ext === ".mjs" || ext === ".mts" || pkg.type === "module" && [".js", ".ts", ".tsx"].includes(ext);
@@ -70541,28 +70588,28 @@ var startDevServer = async (opts) => {
70541
70588
  if (maybeTranspile) {
70542
70589
  const resolveTypescript = (p) => {
70543
70590
  try {
70544
- return require_2.resolve("typescript", {
70591
+ return require_3.resolve("typescript", {
70545
70592
  paths: [p]
70546
70593
  });
70547
70594
  } catch (_) {
70548
70595
  return "";
70549
70596
  }
70550
70597
  };
70551
- const requireTypescript = (p) => require_2(p);
70598
+ const requireTypescript = (p) => require_3(p);
70552
70599
  let ts = null;
70553
70600
  let compiler = resolveTypescript(process.cwd());
70554
70601
  if (compiler) {
70555
70602
  ts = requireTypescript(compiler);
70556
70603
  }
70557
70604
  if (!ts) {
70558
- compiler = resolveTypescript((0, import_path4.join)(__dirname, ".."));
70605
+ compiler = resolveTypescript((0, import_path5.join)(__dirname, ".."));
70559
70606
  ts = requireTypescript(compiler);
70560
70607
  }
70561
70608
  if (pathToTsConfig) {
70562
70609
  try {
70563
70610
  tsConfig = ts.readConfigFile(pathToTsConfig, ts.sys.readFile).config;
70564
70611
  } catch (error) {
70565
- if ((0, import_error_utils.isErrnoException)(error) && error.code !== "ENOENT") {
70612
+ if ((0, import_error_utils2.isErrnoException)(error) && error.code !== "ENOENT") {
70566
70613
  console.error(`Error while parsing "${pathToTsConfig}"`);
70567
70614
  throw error;
70568
70615
  }
@@ -70588,7 +70635,7 @@ var startDevServer = async (opts) => {
70588
70635
  workPath,
70589
70636
  config,
70590
70637
  entrypoint,
70591
- require_: require_2,
70638
+ require_: require_3,
70592
70639
  isEsm,
70593
70640
  isTypeScript,
70594
70641
  maybeTranspile,
@@ -70618,23 +70665,23 @@ var startDevServer = async (opts) => {
70618
70665
  }
70619
70666
  };
70620
70667
  async function doTypeCheck({ entrypoint, workPath, meta = {} }, projectTsConfig) {
70621
- const { devCacheDir = (0, import_path4.join)(workPath, ".vercel", "cache") } = meta;
70622
- const entrypointCacheDir = (0, import_path4.join)(devCacheDir, "node", entrypoint);
70623
- const tsconfigName = projectTsConfig ? `tsconfig-with-${(0, import_path4.relative)(workPath, projectTsConfig).replace(
70668
+ const { devCacheDir = (0, import_path5.join)(workPath, ".vercel", "cache") } = meta;
70669
+ const entrypointCacheDir = (0, import_path5.join)(devCacheDir, "node", entrypoint);
70670
+ const tsconfigName = projectTsConfig ? `tsconfig-with-${(0, import_path5.relative)(workPath, projectTsConfig).replace(
70624
70671
  /[\\/.]/g,
70625
70672
  "-"
70626
70673
  )}.json` : "tsconfig.json";
70627
- const tsconfigPath = (0, import_path4.join)(entrypointCacheDir, tsconfigName);
70674
+ const tsconfigPath = (0, import_path5.join)(entrypointCacheDir, tsconfigName);
70628
70675
  const tsconfig = {
70629
- extends: projectTsConfig ? (0, import_path4.relative)(entrypointCacheDir, projectTsConfig) : void 0,
70630
- include: [(0, import_path4.relative)(entrypointCacheDir, (0, import_path4.join)(workPath, entrypoint))]
70676
+ extends: projectTsConfig ? (0, import_path5.relative)(entrypointCacheDir, projectTsConfig) : void 0,
70677
+ include: [(0, import_path5.relative)(entrypointCacheDir, (0, import_path5.join)(workPath, entrypoint))]
70631
70678
  };
70632
70679
  try {
70633
70680
  const json = JSON.stringify(tsconfig, null, " ");
70634
- await import_fs.promises.mkdir(entrypointCacheDir, { recursive: true });
70635
- await import_fs.promises.writeFile(tsconfigPath, json, { flag: "wx" });
70681
+ await import_fs2.promises.mkdir(entrypointCacheDir, { recursive: true });
70682
+ await import_fs2.promises.writeFile(tsconfigPath, json, { flag: "wx" });
70636
70683
  } catch (error) {
70637
- if ((0, import_error_utils.isErrnoException)(error) && error.code !== "EEXIST")
70684
+ if ((0, import_error_utils2.isErrnoException)(error) && error.code !== "EEXIST")
70638
70685
  throw error;
70639
70686
  }
70640
70687
  const child = (0, import_child_process2.spawn)(
@@ -70654,6 +70701,10 @@ async function doTypeCheck({ entrypoint, workPath, meta = {} }, projectTsConfig)
70654
70701
  );
70655
70702
  await import_once2.default.spread(child, "close");
70656
70703
  }
70704
+
70705
+ // src/index.ts
70706
+ var import_build_utils7 = require("@vercel/build-utils");
70707
+ var version = 3;
70657
70708
  // Annotate the CommonJS export names for ESM import in node:
70658
70709
  0 && (module.exports = {
70659
70710
  build,