@vercel/static-build 1.3.22 → 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.
Files changed (2) hide show
  1. package/dist/index.js +986 -4
  2. package/package.json +4 -4
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";
@@ -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
  }
@@ -211711,7 +212684,7 @@ function buildProcessTree (parentPid, tree, pidsToProcess, spawnChildProcessesLi
211711
212684
 
211712
212685
  Object.defineProperty(exports, "__esModule", ({ value: true }));
211713
212686
 
211714
- var common = __webpack_require__(3016);
212687
+ var common = __webpack_require__(7356);
211715
212688
  var CodeBlockWriter = __webpack_require__(8933);
211716
212689
 
211717
212690
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -239767,6 +240740,15 @@ class MissingBuildTarget extends Error {
239767
240740
  }
239768
240741
  }
239769
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
+ }
239770
240752
  async function getMonorepoDefaultSettings(projectName, projectPath, relativeToRoot, detectorFilesystem) {
239771
240753
  const [monorepoManager, packageManager] = await Promise.all([
239772
240754
  detect_framework_1.detectFramework({
@@ -239814,7 +240796,7 @@ async function getMonorepoDefaultSettings(projectName, projectPath, relativeToRo
239814
240796
  }
239815
240797
  let buildCommand = null;
239816
240798
  if (projectPath) {
239817
- if (turboSemVer && !semver_1.default.intersects(turboSemVer, '<1.8.0')) {
240799
+ if (supportsRootCommand(turboSemVer)) {
239818
240800
  buildCommand = `turbo run build`;
239819
240801
  }
239820
240802
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/static-build",
3
- "version": "1.3.22",
3
+ "version": "1.3.23",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/build-step",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@vercel/gatsby-plugin-vercel-analytics": "1.0.9",
33
- "@vercel/gatsby-plugin-vercel-builder": "1.2.7"
33
+ "@vercel/gatsby-plugin-vercel-builder": "1.2.8"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/aws-lambda": "8.10.64",
@@ -44,7 +44,7 @@
44
44
  "@types/semver": "7.3.13",
45
45
  "@vercel/build-utils": "6.7.1",
46
46
  "@vercel/frameworks": "1.3.4",
47
- "@vercel/fs-detectors": "3.8.9",
47
+ "@vercel/fs-detectors": "3.8.10",
48
48
  "@vercel/ncc": "0.24.0",
49
49
  "@vercel/routing-utils": "2.2.0",
50
50
  "@vercel/static-config": "2.0.15",
@@ -60,5 +60,5 @@
60
60
  "ts-morph": "12.0.0",
61
61
  "typescript": "4.3.4"
62
62
  },
63
- "gitHead": "925c8ba18ceec80174d9440cd2cad0e725ed4f56"
63
+ "gitHead": "14ece4111aed844a92e0024c5933f41b8ae717a0"
64
64
  }