@vercel/static-build 1.3.21 → 1.3.23

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
@@ -3279,7 +3279,7 @@ exports.libFiles = libFiles;
3279
3279
 
3280
3280
  /***/ }),
3281
3281
 
3282
- /***/ 3016:
3282
+ /***/ 7356:
3283
3283
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3284
3284
 
3285
3285
  "use strict";
@@ -3288,7 +3288,7 @@ exports.libFiles = libFiles;
3288
3288
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3289
3289
 
3290
3290
  var ts = __webpack_require__(11);
3291
- var minimatch = __webpack_require__(7767);
3291
+ var minimatch = __webpack_require__(7345);
3292
3292
  var fastGlob = __webpack_require__(4910);
3293
3293
  var fs$1 = __webpack_require__(5747);
3294
3294
  var mkdirp = __webpack_require__(7981);
@@ -182179,6 +182179,979 @@ function patch (fs) {
182179
182179
  }
182180
182180
 
182181
182181
 
182182
+ /***/ }),
182183
+
182184
+ /***/ 3016:
182185
+ /***/ ((module) => {
182186
+
182187
+ "use strict";
182188
+
182189
+
182190
+ module.exports = clone
182191
+
182192
+ var getPrototypeOf = Object.getPrototypeOf || function (obj) {
182193
+ return obj.__proto__
182194
+ }
182195
+
182196
+ function clone (obj) {
182197
+ if (obj === null || typeof obj !== 'object')
182198
+ return obj
182199
+
182200
+ if (obj instanceof Object)
182201
+ var copy = { __proto__: getPrototypeOf(obj) }
182202
+ else
182203
+ var copy = Object.create(null)
182204
+
182205
+ Object.getOwnPropertyNames(obj).forEach(function (key) {
182206
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
182207
+ })
182208
+
182209
+ return copy
182210
+ }
182211
+
182212
+
182213
+ /***/ }),
182214
+
182215
+ /***/ 7156:
182216
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
182217
+
182218
+ var fs = __webpack_require__(5747)
182219
+ var polyfills = __webpack_require__(4692)
182220
+ var legacy = __webpack_require__(6465)
182221
+ var clone = __webpack_require__(3016)
182222
+
182223
+ var util = __webpack_require__(1669)
182224
+
182225
+ /* istanbul ignore next - node 0.x polyfill */
182226
+ var gracefulQueue
182227
+ var previousSymbol
182228
+
182229
+ /* istanbul ignore else - node 0.x polyfill */
182230
+ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
182231
+ gracefulQueue = Symbol.for('graceful-fs.queue')
182232
+ // This is used in testing by future versions
182233
+ previousSymbol = Symbol.for('graceful-fs.previous')
182234
+ } else {
182235
+ gracefulQueue = '___graceful-fs.queue'
182236
+ previousSymbol = '___graceful-fs.previous'
182237
+ }
182238
+
182239
+ function noop () {}
182240
+
182241
+ function publishQueue(context, queue) {
182242
+ Object.defineProperty(context, gracefulQueue, {
182243
+ get: function() {
182244
+ return queue
182245
+ }
182246
+ })
182247
+ }
182248
+
182249
+ var debug = noop
182250
+ if (util.debuglog)
182251
+ debug = util.debuglog('gfs4')
182252
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
182253
+ debug = function() {
182254
+ var m = util.format.apply(util, arguments)
182255
+ m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
182256
+ console.error(m)
182257
+ }
182258
+
182259
+ // Once time initialization
182260
+ if (!fs[gracefulQueue]) {
182261
+ // This queue can be shared by multiple loaded instances
182262
+ var queue = global[gracefulQueue] || []
182263
+ publishQueue(fs, queue)
182264
+
182265
+ // Patch fs.close/closeSync to shared queue version, because we need
182266
+ // to retry() whenever a close happens *anywhere* in the program.
182267
+ // This is essential when multiple graceful-fs instances are
182268
+ // in play at the same time.
182269
+ fs.close = (function (fs$close) {
182270
+ function close (fd, cb) {
182271
+ return fs$close.call(fs, fd, function (err) {
182272
+ // This function uses the graceful-fs shared queue
182273
+ if (!err) {
182274
+ resetQueue()
182275
+ }
182276
+
182277
+ if (typeof cb === 'function')
182278
+ cb.apply(this, arguments)
182279
+ })
182280
+ }
182281
+
182282
+ Object.defineProperty(close, previousSymbol, {
182283
+ value: fs$close
182284
+ })
182285
+ return close
182286
+ })(fs.close)
182287
+
182288
+ fs.closeSync = (function (fs$closeSync) {
182289
+ function closeSync (fd) {
182290
+ // This function uses the graceful-fs shared queue
182291
+ fs$closeSync.apply(fs, arguments)
182292
+ resetQueue()
182293
+ }
182294
+
182295
+ Object.defineProperty(closeSync, previousSymbol, {
182296
+ value: fs$closeSync
182297
+ })
182298
+ return closeSync
182299
+ })(fs.closeSync)
182300
+
182301
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
182302
+ process.on('exit', function() {
182303
+ debug(fs[gracefulQueue])
182304
+ __webpack_require__(2357).equal(fs[gracefulQueue].length, 0)
182305
+ })
182306
+ }
182307
+ }
182308
+
182309
+ if (!global[gracefulQueue]) {
182310
+ publishQueue(global, fs[gracefulQueue]);
182311
+ }
182312
+
182313
+ module.exports = patch(clone(fs))
182314
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
182315
+ module.exports = patch(fs)
182316
+ fs.__patched = true;
182317
+ }
182318
+
182319
+ function patch (fs) {
182320
+ // Everything that references the open() function needs to be in here
182321
+ polyfills(fs)
182322
+ fs.gracefulify = patch
182323
+
182324
+ fs.createReadStream = createReadStream
182325
+ fs.createWriteStream = createWriteStream
182326
+ var fs$readFile = fs.readFile
182327
+ fs.readFile = readFile
182328
+ function readFile (path, options, cb) {
182329
+ if (typeof options === 'function')
182330
+ cb = options, options = null
182331
+
182332
+ return go$readFile(path, options, cb)
182333
+
182334
+ function go$readFile (path, options, cb, startTime) {
182335
+ return fs$readFile(path, options, function (err) {
182336
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
182337
+ enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])
182338
+ else {
182339
+ if (typeof cb === 'function')
182340
+ cb.apply(this, arguments)
182341
+ }
182342
+ })
182343
+ }
182344
+ }
182345
+
182346
+ var fs$writeFile = fs.writeFile
182347
+ fs.writeFile = writeFile
182348
+ function writeFile (path, data, options, cb) {
182349
+ if (typeof options === 'function')
182350
+ cb = options, options = null
182351
+
182352
+ return go$writeFile(path, data, options, cb)
182353
+
182354
+ function go$writeFile (path, data, options, cb, startTime) {
182355
+ return fs$writeFile(path, data, options, function (err) {
182356
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
182357
+ enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
182358
+ else {
182359
+ if (typeof cb === 'function')
182360
+ cb.apply(this, arguments)
182361
+ }
182362
+ })
182363
+ }
182364
+ }
182365
+
182366
+ var fs$appendFile = fs.appendFile
182367
+ if (fs$appendFile)
182368
+ fs.appendFile = appendFile
182369
+ function appendFile (path, data, options, cb) {
182370
+ if (typeof options === 'function')
182371
+ cb = options, options = null
182372
+
182373
+ return go$appendFile(path, data, options, cb)
182374
+
182375
+ function go$appendFile (path, data, options, cb, startTime) {
182376
+ return fs$appendFile(path, data, options, function (err) {
182377
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
182378
+ enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
182379
+ else {
182380
+ if (typeof cb === 'function')
182381
+ cb.apply(this, arguments)
182382
+ }
182383
+ })
182384
+ }
182385
+ }
182386
+
182387
+ var fs$copyFile = fs.copyFile
182388
+ if (fs$copyFile)
182389
+ fs.copyFile = copyFile
182390
+ function copyFile (src, dest, flags, cb) {
182391
+ if (typeof flags === 'function') {
182392
+ cb = flags
182393
+ flags = 0
182394
+ }
182395
+ return go$copyFile(src, dest, flags, cb)
182396
+
182397
+ function go$copyFile (src, dest, flags, cb, startTime) {
182398
+ return fs$copyFile(src, dest, flags, function (err) {
182399
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
182400
+ enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])
182401
+ else {
182402
+ if (typeof cb === 'function')
182403
+ cb.apply(this, arguments)
182404
+ }
182405
+ })
182406
+ }
182407
+ }
182408
+
182409
+ var fs$readdir = fs.readdir
182410
+ fs.readdir = readdir
182411
+ var noReaddirOptionVersions = /^v[0-5]\./
182412
+ function readdir (path, options, cb) {
182413
+ if (typeof options === 'function')
182414
+ cb = options, options = null
182415
+
182416
+ var go$readdir = noReaddirOptionVersions.test(process.version)
182417
+ ? function go$readdir (path, options, cb, startTime) {
182418
+ return fs$readdir(path, fs$readdirCallback(
182419
+ path, options, cb, startTime
182420
+ ))
182421
+ }
182422
+ : function go$readdir (path, options, cb, startTime) {
182423
+ return fs$readdir(path, options, fs$readdirCallback(
182424
+ path, options, cb, startTime
182425
+ ))
182426
+ }
182427
+
182428
+ return go$readdir(path, options, cb)
182429
+
182430
+ function fs$readdirCallback (path, options, cb, startTime) {
182431
+ return function (err, files) {
182432
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
182433
+ enqueue([
182434
+ go$readdir,
182435
+ [path, options, cb],
182436
+ err,
182437
+ startTime || Date.now(),
182438
+ Date.now()
182439
+ ])
182440
+ else {
182441
+ if (files && files.sort)
182442
+ files.sort()
182443
+
182444
+ if (typeof cb === 'function')
182445
+ cb.call(this, err, files)
182446
+ }
182447
+ }
182448
+ }
182449
+ }
182450
+
182451
+ if (process.version.substr(0, 4) === 'v0.8') {
182452
+ var legStreams = legacy(fs)
182453
+ ReadStream = legStreams.ReadStream
182454
+ WriteStream = legStreams.WriteStream
182455
+ }
182456
+
182457
+ var fs$ReadStream = fs.ReadStream
182458
+ if (fs$ReadStream) {
182459
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype)
182460
+ ReadStream.prototype.open = ReadStream$open
182461
+ }
182462
+
182463
+ var fs$WriteStream = fs.WriteStream
182464
+ if (fs$WriteStream) {
182465
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype)
182466
+ WriteStream.prototype.open = WriteStream$open
182467
+ }
182468
+
182469
+ Object.defineProperty(fs, 'ReadStream', {
182470
+ get: function () {
182471
+ return ReadStream
182472
+ },
182473
+ set: function (val) {
182474
+ ReadStream = val
182475
+ },
182476
+ enumerable: true,
182477
+ configurable: true
182478
+ })
182479
+ Object.defineProperty(fs, 'WriteStream', {
182480
+ get: function () {
182481
+ return WriteStream
182482
+ },
182483
+ set: function (val) {
182484
+ WriteStream = val
182485
+ },
182486
+ enumerable: true,
182487
+ configurable: true
182488
+ })
182489
+
182490
+ // legacy names
182491
+ var FileReadStream = ReadStream
182492
+ Object.defineProperty(fs, 'FileReadStream', {
182493
+ get: function () {
182494
+ return FileReadStream
182495
+ },
182496
+ set: function (val) {
182497
+ FileReadStream = val
182498
+ },
182499
+ enumerable: true,
182500
+ configurable: true
182501
+ })
182502
+ var FileWriteStream = WriteStream
182503
+ Object.defineProperty(fs, 'FileWriteStream', {
182504
+ get: function () {
182505
+ return FileWriteStream
182506
+ },
182507
+ set: function (val) {
182508
+ FileWriteStream = val
182509
+ },
182510
+ enumerable: true,
182511
+ configurable: true
182512
+ })
182513
+
182514
+ function ReadStream (path, options) {
182515
+ if (this instanceof ReadStream)
182516
+ return fs$ReadStream.apply(this, arguments), this
182517
+ else
182518
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
182519
+ }
182520
+
182521
+ function ReadStream$open () {
182522
+ var that = this
182523
+ open(that.path, that.flags, that.mode, function (err, fd) {
182524
+ if (err) {
182525
+ if (that.autoClose)
182526
+ that.destroy()
182527
+
182528
+ that.emit('error', err)
182529
+ } else {
182530
+ that.fd = fd
182531
+ that.emit('open', fd)
182532
+ that.read()
182533
+ }
182534
+ })
182535
+ }
182536
+
182537
+ function WriteStream (path, options) {
182538
+ if (this instanceof WriteStream)
182539
+ return fs$WriteStream.apply(this, arguments), this
182540
+ else
182541
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
182542
+ }
182543
+
182544
+ function WriteStream$open () {
182545
+ var that = this
182546
+ open(that.path, that.flags, that.mode, function (err, fd) {
182547
+ if (err) {
182548
+ that.destroy()
182549
+ that.emit('error', err)
182550
+ } else {
182551
+ that.fd = fd
182552
+ that.emit('open', fd)
182553
+ }
182554
+ })
182555
+ }
182556
+
182557
+ function createReadStream (path, options) {
182558
+ return new fs.ReadStream(path, options)
182559
+ }
182560
+
182561
+ function createWriteStream (path, options) {
182562
+ return new fs.WriteStream(path, options)
182563
+ }
182564
+
182565
+ var fs$open = fs.open
182566
+ fs.open = open
182567
+ function open (path, flags, mode, cb) {
182568
+ if (typeof mode === 'function')
182569
+ cb = mode, mode = null
182570
+
182571
+ return go$open(path, flags, mode, cb)
182572
+
182573
+ function go$open (path, flags, mode, cb, startTime) {
182574
+ return fs$open(path, flags, mode, function (err, fd) {
182575
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
182576
+ enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])
182577
+ else {
182578
+ if (typeof cb === 'function')
182579
+ cb.apply(this, arguments)
182580
+ }
182581
+ })
182582
+ }
182583
+ }
182584
+
182585
+ return fs
182586
+ }
182587
+
182588
+ function enqueue (elem) {
182589
+ debug('ENQUEUE', elem[0].name, elem[1])
182590
+ fs[gracefulQueue].push(elem)
182591
+ retry()
182592
+ }
182593
+
182594
+ // keep track of the timeout between retry() calls
182595
+ var retryTimer
182596
+
182597
+ // reset the startTime and lastTime to now
182598
+ // this resets the start of the 60 second overall timeout as well as the
182599
+ // delay between attempts so that we'll retry these jobs sooner
182600
+ function resetQueue () {
182601
+ var now = Date.now()
182602
+ for (var i = 0; i < fs[gracefulQueue].length; ++i) {
182603
+ // entries that are only a length of 2 are from an older version, don't
182604
+ // bother modifying those since they'll be retried anyway.
182605
+ if (fs[gracefulQueue][i].length > 2) {
182606
+ fs[gracefulQueue][i][3] = now // startTime
182607
+ fs[gracefulQueue][i][4] = now // lastTime
182608
+ }
182609
+ }
182610
+ // call retry to make sure we're actively processing the queue
182611
+ retry()
182612
+ }
182613
+
182614
+ function retry () {
182615
+ // clear the timer and remove it to help prevent unintended concurrency
182616
+ clearTimeout(retryTimer)
182617
+ retryTimer = undefined
182618
+
182619
+ if (fs[gracefulQueue].length === 0)
182620
+ return
182621
+
182622
+ var elem = fs[gracefulQueue].shift()
182623
+ var fn = elem[0]
182624
+ var args = elem[1]
182625
+ // these items may be unset if they were added by an older graceful-fs
182626
+ var err = elem[2]
182627
+ var startTime = elem[3]
182628
+ var lastTime = elem[4]
182629
+
182630
+ // if we don't have a startTime we have no way of knowing if we've waited
182631
+ // long enough, so go ahead and retry this item now
182632
+ if (startTime === undefined) {
182633
+ debug('RETRY', fn.name, args)
182634
+ fn.apply(null, args)
182635
+ } else if (Date.now() - startTime >= 60000) {
182636
+ // it's been more than 60 seconds total, bail now
182637
+ debug('TIMEOUT', fn.name, args)
182638
+ var cb = args.pop()
182639
+ if (typeof cb === 'function')
182640
+ cb.call(null, err)
182641
+ } else {
182642
+ // the amount of time between the last attempt and right now
182643
+ var sinceAttempt = Date.now() - lastTime
182644
+ // the amount of time between when we first tried, and when we last tried
182645
+ // rounded up to at least 1
182646
+ var sinceStart = Math.max(lastTime - startTime, 1)
182647
+ // backoff. wait longer than the total time we've been retrying, but only
182648
+ // up to a maximum of 100ms
182649
+ var desiredDelay = Math.min(sinceStart * 1.2, 100)
182650
+ // it's been long enough since the last retry, do it again
182651
+ if (sinceAttempt >= desiredDelay) {
182652
+ debug('RETRY', fn.name, args)
182653
+ fn.apply(null, args.concat([startTime]))
182654
+ } else {
182655
+ // if we can't do this job yet, push it to the end of the queue
182656
+ // and let the next iteration check again
182657
+ fs[gracefulQueue].push(elem)
182658
+ }
182659
+ }
182660
+
182661
+ // schedule our next run if one isn't already scheduled
182662
+ if (retryTimer === undefined) {
182663
+ retryTimer = setTimeout(retry, 0)
182664
+ }
182665
+ }
182666
+
182667
+
182668
+ /***/ }),
182669
+
182670
+ /***/ 6465:
182671
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
182672
+
182673
+ var Stream = __webpack_require__(2413).Stream
182674
+
182675
+ module.exports = legacy
182676
+
182677
+ function legacy (fs) {
182678
+ return {
182679
+ ReadStream: ReadStream,
182680
+ WriteStream: WriteStream
182681
+ }
182682
+
182683
+ function ReadStream (path, options) {
182684
+ if (!(this instanceof ReadStream)) return new ReadStream(path, options);
182685
+
182686
+ Stream.call(this);
182687
+
182688
+ var self = this;
182689
+
182690
+ this.path = path;
182691
+ this.fd = null;
182692
+ this.readable = true;
182693
+ this.paused = false;
182694
+
182695
+ this.flags = 'r';
182696
+ this.mode = 438; /*=0666*/
182697
+ this.bufferSize = 64 * 1024;
182698
+
182699
+ options = options || {};
182700
+
182701
+ // Mixin options into this
182702
+ var keys = Object.keys(options);
182703
+ for (var index = 0, length = keys.length; index < length; index++) {
182704
+ var key = keys[index];
182705
+ this[key] = options[key];
182706
+ }
182707
+
182708
+ if (this.encoding) this.setEncoding(this.encoding);
182709
+
182710
+ if (this.start !== undefined) {
182711
+ if ('number' !== typeof this.start) {
182712
+ throw TypeError('start must be a Number');
182713
+ }
182714
+ if (this.end === undefined) {
182715
+ this.end = Infinity;
182716
+ } else if ('number' !== typeof this.end) {
182717
+ throw TypeError('end must be a Number');
182718
+ }
182719
+
182720
+ if (this.start > this.end) {
182721
+ throw new Error('start must be <= end');
182722
+ }
182723
+
182724
+ this.pos = this.start;
182725
+ }
182726
+
182727
+ if (this.fd !== null) {
182728
+ process.nextTick(function() {
182729
+ self._read();
182730
+ });
182731
+ return;
182732
+ }
182733
+
182734
+ fs.open(this.path, this.flags, this.mode, function (err, fd) {
182735
+ if (err) {
182736
+ self.emit('error', err);
182737
+ self.readable = false;
182738
+ return;
182739
+ }
182740
+
182741
+ self.fd = fd;
182742
+ self.emit('open', fd);
182743
+ self._read();
182744
+ })
182745
+ }
182746
+
182747
+ function WriteStream (path, options) {
182748
+ if (!(this instanceof WriteStream)) return new WriteStream(path, options);
182749
+
182750
+ Stream.call(this);
182751
+
182752
+ this.path = path;
182753
+ this.fd = null;
182754
+ this.writable = true;
182755
+
182756
+ this.flags = 'w';
182757
+ this.encoding = 'binary';
182758
+ this.mode = 438; /*=0666*/
182759
+ this.bytesWritten = 0;
182760
+
182761
+ options = options || {};
182762
+
182763
+ // Mixin options into this
182764
+ var keys = Object.keys(options);
182765
+ for (var index = 0, length = keys.length; index < length; index++) {
182766
+ var key = keys[index];
182767
+ this[key] = options[key];
182768
+ }
182769
+
182770
+ if (this.start !== undefined) {
182771
+ if ('number' !== typeof this.start) {
182772
+ throw TypeError('start must be a Number');
182773
+ }
182774
+ if (this.start < 0) {
182775
+ throw new Error('start must be >= zero');
182776
+ }
182777
+
182778
+ this.pos = this.start;
182779
+ }
182780
+
182781
+ this.busy = false;
182782
+ this._queue = [];
182783
+
182784
+ if (this.fd === null) {
182785
+ this._open = fs.open;
182786
+ this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
182787
+ this.flush();
182788
+ }
182789
+ }
182790
+ }
182791
+
182792
+
182793
+ /***/ }),
182794
+
182795
+ /***/ 4692:
182796
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
182797
+
182798
+ var constants = __webpack_require__(7619)
182799
+
182800
+ var origCwd = process.cwd
182801
+ var cwd = null
182802
+
182803
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
182804
+
182805
+ process.cwd = function() {
182806
+ if (!cwd)
182807
+ cwd = origCwd.call(process)
182808
+ return cwd
182809
+ }
182810
+ try {
182811
+ process.cwd()
182812
+ } catch (er) {}
182813
+
182814
+ // This check is needed until node.js 12 is required
182815
+ if (typeof process.chdir === 'function') {
182816
+ var chdir = process.chdir
182817
+ process.chdir = function (d) {
182818
+ cwd = null
182819
+ chdir.call(process, d)
182820
+ }
182821
+ if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)
182822
+ }
182823
+
182824
+ module.exports = patch
182825
+
182826
+ function patch (fs) {
182827
+ // (re-)implement some things that are known busted or missing.
182828
+
182829
+ // lchmod, broken prior to 0.6.2
182830
+ // back-port the fix here.
182831
+ if (constants.hasOwnProperty('O_SYMLINK') &&
182832
+ process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
182833
+ patchLchmod(fs)
182834
+ }
182835
+
182836
+ // lutimes implementation, or no-op
182837
+ if (!fs.lutimes) {
182838
+ patchLutimes(fs)
182839
+ }
182840
+
182841
+ // https://github.com/isaacs/node-graceful-fs/issues/4
182842
+ // Chown should not fail on einval or eperm if non-root.
182843
+ // It should not fail on enosys ever, as this just indicates
182844
+ // that a fs doesn't support the intended operation.
182845
+
182846
+ fs.chown = chownFix(fs.chown)
182847
+ fs.fchown = chownFix(fs.fchown)
182848
+ fs.lchown = chownFix(fs.lchown)
182849
+
182850
+ fs.chmod = chmodFix(fs.chmod)
182851
+ fs.fchmod = chmodFix(fs.fchmod)
182852
+ fs.lchmod = chmodFix(fs.lchmod)
182853
+
182854
+ fs.chownSync = chownFixSync(fs.chownSync)
182855
+ fs.fchownSync = chownFixSync(fs.fchownSync)
182856
+ fs.lchownSync = chownFixSync(fs.lchownSync)
182857
+
182858
+ fs.chmodSync = chmodFixSync(fs.chmodSync)
182859
+ fs.fchmodSync = chmodFixSync(fs.fchmodSync)
182860
+ fs.lchmodSync = chmodFixSync(fs.lchmodSync)
182861
+
182862
+ fs.stat = statFix(fs.stat)
182863
+ fs.fstat = statFix(fs.fstat)
182864
+ fs.lstat = statFix(fs.lstat)
182865
+
182866
+ fs.statSync = statFixSync(fs.statSync)
182867
+ fs.fstatSync = statFixSync(fs.fstatSync)
182868
+ fs.lstatSync = statFixSync(fs.lstatSync)
182869
+
182870
+ // if lchmod/lchown do not exist, then make them no-ops
182871
+ if (fs.chmod && !fs.lchmod) {
182872
+ fs.lchmod = function (path, mode, cb) {
182873
+ if (cb) process.nextTick(cb)
182874
+ }
182875
+ fs.lchmodSync = function () {}
182876
+ }
182877
+ if (fs.chown && !fs.lchown) {
182878
+ fs.lchown = function (path, uid, gid, cb) {
182879
+ if (cb) process.nextTick(cb)
182880
+ }
182881
+ fs.lchownSync = function () {}
182882
+ }
182883
+
182884
+ // on Windows, A/V software can lock the directory, causing this
182885
+ // to fail with an EACCES or EPERM if the directory contains newly
182886
+ // created files. Try again on failure, for up to 60 seconds.
182887
+
182888
+ // Set the timeout this long because some Windows Anti-Virus, such as Parity
182889
+ // bit9, may lock files for up to a minute, causing npm package install
182890
+ // failures. Also, take care to yield the scheduler. Windows scheduling gives
182891
+ // CPU to a busy looping process, which can cause the program causing the lock
182892
+ // contention to be starved of CPU by node, so the contention doesn't resolve.
182893
+ if (platform === "win32") {
182894
+ fs.rename = typeof fs.rename !== 'function' ? fs.rename
182895
+ : (function (fs$rename) {
182896
+ function rename (from, to, cb) {
182897
+ var start = Date.now()
182898
+ var backoff = 0;
182899
+ fs$rename(from, to, function CB (er) {
182900
+ if (er
182901
+ && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY")
182902
+ && Date.now() - start < 60000) {
182903
+ setTimeout(function() {
182904
+ fs.stat(to, function (stater, st) {
182905
+ if (stater && stater.code === "ENOENT")
182906
+ fs$rename(from, to, CB);
182907
+ else
182908
+ cb(er)
182909
+ })
182910
+ }, backoff)
182911
+ if (backoff < 100)
182912
+ backoff += 10;
182913
+ return;
182914
+ }
182915
+ if (cb) cb(er)
182916
+ })
182917
+ }
182918
+ if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)
182919
+ return rename
182920
+ })(fs.rename)
182921
+ }
182922
+
182923
+ // if read() returns EAGAIN, then just try it again.
182924
+ fs.read = typeof fs.read !== 'function' ? fs.read
182925
+ : (function (fs$read) {
182926
+ function read (fd, buffer, offset, length, position, callback_) {
182927
+ var callback
182928
+ if (callback_ && typeof callback_ === 'function') {
182929
+ var eagCounter = 0
182930
+ callback = function (er, _, __) {
182931
+ if (er && er.code === 'EAGAIN' && eagCounter < 10) {
182932
+ eagCounter ++
182933
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback)
182934
+ }
182935
+ callback_.apply(this, arguments)
182936
+ }
182937
+ }
182938
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback)
182939
+ }
182940
+
182941
+ // This ensures `util.promisify` works as it does for native `fs.read`.
182942
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
182943
+ return read
182944
+ })(fs.read)
182945
+
182946
+ fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync
182947
+ : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
182948
+ var eagCounter = 0
182949
+ while (true) {
182950
+ try {
182951
+ return fs$readSync.call(fs, fd, buffer, offset, length, position)
182952
+ } catch (er) {
182953
+ if (er.code === 'EAGAIN' && eagCounter < 10) {
182954
+ eagCounter ++
182955
+ continue
182956
+ }
182957
+ throw er
182958
+ }
182959
+ }
182960
+ }})(fs.readSync)
182961
+
182962
+ function patchLchmod (fs) {
182963
+ fs.lchmod = function (path, mode, callback) {
182964
+ fs.open( path
182965
+ , constants.O_WRONLY | constants.O_SYMLINK
182966
+ , mode
182967
+ , function (err, fd) {
182968
+ if (err) {
182969
+ if (callback) callback(err)
182970
+ return
182971
+ }
182972
+ // prefer to return the chmod error, if one occurs,
182973
+ // but still try to close, and report closing errors if they occur.
182974
+ fs.fchmod(fd, mode, function (err) {
182975
+ fs.close(fd, function(err2) {
182976
+ if (callback) callback(err || err2)
182977
+ })
182978
+ })
182979
+ })
182980
+ }
182981
+
182982
+ fs.lchmodSync = function (path, mode) {
182983
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
182984
+
182985
+ // prefer to return the chmod error, if one occurs,
182986
+ // but still try to close, and report closing errors if they occur.
182987
+ var threw = true
182988
+ var ret
182989
+ try {
182990
+ ret = fs.fchmodSync(fd, mode)
182991
+ threw = false
182992
+ } finally {
182993
+ if (threw) {
182994
+ try {
182995
+ fs.closeSync(fd)
182996
+ } catch (er) {}
182997
+ } else {
182998
+ fs.closeSync(fd)
182999
+ }
183000
+ }
183001
+ return ret
183002
+ }
183003
+ }
183004
+
183005
+ function patchLutimes (fs) {
183006
+ if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
183007
+ fs.lutimes = function (path, at, mt, cb) {
183008
+ fs.open(path, constants.O_SYMLINK, function (er, fd) {
183009
+ if (er) {
183010
+ if (cb) cb(er)
183011
+ return
183012
+ }
183013
+ fs.futimes(fd, at, mt, function (er) {
183014
+ fs.close(fd, function (er2) {
183015
+ if (cb) cb(er || er2)
183016
+ })
183017
+ })
183018
+ })
183019
+ }
183020
+
183021
+ fs.lutimesSync = function (path, at, mt) {
183022
+ var fd = fs.openSync(path, constants.O_SYMLINK)
183023
+ var ret
183024
+ var threw = true
183025
+ try {
183026
+ ret = fs.futimesSync(fd, at, mt)
183027
+ threw = false
183028
+ } finally {
183029
+ if (threw) {
183030
+ try {
183031
+ fs.closeSync(fd)
183032
+ } catch (er) {}
183033
+ } else {
183034
+ fs.closeSync(fd)
183035
+ }
183036
+ }
183037
+ return ret
183038
+ }
183039
+
183040
+ } else if (fs.futimes) {
183041
+ fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
183042
+ fs.lutimesSync = function () {}
183043
+ }
183044
+ }
183045
+
183046
+ function chmodFix (orig) {
183047
+ if (!orig) return orig
183048
+ return function (target, mode, cb) {
183049
+ return orig.call(fs, target, mode, function (er) {
183050
+ if (chownErOk(er)) er = null
183051
+ if (cb) cb.apply(this, arguments)
183052
+ })
183053
+ }
183054
+ }
183055
+
183056
+ function chmodFixSync (orig) {
183057
+ if (!orig) return orig
183058
+ return function (target, mode) {
183059
+ try {
183060
+ return orig.call(fs, target, mode)
183061
+ } catch (er) {
183062
+ if (!chownErOk(er)) throw er
183063
+ }
183064
+ }
183065
+ }
183066
+
183067
+
183068
+ function chownFix (orig) {
183069
+ if (!orig) return orig
183070
+ return function (target, uid, gid, cb) {
183071
+ return orig.call(fs, target, uid, gid, function (er) {
183072
+ if (chownErOk(er)) er = null
183073
+ if (cb) cb.apply(this, arguments)
183074
+ })
183075
+ }
183076
+ }
183077
+
183078
+ function chownFixSync (orig) {
183079
+ if (!orig) return orig
183080
+ return function (target, uid, gid) {
183081
+ try {
183082
+ return orig.call(fs, target, uid, gid)
183083
+ } catch (er) {
183084
+ if (!chownErOk(er)) throw er
183085
+ }
183086
+ }
183087
+ }
183088
+
183089
+ function statFix (orig) {
183090
+ if (!orig) return orig
183091
+ // Older versions of Node erroneously returned signed integers for
183092
+ // uid + gid.
183093
+ return function (target, options, cb) {
183094
+ if (typeof options === 'function') {
183095
+ cb = options
183096
+ options = null
183097
+ }
183098
+ function callback (er, stats) {
183099
+ if (stats) {
183100
+ if (stats.uid < 0) stats.uid += 0x100000000
183101
+ if (stats.gid < 0) stats.gid += 0x100000000
183102
+ }
183103
+ if (cb) cb.apply(this, arguments)
183104
+ }
183105
+ return options ? orig.call(fs, target, options, callback)
183106
+ : orig.call(fs, target, callback)
183107
+ }
183108
+ }
183109
+
183110
+ function statFixSync (orig) {
183111
+ if (!orig) return orig
183112
+ // Older versions of Node erroneously returned signed integers for
183113
+ // uid + gid.
183114
+ return function (target, options) {
183115
+ var stats = options ? orig.call(fs, target, options)
183116
+ : orig.call(fs, target)
183117
+ if (stats) {
183118
+ if (stats.uid < 0) stats.uid += 0x100000000
183119
+ if (stats.gid < 0) stats.gid += 0x100000000
183120
+ }
183121
+ return stats;
183122
+ }
183123
+ }
183124
+
183125
+ // ENOSYS means that the fs doesn't support the op. Just ignore
183126
+ // that, because it doesn't matter.
183127
+ //
183128
+ // if there's no getuid, or if getuid() is something other
183129
+ // than 0, and the error is EINVAL or EPERM, then just ignore
183130
+ // it.
183131
+ //
183132
+ // This specific case is a silent failure in cp, install, tar,
183133
+ // and most other unix tools that manage permissions.
183134
+ //
183135
+ // When running as root, or if other types of errors are
183136
+ // encountered, then it's strict.
183137
+ function chownErOk (er) {
183138
+ if (!er)
183139
+ return true
183140
+
183141
+ if (er.code === "ENOSYS")
183142
+ return true
183143
+
183144
+ var nonroot = !process.getuid || process.getuid() !== 0
183145
+ if (nonroot) {
183146
+ if (er.code === "EINVAL" || er.code === "EPERM")
183147
+ return true
183148
+ }
183149
+
183150
+ return false
183151
+ }
183152
+ }
183153
+
183154
+
182182
183155
  /***/ }),
182183
183156
 
182184
183157
  /***/ 8675:
@@ -195286,7 +196259,7 @@ module.exports = {
195286
196259
 
195287
196260
  let _fs
195288
196261
  try {
195289
- _fs = __webpack_require__(1317)
196262
+ _fs = __webpack_require__(7156)
195290
196263
  } catch (_) {
195291
196264
  _fs = __webpack_require__(5747)
195292
196265
  }
@@ -196366,16 +197339,16 @@ module.exports = micromatch;
196366
197339
 
196367
197340
  /***/ }),
196368
197341
 
196369
- /***/ 7767:
197342
+ /***/ 7345:
196370
197343
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
196371
197344
 
196372
197345
  module.exports = minimatch
196373
197346
  minimatch.Minimatch = Minimatch
196374
197347
 
196375
- var path = { sep: '/' }
196376
- try {
196377
- path = __webpack_require__(5622)
196378
- } catch (er) {}
197348
+ var path = (function () { try { return __webpack_require__(5622) } catch (e) {}}()) || {
197349
+ sep: '/'
197350
+ }
197351
+ minimatch.sep = path.sep
196379
197352
 
196380
197353
  var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
196381
197354
  var expand = __webpack_require__(490)
@@ -196427,43 +197400,64 @@ function filter (pattern, options) {
196427
197400
  }
196428
197401
 
196429
197402
  function ext (a, b) {
196430
- a = a || {}
196431
197403
  b = b || {}
196432
197404
  var t = {}
196433
- Object.keys(b).forEach(function (k) {
196434
- t[k] = b[k]
196435
- })
196436
197405
  Object.keys(a).forEach(function (k) {
196437
197406
  t[k] = a[k]
196438
197407
  })
197408
+ Object.keys(b).forEach(function (k) {
197409
+ t[k] = b[k]
197410
+ })
196439
197411
  return t
196440
197412
  }
196441
197413
 
196442
197414
  minimatch.defaults = function (def) {
196443
- if (!def || !Object.keys(def).length) return minimatch
197415
+ if (!def || typeof def !== 'object' || !Object.keys(def).length) {
197416
+ return minimatch
197417
+ }
196444
197418
 
196445
197419
  var orig = minimatch
196446
197420
 
196447
197421
  var m = function minimatch (p, pattern, options) {
196448
- return orig.minimatch(p, pattern, ext(def, options))
197422
+ return orig(p, pattern, ext(def, options))
196449
197423
  }
196450
197424
 
196451
197425
  m.Minimatch = function Minimatch (pattern, options) {
196452
197426
  return new orig.Minimatch(pattern, ext(def, options))
196453
197427
  }
197428
+ m.Minimatch.defaults = function defaults (options) {
197429
+ return orig.defaults(ext(def, options)).Minimatch
197430
+ }
197431
+
197432
+ m.filter = function filter (pattern, options) {
197433
+ return orig.filter(pattern, ext(def, options))
197434
+ }
197435
+
197436
+ m.defaults = function defaults (options) {
197437
+ return orig.defaults(ext(def, options))
197438
+ }
197439
+
197440
+ m.makeRe = function makeRe (pattern, options) {
197441
+ return orig.makeRe(pattern, ext(def, options))
197442
+ }
197443
+
197444
+ m.braceExpand = function braceExpand (pattern, options) {
197445
+ return orig.braceExpand(pattern, ext(def, options))
197446
+ }
197447
+
197448
+ m.match = function (list, pattern, options) {
197449
+ return orig.match(list, pattern, ext(def, options))
197450
+ }
196454
197451
 
196455
197452
  return m
196456
197453
  }
196457
197454
 
196458
197455
  Minimatch.defaults = function (def) {
196459
- if (!def || !Object.keys(def).length) return Minimatch
196460
197456
  return minimatch.defaults(def).Minimatch
196461
197457
  }
196462
197458
 
196463
197459
  function minimatch (p, pattern, options) {
196464
- if (typeof pattern !== 'string') {
196465
- throw new TypeError('glob pattern string required')
196466
- }
197460
+ assertValidPattern(pattern)
196467
197461
 
196468
197462
  if (!options) options = {}
196469
197463
 
@@ -196472,9 +197466,6 @@ function minimatch (p, pattern, options) {
196472
197466
  return false
196473
197467
  }
196474
197468
 
196475
- // "" only matches ""
196476
- if (pattern.trim() === '') return p === ''
196477
-
196478
197469
  return new Minimatch(pattern, options).match(p)
196479
197470
  }
196480
197471
 
@@ -196483,15 +197474,14 @@ function Minimatch (pattern, options) {
196483
197474
  return new Minimatch(pattern, options)
196484
197475
  }
196485
197476
 
196486
- if (typeof pattern !== 'string') {
196487
- throw new TypeError('glob pattern string required')
196488
- }
197477
+ assertValidPattern(pattern)
196489
197478
 
196490
197479
  if (!options) options = {}
197480
+
196491
197481
  pattern = pattern.trim()
196492
197482
 
196493
197483
  // windows support: need to use /, not \
196494
- if (path.sep !== '/') {
197484
+ if (!options.allowWindowsEscape && path.sep !== '/') {
196495
197485
  pattern = pattern.split(path.sep).join('/')
196496
197486
  }
196497
197487
 
@@ -196502,6 +197492,7 @@ function Minimatch (pattern, options) {
196502
197492
  this.negate = false
196503
197493
  this.comment = false
196504
197494
  this.empty = false
197495
+ this.partial = !!options.partial
196505
197496
 
196506
197497
  // make the set of regexps etc.
196507
197498
  this.make()
@@ -196511,9 +197502,6 @@ Minimatch.prototype.debug = function () {}
196511
197502
 
196512
197503
  Minimatch.prototype.make = make
196513
197504
  function make () {
196514
- // don't do it more than once.
196515
- if (this._made) return
196516
-
196517
197505
  var pattern = this.pattern
196518
197506
  var options = this.options
196519
197507
 
@@ -196533,7 +197521,7 @@ function make () {
196533
197521
  // step 2: expand braces
196534
197522
  var set = this.globSet = this.braceExpand()
196535
197523
 
196536
- if (options.debug) this.debug = console.error
197524
+ if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) }
196537
197525
 
196538
197526
  this.debug(this.pattern, set)
196539
197527
 
@@ -196613,12 +197601,11 @@ function braceExpand (pattern, options) {
196613
197601
  pattern = typeof pattern === 'undefined'
196614
197602
  ? this.pattern : pattern
196615
197603
 
196616
- if (typeof pattern === 'undefined') {
196617
- throw new TypeError('undefined pattern')
196618
- }
197604
+ assertValidPattern(pattern)
196619
197605
 
196620
- if (options.nobrace ||
196621
- !pattern.match(/\{.*\}/)) {
197606
+ // Thanks to Yeting Li <https://github.com/yetingli> for
197607
+ // improving this regexp to avoid a ReDOS vulnerability.
197608
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
196622
197609
  // shortcut. no need to expand.
196623
197610
  return [pattern]
196624
197611
  }
@@ -196626,6 +197613,17 @@ function braceExpand (pattern, options) {
196626
197613
  return expand(pattern)
196627
197614
  }
196628
197615
 
197616
+ var MAX_PATTERN_LENGTH = 1024 * 64
197617
+ var assertValidPattern = function (pattern) {
197618
+ if (typeof pattern !== 'string') {
197619
+ throw new TypeError('invalid pattern')
197620
+ }
197621
+
197622
+ if (pattern.length > MAX_PATTERN_LENGTH) {
197623
+ throw new TypeError('pattern is too long')
197624
+ }
197625
+ }
197626
+
196629
197627
  // parse a component of the expanded set.
196630
197628
  // At this point, no pattern may contain "/" in it
196631
197629
  // so we're going to return a 2d array, where each entry is the full
@@ -196640,14 +197638,17 @@ function braceExpand (pattern, options) {
196640
197638
  Minimatch.prototype.parse = parse
196641
197639
  var SUBPARSE = {}
196642
197640
  function parse (pattern, isSub) {
196643
- if (pattern.length > 1024 * 64) {
196644
- throw new TypeError('pattern is too long')
196645
- }
197641
+ assertValidPattern(pattern)
196646
197642
 
196647
197643
  var options = this.options
196648
197644
 
196649
197645
  // shortcuts
196650
- if (!options.noglobstar && pattern === '**') return GLOBSTAR
197646
+ if (pattern === '**') {
197647
+ if (!options.noglobstar)
197648
+ return GLOBSTAR
197649
+ else
197650
+ pattern = '*'
197651
+ }
196651
197652
  if (pattern === '') return ''
196652
197653
 
196653
197654
  var re = ''
@@ -196703,10 +197704,12 @@ function parse (pattern, isSub) {
196703
197704
  }
196704
197705
 
196705
197706
  switch (c) {
196706
- case '/':
197707
+ /* istanbul ignore next */
197708
+ case '/': {
196707
197709
  // completely not allowed, even escaped.
196708
197710
  // Should already be path-split by now.
196709
197711
  return false
197712
+ }
196710
197713
 
196711
197714
  case '\\':
196712
197715
  clearStateChar()
@@ -196825,25 +197828,23 @@ function parse (pattern, isSub) {
196825
197828
 
196826
197829
  // handle the case where we left a class open.
196827
197830
  // "[z-a]" is valid, equivalent to "\[z-a\]"
196828
- if (inClass) {
196829
- // split where the last [ was, make sure we don't have
196830
- // an invalid re. if so, re-walk the contents of the
196831
- // would-be class to re-translate any characters that
196832
- // were passed through as-is
196833
- // TODO: It would probably be faster to determine this
196834
- // without a try/catch and a new RegExp, but it's tricky
196835
- // to do safely. For now, this is safe and works.
196836
- var cs = pattern.substring(classStart + 1, i)
196837
- try {
196838
- RegExp('[' + cs + ']')
196839
- } catch (er) {
196840
- // not a valid class!
196841
- var sp = this.parse(cs, SUBPARSE)
196842
- re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
196843
- hasMagic = hasMagic || sp[1]
196844
- inClass = false
196845
- continue
196846
- }
197831
+ // split where the last [ was, make sure we don't have
197832
+ // an invalid re. if so, re-walk the contents of the
197833
+ // would-be class to re-translate any characters that
197834
+ // were passed through as-is
197835
+ // TODO: It would probably be faster to determine this
197836
+ // without a try/catch and a new RegExp, but it's tricky
197837
+ // to do safely. For now, this is safe and works.
197838
+ var cs = pattern.substring(classStart + 1, i)
197839
+ try {
197840
+ RegExp('[' + cs + ']')
197841
+ } catch (er) {
197842
+ // not a valid class!
197843
+ var sp = this.parse(cs, SUBPARSE)
197844
+ re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
197845
+ hasMagic = hasMagic || sp[1]
197846
+ inClass = false
197847
+ continue
196847
197848
  }
196848
197849
 
196849
197850
  // finish up the class.
@@ -196927,9 +197928,7 @@ function parse (pattern, isSub) {
196927
197928
  // something that could conceivably capture a dot
196928
197929
  var addPatternStart = false
196929
197930
  switch (re.charAt(0)) {
196930
- case '.':
196931
- case '[':
196932
- case '(': addPatternStart = true
197931
+ case '[': case '.': case '(': addPatternStart = true
196933
197932
  }
196934
197933
 
196935
197934
  // Hack to work around lack of negative lookbehind in JS
@@ -196991,7 +197990,7 @@ function parse (pattern, isSub) {
196991
197990
  var flags = options.nocase ? 'i' : ''
196992
197991
  try {
196993
197992
  var regExp = new RegExp('^' + re + '$', flags)
196994
- } catch (er) {
197993
+ } catch (er) /* istanbul ignore next - should be impossible */ {
196995
197994
  // If it was an invalid regular expression, then it can't match
196996
197995
  // anything. This trick looks for a character after the end of
196997
197996
  // the string, which is of course impossible, except in multi-line
@@ -197049,7 +198048,7 @@ function makeRe () {
197049
198048
 
197050
198049
  try {
197051
198050
  this.regexp = new RegExp(re, flags)
197052
- } catch (ex) {
198051
+ } catch (ex) /* istanbul ignore next - should be impossible */ {
197053
198052
  this.regexp = false
197054
198053
  }
197055
198054
  return this.regexp
@@ -197067,8 +198066,8 @@ minimatch.match = function (list, pattern, options) {
197067
198066
  return list
197068
198067
  }
197069
198068
 
197070
- Minimatch.prototype.match = match
197071
- function match (f, partial) {
198069
+ Minimatch.prototype.match = function match (f, partial) {
198070
+ if (typeof partial === 'undefined') partial = this.partial
197072
198071
  this.debug('match', f, this.pattern)
197073
198072
  // short-circuit in the case of busted things.
197074
198073
  // comments, etc.
@@ -197150,6 +198149,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
197150
198149
 
197151
198150
  // should be impossible.
197152
198151
  // some invalid regexp stuff in the set.
198152
+ /* istanbul ignore if */
197153
198153
  if (p === false) return false
197154
198154
 
197155
198155
  if (p === GLOBSTAR) {
@@ -197223,6 +198223,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
197223
198223
  // no match was found.
197224
198224
  // However, in partial mode, we can't say this is necessarily over.
197225
198225
  // If there's more *pattern* left, then
198226
+ /* istanbul ignore if */
197226
198227
  if (partial) {
197227
198228
  // ran out of file
197228
198229
  this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
@@ -197236,11 +198237,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
197236
198237
  // patterns with magic have been turned into regexps.
197237
198238
  var hit
197238
198239
  if (typeof p === 'string') {
197239
- if (options.nocase) {
197240
- hit = f.toLowerCase() === p.toLowerCase()
197241
- } else {
197242
- hit = f === p
197243
- }
198240
+ hit = f === p
197244
198241
  this.debug('string match', p, f, hit)
197245
198242
  } else {
197246
198243
  hit = f.match(p)
@@ -197271,16 +198268,16 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
197271
198268
  // this is ok if we're doing the match as part of
197272
198269
  // a glob fs traversal.
197273
198270
  return partial
197274
- } else if (pi === pl) {
198271
+ } else /* istanbul ignore else */ if (pi === pl) {
197275
198272
  // ran out of pattern, still have file left.
197276
198273
  // this is only acceptable if we're on the very last
197277
198274
  // empty segment of a file with a trailing slash.
197278
198275
  // a/* should match a/b/
197279
- var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
197280
- return emptyFileEnd
198276
+ return (fi === fl - 1) && (file[fi] === '')
197281
198277
  }
197282
198278
 
197283
198279
  // should be unreachable.
198280
+ /* istanbul ignore next */
197284
198281
  throw new Error('wtf?')
197285
198282
  }
197286
198283
 
@@ -211687,7 +212684,7 @@ function buildProcessTree (parentPid, tree, pidsToProcess, spawnChildProcessesLi
211687
212684
 
211688
212685
  Object.defineProperty(exports, "__esModule", ({ value: true }));
211689
212686
 
211690
- var common = __webpack_require__(3016);
212687
+ var common = __webpack_require__(7356);
211691
212688
  var CodeBlockWriter = __webpack_require__(8933);
211692
212689
 
211693
212690
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -238273,7 +239270,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
238273
239270
  };
238274
239271
  Object.defineProperty(exports, "__esModule", ({ value: true }));
238275
239272
  exports.detectBuilders = exports.detectOutputDirectory = exports.detectApiDirectory = exports.detectApiExtensions = exports.sortFiles = void 0;
238276
- const minimatch_1 = __importDefault(__webpack_require__(7767));
239273
+ const minimatch_1 = __importDefault(__webpack_require__(7345));
238277
239274
  const semver_1 = __webpack_require__(1039);
238278
239275
  const path_1 = __webpack_require__(5622);
238279
239276
  const frameworks_1 = __importDefault(__webpack_require__(6678));
@@ -239730,6 +240727,7 @@ const monorepo_managers_1 = __webpack_require__(3315);
239730
240727
  const package_managers_1 = __webpack_require__(4501);
239731
240728
  const detect_framework_1 = __webpack_require__(7244);
239732
240729
  const json5_1 = __importDefault(__webpack_require__(3406));
240730
+ const semver_1 = __importDefault(__webpack_require__(1039));
239733
240731
  class MissingBuildPipeline extends Error {
239734
240732
  constructor() {
239735
240733
  super('Missing required `build` pipeline in turbo.json or package.json Turbo configuration.');
@@ -239742,6 +240740,15 @@ class MissingBuildTarget extends Error {
239742
240740
  }
239743
240741
  }
239744
240742
  exports.MissingBuildTarget = MissingBuildTarget;
240743
+ function supportsRootCommand(turboSemVer) {
240744
+ if (!turboSemVer) {
240745
+ return false;
240746
+ }
240747
+ if (!semver_1.default.validRange(turboSemVer)) {
240748
+ return false;
240749
+ }
240750
+ return !semver_1.default.intersects(turboSemVer, '<1.8.0');
240751
+ }
239745
240752
  async function getMonorepoDefaultSettings(projectName, projectPath, relativeToRoot, detectorFilesystem) {
239746
240753
  const [monorepoManager, packageManager] = await Promise.all([
239747
240754
  detect_framework_1.detectFramework({
@@ -239759,17 +240766,22 @@ async function getMonorepoDefaultSettings(projectName, projectPath, relativeToRo
239759
240766
  detectorFilesystem.readFile('package.json').catch(() => null),
239760
240767
  ]);
239761
240768
  let hasBuildPipeline = false;
240769
+ let turboSemVer = null;
239762
240770
  if (turboJSONBuf !== null) {
239763
240771
  const turboJSON = json5_1.default.parse(turboJSONBuf.toString('utf-8'));
239764
240772
  if (turboJSON?.pipeline?.build) {
239765
240773
  hasBuildPipeline = true;
239766
240774
  }
239767
240775
  }
239768
- else if (packageJSONBuf !== null) {
240776
+ if (packageJSONBuf !== null) {
239769
240777
  const packageJSON = JSON.parse(packageJSONBuf.toString('utf-8'));
239770
240778
  if (packageJSON?.turbo?.pipeline?.build) {
239771
240779
  hasBuildPipeline = true;
239772
240780
  }
240781
+ turboSemVer =
240782
+ packageJSON?.dependencies?.turbo ||
240783
+ packageJSON?.devDependencies?.turbo ||
240784
+ null;
239773
240785
  }
239774
240786
  if (!hasBuildPipeline) {
239775
240787
  throw new MissingBuildPipeline();
@@ -239777,16 +240789,24 @@ async function getMonorepoDefaultSettings(projectName, projectPath, relativeToRo
239777
240789
  if (projectPath === '/') {
239778
240790
  return {
239779
240791
  monorepoManager: 'turbo',
239780
- buildCommand: 'npx turbo run build',
240792
+ buildCommand: 'turbo run build',
239781
240793
  installCommand: packageManager ? `${packageManager} install` : null,
239782
240794
  commandForIgnoringBuildStep: 'npx turbo-ignore',
239783
240795
  };
239784
240796
  }
240797
+ let buildCommand = null;
240798
+ if (projectPath) {
240799
+ if (supportsRootCommand(turboSemVer)) {
240800
+ buildCommand = `turbo run build`;
240801
+ }
240802
+ else {
240803
+ // We don't know for sure if the local `turbo` supports inference.
240804
+ buildCommand = `cd ${relativeToRoot} && turbo run build --filter={${projectPath}}...`;
240805
+ }
240806
+ }
239785
240807
  return {
239786
240808
  monorepoManager: 'turbo',
239787
- buildCommand: projectPath
239788
- ? `cd ${relativeToRoot} && npx turbo run build --filter={${projectPath}}...`
239789
- : null,
240809
+ buildCommand,
239790
240810
  installCommand: packageManager === 'npm'
239791
240811
  ? `${packageManager} install --prefix=${relativeToRoot}`
239792
240812
  : packageManager
@@ -241626,7 +242646,7 @@ const PLUGIN_PATHS = {
241626
242646
  };
241627
242647
  async function injectPlugins(detectedVersion, dir) {
241628
242648
  const plugins = new Set();
241629
- if (process.env.VERCEL_GATSBY_BUILDER_PLUGIN === '1' && detectedVersion) {
242649
+ if (detectedVersion) {
241630
242650
  const version = semver_1.default.coerce(detectedVersion);
241631
242651
  if (version && semver_1.default.satisfies(version, '>=4.0.0')) {
241632
242652
  plugins.add('@vercel/gatsby-plugin-vercel-builder');