@vercel/build-utils 4.0.0 → 4.1.1-canary.0

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
@@ -2672,7 +2672,6 @@ function range(a, b, str) {
2672
2672
  /***/ 3197:
2673
2673
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2674
2674
 
2675
- var concatMap = __webpack_require__(4527);
2676
2675
  var balanced = __webpack_require__(3353);
2677
2676
 
2678
2677
  module.exports = expandTop;
@@ -2753,10 +2752,6 @@ function expandTop(str) {
2753
2752
  return expand(escapeBraces(str), true).map(unescapeBraces);
2754
2753
  }
2755
2754
 
2756
- function identity(e) {
2757
- return e;
2758
- }
2759
-
2760
2755
  function embrace(str) {
2761
2756
  return '{' + str + '}';
2762
2757
  }
@@ -2775,42 +2770,7 @@ function expand(str, isTop) {
2775
2770
  var expansions = [];
2776
2771
 
2777
2772
  var m = balanced('{', '}', str);
2778
- if (!m || /\$$/.test(m.pre)) return [str];
2779
-
2780
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
2781
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
2782
- var isSequence = isNumericSequence || isAlphaSequence;
2783
- var isOptions = m.body.indexOf(',') >= 0;
2784
- if (!isSequence && !isOptions) {
2785
- // {a},b}
2786
- if (m.post.match(/,.*\}/)) {
2787
- str = m.pre + '{' + m.body + escClose + m.post;
2788
- return expand(str);
2789
- }
2790
- return [str];
2791
- }
2792
-
2793
- var n;
2794
- if (isSequence) {
2795
- n = m.body.split(/\.\./);
2796
- } else {
2797
- n = parseCommaParts(m.body);
2798
- if (n.length === 1) {
2799
- // x{{a,b}}y ==> x{a}y x{b}y
2800
- n = expand(n[0], false).map(embrace);
2801
- if (n.length === 1) {
2802
- var post = m.post.length
2803
- ? expand(m.post, false)
2804
- : [''];
2805
- return post.map(function(p) {
2806
- return m.pre + n[0] + p;
2807
- });
2808
- }
2809
- }
2810
- }
2811
-
2812
- // at this point, n is the parts, and we know it's not a comma set
2813
- // with a single entry.
2773
+ if (!m) return [str];
2814
2774
 
2815
2775
  // no need to expand pre, since it is guaranteed to be free of brace-sets
2816
2776
  var pre = m.pre;
@@ -2818,55 +2778,97 @@ function expand(str, isTop) {
2818
2778
  ? expand(m.post, false)
2819
2779
  : [''];
2820
2780
 
2821
- var N;
2822
-
2823
- if (isSequence) {
2824
- var x = numeric(n[0]);
2825
- var y = numeric(n[1]);
2826
- var width = Math.max(n[0].length, n[1].length)
2827
- var incr = n.length == 3
2828
- ? Math.abs(numeric(n[2]))
2829
- : 1;
2830
- var test = lte;
2831
- var reverse = y < x;
2832
- if (reverse) {
2833
- incr *= -1;
2834
- test = gte;
2781
+ if (/\$$/.test(m.pre)) {
2782
+ for (var k = 0; k < post.length; k++) {
2783
+ var expansion = pre+ '{' + m.body + '}' + post[k];
2784
+ expansions.push(expansion);
2835
2785
  }
2836
- var pad = n.some(isPadded);
2837
-
2838
- N = [];
2839
-
2840
- for (var i = x; test(i, y); i += incr) {
2841
- var c;
2842
- if (isAlphaSequence) {
2843
- c = String.fromCharCode(i);
2844
- if (c === '\\')
2845
- c = '';
2846
- } else {
2847
- c = String(i);
2848
- if (pad) {
2849
- var need = width - c.length;
2850
- if (need > 0) {
2851
- var z = new Array(need + 1).join('0');
2852
- if (i < 0)
2853
- c = '-' + z + c.slice(1);
2854
- else
2855
- c = z + c;
2786
+ } else {
2787
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
2788
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
2789
+ var isSequence = isNumericSequence || isAlphaSequence;
2790
+ var isOptions = m.body.indexOf(',') >= 0;
2791
+ if (!isSequence && !isOptions) {
2792
+ // {a},b}
2793
+ if (m.post.match(/,.*\}/)) {
2794
+ str = m.pre + '{' + m.body + escClose + m.post;
2795
+ return expand(str);
2796
+ }
2797
+ return [str];
2798
+ }
2799
+
2800
+ var n;
2801
+ if (isSequence) {
2802
+ n = m.body.split(/\.\./);
2803
+ } else {
2804
+ n = parseCommaParts(m.body);
2805
+ if (n.length === 1) {
2806
+ // x{{a,b}}y ==> x{a}y x{b}y
2807
+ n = expand(n[0], false).map(embrace);
2808
+ if (n.length === 1) {
2809
+ return post.map(function(p) {
2810
+ return m.pre + n[0] + p;
2811
+ });
2812
+ }
2813
+ }
2814
+ }
2815
+
2816
+ // at this point, n is the parts, and we know it's not a comma set
2817
+ // with a single entry.
2818
+ var N;
2819
+
2820
+ if (isSequence) {
2821
+ var x = numeric(n[0]);
2822
+ var y = numeric(n[1]);
2823
+ var width = Math.max(n[0].length, n[1].length)
2824
+ var incr = n.length == 3
2825
+ ? Math.abs(numeric(n[2]))
2826
+ : 1;
2827
+ var test = lte;
2828
+ var reverse = y < x;
2829
+ if (reverse) {
2830
+ incr *= -1;
2831
+ test = gte;
2832
+ }
2833
+ var pad = n.some(isPadded);
2834
+
2835
+ N = [];
2836
+
2837
+ for (var i = x; test(i, y); i += incr) {
2838
+ var c;
2839
+ if (isAlphaSequence) {
2840
+ c = String.fromCharCode(i);
2841
+ if (c === '\\')
2842
+ c = '';
2843
+ } else {
2844
+ c = String(i);
2845
+ if (pad) {
2846
+ var need = width - c.length;
2847
+ if (need > 0) {
2848
+ var z = new Array(need + 1).join('0');
2849
+ if (i < 0)
2850
+ c = '-' + z + c.slice(1);
2851
+ else
2852
+ c = z + c;
2853
+ }
2856
2854
  }
2857
2855
  }
2856
+ N.push(c);
2857
+ }
2858
+ } else {
2859
+ N = [];
2860
+
2861
+ for (var j = 0; j < n.length; j++) {
2862
+ N.push.apply(N, expand(n[j], false));
2858
2863
  }
2859
- N.push(c);
2860
2864
  }
2861
- } else {
2862
- N = concatMap(n, function(el) { return expand(el, false) });
2863
- }
2864
2865
 
2865
- for (var j = 0; j < N.length; j++) {
2866
- for (var k = 0; k < post.length; k++) {
2867
- var expansion = pre + N[j] + post[k];
2868
- if (!isTop || isSequence || expansion)
2869
- expansions.push(expansion);
2866
+ for (var j = 0; j < N.length; j++) {
2867
+ for (var k = 0; k < post.length; k++) {
2868
+ var expansion = pre + N[j] + post[k];
2869
+ if (!isTop || isSequence || expansion)
2870
+ expansions.push(expansion);
2871
+ }
2870
2872
  }
2871
2873
  }
2872
2874
 
@@ -8680,7 +8682,7 @@ try {
8680
8682
  } catch (er) {}
8681
8683
 
8682
8684
  var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
8683
- var expand = __webpack_require__(3197)
8685
+ var expand = __webpack_require__(1561)
8684
8686
 
8685
8687
  var plTypes = {
8686
8688
  '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
@@ -9596,6 +9598,214 @@ function regExpEscape (s) {
9596
9598
  }
9597
9599
 
9598
9600
 
9601
+ /***/ }),
9602
+
9603
+ /***/ 1561:
9604
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9605
+
9606
+ var concatMap = __webpack_require__(4527);
9607
+ var balanced = __webpack_require__(3353);
9608
+
9609
+ module.exports = expandTop;
9610
+
9611
+ var escSlash = '\0SLASH'+Math.random()+'\0';
9612
+ var escOpen = '\0OPEN'+Math.random()+'\0';
9613
+ var escClose = '\0CLOSE'+Math.random()+'\0';
9614
+ var escComma = '\0COMMA'+Math.random()+'\0';
9615
+ var escPeriod = '\0PERIOD'+Math.random()+'\0';
9616
+
9617
+ function numeric(str) {
9618
+ return parseInt(str, 10) == str
9619
+ ? parseInt(str, 10)
9620
+ : str.charCodeAt(0);
9621
+ }
9622
+
9623
+ function escapeBraces(str) {
9624
+ return str.split('\\\\').join(escSlash)
9625
+ .split('\\{').join(escOpen)
9626
+ .split('\\}').join(escClose)
9627
+ .split('\\,').join(escComma)
9628
+ .split('\\.').join(escPeriod);
9629
+ }
9630
+
9631
+ function unescapeBraces(str) {
9632
+ return str.split(escSlash).join('\\')
9633
+ .split(escOpen).join('{')
9634
+ .split(escClose).join('}')
9635
+ .split(escComma).join(',')
9636
+ .split(escPeriod).join('.');
9637
+ }
9638
+
9639
+
9640
+ // Basically just str.split(","), but handling cases
9641
+ // where we have nested braced sections, which should be
9642
+ // treated as individual members, like {a,{b,c},d}
9643
+ function parseCommaParts(str) {
9644
+ if (!str)
9645
+ return [''];
9646
+
9647
+ var parts = [];
9648
+ var m = balanced('{', '}', str);
9649
+
9650
+ if (!m)
9651
+ return str.split(',');
9652
+
9653
+ var pre = m.pre;
9654
+ var body = m.body;
9655
+ var post = m.post;
9656
+ var p = pre.split(',');
9657
+
9658
+ p[p.length-1] += '{' + body + '}';
9659
+ var postParts = parseCommaParts(post);
9660
+ if (post.length) {
9661
+ p[p.length-1] += postParts.shift();
9662
+ p.push.apply(p, postParts);
9663
+ }
9664
+
9665
+ parts.push.apply(parts, p);
9666
+
9667
+ return parts;
9668
+ }
9669
+
9670
+ function expandTop(str) {
9671
+ if (!str)
9672
+ return [];
9673
+
9674
+ // I don't know why Bash 4.3 does this, but it does.
9675
+ // Anything starting with {} will have the first two bytes preserved
9676
+ // but *only* at the top level, so {},a}b will not expand to anything,
9677
+ // but a{},b}c will be expanded to [a}c,abc].
9678
+ // One could argue that this is a bug in Bash, but since the goal of
9679
+ // this module is to match Bash's rules, we escape a leading {}
9680
+ if (str.substr(0, 2) === '{}') {
9681
+ str = '\\{\\}' + str.substr(2);
9682
+ }
9683
+
9684
+ return expand(escapeBraces(str), true).map(unescapeBraces);
9685
+ }
9686
+
9687
+ function identity(e) {
9688
+ return e;
9689
+ }
9690
+
9691
+ function embrace(str) {
9692
+ return '{' + str + '}';
9693
+ }
9694
+ function isPadded(el) {
9695
+ return /^-?0\d/.test(el);
9696
+ }
9697
+
9698
+ function lte(i, y) {
9699
+ return i <= y;
9700
+ }
9701
+ function gte(i, y) {
9702
+ return i >= y;
9703
+ }
9704
+
9705
+ function expand(str, isTop) {
9706
+ var expansions = [];
9707
+
9708
+ var m = balanced('{', '}', str);
9709
+ if (!m || /\$$/.test(m.pre)) return [str];
9710
+
9711
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
9712
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
9713
+ var isSequence = isNumericSequence || isAlphaSequence;
9714
+ var isOptions = m.body.indexOf(',') >= 0;
9715
+ if (!isSequence && !isOptions) {
9716
+ // {a},b}
9717
+ if (m.post.match(/,.*\}/)) {
9718
+ str = m.pre + '{' + m.body + escClose + m.post;
9719
+ return expand(str);
9720
+ }
9721
+ return [str];
9722
+ }
9723
+
9724
+ var n;
9725
+ if (isSequence) {
9726
+ n = m.body.split(/\.\./);
9727
+ } else {
9728
+ n = parseCommaParts(m.body);
9729
+ if (n.length === 1) {
9730
+ // x{{a,b}}y ==> x{a}y x{b}y
9731
+ n = expand(n[0], false).map(embrace);
9732
+ if (n.length === 1) {
9733
+ var post = m.post.length
9734
+ ? expand(m.post, false)
9735
+ : [''];
9736
+ return post.map(function(p) {
9737
+ return m.pre + n[0] + p;
9738
+ });
9739
+ }
9740
+ }
9741
+ }
9742
+
9743
+ // at this point, n is the parts, and we know it's not a comma set
9744
+ // with a single entry.
9745
+
9746
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
9747
+ var pre = m.pre;
9748
+ var post = m.post.length
9749
+ ? expand(m.post, false)
9750
+ : [''];
9751
+
9752
+ var N;
9753
+
9754
+ if (isSequence) {
9755
+ var x = numeric(n[0]);
9756
+ var y = numeric(n[1]);
9757
+ var width = Math.max(n[0].length, n[1].length)
9758
+ var incr = n.length == 3
9759
+ ? Math.abs(numeric(n[2]))
9760
+ : 1;
9761
+ var test = lte;
9762
+ var reverse = y < x;
9763
+ if (reverse) {
9764
+ incr *= -1;
9765
+ test = gte;
9766
+ }
9767
+ var pad = n.some(isPadded);
9768
+
9769
+ N = [];
9770
+
9771
+ for (var i = x; test(i, y); i += incr) {
9772
+ var c;
9773
+ if (isAlphaSequence) {
9774
+ c = String.fromCharCode(i);
9775
+ if (c === '\\')
9776
+ c = '';
9777
+ } else {
9778
+ c = String(i);
9779
+ if (pad) {
9780
+ var need = width - c.length;
9781
+ if (need > 0) {
9782
+ var z = new Array(need + 1).join('0');
9783
+ if (i < 0)
9784
+ c = '-' + z + c.slice(1);
9785
+ else
9786
+ c = z + c;
9787
+ }
9788
+ }
9789
+ }
9790
+ N.push(c);
9791
+ }
9792
+ } else {
9793
+ N = concatMap(n, function(el) { return expand(el, false) });
9794
+ }
9795
+
9796
+ for (var j = 0; j < N.length; j++) {
9797
+ for (var k = 0; k < post.length; k++) {
9798
+ var expansion = pre + N[j] + post[k];
9799
+ if (!isTop || isSequence || expansion)
9800
+ expansions.push(expansion);
9801
+ }
9802
+ }
9803
+
9804
+ return expansions;
9805
+ }
9806
+
9807
+
9808
+
9599
9809
  /***/ }),
9600
9810
 
9601
9811
  /***/ 8179:
@@ -11503,34 +11713,6 @@ module.exports = isPromise;
11503
11713
  module.exports.default = isPromise;
11504
11714
 
11505
11715
 
11506
- /***/ }),
11507
-
11508
- /***/ 1323:
11509
- /***/ ((module) => {
11510
-
11511
- "use strict";
11512
-
11513
-
11514
- function posix(path) {
11515
- return path.charAt(0) === '/';
11516
- }
11517
-
11518
- function win32(path) {
11519
- // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
11520
- var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
11521
- var result = splitDeviceRe.exec(path);
11522
- var device = result[1] || '';
11523
- var isUnc = Boolean(device && device.charAt(1) !== ':');
11524
-
11525
- // UNC paths are always absolute
11526
- return Boolean(result[2] || isUnc);
11527
- }
11528
-
11529
- module.exports = process.platform === 'win32' ? win32 : posix;
11530
- module.exports.posix = posix;
11531
- module.exports.win32 = win32;
11532
-
11533
-
11534
11716
  /***/ }),
11535
11717
 
11536
11718
  /***/ 7843:
@@ -19416,8 +19598,6 @@ module.exports = {
19416
19598
  /***/ 9686:
19417
19599
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
19418
19600
 
19419
- exports.alphasort = alphasort
19420
- exports.alphasorti = alphasorti
19421
19601
  exports.setopts = setopts
19422
19602
  exports.ownProp = ownProp
19423
19603
  exports.makeAbs = makeAbs
@@ -19430,17 +19610,14 @@ function ownProp (obj, field) {
19430
19610
  return Object.prototype.hasOwnProperty.call(obj, field)
19431
19611
  }
19432
19612
 
19613
+ var fs = __webpack_require__(5747)
19433
19614
  var path = __webpack_require__(5622)
19434
- var minimatch = __webpack_require__(9566)
19435
- var isAbsolute = __webpack_require__(1323)
19615
+ var minimatch = __webpack_require__(949)
19616
+ var isAbsolute = __webpack_require__(5622).isAbsolute
19436
19617
  var Minimatch = minimatch.Minimatch
19437
19618
 
19438
- function alphasorti (a, b) {
19439
- return a.toLowerCase().localeCompare(b.toLowerCase())
19440
- }
19441
-
19442
19619
  function alphasort (a, b) {
19443
- return a.localeCompare(b)
19620
+ return a.localeCompare(b, 'en')
19444
19621
  }
19445
19622
 
19446
19623
  function setupIgnores (self, options) {
@@ -19499,6 +19676,7 @@ function setopts (self, pattern, options) {
19499
19676
  self.stat = !!options.stat
19500
19677
  self.noprocess = !!options.noprocess
19501
19678
  self.absolute = !!options.absolute
19679
+ self.fs = options.fs || fs
19502
19680
 
19503
19681
  self.maxLength = options.maxLength || Infinity
19504
19682
  self.cache = options.cache || Object.create(null)
@@ -19510,7 +19688,7 @@ function setopts (self, pattern, options) {
19510
19688
  self.changedCwd = false
19511
19689
  var cwd = process.cwd()
19512
19690
  if (!ownProp(options, "cwd"))
19513
- self.cwd = cwd
19691
+ self.cwd = path.resolve(cwd)
19514
19692
  else {
19515
19693
  self.cwd = path.resolve(options.cwd)
19516
19694
  self.changedCwd = self.cwd !== cwd
@@ -19518,20 +19696,24 @@ function setopts (self, pattern, options) {
19518
19696
 
19519
19697
  self.root = options.root || path.resolve(self.cwd, "/")
19520
19698
  self.root = path.resolve(self.root)
19521
- if (process.platform === "win32")
19522
- self.root = self.root.replace(/\\/g, "/")
19523
19699
 
19524
19700
  // TODO: is an absolute `cwd` supposed to be resolved against `root`?
19525
19701
  // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
19526
19702
  self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)
19527
- if (process.platform === "win32")
19528
- self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
19529
19703
  self.nomount = !!options.nomount
19530
19704
 
19705
+ if (process.platform === "win32") {
19706
+ self.root = self.root.replace(/\\/g, "/")
19707
+ self.cwd = self.cwd.replace(/\\/g, "/")
19708
+ self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
19709
+ }
19710
+
19531
19711
  // disable comments and negation in Minimatch.
19532
19712
  // Note that they are not supported in Glob itself anyway.
19533
19713
  options.nonegate = true
19534
19714
  options.nocomment = true
19715
+ // always treat \ in patterns as escapes, not path separators
19716
+ options.allowWindowsEscape = true
19535
19717
 
19536
19718
  self.minimatch = new Minimatch(pattern, options)
19537
19719
  self.options = self.minimatch.options
@@ -19568,7 +19750,7 @@ function finish (self) {
19568
19750
  all = Object.keys(all)
19569
19751
 
19570
19752
  if (!self.nosort)
19571
- all = all.sort(self.nocase ? alphasorti : alphasort)
19753
+ all = all.sort(alphasort)
19572
19754
 
19573
19755
  // at *some* point we statted all of these
19574
19756
  if (self.mark) {
@@ -19705,19 +19887,16 @@ function childrenIgnored (self, path) {
19705
19887
 
19706
19888
  module.exports = glob
19707
19889
 
19708
- var fs = __webpack_require__(5747)
19709
19890
  var rp = __webpack_require__(8945)
19710
- var minimatch = __webpack_require__(9566)
19891
+ var minimatch = __webpack_require__(949)
19711
19892
  var Minimatch = minimatch.Minimatch
19712
19893
  var inherits = __webpack_require__(6919)
19713
19894
  var EE = __webpack_require__(8614).EventEmitter
19714
19895
  var path = __webpack_require__(5622)
19715
19896
  var assert = __webpack_require__(2357)
19716
- var isAbsolute = __webpack_require__(1323)
19897
+ var isAbsolute = __webpack_require__(5622).isAbsolute
19717
19898
  var globSync = __webpack_require__(2231)
19718
19899
  var common = __webpack_require__(9686)
19719
- var alphasort = common.alphasort
19720
- var alphasorti = common.alphasorti
19721
19900
  var setopts = common.setopts
19722
19901
  var ownProp = common.ownProp
19723
19902
  var inflight = __webpack_require__(9442)
@@ -20010,7 +20189,10 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
20010
20189
  var read
20011
20190
  if (prefix === null)
20012
20191
  read = '.'
20013
- else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
20192
+ else if (isAbsolute(prefix) ||
20193
+ isAbsolute(pattern.map(function (p) {
20194
+ return typeof p === 'string' ? p : '[*]'
20195
+ }).join('/'))) {
20014
20196
  if (!prefix || !isAbsolute(prefix))
20015
20197
  prefix = '/' + prefix
20016
20198
  read = prefix
@@ -20168,7 +20350,7 @@ Glob.prototype._readdirInGlobStar = function (abs, cb) {
20168
20350
  var lstatcb = inflight(lstatkey, lstatcb_)
20169
20351
 
20170
20352
  if (lstatcb)
20171
- fs.lstat(abs, lstatcb)
20353
+ self.fs.lstat(abs, lstatcb)
20172
20354
 
20173
20355
  function lstatcb_ (er, lstat) {
20174
20356
  if (er && er.code === 'ENOENT')
@@ -20209,7 +20391,7 @@ Glob.prototype._readdir = function (abs, inGlobStar, cb) {
20209
20391
  }
20210
20392
 
20211
20393
  var self = this
20212
- fs.readdir(abs, readdirCb(this, abs, cb))
20394
+ self.fs.readdir(abs, readdirCb(this, abs, cb))
20213
20395
  }
20214
20396
 
20215
20397
  function readdirCb (self, abs, cb) {
@@ -20413,13 +20595,13 @@ Glob.prototype._stat = function (f, cb) {
20413
20595
  var self = this
20414
20596
  var statcb = inflight('stat\0' + abs, lstatcb_)
20415
20597
  if (statcb)
20416
- fs.lstat(abs, statcb)
20598
+ self.fs.lstat(abs, statcb)
20417
20599
 
20418
20600
  function lstatcb_ (er, lstat) {
20419
20601
  if (lstat && lstat.isSymbolicLink()) {
20420
20602
  // If it's a symlink, then treat it as the target, unless
20421
20603
  // the target does not exist, then treat it as a file.
20422
- return fs.stat(abs, function (er, stat) {
20604
+ return self.fs.stat(abs, function (er, stat) {
20423
20605
  if (er)
20424
20606
  self._stat2(f, abs, null, lstat, cb)
20425
20607
  else
@@ -20455,6 +20637,930 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
20455
20637
  }
20456
20638
 
20457
20639
 
20640
+ /***/ }),
20641
+
20642
+ /***/ 7581:
20643
+ /***/ ((module) => {
20644
+
20645
+ const isWindows = typeof process === 'object' &&
20646
+ process &&
20647
+ process.platform === 'win32'
20648
+ module.exports = isWindows ? { sep: '\\' } : { sep: '/' }
20649
+
20650
+
20651
+ /***/ }),
20652
+
20653
+ /***/ 949:
20654
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
20655
+
20656
+ const minimatch = module.exports = (p, pattern, options = {}) => {
20657
+ assertValidPattern(pattern)
20658
+
20659
+ // shortcut: comments match nothing.
20660
+ if (!options.nocomment && pattern.charAt(0) === '#') {
20661
+ return false
20662
+ }
20663
+
20664
+ return new Minimatch(pattern, options).match(p)
20665
+ }
20666
+
20667
+ module.exports = minimatch
20668
+
20669
+ const path = __webpack_require__(7581)
20670
+ minimatch.sep = path.sep
20671
+
20672
+ const GLOBSTAR = Symbol('globstar **')
20673
+ minimatch.GLOBSTAR = GLOBSTAR
20674
+ const expand = __webpack_require__(3197)
20675
+
20676
+ const plTypes = {
20677
+ '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
20678
+ '?': { open: '(?:', close: ')?' },
20679
+ '+': { open: '(?:', close: ')+' },
20680
+ '*': { open: '(?:', close: ')*' },
20681
+ '@': { open: '(?:', close: ')' }
20682
+ }
20683
+
20684
+ // any single thing other than /
20685
+ // don't need to escape / when using new RegExp()
20686
+ const qmark = '[^/]'
20687
+
20688
+ // * => any number of characters
20689
+ const star = qmark + '*?'
20690
+
20691
+ // ** when dots are allowed. Anything goes, except .. and .
20692
+ // not (^ or / followed by one or two dots followed by $ or /),
20693
+ // followed by anything, any number of times.
20694
+ const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
20695
+
20696
+ // not a ^ or / followed by a dot,
20697
+ // followed by anything, any number of times.
20698
+ const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
20699
+
20700
+ // "abc" -> { a:true, b:true, c:true }
20701
+ const charSet = s => s.split('').reduce((set, c) => {
20702
+ set[c] = true
20703
+ return set
20704
+ }, {})
20705
+
20706
+ // characters that need to be escaped in RegExp.
20707
+ const reSpecials = charSet('().*{}+?[]^$\\!')
20708
+
20709
+ // characters that indicate we have to add the pattern start
20710
+ const addPatternStartSet = charSet('[.(')
20711
+
20712
+ // normalizes slashes.
20713
+ const slashSplit = /\/+/
20714
+
20715
+ minimatch.filter = (pattern, options = {}) =>
20716
+ (p, i, list) => minimatch(p, pattern, options)
20717
+
20718
+ const ext = (a, b = {}) => {
20719
+ const t = {}
20720
+ Object.keys(a).forEach(k => t[k] = a[k])
20721
+ Object.keys(b).forEach(k => t[k] = b[k])
20722
+ return t
20723
+ }
20724
+
20725
+ minimatch.defaults = def => {
20726
+ if (!def || typeof def !== 'object' || !Object.keys(def).length) {
20727
+ return minimatch
20728
+ }
20729
+
20730
+ const orig = minimatch
20731
+
20732
+ const m = (p, pattern, options) => orig(p, pattern, ext(def, options))
20733
+ m.Minimatch = class Minimatch extends orig.Minimatch {
20734
+ constructor (pattern, options) {
20735
+ super(pattern, ext(def, options))
20736
+ }
20737
+ }
20738
+ m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch
20739
+ m.filter = (pattern, options) => orig.filter(pattern, ext(def, options))
20740
+ m.defaults = options => orig.defaults(ext(def, options))
20741
+ m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options))
20742
+ m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options))
20743
+ m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options))
20744
+
20745
+ return m
20746
+ }
20747
+
20748
+
20749
+
20750
+
20751
+
20752
+ // Brace expansion:
20753
+ // a{b,c}d -> abd acd
20754
+ // a{b,}c -> abc ac
20755
+ // a{0..3}d -> a0d a1d a2d a3d
20756
+ // a{b,c{d,e}f}g -> abg acdfg acefg
20757
+ // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
20758
+ //
20759
+ // Invalid sets are not expanded.
20760
+ // a{2..}b -> a{2..}b
20761
+ // a{b}c -> a{b}c
20762
+ minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options)
20763
+
20764
+ const braceExpand = (pattern, options = {}) => {
20765
+ assertValidPattern(pattern)
20766
+
20767
+ // Thanks to Yeting Li <https://github.com/yetingli> for
20768
+ // improving this regexp to avoid a ReDOS vulnerability.
20769
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
20770
+ // shortcut. no need to expand.
20771
+ return [pattern]
20772
+ }
20773
+
20774
+ return expand(pattern)
20775
+ }
20776
+
20777
+ const MAX_PATTERN_LENGTH = 1024 * 64
20778
+ const assertValidPattern = pattern => {
20779
+ if (typeof pattern !== 'string') {
20780
+ throw new TypeError('invalid pattern')
20781
+ }
20782
+
20783
+ if (pattern.length > MAX_PATTERN_LENGTH) {
20784
+ throw new TypeError('pattern is too long')
20785
+ }
20786
+ }
20787
+
20788
+ // parse a component of the expanded set.
20789
+ // At this point, no pattern may contain "/" in it
20790
+ // so we're going to return a 2d array, where each entry is the full
20791
+ // pattern, split on '/', and then turned into a regular expression.
20792
+ // A regexp is made at the end which joins each array with an
20793
+ // escaped /, and another full one which joins each regexp with |.
20794
+ //
20795
+ // Following the lead of Bash 4.1, note that "**" only has special meaning
20796
+ // when it is the *only* thing in a path portion. Otherwise, any series
20797
+ // of * is equivalent to a single *. Globstar behavior is enabled by
20798
+ // default, and can be disabled by setting options.noglobstar.
20799
+ const SUBPARSE = Symbol('subparse')
20800
+
20801
+ minimatch.makeRe = (pattern, options) =>
20802
+ new Minimatch(pattern, options || {}).makeRe()
20803
+
20804
+ minimatch.match = (list, pattern, options = {}) => {
20805
+ const mm = new Minimatch(pattern, options)
20806
+ list = list.filter(f => mm.match(f))
20807
+ if (mm.options.nonull && !list.length) {
20808
+ list.push(pattern)
20809
+ }
20810
+ return list
20811
+ }
20812
+
20813
+ // replace stuff like \* with *
20814
+ const globUnescape = s => s.replace(/\\(.)/g, '$1')
20815
+ const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
20816
+
20817
+ class Minimatch {
20818
+ constructor (pattern, options) {
20819
+ assertValidPattern(pattern)
20820
+
20821
+ if (!options) options = {}
20822
+
20823
+ this.options = options
20824
+ this.set = []
20825
+ this.pattern = pattern
20826
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape ||
20827
+ options.allowWindowsEscape === false
20828
+ if (this.windowsPathsNoEscape) {
20829
+ this.pattern = this.pattern.replace(/\\/g, '/')
20830
+ }
20831
+ this.regexp = null
20832
+ this.negate = false
20833
+ this.comment = false
20834
+ this.empty = false
20835
+ this.partial = !!options.partial
20836
+
20837
+ // make the set of regexps etc.
20838
+ this.make()
20839
+ }
20840
+
20841
+ debug () {}
20842
+
20843
+ make () {
20844
+ const pattern = this.pattern
20845
+ const options = this.options
20846
+
20847
+ // empty patterns and comments match nothing.
20848
+ if (!options.nocomment && pattern.charAt(0) === '#') {
20849
+ this.comment = true
20850
+ return
20851
+ }
20852
+ if (!pattern) {
20853
+ this.empty = true
20854
+ return
20855
+ }
20856
+
20857
+ // step 1: figure out negation, etc.
20858
+ this.parseNegate()
20859
+
20860
+ // step 2: expand braces
20861
+ let set = this.globSet = this.braceExpand()
20862
+
20863
+ if (options.debug) this.debug = (...args) => console.error(...args)
20864
+
20865
+ this.debug(this.pattern, set)
20866
+
20867
+ // step 3: now we have a set, so turn each one into a series of path-portion
20868
+ // matching patterns.
20869
+ // These will be regexps, except in the case of "**", which is
20870
+ // set to the GLOBSTAR object for globstar behavior,
20871
+ // and will not contain any / characters
20872
+ set = this.globParts = set.map(s => s.split(slashSplit))
20873
+
20874
+ this.debug(this.pattern, set)
20875
+
20876
+ // glob --> regexps
20877
+ set = set.map((s, si, set) => s.map(this.parse, this))
20878
+
20879
+ this.debug(this.pattern, set)
20880
+
20881
+ // filter out everything that didn't compile properly.
20882
+ set = set.filter(s => s.indexOf(false) === -1)
20883
+
20884
+ this.debug(this.pattern, set)
20885
+
20886
+ this.set = set
20887
+ }
20888
+
20889
+ parseNegate () {
20890
+ if (this.options.nonegate) return
20891
+
20892
+ const pattern = this.pattern
20893
+ let negate = false
20894
+ let negateOffset = 0
20895
+
20896
+ for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
20897
+ negate = !negate
20898
+ negateOffset++
20899
+ }
20900
+
20901
+ if (negateOffset) this.pattern = pattern.substr(negateOffset)
20902
+ this.negate = negate
20903
+ }
20904
+
20905
+ // set partial to true to test if, for example,
20906
+ // "/a/b" matches the start of "/*/b/*/d"
20907
+ // Partial means, if you run out of file before you run
20908
+ // out of pattern, then that's fine, as long as all
20909
+ // the parts match.
20910
+ matchOne (file, pattern, partial) {
20911
+ var options = this.options
20912
+
20913
+ this.debug('matchOne',
20914
+ { 'this': this, file: file, pattern: pattern })
20915
+
20916
+ this.debug('matchOne', file.length, pattern.length)
20917
+
20918
+ for (var fi = 0,
20919
+ pi = 0,
20920
+ fl = file.length,
20921
+ pl = pattern.length
20922
+ ; (fi < fl) && (pi < pl)
20923
+ ; fi++, pi++) {
20924
+ this.debug('matchOne loop')
20925
+ var p = pattern[pi]
20926
+ var f = file[fi]
20927
+
20928
+ this.debug(pattern, p, f)
20929
+
20930
+ // should be impossible.
20931
+ // some invalid regexp stuff in the set.
20932
+ /* istanbul ignore if */
20933
+ if (p === false) return false
20934
+
20935
+ if (p === GLOBSTAR) {
20936
+ this.debug('GLOBSTAR', [pattern, p, f])
20937
+
20938
+ // "**"
20939
+ // a/**/b/**/c would match the following:
20940
+ // a/b/x/y/z/c
20941
+ // a/x/y/z/b/c
20942
+ // a/b/x/b/x/c
20943
+ // a/b/c
20944
+ // To do this, take the rest of the pattern after
20945
+ // the **, and see if it would match the file remainder.
20946
+ // If so, return success.
20947
+ // If not, the ** "swallows" a segment, and try again.
20948
+ // This is recursively awful.
20949
+ //
20950
+ // a/**/b/**/c matching a/b/x/y/z/c
20951
+ // - a matches a
20952
+ // - doublestar
20953
+ // - matchOne(b/x/y/z/c, b/**/c)
20954
+ // - b matches b
20955
+ // - doublestar
20956
+ // - matchOne(x/y/z/c, c) -> no
20957
+ // - matchOne(y/z/c, c) -> no
20958
+ // - matchOne(z/c, c) -> no
20959
+ // - matchOne(c, c) yes, hit
20960
+ var fr = fi
20961
+ var pr = pi + 1
20962
+ if (pr === pl) {
20963
+ this.debug('** at the end')
20964
+ // a ** at the end will just swallow the rest.
20965
+ // We have found a match.
20966
+ // however, it will not swallow /.x, unless
20967
+ // options.dot is set.
20968
+ // . and .. are *never* matched by **, for explosively
20969
+ // exponential reasons.
20970
+ for (; fi < fl; fi++) {
20971
+ if (file[fi] === '.' || file[fi] === '..' ||
20972
+ (!options.dot && file[fi].charAt(0) === '.')) return false
20973
+ }
20974
+ return true
20975
+ }
20976
+
20977
+ // ok, let's see if we can swallow whatever we can.
20978
+ while (fr < fl) {
20979
+ var swallowee = file[fr]
20980
+
20981
+ this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
20982
+
20983
+ // XXX remove this slice. Just pass the start index.
20984
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
20985
+ this.debug('globstar found match!', fr, fl, swallowee)
20986
+ // found a match.
20987
+ return true
20988
+ } else {
20989
+ // can't swallow "." or ".." ever.
20990
+ // can only swallow ".foo" when explicitly asked.
20991
+ if (swallowee === '.' || swallowee === '..' ||
20992
+ (!options.dot && swallowee.charAt(0) === '.')) {
20993
+ this.debug('dot detected!', file, fr, pattern, pr)
20994
+ break
20995
+ }
20996
+
20997
+ // ** swallows a segment, and continue.
20998
+ this.debug('globstar swallow a segment, and continue')
20999
+ fr++
21000
+ }
21001
+ }
21002
+
21003
+ // no match was found.
21004
+ // However, in partial mode, we can't say this is necessarily over.
21005
+ // If there's more *pattern* left, then
21006
+ /* istanbul ignore if */
21007
+ if (partial) {
21008
+ // ran out of file
21009
+ this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
21010
+ if (fr === fl) return true
21011
+ }
21012
+ return false
21013
+ }
21014
+
21015
+ // something other than **
21016
+ // non-magic patterns just have to match exactly
21017
+ // patterns with magic have been turned into regexps.
21018
+ var hit
21019
+ if (typeof p === 'string') {
21020
+ hit = f === p
21021
+ this.debug('string match', p, f, hit)
21022
+ } else {
21023
+ hit = f.match(p)
21024
+ this.debug('pattern match', p, f, hit)
21025
+ }
21026
+
21027
+ if (!hit) return false
21028
+ }
21029
+
21030
+ // Note: ending in / means that we'll get a final ""
21031
+ // at the end of the pattern. This can only match a
21032
+ // corresponding "" at the end of the file.
21033
+ // If the file ends in /, then it can only match a
21034
+ // a pattern that ends in /, unless the pattern just
21035
+ // doesn't have any more for it. But, a/b/ should *not*
21036
+ // match "a/b/*", even though "" matches against the
21037
+ // [^/]*? pattern, except in partial mode, where it might
21038
+ // simply not be reached yet.
21039
+ // However, a/b/ should still satisfy a/*
21040
+
21041
+ // now either we fell off the end of the pattern, or we're done.
21042
+ if (fi === fl && pi === pl) {
21043
+ // ran out of pattern and filename at the same time.
21044
+ // an exact hit!
21045
+ return true
21046
+ } else if (fi === fl) {
21047
+ // ran out of file, but still had pattern left.
21048
+ // this is ok if we're doing the match as part of
21049
+ // a glob fs traversal.
21050
+ return partial
21051
+ } else /* istanbul ignore else */ if (pi === pl) {
21052
+ // ran out of pattern, still have file left.
21053
+ // this is only acceptable if we're on the very last
21054
+ // empty segment of a file with a trailing slash.
21055
+ // a/* should match a/b/
21056
+ return (fi === fl - 1) && (file[fi] === '')
21057
+ }
21058
+
21059
+ // should be unreachable.
21060
+ /* istanbul ignore next */
21061
+ throw new Error('wtf?')
21062
+ }
21063
+
21064
+ braceExpand () {
21065
+ return braceExpand(this.pattern, this.options)
21066
+ }
21067
+
21068
+ parse (pattern, isSub) {
21069
+ assertValidPattern(pattern)
21070
+
21071
+ const options = this.options
21072
+
21073
+ // shortcuts
21074
+ if (pattern === '**') {
21075
+ if (!options.noglobstar)
21076
+ return GLOBSTAR
21077
+ else
21078
+ pattern = '*'
21079
+ }
21080
+ if (pattern === '') return ''
21081
+
21082
+ let re = ''
21083
+ let hasMagic = !!options.nocase
21084
+ let escaping = false
21085
+ // ? => one single character
21086
+ const patternListStack = []
21087
+ const negativeLists = []
21088
+ let stateChar
21089
+ let inClass = false
21090
+ let reClassStart = -1
21091
+ let classStart = -1
21092
+ let cs
21093
+ let pl
21094
+ let sp
21095
+ // . and .. never match anything that doesn't start with .,
21096
+ // even when options.dot is set.
21097
+ const patternStart = pattern.charAt(0) === '.' ? '' // anything
21098
+ // not (start or / followed by . or .. followed by / or end)
21099
+ : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
21100
+ : '(?!\\.)'
21101
+
21102
+ const clearStateChar = () => {
21103
+ if (stateChar) {
21104
+ // we had some state-tracking character
21105
+ // that wasn't consumed by this pass.
21106
+ switch (stateChar) {
21107
+ case '*':
21108
+ re += star
21109
+ hasMagic = true
21110
+ break
21111
+ case '?':
21112
+ re += qmark
21113
+ hasMagic = true
21114
+ break
21115
+ default:
21116
+ re += '\\' + stateChar
21117
+ break
21118
+ }
21119
+ this.debug('clearStateChar %j %j', stateChar, re)
21120
+ stateChar = false
21121
+ }
21122
+ }
21123
+
21124
+ for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) {
21125
+ this.debug('%s\t%s %s %j', pattern, i, re, c)
21126
+
21127
+ // skip over any that are escaped.
21128
+ if (escaping) {
21129
+ /* istanbul ignore next - completely not allowed, even escaped. */
21130
+ if (c === '/') {
21131
+ return false
21132
+ }
21133
+
21134
+ if (reSpecials[c]) {
21135
+ re += '\\'
21136
+ }
21137
+ re += c
21138
+ escaping = false
21139
+ continue
21140
+ }
21141
+
21142
+ switch (c) {
21143
+ /* istanbul ignore next */
21144
+ case '/': {
21145
+ // Should already be path-split by now.
21146
+ return false
21147
+ }
21148
+
21149
+ case '\\':
21150
+ clearStateChar()
21151
+ escaping = true
21152
+ continue
21153
+
21154
+ // the various stateChar values
21155
+ // for the "extglob" stuff.
21156
+ case '?':
21157
+ case '*':
21158
+ case '+':
21159
+ case '@':
21160
+ case '!':
21161
+ this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
21162
+
21163
+ // all of those are literals inside a class, except that
21164
+ // the glob [!a] means [^a] in regexp
21165
+ if (inClass) {
21166
+ this.debug(' in class')
21167
+ if (c === '!' && i === classStart + 1) c = '^'
21168
+ re += c
21169
+ continue
21170
+ }
21171
+
21172
+ // if we already have a stateChar, then it means
21173
+ // that there was something like ** or +? in there.
21174
+ // Handle the stateChar, then proceed with this one.
21175
+ this.debug('call clearStateChar %j', stateChar)
21176
+ clearStateChar()
21177
+ stateChar = c
21178
+ // if extglob is disabled, then +(asdf|foo) isn't a thing.
21179
+ // just clear the statechar *now*, rather than even diving into
21180
+ // the patternList stuff.
21181
+ if (options.noext) clearStateChar()
21182
+ continue
21183
+
21184
+ case '(':
21185
+ if (inClass) {
21186
+ re += '('
21187
+ continue
21188
+ }
21189
+
21190
+ if (!stateChar) {
21191
+ re += '\\('
21192
+ continue
21193
+ }
21194
+
21195
+ patternListStack.push({
21196
+ type: stateChar,
21197
+ start: i - 1,
21198
+ reStart: re.length,
21199
+ open: plTypes[stateChar].open,
21200
+ close: plTypes[stateChar].close
21201
+ })
21202
+ // negation is (?:(?!js)[^/]*)
21203
+ re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
21204
+ this.debug('plType %j %j', stateChar, re)
21205
+ stateChar = false
21206
+ continue
21207
+
21208
+ case ')':
21209
+ if (inClass || !patternListStack.length) {
21210
+ re += '\\)'
21211
+ continue
21212
+ }
21213
+
21214
+ clearStateChar()
21215
+ hasMagic = true
21216
+ pl = patternListStack.pop()
21217
+ // negation is (?:(?!js)[^/]*)
21218
+ // The others are (?:<pattern>)<type>
21219
+ re += pl.close
21220
+ if (pl.type === '!') {
21221
+ negativeLists.push(pl)
21222
+ }
21223
+ pl.reEnd = re.length
21224
+ continue
21225
+
21226
+ case '|':
21227
+ if (inClass || !patternListStack.length) {
21228
+ re += '\\|'
21229
+ continue
21230
+ }
21231
+
21232
+ clearStateChar()
21233
+ re += '|'
21234
+ continue
21235
+
21236
+ // these are mostly the same in regexp and glob
21237
+ case '[':
21238
+ // swallow any state-tracking char before the [
21239
+ clearStateChar()
21240
+
21241
+ if (inClass) {
21242
+ re += '\\' + c
21243
+ continue
21244
+ }
21245
+
21246
+ inClass = true
21247
+ classStart = i
21248
+ reClassStart = re.length
21249
+ re += c
21250
+ continue
21251
+
21252
+ case ']':
21253
+ // a right bracket shall lose its special
21254
+ // meaning and represent itself in
21255
+ // a bracket expression if it occurs
21256
+ // first in the list. -- POSIX.2 2.8.3.2
21257
+ if (i === classStart + 1 || !inClass) {
21258
+ re += '\\' + c
21259
+ continue
21260
+ }
21261
+
21262
+ // handle the case where we left a class open.
21263
+ // "[z-a]" is valid, equivalent to "\[z-a\]"
21264
+ // split where the last [ was, make sure we don't have
21265
+ // an invalid re. if so, re-walk the contents of the
21266
+ // would-be class to re-translate any characters that
21267
+ // were passed through as-is
21268
+ // TODO: It would probably be faster to determine this
21269
+ // without a try/catch and a new RegExp, but it's tricky
21270
+ // to do safely. For now, this is safe and works.
21271
+ cs = pattern.substring(classStart + 1, i)
21272
+ try {
21273
+ RegExp('[' + cs + ']')
21274
+ } catch (er) {
21275
+ // not a valid class!
21276
+ sp = this.parse(cs, SUBPARSE)
21277
+ re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
21278
+ hasMagic = hasMagic || sp[1]
21279
+ inClass = false
21280
+ continue
21281
+ }
21282
+
21283
+ // finish up the class.
21284
+ hasMagic = true
21285
+ inClass = false
21286
+ re += c
21287
+ continue
21288
+
21289
+ default:
21290
+ // swallow any state char that wasn't consumed
21291
+ clearStateChar()
21292
+
21293
+ if (reSpecials[c] && !(c === '^' && inClass)) {
21294
+ re += '\\'
21295
+ }
21296
+
21297
+ re += c
21298
+ break
21299
+
21300
+ } // switch
21301
+ } // for
21302
+
21303
+ // handle the case where we left a class open.
21304
+ // "[abc" is valid, equivalent to "\[abc"
21305
+ if (inClass) {
21306
+ // split where the last [ was, and escape it
21307
+ // this is a huge pita. We now have to re-walk
21308
+ // the contents of the would-be class to re-translate
21309
+ // any characters that were passed through as-is
21310
+ cs = pattern.substr(classStart + 1)
21311
+ sp = this.parse(cs, SUBPARSE)
21312
+ re = re.substr(0, reClassStart) + '\\[' + sp[0]
21313
+ hasMagic = hasMagic || sp[1]
21314
+ }
21315
+
21316
+ // handle the case where we had a +( thing at the *end*
21317
+ // of the pattern.
21318
+ // each pattern list stack adds 3 chars, and we need to go through
21319
+ // and escape any | chars that were passed through as-is for the regexp.
21320
+ // Go through and escape them, taking care not to double-escape any
21321
+ // | chars that were already escaped.
21322
+ for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
21323
+ let tail
21324
+ tail = re.slice(pl.reStart + pl.open.length)
21325
+ this.debug('setting tail', re, pl)
21326
+ // maybe some even number of \, then maybe 1 \, followed by a |
21327
+ tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
21328
+ /* istanbul ignore else - should already be done */
21329
+ if (!$2) {
21330
+ // the | isn't already escaped, so escape it.
21331
+ $2 = '\\'
21332
+ }
21333
+
21334
+ // need to escape all those slashes *again*, without escaping the
21335
+ // one that we need for escaping the | character. As it works out,
21336
+ // escaping an even number of slashes can be done by simply repeating
21337
+ // it exactly after itself. That's why this trick works.
21338
+ //
21339
+ // I am sorry that you have to see this.
21340
+ return $1 + $1 + $2 + '|'
21341
+ })
21342
+
21343
+ this.debug('tail=%j\n %s', tail, tail, pl, re)
21344
+ const t = pl.type === '*' ? star
21345
+ : pl.type === '?' ? qmark
21346
+ : '\\' + pl.type
21347
+
21348
+ hasMagic = true
21349
+ re = re.slice(0, pl.reStart) + t + '\\(' + tail
21350
+ }
21351
+
21352
+ // handle trailing things that only matter at the very end.
21353
+ clearStateChar()
21354
+ if (escaping) {
21355
+ // trailing \\
21356
+ re += '\\\\'
21357
+ }
21358
+
21359
+ // only need to apply the nodot start if the re starts with
21360
+ // something that could conceivably capture a dot
21361
+ const addPatternStart = addPatternStartSet[re.charAt(0)]
21362
+
21363
+ // Hack to work around lack of negative lookbehind in JS
21364
+ // A pattern like: *.!(x).!(y|z) needs to ensure that a name
21365
+ // like 'a.xyz.yz' doesn't match. So, the first negative
21366
+ // lookahead, has to look ALL the way ahead, to the end of
21367
+ // the pattern.
21368
+ for (let n = negativeLists.length - 1; n > -1; n--) {
21369
+ const nl = negativeLists[n]
21370
+
21371
+ const nlBefore = re.slice(0, nl.reStart)
21372
+ const nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
21373
+ let nlAfter = re.slice(nl.reEnd)
21374
+ const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter
21375
+
21376
+ // Handle nested stuff like *(*.js|!(*.json)), where open parens
21377
+ // mean that we should *not* include the ) in the bit that is considered
21378
+ // "after" the negated section.
21379
+ const openParensBefore = nlBefore.split('(').length - 1
21380
+ let cleanAfter = nlAfter
21381
+ for (let i = 0; i < openParensBefore; i++) {
21382
+ cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
21383
+ }
21384
+ nlAfter = cleanAfter
21385
+
21386
+ const dollar = nlAfter === '' && isSub !== SUBPARSE ? '$' : ''
21387
+ re = nlBefore + nlFirst + nlAfter + dollar + nlLast
21388
+ }
21389
+
21390
+ // if the re is not "" at this point, then we need to make sure
21391
+ // it doesn't match against an empty path part.
21392
+ // Otherwise a/* will match a/, which it should not.
21393
+ if (re !== '' && hasMagic) {
21394
+ re = '(?=.)' + re
21395
+ }
21396
+
21397
+ if (addPatternStart) {
21398
+ re = patternStart + re
21399
+ }
21400
+
21401
+ // parsing just a piece of a larger pattern.
21402
+ if (isSub === SUBPARSE) {
21403
+ return [re, hasMagic]
21404
+ }
21405
+
21406
+ // skip the regexp for non-magical patterns
21407
+ // unescape anything in it, though, so that it'll be
21408
+ // an exact match against a file etc.
21409
+ if (!hasMagic) {
21410
+ return globUnescape(pattern)
21411
+ }
21412
+
21413
+ const flags = options.nocase ? 'i' : ''
21414
+ try {
21415
+ return Object.assign(new RegExp('^' + re + '$', flags), {
21416
+ _glob: pattern,
21417
+ _src: re,
21418
+ })
21419
+ } catch (er) /* istanbul ignore next - should be impossible */ {
21420
+ // If it was an invalid regular expression, then it can't match
21421
+ // anything. This trick looks for a character after the end of
21422
+ // the string, which is of course impossible, except in multi-line
21423
+ // mode, but it's not a /m regex.
21424
+ return new RegExp('$.')
21425
+ }
21426
+ }
21427
+
21428
+ makeRe () {
21429
+ if (this.regexp || this.regexp === false) return this.regexp
21430
+
21431
+ // at this point, this.set is a 2d array of partial
21432
+ // pattern strings, or "**".
21433
+ //
21434
+ // It's better to use .match(). This function shouldn't
21435
+ // be used, really, but it's pretty convenient sometimes,
21436
+ // when you just want to work with a regex.
21437
+ const set = this.set
21438
+
21439
+ if (!set.length) {
21440
+ this.regexp = false
21441
+ return this.regexp
21442
+ }
21443
+ const options = this.options
21444
+
21445
+ const twoStar = options.noglobstar ? star
21446
+ : options.dot ? twoStarDot
21447
+ : twoStarNoDot
21448
+ const flags = options.nocase ? 'i' : ''
21449
+
21450
+ // coalesce globstars and regexpify non-globstar patterns
21451
+ // if it's the only item, then we just do one twoStar
21452
+ // if it's the first, and there are more, prepend (\/|twoStar\/)? to next
21453
+ // if it's the last, append (\/twoStar|) to previous
21454
+ // if it's in the middle, append (\/|\/twoStar\/) to previous
21455
+ // then filter out GLOBSTAR symbols
21456
+ let re = set.map(pattern => {
21457
+ pattern = pattern.map(p =>
21458
+ typeof p === 'string' ? regExpEscape(p)
21459
+ : p === GLOBSTAR ? GLOBSTAR
21460
+ : p._src
21461
+ ).reduce((set, p) => {
21462
+ if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) {
21463
+ set.push(p)
21464
+ }
21465
+ return set
21466
+ }, [])
21467
+ pattern.forEach((p, i) => {
21468
+ if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) {
21469
+ return
21470
+ }
21471
+ if (i === 0) {
21472
+ if (pattern.length > 1) {
21473
+ pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1]
21474
+ } else {
21475
+ pattern[i] = twoStar
21476
+ }
21477
+ } else if (i === pattern.length - 1) {
21478
+ pattern[i-1] += '(?:\\\/|' + twoStar + ')?'
21479
+ } else {
21480
+ pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1]
21481
+ pattern[i+1] = GLOBSTAR
21482
+ }
21483
+ })
21484
+ return pattern.filter(p => p !== GLOBSTAR).join('/')
21485
+ }).join('|')
21486
+
21487
+ // must match entire pattern
21488
+ // ending in a * or ** will make it less strict.
21489
+ re = '^(?:' + re + ')$'
21490
+
21491
+ // can match anything, as long as it's not this.
21492
+ if (this.negate) re = '^(?!' + re + ').*$'
21493
+
21494
+ try {
21495
+ this.regexp = new RegExp(re, flags)
21496
+ } catch (ex) /* istanbul ignore next - should be impossible */ {
21497
+ this.regexp = false
21498
+ }
21499
+ return this.regexp
21500
+ }
21501
+
21502
+ match (f, partial = this.partial) {
21503
+ this.debug('match', f, this.pattern)
21504
+ // short-circuit in the case of busted things.
21505
+ // comments, etc.
21506
+ if (this.comment) return false
21507
+ if (this.empty) return f === ''
21508
+
21509
+ if (f === '/' && partial) return true
21510
+
21511
+ const options = this.options
21512
+
21513
+ // windows: need to use /, not \
21514
+ if (path.sep !== '/') {
21515
+ f = f.split(path.sep).join('/')
21516
+ }
21517
+
21518
+ // treat the test path as a set of pathparts.
21519
+ f = f.split(slashSplit)
21520
+ this.debug(this.pattern, 'split', f)
21521
+
21522
+ // just ONE of the pattern sets in this.set needs to match
21523
+ // in order for it to be valid. If negating, then just one
21524
+ // match means that we have failed.
21525
+ // Either way, return on the first hit.
21526
+
21527
+ const set = this.set
21528
+ this.debug(this.pattern, 'set', set)
21529
+
21530
+ // Find the basename of the path by looking for the last non-empty segment
21531
+ let filename
21532
+ for (let i = f.length - 1; i >= 0; i--) {
21533
+ filename = f[i]
21534
+ if (filename) break
21535
+ }
21536
+
21537
+ for (let i = 0; i < set.length; i++) {
21538
+ const pattern = set[i]
21539
+ let file = f
21540
+ if (options.matchBase && pattern.length === 1) {
21541
+ file = [filename]
21542
+ }
21543
+ const hit = this.matchOne(file, pattern, partial)
21544
+ if (hit) {
21545
+ if (options.flipNegate) return true
21546
+ return !this.negate
21547
+ }
21548
+ }
21549
+
21550
+ // didn't get any hits. this is success if it's a negative
21551
+ // pattern, failure otherwise.
21552
+ if (options.flipNegate) return false
21553
+ return this.negate
21554
+ }
21555
+
21556
+ static defaults (def) {
21557
+ return minimatch.defaults(def).Minimatch
21558
+ }
21559
+ }
21560
+
21561
+ minimatch.Minimatch = Minimatch
21562
+
21563
+
20458
21564
  /***/ }),
20459
21565
 
20460
21566
  /***/ 2231:
@@ -20463,18 +21569,15 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
20463
21569
  module.exports = globSync
20464
21570
  globSync.GlobSync = GlobSync
20465
21571
 
20466
- var fs = __webpack_require__(5747)
20467
21572
  var rp = __webpack_require__(8945)
20468
- var minimatch = __webpack_require__(9566)
21573
+ var minimatch = __webpack_require__(949)
20469
21574
  var Minimatch = minimatch.Minimatch
20470
21575
  var Glob = __webpack_require__(1104).Glob
20471
21576
  var util = __webpack_require__(1669)
20472
21577
  var path = __webpack_require__(5622)
20473
21578
  var assert = __webpack_require__(2357)
20474
- var isAbsolute = __webpack_require__(1323)
21579
+ var isAbsolute = __webpack_require__(5622).isAbsolute
20475
21580
  var common = __webpack_require__(9686)
20476
- var alphasort = common.alphasort
20477
- var alphasorti = common.alphasorti
20478
21581
  var setopts = common.setopts
20479
21582
  var ownProp = common.ownProp
20480
21583
  var childrenIgnored = common.childrenIgnored
@@ -20513,7 +21616,7 @@ function GlobSync (pattern, options) {
20513
21616
  }
20514
21617
 
20515
21618
  GlobSync.prototype._finish = function () {
20516
- assert(this instanceof GlobSync)
21619
+ assert.ok(this instanceof GlobSync)
20517
21620
  if (this.realpath) {
20518
21621
  var self = this
20519
21622
  this.matches.forEach(function (matchset, index) {
@@ -20537,7 +21640,7 @@ GlobSync.prototype._finish = function () {
20537
21640
 
20538
21641
 
20539
21642
  GlobSync.prototype._process = function (pattern, index, inGlobStar) {
20540
- assert(this instanceof GlobSync)
21643
+ assert.ok(this instanceof GlobSync)
20541
21644
 
20542
21645
  // Get the first [n] parts of pattern that are all strings.
20543
21646
  var n = 0
@@ -20574,7 +21677,10 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) {
20574
21677
  var read
20575
21678
  if (prefix === null)
20576
21679
  read = '.'
20577
- else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
21680
+ else if (isAbsolute(prefix) ||
21681
+ isAbsolute(pattern.map(function (p) {
21682
+ return typeof p === 'string' ? p : '[*]'
21683
+ }).join('/'))) {
20578
21684
  if (!prefix || !isAbsolute(prefix))
20579
21685
  prefix = '/' + prefix
20580
21686
  read = prefix
@@ -20710,7 +21816,7 @@ GlobSync.prototype._readdirInGlobStar = function (abs) {
20710
21816
  var lstat
20711
21817
  var stat
20712
21818
  try {
20713
- lstat = fs.lstatSync(abs)
21819
+ lstat = this.fs.lstatSync(abs)
20714
21820
  } catch (er) {
20715
21821
  if (er.code === 'ENOENT') {
20716
21822
  // lstat failed, doesn't exist
@@ -20747,7 +21853,7 @@ GlobSync.prototype._readdir = function (abs, inGlobStar) {
20747
21853
  }
20748
21854
 
20749
21855
  try {
20750
- return this._readdirEntries(abs, fs.readdirSync(abs))
21856
+ return this._readdirEntries(abs, this.fs.readdirSync(abs))
20751
21857
  } catch (er) {
20752
21858
  this._readdirError(abs, er)
20753
21859
  return null
@@ -20906,7 +22012,7 @@ GlobSync.prototype._stat = function (f) {
20906
22012
  if (!stat) {
20907
22013
  var lstat
20908
22014
  try {
20909
- lstat = fs.lstatSync(abs)
22015
+ lstat = this.fs.lstatSync(abs)
20910
22016
  } catch (er) {
20911
22017
  if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
20912
22018
  this.statCache[abs] = false
@@ -20916,7 +22022,7 @@ GlobSync.prototype._stat = function (f) {
20916
22022
 
20917
22023
  if (lstat && lstat.isSymbolicLink()) {
20918
22024
  try {
20919
- stat = fs.statSync(abs)
22025
+ stat = this.fs.statSync(abs)
20920
22026
  } catch (er) {
20921
22027
  stat = lstat
20922
22028
  }
@@ -32969,7 +34075,7 @@ async function detectBuilders(files, pkg, options = {}) {
32969
34075
  // and package.json can be served as static files
32970
34076
  frontendBuilder = {
32971
34077
  use: '@vercel/static',
32972
- src: '!{api/**,package.json}',
34078
+ src: '!{api/**,package.json,middleware.[jt]s}',
32973
34079
  config: {
32974
34080
  zeroConfig: true,
32975
34081
  },
@@ -33019,7 +34125,13 @@ async function detectBuilders(files, pkg, options = {}) {
33019
34125
  }
33020
34126
  exports.detectBuilders = detectBuilders;
33021
34127
  function maybeGetApiBuilder(fileName, apiMatches, options) {
33022
- if (!fileName.startsWith('api/')) {
34128
+ const middleware = fileName === 'middleware.js' || fileName === 'middleware.ts';
34129
+ // Root-level Middleware file is handled by `@vercel/next`, so don't
34130
+ // schedule a separate Builder when "nextjs" framework is selected
34131
+ if (middleware && options.projectSettings?.framework === 'nextjs') {
34132
+ return null;
34133
+ }
34134
+ if (!(fileName.startsWith('api/') || middleware)) {
33023
34135
  return null;
33024
34136
  }
33025
34137
  if (fileName.includes('/.')) {
@@ -33038,11 +34150,14 @@ function maybeGetApiBuilder(fileName, apiMatches, options) {
33038
34150
  return src === fileName || minimatch_1.default(fileName, src);
33039
34151
  });
33040
34152
  const { fnPattern, func } = getFunction(fileName, options);
33041
- const use = (func && func.runtime) || (match && match.use);
34153
+ const use = func?.runtime || match?.use;
33042
34154
  if (!use) {
33043
34155
  return null;
33044
34156
  }
33045
34157
  const config = { zeroConfig: true };
34158
+ if (middleware) {
34159
+ config.middleware = true;
34160
+ }
33046
34161
  if (fnPattern && func) {
33047
34162
  config.functions = { [fnPattern]: func };
33048
34163
  if (func.includeFiles) {
@@ -33072,6 +34187,7 @@ function getFunction(fileName, { functions = {} }) {
33072
34187
  function getApiMatches() {
33073
34188
  const config = { zeroConfig: true };
33074
34189
  return [
34190
+ { src: 'middleware.[jt]s', use: `@vercel/node`, config },
33075
34191
  { src: 'api/**/*.js', use: `@vercel/node`, config },
33076
34192
  { src: 'api/**/*.mjs', use: `@vercel/node`, config },
33077
34193
  { src: 'api/**/*.ts', use: `@vercel/node`, config },
@@ -34368,6 +35484,85 @@ async function download(files, basePath, meta) {
34368
35484
  exports.default = download;
34369
35485
 
34370
35486
 
35487
+ /***/ }),
35488
+
35489
+ /***/ 5706:
35490
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
35491
+
35492
+ "use strict";
35493
+
35494
+ var __importDefault = (this && this.__importDefault) || function (mod) {
35495
+ return (mod && mod.__esModule) ? mod : { "default": mod };
35496
+ };
35497
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
35498
+ exports.getGlobFs = void 0;
35499
+ const fs_1 = __importDefault(__webpack_require__(5747));
35500
+ function normalizePath(path) {
35501
+ // on windows, this will return a path like
35502
+ // D:/c/package.json
35503
+ // since we abstract the filesystem, we need to remove windows specific info from the path
35504
+ // and let the FS decide how to process the path
35505
+ // D:/c/package.json => /c/package.json
35506
+ return path.replace(/^[a-zA-Z]:/, '');
35507
+ }
35508
+ function getGlobFs(_fs) {
35509
+ const readdir = (path, callback) => {
35510
+ _fs
35511
+ .readdir(normalizePath(String(path)))
35512
+ .then(stats => callback(null, stats.map(stat => stat.name)))
35513
+ .catch(err => callback(err, []));
35514
+ };
35515
+ const stat = (path, callback) => {
35516
+ _fs
35517
+ .isFile(normalizePath(String(path)))
35518
+ .then(isPathAFile => {
35519
+ callback(null, {
35520
+ ino: 0,
35521
+ mode: 0,
35522
+ nlink: 0,
35523
+ uid: 0,
35524
+ gid: 0,
35525
+ rdev: 0,
35526
+ size: 0,
35527
+ blksize: 0,
35528
+ blocks: 0,
35529
+ atimeMs: 0,
35530
+ mtimeMs: 0,
35531
+ ctimeMs: 0,
35532
+ birthtimeMs: 0,
35533
+ atime: new Date(),
35534
+ mtime: new Date(),
35535
+ ctime: new Date(),
35536
+ birthtime: new Date(),
35537
+ dev: 0,
35538
+ isBlockDevice: () => false,
35539
+ isCharacterDevice: () => false,
35540
+ isDirectory: () => !isPathAFile,
35541
+ isFIFO: () => false,
35542
+ isFile: () => isPathAFile,
35543
+ isSocket: () => false,
35544
+ isSymbolicLink: () => false,
35545
+ });
35546
+ })
35547
+ .catch(err => callback(err, null));
35548
+ };
35549
+ return new Proxy(fs_1.default, {
35550
+ get(_target, prop) {
35551
+ switch (prop) {
35552
+ case 'readdir':
35553
+ return readdir;
35554
+ case 'lstat':
35555
+ case 'stat':
35556
+ return stat;
35557
+ default:
35558
+ throw new Error('Not Implemented');
35559
+ }
35560
+ },
35561
+ });
35562
+ }
35563
+ exports.getGlobFs = getGlobFs;
35564
+
35565
+
34371
35566
  /***/ }),
34372
35567
 
34373
35568
  /***/ 3838:
@@ -35197,6 +36392,53 @@ const getPlatformEnv = (name) => {
35197
36392
  exports.getPlatformEnv = getPlatformEnv;
35198
36393
 
35199
36394
 
36395
+ /***/ }),
36396
+
36397
+ /***/ 1886:
36398
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
36399
+
36400
+ "use strict";
36401
+
36402
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36403
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36404
+ };
36405
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
36406
+ exports.getProjectPaths = void 0;
36407
+ const detect_framework_1 = __webpack_require__(5224);
36408
+ const frameworks_1 = __importDefault(__webpack_require__(8438));
36409
+ const MAX_DEPTH_TRAVERSE = 3;
36410
+ const getProjectPaths = async ({ fs, path, skipPaths, depth = MAX_DEPTH_TRAVERSE, }) => {
36411
+ if (depth === 0)
36412
+ return [];
36413
+ const allPaths = [];
36414
+ const topPath = path ?? './';
36415
+ if (path && skipPaths?.includes(path)) {
36416
+ return allPaths;
36417
+ }
36418
+ const framework = await detect_framework_1.detectFramework({
36419
+ fs: fs.chdir(topPath),
36420
+ frameworkList: frameworks_1.default,
36421
+ });
36422
+ if (framework !== null)
36423
+ allPaths.push(topPath);
36424
+ if (depth > 1) {
36425
+ const directoryContents = await fs.readdir(topPath);
36426
+ const childDirectories = directoryContents.filter(stat => stat.type === 'dir' && !skipPaths?.includes(stat.path));
36427
+ const paths = (await Promise.all(childDirectories.map(({ path }) => {
36428
+ return exports.getProjectPaths({
36429
+ fs,
36430
+ path,
36431
+ depth: depth - 1,
36432
+ skipPaths,
36433
+ });
36434
+ }))).flat();
36435
+ return [...paths, ...allPaths];
36436
+ }
36437
+ return allPaths;
36438
+ };
36439
+ exports.getProjectPaths = getProjectPaths;
36440
+
36441
+
35200
36442
  /***/ }),
35201
36443
 
35202
36444
  /***/ 2855:
@@ -35230,8 +36472,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35230
36472
  return (mod && mod.__esModule) ? mod : { "default": mod };
35231
36473
  };
35232
36474
  Object.defineProperty(exports, "__esModule", ({ value: true }));
35233
- exports.workspaceManagers = exports.isStaticRuntime = exports.isOfficialRuntime = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.EdgeFunction = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.streamToBuffer = exports.getPlatformEnv = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.getEnvForPackageManager = exports.runCustomInstallCommand = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.execAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.download = exports.Prerender = exports.createLambda = exports.NodejsLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
35234
- exports.monorepoManagers = exports.getWorkspaces = void 0;
36475
+ exports.isStaticRuntime = exports.isOfficialRuntime = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.getProjectPaths = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.EdgeFunction = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.streamToBuffer = exports.getPlatformEnv = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.getEnvForPackageManager = exports.runCustomInstallCommand = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.execAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.download = exports.Prerender = exports.createLambda = exports.NodejsLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
36476
+ exports.monorepoManagers = exports.getWorkspacePackagePaths = exports.getWorkspaces = exports.workspaceManagers = void 0;
35235
36477
  const file_blob_1 = __importDefault(__webpack_require__(2397));
35236
36478
  exports.FileBlob = file_blob_1.default;
35237
36479
  const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
@@ -35296,6 +36538,8 @@ var detect_file_system_api_1 = __webpack_require__(1182);
35296
36538
  Object.defineProperty(exports, "detectFileSystemAPI", ({ enumerable: true, get: function () { return detect_file_system_api_1.detectFileSystemAPI; } }));
35297
36539
  var detect_framework_1 = __webpack_require__(5224);
35298
36540
  Object.defineProperty(exports, "detectFramework", ({ enumerable: true, get: function () { return detect_framework_1.detectFramework; } }));
36541
+ var get_project_paths_1 = __webpack_require__(1886);
36542
+ Object.defineProperty(exports, "getProjectPaths", ({ enumerable: true, get: function () { return get_project_paths_1.getProjectPaths; } }));
35299
36543
  var filesystem_1 = __webpack_require__(461);
35300
36544
  Object.defineProperty(exports, "DetectorFilesystem", ({ enumerable: true, get: function () { return filesystem_1.DetectorFilesystem; } }));
35301
36545
  var read_config_file_1 = __webpack_require__(7792);
@@ -35327,6 +36571,8 @@ var workspace_managers_1 = __webpack_require__(4896);
35327
36571
  Object.defineProperty(exports, "workspaceManagers", ({ enumerable: true, get: function () { return workspace_managers_1.workspaceManagers; } }));
35328
36572
  var get_workspaces_1 = __webpack_require__(9740);
35329
36573
  Object.defineProperty(exports, "getWorkspaces", ({ enumerable: true, get: function () { return get_workspaces_1.getWorkspaces; } }));
36574
+ var get_workspace_package_paths_1 = __webpack_require__(1953);
36575
+ Object.defineProperty(exports, "getWorkspacePackagePaths", ({ enumerable: true, get: function () { return get_workspace_package_paths_1.getWorkspacePackagePaths; } }));
35330
36576
  var monorepo_managers_1 = __webpack_require__(6418);
35331
36577
  Object.defineProperty(exports, "monorepoManagers", ({ enumerable: true, get: function () { return monorepo_managers_1.monorepoManagers; } }));
35332
36578
 
@@ -35691,6 +36937,76 @@ function hasProp(obj, key) {
35691
36937
  Object.defineProperty(exports, "__esModule", ({ value: true }));
35692
36938
 
35693
36939
 
36940
+ /***/ }),
36941
+
36942
+ /***/ 1953:
36943
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
36944
+
36945
+ "use strict";
36946
+
36947
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36948
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36949
+ };
36950
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
36951
+ exports.getWorkspacePackagePaths = void 0;
36952
+ const path_1 = __importDefault(__webpack_require__(5622));
36953
+ const js_yaml_1 = __importDefault(__webpack_require__(6540));
36954
+ const glob_1 = __importDefault(__webpack_require__(1104));
36955
+ const get_glob_fs_1 = __webpack_require__(5706);
36956
+ const normalize_path_1 = __webpack_require__(6261);
36957
+ const posixPath = path_1.default.posix;
36958
+ async function getWorkspacePackagePaths({ fs, workspace, }) {
36959
+ const { type, rootPath } = workspace;
36960
+ const workspaceFs = fs.chdir(rootPath);
36961
+ let results = [];
36962
+ switch (type) {
36963
+ case 'yarn':
36964
+ case 'npm':
36965
+ results = await getPackageJsonWorkspacePackagePaths({ fs: workspaceFs });
36966
+ break;
36967
+ case 'pnpm':
36968
+ results = await getPnpmWorkspacePackagePaths({ fs: workspaceFs });
36969
+ break;
36970
+ default:
36971
+ throw new Error(`Unknown workspace implementation: ${type}`);
36972
+ }
36973
+ return results.map(packagePath => {
36974
+ return posixPath.join(rootPath, posixPath.dirname(packagePath));
36975
+ });
36976
+ }
36977
+ exports.getWorkspacePackagePaths = getWorkspacePackagePaths;
36978
+ async function getPackagePaths(packages, fs) {
36979
+ return (await Promise.all(packages.map(packageGlob => new Promise((resolve, reject) => {
36980
+ glob_1.default(normalize_path_1.normalizePath(posixPath.join(packageGlob, 'package.json')), {
36981
+ cwd: '/',
36982
+ fs: get_glob_fs_1.getGlobFs(fs),
36983
+ }, (err, matches) => {
36984
+ if (err)
36985
+ reject(err);
36986
+ else
36987
+ resolve(matches);
36988
+ });
36989
+ })))).flat();
36990
+ }
36991
+ async function getPackageJsonWorkspacePackagePaths({ fs, }) {
36992
+ const packageJsonAsBuffer = await fs.readFile('package.json');
36993
+ const { workspaces } = JSON.parse(packageJsonAsBuffer.toString());
36994
+ let packages = [];
36995
+ if (Array.isArray(workspaces)) {
36996
+ packages = workspaces;
36997
+ }
36998
+ else {
36999
+ packages = workspaces?.packages ?? [];
37000
+ }
37001
+ return getPackagePaths(packages, fs);
37002
+ }
37003
+ async function getPnpmWorkspacePackagePaths({ fs, }) {
37004
+ const pnpmWorkspaceAsBuffer = await fs.readFile('pnpm-workspace.yaml');
37005
+ const { packages = [] } = js_yaml_1.default.load(pnpmWorkspaceAsBuffer.toString());
37006
+ return getPackagePaths(packages, fs);
37007
+ }
37008
+
37009
+
35694
37010
  /***/ }),
35695
37011
 
35696
37012
  /***/ 9740: