@vercel/build-utils 6.7.0 → 6.7.2

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
@@ -8927,6 +8927,979 @@ function patch (fs) {
8927
8927
  }
8928
8928
 
8929
8929
 
8930
+ /***/ }),
8931
+
8932
+ /***/ 3016:
8933
+ /***/ ((module) => {
8934
+
8935
+ "use strict";
8936
+
8937
+
8938
+ module.exports = clone
8939
+
8940
+ var getPrototypeOf = Object.getPrototypeOf || function (obj) {
8941
+ return obj.__proto__
8942
+ }
8943
+
8944
+ function clone (obj) {
8945
+ if (obj === null || typeof obj !== 'object')
8946
+ return obj
8947
+
8948
+ if (obj instanceof Object)
8949
+ var copy = { __proto__: getPrototypeOf(obj) }
8950
+ else
8951
+ var copy = Object.create(null)
8952
+
8953
+ Object.getOwnPropertyNames(obj).forEach(function (key) {
8954
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
8955
+ })
8956
+
8957
+ return copy
8958
+ }
8959
+
8960
+
8961
+ /***/ }),
8962
+
8963
+ /***/ 7156:
8964
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8965
+
8966
+ var fs = __webpack_require__(5747)
8967
+ var polyfills = __webpack_require__(4692)
8968
+ var legacy = __webpack_require__(6465)
8969
+ var clone = __webpack_require__(3016)
8970
+
8971
+ var util = __webpack_require__(1669)
8972
+
8973
+ /* istanbul ignore next - node 0.x polyfill */
8974
+ var gracefulQueue
8975
+ var previousSymbol
8976
+
8977
+ /* istanbul ignore else - node 0.x polyfill */
8978
+ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
8979
+ gracefulQueue = Symbol.for('graceful-fs.queue')
8980
+ // This is used in testing by future versions
8981
+ previousSymbol = Symbol.for('graceful-fs.previous')
8982
+ } else {
8983
+ gracefulQueue = '___graceful-fs.queue'
8984
+ previousSymbol = '___graceful-fs.previous'
8985
+ }
8986
+
8987
+ function noop () {}
8988
+
8989
+ function publishQueue(context, queue) {
8990
+ Object.defineProperty(context, gracefulQueue, {
8991
+ get: function() {
8992
+ return queue
8993
+ }
8994
+ })
8995
+ }
8996
+
8997
+ var debug = noop
8998
+ if (util.debuglog)
8999
+ debug = util.debuglog('gfs4')
9000
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
9001
+ debug = function() {
9002
+ var m = util.format.apply(util, arguments)
9003
+ m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
9004
+ console.error(m)
9005
+ }
9006
+
9007
+ // Once time initialization
9008
+ if (!fs[gracefulQueue]) {
9009
+ // This queue can be shared by multiple loaded instances
9010
+ var queue = global[gracefulQueue] || []
9011
+ publishQueue(fs, queue)
9012
+
9013
+ // Patch fs.close/closeSync to shared queue version, because we need
9014
+ // to retry() whenever a close happens *anywhere* in the program.
9015
+ // This is essential when multiple graceful-fs instances are
9016
+ // in play at the same time.
9017
+ fs.close = (function (fs$close) {
9018
+ function close (fd, cb) {
9019
+ return fs$close.call(fs, fd, function (err) {
9020
+ // This function uses the graceful-fs shared queue
9021
+ if (!err) {
9022
+ resetQueue()
9023
+ }
9024
+
9025
+ if (typeof cb === 'function')
9026
+ cb.apply(this, arguments)
9027
+ })
9028
+ }
9029
+
9030
+ Object.defineProperty(close, previousSymbol, {
9031
+ value: fs$close
9032
+ })
9033
+ return close
9034
+ })(fs.close)
9035
+
9036
+ fs.closeSync = (function (fs$closeSync) {
9037
+ function closeSync (fd) {
9038
+ // This function uses the graceful-fs shared queue
9039
+ fs$closeSync.apply(fs, arguments)
9040
+ resetQueue()
9041
+ }
9042
+
9043
+ Object.defineProperty(closeSync, previousSymbol, {
9044
+ value: fs$closeSync
9045
+ })
9046
+ return closeSync
9047
+ })(fs.closeSync)
9048
+
9049
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
9050
+ process.on('exit', function() {
9051
+ debug(fs[gracefulQueue])
9052
+ __webpack_require__(2357).equal(fs[gracefulQueue].length, 0)
9053
+ })
9054
+ }
9055
+ }
9056
+
9057
+ if (!global[gracefulQueue]) {
9058
+ publishQueue(global, fs[gracefulQueue]);
9059
+ }
9060
+
9061
+ module.exports = patch(clone(fs))
9062
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
9063
+ module.exports = patch(fs)
9064
+ fs.__patched = true;
9065
+ }
9066
+
9067
+ function patch (fs) {
9068
+ // Everything that references the open() function needs to be in here
9069
+ polyfills(fs)
9070
+ fs.gracefulify = patch
9071
+
9072
+ fs.createReadStream = createReadStream
9073
+ fs.createWriteStream = createWriteStream
9074
+ var fs$readFile = fs.readFile
9075
+ fs.readFile = readFile
9076
+ function readFile (path, options, cb) {
9077
+ if (typeof options === 'function')
9078
+ cb = options, options = null
9079
+
9080
+ return go$readFile(path, options, cb)
9081
+
9082
+ function go$readFile (path, options, cb, startTime) {
9083
+ return fs$readFile(path, options, function (err) {
9084
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
9085
+ enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])
9086
+ else {
9087
+ if (typeof cb === 'function')
9088
+ cb.apply(this, arguments)
9089
+ }
9090
+ })
9091
+ }
9092
+ }
9093
+
9094
+ var fs$writeFile = fs.writeFile
9095
+ fs.writeFile = writeFile
9096
+ function writeFile (path, data, options, cb) {
9097
+ if (typeof options === 'function')
9098
+ cb = options, options = null
9099
+
9100
+ return go$writeFile(path, data, options, cb)
9101
+
9102
+ function go$writeFile (path, data, options, cb, startTime) {
9103
+ return fs$writeFile(path, data, options, function (err) {
9104
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
9105
+ enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
9106
+ else {
9107
+ if (typeof cb === 'function')
9108
+ cb.apply(this, arguments)
9109
+ }
9110
+ })
9111
+ }
9112
+ }
9113
+
9114
+ var fs$appendFile = fs.appendFile
9115
+ if (fs$appendFile)
9116
+ fs.appendFile = appendFile
9117
+ function appendFile (path, data, options, cb) {
9118
+ if (typeof options === 'function')
9119
+ cb = options, options = null
9120
+
9121
+ return go$appendFile(path, data, options, cb)
9122
+
9123
+ function go$appendFile (path, data, options, cb, startTime) {
9124
+ return fs$appendFile(path, data, options, function (err) {
9125
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
9126
+ enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
9127
+ else {
9128
+ if (typeof cb === 'function')
9129
+ cb.apply(this, arguments)
9130
+ }
9131
+ })
9132
+ }
9133
+ }
9134
+
9135
+ var fs$copyFile = fs.copyFile
9136
+ if (fs$copyFile)
9137
+ fs.copyFile = copyFile
9138
+ function copyFile (src, dest, flags, cb) {
9139
+ if (typeof flags === 'function') {
9140
+ cb = flags
9141
+ flags = 0
9142
+ }
9143
+ return go$copyFile(src, dest, flags, cb)
9144
+
9145
+ function go$copyFile (src, dest, flags, cb, startTime) {
9146
+ return fs$copyFile(src, dest, flags, function (err) {
9147
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
9148
+ enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])
9149
+ else {
9150
+ if (typeof cb === 'function')
9151
+ cb.apply(this, arguments)
9152
+ }
9153
+ })
9154
+ }
9155
+ }
9156
+
9157
+ var fs$readdir = fs.readdir
9158
+ fs.readdir = readdir
9159
+ var noReaddirOptionVersions = /^v[0-5]\./
9160
+ function readdir (path, options, cb) {
9161
+ if (typeof options === 'function')
9162
+ cb = options, options = null
9163
+
9164
+ var go$readdir = noReaddirOptionVersions.test(process.version)
9165
+ ? function go$readdir (path, options, cb, startTime) {
9166
+ return fs$readdir(path, fs$readdirCallback(
9167
+ path, options, cb, startTime
9168
+ ))
9169
+ }
9170
+ : function go$readdir (path, options, cb, startTime) {
9171
+ return fs$readdir(path, options, fs$readdirCallback(
9172
+ path, options, cb, startTime
9173
+ ))
9174
+ }
9175
+
9176
+ return go$readdir(path, options, cb)
9177
+
9178
+ function fs$readdirCallback (path, options, cb, startTime) {
9179
+ return function (err, files) {
9180
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
9181
+ enqueue([
9182
+ go$readdir,
9183
+ [path, options, cb],
9184
+ err,
9185
+ startTime || Date.now(),
9186
+ Date.now()
9187
+ ])
9188
+ else {
9189
+ if (files && files.sort)
9190
+ files.sort()
9191
+
9192
+ if (typeof cb === 'function')
9193
+ cb.call(this, err, files)
9194
+ }
9195
+ }
9196
+ }
9197
+ }
9198
+
9199
+ if (process.version.substr(0, 4) === 'v0.8') {
9200
+ var legStreams = legacy(fs)
9201
+ ReadStream = legStreams.ReadStream
9202
+ WriteStream = legStreams.WriteStream
9203
+ }
9204
+
9205
+ var fs$ReadStream = fs.ReadStream
9206
+ if (fs$ReadStream) {
9207
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype)
9208
+ ReadStream.prototype.open = ReadStream$open
9209
+ }
9210
+
9211
+ var fs$WriteStream = fs.WriteStream
9212
+ if (fs$WriteStream) {
9213
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype)
9214
+ WriteStream.prototype.open = WriteStream$open
9215
+ }
9216
+
9217
+ Object.defineProperty(fs, 'ReadStream', {
9218
+ get: function () {
9219
+ return ReadStream
9220
+ },
9221
+ set: function (val) {
9222
+ ReadStream = val
9223
+ },
9224
+ enumerable: true,
9225
+ configurable: true
9226
+ })
9227
+ Object.defineProperty(fs, 'WriteStream', {
9228
+ get: function () {
9229
+ return WriteStream
9230
+ },
9231
+ set: function (val) {
9232
+ WriteStream = val
9233
+ },
9234
+ enumerable: true,
9235
+ configurable: true
9236
+ })
9237
+
9238
+ // legacy names
9239
+ var FileReadStream = ReadStream
9240
+ Object.defineProperty(fs, 'FileReadStream', {
9241
+ get: function () {
9242
+ return FileReadStream
9243
+ },
9244
+ set: function (val) {
9245
+ FileReadStream = val
9246
+ },
9247
+ enumerable: true,
9248
+ configurable: true
9249
+ })
9250
+ var FileWriteStream = WriteStream
9251
+ Object.defineProperty(fs, 'FileWriteStream', {
9252
+ get: function () {
9253
+ return FileWriteStream
9254
+ },
9255
+ set: function (val) {
9256
+ FileWriteStream = val
9257
+ },
9258
+ enumerable: true,
9259
+ configurable: true
9260
+ })
9261
+
9262
+ function ReadStream (path, options) {
9263
+ if (this instanceof ReadStream)
9264
+ return fs$ReadStream.apply(this, arguments), this
9265
+ else
9266
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
9267
+ }
9268
+
9269
+ function ReadStream$open () {
9270
+ var that = this
9271
+ open(that.path, that.flags, that.mode, function (err, fd) {
9272
+ if (err) {
9273
+ if (that.autoClose)
9274
+ that.destroy()
9275
+
9276
+ that.emit('error', err)
9277
+ } else {
9278
+ that.fd = fd
9279
+ that.emit('open', fd)
9280
+ that.read()
9281
+ }
9282
+ })
9283
+ }
9284
+
9285
+ function WriteStream (path, options) {
9286
+ if (this instanceof WriteStream)
9287
+ return fs$WriteStream.apply(this, arguments), this
9288
+ else
9289
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
9290
+ }
9291
+
9292
+ function WriteStream$open () {
9293
+ var that = this
9294
+ open(that.path, that.flags, that.mode, function (err, fd) {
9295
+ if (err) {
9296
+ that.destroy()
9297
+ that.emit('error', err)
9298
+ } else {
9299
+ that.fd = fd
9300
+ that.emit('open', fd)
9301
+ }
9302
+ })
9303
+ }
9304
+
9305
+ function createReadStream (path, options) {
9306
+ return new fs.ReadStream(path, options)
9307
+ }
9308
+
9309
+ function createWriteStream (path, options) {
9310
+ return new fs.WriteStream(path, options)
9311
+ }
9312
+
9313
+ var fs$open = fs.open
9314
+ fs.open = open
9315
+ function open (path, flags, mode, cb) {
9316
+ if (typeof mode === 'function')
9317
+ cb = mode, mode = null
9318
+
9319
+ return go$open(path, flags, mode, cb)
9320
+
9321
+ function go$open (path, flags, mode, cb, startTime) {
9322
+ return fs$open(path, flags, mode, function (err, fd) {
9323
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
9324
+ enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])
9325
+ else {
9326
+ if (typeof cb === 'function')
9327
+ cb.apply(this, arguments)
9328
+ }
9329
+ })
9330
+ }
9331
+ }
9332
+
9333
+ return fs
9334
+ }
9335
+
9336
+ function enqueue (elem) {
9337
+ debug('ENQUEUE', elem[0].name, elem[1])
9338
+ fs[gracefulQueue].push(elem)
9339
+ retry()
9340
+ }
9341
+
9342
+ // keep track of the timeout between retry() calls
9343
+ var retryTimer
9344
+
9345
+ // reset the startTime and lastTime to now
9346
+ // this resets the start of the 60 second overall timeout as well as the
9347
+ // delay between attempts so that we'll retry these jobs sooner
9348
+ function resetQueue () {
9349
+ var now = Date.now()
9350
+ for (var i = 0; i < fs[gracefulQueue].length; ++i) {
9351
+ // entries that are only a length of 2 are from an older version, don't
9352
+ // bother modifying those since they'll be retried anyway.
9353
+ if (fs[gracefulQueue][i].length > 2) {
9354
+ fs[gracefulQueue][i][3] = now // startTime
9355
+ fs[gracefulQueue][i][4] = now // lastTime
9356
+ }
9357
+ }
9358
+ // call retry to make sure we're actively processing the queue
9359
+ retry()
9360
+ }
9361
+
9362
+ function retry () {
9363
+ // clear the timer and remove it to help prevent unintended concurrency
9364
+ clearTimeout(retryTimer)
9365
+ retryTimer = undefined
9366
+
9367
+ if (fs[gracefulQueue].length === 0)
9368
+ return
9369
+
9370
+ var elem = fs[gracefulQueue].shift()
9371
+ var fn = elem[0]
9372
+ var args = elem[1]
9373
+ // these items may be unset if they were added by an older graceful-fs
9374
+ var err = elem[2]
9375
+ var startTime = elem[3]
9376
+ var lastTime = elem[4]
9377
+
9378
+ // if we don't have a startTime we have no way of knowing if we've waited
9379
+ // long enough, so go ahead and retry this item now
9380
+ if (startTime === undefined) {
9381
+ debug('RETRY', fn.name, args)
9382
+ fn.apply(null, args)
9383
+ } else if (Date.now() - startTime >= 60000) {
9384
+ // it's been more than 60 seconds total, bail now
9385
+ debug('TIMEOUT', fn.name, args)
9386
+ var cb = args.pop()
9387
+ if (typeof cb === 'function')
9388
+ cb.call(null, err)
9389
+ } else {
9390
+ // the amount of time between the last attempt and right now
9391
+ var sinceAttempt = Date.now() - lastTime
9392
+ // the amount of time between when we first tried, and when we last tried
9393
+ // rounded up to at least 1
9394
+ var sinceStart = Math.max(lastTime - startTime, 1)
9395
+ // backoff. wait longer than the total time we've been retrying, but only
9396
+ // up to a maximum of 100ms
9397
+ var desiredDelay = Math.min(sinceStart * 1.2, 100)
9398
+ // it's been long enough since the last retry, do it again
9399
+ if (sinceAttempt >= desiredDelay) {
9400
+ debug('RETRY', fn.name, args)
9401
+ fn.apply(null, args.concat([startTime]))
9402
+ } else {
9403
+ // if we can't do this job yet, push it to the end of the queue
9404
+ // and let the next iteration check again
9405
+ fs[gracefulQueue].push(elem)
9406
+ }
9407
+ }
9408
+
9409
+ // schedule our next run if one isn't already scheduled
9410
+ if (retryTimer === undefined) {
9411
+ retryTimer = setTimeout(retry, 0)
9412
+ }
9413
+ }
9414
+
9415
+
9416
+ /***/ }),
9417
+
9418
+ /***/ 6465:
9419
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9420
+
9421
+ var Stream = __webpack_require__(2413).Stream
9422
+
9423
+ module.exports = legacy
9424
+
9425
+ function legacy (fs) {
9426
+ return {
9427
+ ReadStream: ReadStream,
9428
+ WriteStream: WriteStream
9429
+ }
9430
+
9431
+ function ReadStream (path, options) {
9432
+ if (!(this instanceof ReadStream)) return new ReadStream(path, options);
9433
+
9434
+ Stream.call(this);
9435
+
9436
+ var self = this;
9437
+
9438
+ this.path = path;
9439
+ this.fd = null;
9440
+ this.readable = true;
9441
+ this.paused = false;
9442
+
9443
+ this.flags = 'r';
9444
+ this.mode = 438; /*=0666*/
9445
+ this.bufferSize = 64 * 1024;
9446
+
9447
+ options = options || {};
9448
+
9449
+ // Mixin options into this
9450
+ var keys = Object.keys(options);
9451
+ for (var index = 0, length = keys.length; index < length; index++) {
9452
+ var key = keys[index];
9453
+ this[key] = options[key];
9454
+ }
9455
+
9456
+ if (this.encoding) this.setEncoding(this.encoding);
9457
+
9458
+ if (this.start !== undefined) {
9459
+ if ('number' !== typeof this.start) {
9460
+ throw TypeError('start must be a Number');
9461
+ }
9462
+ if (this.end === undefined) {
9463
+ this.end = Infinity;
9464
+ } else if ('number' !== typeof this.end) {
9465
+ throw TypeError('end must be a Number');
9466
+ }
9467
+
9468
+ if (this.start > this.end) {
9469
+ throw new Error('start must be <= end');
9470
+ }
9471
+
9472
+ this.pos = this.start;
9473
+ }
9474
+
9475
+ if (this.fd !== null) {
9476
+ process.nextTick(function() {
9477
+ self._read();
9478
+ });
9479
+ return;
9480
+ }
9481
+
9482
+ fs.open(this.path, this.flags, this.mode, function (err, fd) {
9483
+ if (err) {
9484
+ self.emit('error', err);
9485
+ self.readable = false;
9486
+ return;
9487
+ }
9488
+
9489
+ self.fd = fd;
9490
+ self.emit('open', fd);
9491
+ self._read();
9492
+ })
9493
+ }
9494
+
9495
+ function WriteStream (path, options) {
9496
+ if (!(this instanceof WriteStream)) return new WriteStream(path, options);
9497
+
9498
+ Stream.call(this);
9499
+
9500
+ this.path = path;
9501
+ this.fd = null;
9502
+ this.writable = true;
9503
+
9504
+ this.flags = 'w';
9505
+ this.encoding = 'binary';
9506
+ this.mode = 438; /*=0666*/
9507
+ this.bytesWritten = 0;
9508
+
9509
+ options = options || {};
9510
+
9511
+ // Mixin options into this
9512
+ var keys = Object.keys(options);
9513
+ for (var index = 0, length = keys.length; index < length; index++) {
9514
+ var key = keys[index];
9515
+ this[key] = options[key];
9516
+ }
9517
+
9518
+ if (this.start !== undefined) {
9519
+ if ('number' !== typeof this.start) {
9520
+ throw TypeError('start must be a Number');
9521
+ }
9522
+ if (this.start < 0) {
9523
+ throw new Error('start must be >= zero');
9524
+ }
9525
+
9526
+ this.pos = this.start;
9527
+ }
9528
+
9529
+ this.busy = false;
9530
+ this._queue = [];
9531
+
9532
+ if (this.fd === null) {
9533
+ this._open = fs.open;
9534
+ this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
9535
+ this.flush();
9536
+ }
9537
+ }
9538
+ }
9539
+
9540
+
9541
+ /***/ }),
9542
+
9543
+ /***/ 4692:
9544
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9545
+
9546
+ var constants = __webpack_require__(7619)
9547
+
9548
+ var origCwd = process.cwd
9549
+ var cwd = null
9550
+
9551
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
9552
+
9553
+ process.cwd = function() {
9554
+ if (!cwd)
9555
+ cwd = origCwd.call(process)
9556
+ return cwd
9557
+ }
9558
+ try {
9559
+ process.cwd()
9560
+ } catch (er) {}
9561
+
9562
+ // This check is needed until node.js 12 is required
9563
+ if (typeof process.chdir === 'function') {
9564
+ var chdir = process.chdir
9565
+ process.chdir = function (d) {
9566
+ cwd = null
9567
+ chdir.call(process, d)
9568
+ }
9569
+ if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)
9570
+ }
9571
+
9572
+ module.exports = patch
9573
+
9574
+ function patch (fs) {
9575
+ // (re-)implement some things that are known busted or missing.
9576
+
9577
+ // lchmod, broken prior to 0.6.2
9578
+ // back-port the fix here.
9579
+ if (constants.hasOwnProperty('O_SYMLINK') &&
9580
+ process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
9581
+ patchLchmod(fs)
9582
+ }
9583
+
9584
+ // lutimes implementation, or no-op
9585
+ if (!fs.lutimes) {
9586
+ patchLutimes(fs)
9587
+ }
9588
+
9589
+ // https://github.com/isaacs/node-graceful-fs/issues/4
9590
+ // Chown should not fail on einval or eperm if non-root.
9591
+ // It should not fail on enosys ever, as this just indicates
9592
+ // that a fs doesn't support the intended operation.
9593
+
9594
+ fs.chown = chownFix(fs.chown)
9595
+ fs.fchown = chownFix(fs.fchown)
9596
+ fs.lchown = chownFix(fs.lchown)
9597
+
9598
+ fs.chmod = chmodFix(fs.chmod)
9599
+ fs.fchmod = chmodFix(fs.fchmod)
9600
+ fs.lchmod = chmodFix(fs.lchmod)
9601
+
9602
+ fs.chownSync = chownFixSync(fs.chownSync)
9603
+ fs.fchownSync = chownFixSync(fs.fchownSync)
9604
+ fs.lchownSync = chownFixSync(fs.lchownSync)
9605
+
9606
+ fs.chmodSync = chmodFixSync(fs.chmodSync)
9607
+ fs.fchmodSync = chmodFixSync(fs.fchmodSync)
9608
+ fs.lchmodSync = chmodFixSync(fs.lchmodSync)
9609
+
9610
+ fs.stat = statFix(fs.stat)
9611
+ fs.fstat = statFix(fs.fstat)
9612
+ fs.lstat = statFix(fs.lstat)
9613
+
9614
+ fs.statSync = statFixSync(fs.statSync)
9615
+ fs.fstatSync = statFixSync(fs.fstatSync)
9616
+ fs.lstatSync = statFixSync(fs.lstatSync)
9617
+
9618
+ // if lchmod/lchown do not exist, then make them no-ops
9619
+ if (fs.chmod && !fs.lchmod) {
9620
+ fs.lchmod = function (path, mode, cb) {
9621
+ if (cb) process.nextTick(cb)
9622
+ }
9623
+ fs.lchmodSync = function () {}
9624
+ }
9625
+ if (fs.chown && !fs.lchown) {
9626
+ fs.lchown = function (path, uid, gid, cb) {
9627
+ if (cb) process.nextTick(cb)
9628
+ }
9629
+ fs.lchownSync = function () {}
9630
+ }
9631
+
9632
+ // on Windows, A/V software can lock the directory, causing this
9633
+ // to fail with an EACCES or EPERM if the directory contains newly
9634
+ // created files. Try again on failure, for up to 60 seconds.
9635
+
9636
+ // Set the timeout this long because some Windows Anti-Virus, such as Parity
9637
+ // bit9, may lock files for up to a minute, causing npm package install
9638
+ // failures. Also, take care to yield the scheduler. Windows scheduling gives
9639
+ // CPU to a busy looping process, which can cause the program causing the lock
9640
+ // contention to be starved of CPU by node, so the contention doesn't resolve.
9641
+ if (platform === "win32") {
9642
+ fs.rename = typeof fs.rename !== 'function' ? fs.rename
9643
+ : (function (fs$rename) {
9644
+ function rename (from, to, cb) {
9645
+ var start = Date.now()
9646
+ var backoff = 0;
9647
+ fs$rename(from, to, function CB (er) {
9648
+ if (er
9649
+ && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY")
9650
+ && Date.now() - start < 60000) {
9651
+ setTimeout(function() {
9652
+ fs.stat(to, function (stater, st) {
9653
+ if (stater && stater.code === "ENOENT")
9654
+ fs$rename(from, to, CB);
9655
+ else
9656
+ cb(er)
9657
+ })
9658
+ }, backoff)
9659
+ if (backoff < 100)
9660
+ backoff += 10;
9661
+ return;
9662
+ }
9663
+ if (cb) cb(er)
9664
+ })
9665
+ }
9666
+ if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)
9667
+ return rename
9668
+ })(fs.rename)
9669
+ }
9670
+
9671
+ // if read() returns EAGAIN, then just try it again.
9672
+ fs.read = typeof fs.read !== 'function' ? fs.read
9673
+ : (function (fs$read) {
9674
+ function read (fd, buffer, offset, length, position, callback_) {
9675
+ var callback
9676
+ if (callback_ && typeof callback_ === 'function') {
9677
+ var eagCounter = 0
9678
+ callback = function (er, _, __) {
9679
+ if (er && er.code === 'EAGAIN' && eagCounter < 10) {
9680
+ eagCounter ++
9681
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback)
9682
+ }
9683
+ callback_.apply(this, arguments)
9684
+ }
9685
+ }
9686
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback)
9687
+ }
9688
+
9689
+ // This ensures `util.promisify` works as it does for native `fs.read`.
9690
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
9691
+ return read
9692
+ })(fs.read)
9693
+
9694
+ fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync
9695
+ : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
9696
+ var eagCounter = 0
9697
+ while (true) {
9698
+ try {
9699
+ return fs$readSync.call(fs, fd, buffer, offset, length, position)
9700
+ } catch (er) {
9701
+ if (er.code === 'EAGAIN' && eagCounter < 10) {
9702
+ eagCounter ++
9703
+ continue
9704
+ }
9705
+ throw er
9706
+ }
9707
+ }
9708
+ }})(fs.readSync)
9709
+
9710
+ function patchLchmod (fs) {
9711
+ fs.lchmod = function (path, mode, callback) {
9712
+ fs.open( path
9713
+ , constants.O_WRONLY | constants.O_SYMLINK
9714
+ , mode
9715
+ , function (err, fd) {
9716
+ if (err) {
9717
+ if (callback) callback(err)
9718
+ return
9719
+ }
9720
+ // prefer to return the chmod error, if one occurs,
9721
+ // but still try to close, and report closing errors if they occur.
9722
+ fs.fchmod(fd, mode, function (err) {
9723
+ fs.close(fd, function(err2) {
9724
+ if (callback) callback(err || err2)
9725
+ })
9726
+ })
9727
+ })
9728
+ }
9729
+
9730
+ fs.lchmodSync = function (path, mode) {
9731
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
9732
+
9733
+ // prefer to return the chmod error, if one occurs,
9734
+ // but still try to close, and report closing errors if they occur.
9735
+ var threw = true
9736
+ var ret
9737
+ try {
9738
+ ret = fs.fchmodSync(fd, mode)
9739
+ threw = false
9740
+ } finally {
9741
+ if (threw) {
9742
+ try {
9743
+ fs.closeSync(fd)
9744
+ } catch (er) {}
9745
+ } else {
9746
+ fs.closeSync(fd)
9747
+ }
9748
+ }
9749
+ return ret
9750
+ }
9751
+ }
9752
+
9753
+ function patchLutimes (fs) {
9754
+ if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
9755
+ fs.lutimes = function (path, at, mt, cb) {
9756
+ fs.open(path, constants.O_SYMLINK, function (er, fd) {
9757
+ if (er) {
9758
+ if (cb) cb(er)
9759
+ return
9760
+ }
9761
+ fs.futimes(fd, at, mt, function (er) {
9762
+ fs.close(fd, function (er2) {
9763
+ if (cb) cb(er || er2)
9764
+ })
9765
+ })
9766
+ })
9767
+ }
9768
+
9769
+ fs.lutimesSync = function (path, at, mt) {
9770
+ var fd = fs.openSync(path, constants.O_SYMLINK)
9771
+ var ret
9772
+ var threw = true
9773
+ try {
9774
+ ret = fs.futimesSync(fd, at, mt)
9775
+ threw = false
9776
+ } finally {
9777
+ if (threw) {
9778
+ try {
9779
+ fs.closeSync(fd)
9780
+ } catch (er) {}
9781
+ } else {
9782
+ fs.closeSync(fd)
9783
+ }
9784
+ }
9785
+ return ret
9786
+ }
9787
+
9788
+ } else if (fs.futimes) {
9789
+ fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
9790
+ fs.lutimesSync = function () {}
9791
+ }
9792
+ }
9793
+
9794
+ function chmodFix (orig) {
9795
+ if (!orig) return orig
9796
+ return function (target, mode, cb) {
9797
+ return orig.call(fs, target, mode, function (er) {
9798
+ if (chownErOk(er)) er = null
9799
+ if (cb) cb.apply(this, arguments)
9800
+ })
9801
+ }
9802
+ }
9803
+
9804
+ function chmodFixSync (orig) {
9805
+ if (!orig) return orig
9806
+ return function (target, mode) {
9807
+ try {
9808
+ return orig.call(fs, target, mode)
9809
+ } catch (er) {
9810
+ if (!chownErOk(er)) throw er
9811
+ }
9812
+ }
9813
+ }
9814
+
9815
+
9816
+ function chownFix (orig) {
9817
+ if (!orig) return orig
9818
+ return function (target, uid, gid, cb) {
9819
+ return orig.call(fs, target, uid, gid, function (er) {
9820
+ if (chownErOk(er)) er = null
9821
+ if (cb) cb.apply(this, arguments)
9822
+ })
9823
+ }
9824
+ }
9825
+
9826
+ function chownFixSync (orig) {
9827
+ if (!orig) return orig
9828
+ return function (target, uid, gid) {
9829
+ try {
9830
+ return orig.call(fs, target, uid, gid)
9831
+ } catch (er) {
9832
+ if (!chownErOk(er)) throw er
9833
+ }
9834
+ }
9835
+ }
9836
+
9837
+ function statFix (orig) {
9838
+ if (!orig) return orig
9839
+ // Older versions of Node erroneously returned signed integers for
9840
+ // uid + gid.
9841
+ return function (target, options, cb) {
9842
+ if (typeof options === 'function') {
9843
+ cb = options
9844
+ options = null
9845
+ }
9846
+ function callback (er, stats) {
9847
+ if (stats) {
9848
+ if (stats.uid < 0) stats.uid += 0x100000000
9849
+ if (stats.gid < 0) stats.gid += 0x100000000
9850
+ }
9851
+ if (cb) cb.apply(this, arguments)
9852
+ }
9853
+ return options ? orig.call(fs, target, options, callback)
9854
+ : orig.call(fs, target, callback)
9855
+ }
9856
+ }
9857
+
9858
+ function statFixSync (orig) {
9859
+ if (!orig) return orig
9860
+ // Older versions of Node erroneously returned signed integers for
9861
+ // uid + gid.
9862
+ return function (target, options) {
9863
+ var stats = options ? orig.call(fs, target, options)
9864
+ : orig.call(fs, target)
9865
+ if (stats) {
9866
+ if (stats.uid < 0) stats.uid += 0x100000000
9867
+ if (stats.gid < 0) stats.gid += 0x100000000
9868
+ }
9869
+ return stats;
9870
+ }
9871
+ }
9872
+
9873
+ // ENOSYS means that the fs doesn't support the op. Just ignore
9874
+ // that, because it doesn't matter.
9875
+ //
9876
+ // if there's no getuid, or if getuid() is something other
9877
+ // than 0, and the error is EINVAL or EPERM, then just ignore
9878
+ // it.
9879
+ //
9880
+ // This specific case is a silent failure in cp, install, tar,
9881
+ // and most other unix tools that manage permissions.
9882
+ //
9883
+ // When running as root, or if other types of errors are
9884
+ // encountered, then it's strict.
9885
+ function chownErOk (er) {
9886
+ if (!er)
9887
+ return true
9888
+
9889
+ if (er.code === "ENOSYS")
9890
+ return true
9891
+
9892
+ var nonroot = !process.getuid || process.getuid() !== 0
9893
+ if (nonroot) {
9894
+ if (er.code === "EINVAL" || er.code === "EPERM")
9895
+ return true
9896
+ }
9897
+
9898
+ return false
9899
+ }
9900
+ }
9901
+
9902
+
8930
9903
  /***/ }),
8931
9904
 
8932
9905
  /***/ 8675:
@@ -16883,7 +17856,7 @@ module.exports = new Type('tag:yaml.org,2002:timestamp', {
16883
17856
 
16884
17857
  let _fs
16885
17858
  try {
16886
- _fs = __webpack_require__(1317)
17859
+ _fs = __webpack_require__(7156)
16887
17860
  } catch (_) {
16888
17861
  _fs = __webpack_require__(5747)
16889
17862
  }
@@ -16994,16 +17967,16 @@ module.exports = { stringify, stripBom }
16994
17967
 
16995
17968
  /***/ }),
16996
17969
 
16997
- /***/ 7767:
17970
+ /***/ 7345:
16998
17971
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
16999
17972
 
17000
17973
  module.exports = minimatch
17001
17974
  minimatch.Minimatch = Minimatch
17002
17975
 
17003
- var path = { sep: '/' }
17004
- try {
17005
- path = __webpack_require__(5622)
17006
- } catch (er) {}
17976
+ var path = (function () { try { return __webpack_require__(5622) } catch (e) {}}()) || {
17977
+ sep: '/'
17978
+ }
17979
+ minimatch.sep = path.sep
17007
17980
 
17008
17981
  var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
17009
17982
  var expand = __webpack_require__(490)
@@ -17055,43 +18028,64 @@ function filter (pattern, options) {
17055
18028
  }
17056
18029
 
17057
18030
  function ext (a, b) {
17058
- a = a || {}
17059
18031
  b = b || {}
17060
18032
  var t = {}
17061
- Object.keys(b).forEach(function (k) {
17062
- t[k] = b[k]
17063
- })
17064
18033
  Object.keys(a).forEach(function (k) {
17065
18034
  t[k] = a[k]
17066
18035
  })
18036
+ Object.keys(b).forEach(function (k) {
18037
+ t[k] = b[k]
18038
+ })
17067
18039
  return t
17068
18040
  }
17069
18041
 
17070
18042
  minimatch.defaults = function (def) {
17071
- if (!def || !Object.keys(def).length) return minimatch
18043
+ if (!def || typeof def !== 'object' || !Object.keys(def).length) {
18044
+ return minimatch
18045
+ }
17072
18046
 
17073
18047
  var orig = minimatch
17074
18048
 
17075
18049
  var m = function minimatch (p, pattern, options) {
17076
- return orig.minimatch(p, pattern, ext(def, options))
18050
+ return orig(p, pattern, ext(def, options))
17077
18051
  }
17078
18052
 
17079
18053
  m.Minimatch = function Minimatch (pattern, options) {
17080
18054
  return new orig.Minimatch(pattern, ext(def, options))
17081
18055
  }
18056
+ m.Minimatch.defaults = function defaults (options) {
18057
+ return orig.defaults(ext(def, options)).Minimatch
18058
+ }
18059
+
18060
+ m.filter = function filter (pattern, options) {
18061
+ return orig.filter(pattern, ext(def, options))
18062
+ }
18063
+
18064
+ m.defaults = function defaults (options) {
18065
+ return orig.defaults(ext(def, options))
18066
+ }
18067
+
18068
+ m.makeRe = function makeRe (pattern, options) {
18069
+ return orig.makeRe(pattern, ext(def, options))
18070
+ }
18071
+
18072
+ m.braceExpand = function braceExpand (pattern, options) {
18073
+ return orig.braceExpand(pattern, ext(def, options))
18074
+ }
18075
+
18076
+ m.match = function (list, pattern, options) {
18077
+ return orig.match(list, pattern, ext(def, options))
18078
+ }
17082
18079
 
17083
18080
  return m
17084
18081
  }
17085
18082
 
17086
18083
  Minimatch.defaults = function (def) {
17087
- if (!def || !Object.keys(def).length) return Minimatch
17088
18084
  return minimatch.defaults(def).Minimatch
17089
18085
  }
17090
18086
 
17091
18087
  function minimatch (p, pattern, options) {
17092
- if (typeof pattern !== 'string') {
17093
- throw new TypeError('glob pattern string required')
17094
- }
18088
+ assertValidPattern(pattern)
17095
18089
 
17096
18090
  if (!options) options = {}
17097
18091
 
@@ -17100,9 +18094,6 @@ function minimatch (p, pattern, options) {
17100
18094
  return false
17101
18095
  }
17102
18096
 
17103
- // "" only matches ""
17104
- if (pattern.trim() === '') return p === ''
17105
-
17106
18097
  return new Minimatch(pattern, options).match(p)
17107
18098
  }
17108
18099
 
@@ -17111,15 +18102,14 @@ function Minimatch (pattern, options) {
17111
18102
  return new Minimatch(pattern, options)
17112
18103
  }
17113
18104
 
17114
- if (typeof pattern !== 'string') {
17115
- throw new TypeError('glob pattern string required')
17116
- }
18105
+ assertValidPattern(pattern)
17117
18106
 
17118
18107
  if (!options) options = {}
18108
+
17119
18109
  pattern = pattern.trim()
17120
18110
 
17121
18111
  // windows support: need to use /, not \
17122
- if (path.sep !== '/') {
18112
+ if (!options.allowWindowsEscape && path.sep !== '/') {
17123
18113
  pattern = pattern.split(path.sep).join('/')
17124
18114
  }
17125
18115
 
@@ -17130,6 +18120,7 @@ function Minimatch (pattern, options) {
17130
18120
  this.negate = false
17131
18121
  this.comment = false
17132
18122
  this.empty = false
18123
+ this.partial = !!options.partial
17133
18124
 
17134
18125
  // make the set of regexps etc.
17135
18126
  this.make()
@@ -17139,9 +18130,6 @@ Minimatch.prototype.debug = function () {}
17139
18130
 
17140
18131
  Minimatch.prototype.make = make
17141
18132
  function make () {
17142
- // don't do it more than once.
17143
- if (this._made) return
17144
-
17145
18133
  var pattern = this.pattern
17146
18134
  var options = this.options
17147
18135
 
@@ -17161,7 +18149,7 @@ function make () {
17161
18149
  // step 2: expand braces
17162
18150
  var set = this.globSet = this.braceExpand()
17163
18151
 
17164
- if (options.debug) this.debug = console.error
18152
+ if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) }
17165
18153
 
17166
18154
  this.debug(this.pattern, set)
17167
18155
 
@@ -17241,12 +18229,11 @@ function braceExpand (pattern, options) {
17241
18229
  pattern = typeof pattern === 'undefined'
17242
18230
  ? this.pattern : pattern
17243
18231
 
17244
- if (typeof pattern === 'undefined') {
17245
- throw new TypeError('undefined pattern')
17246
- }
18232
+ assertValidPattern(pattern)
17247
18233
 
17248
- if (options.nobrace ||
17249
- !pattern.match(/\{.*\}/)) {
18234
+ // Thanks to Yeting Li <https://github.com/yetingli> for
18235
+ // improving this regexp to avoid a ReDOS vulnerability.
18236
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
17250
18237
  // shortcut. no need to expand.
17251
18238
  return [pattern]
17252
18239
  }
@@ -17254,6 +18241,17 @@ function braceExpand (pattern, options) {
17254
18241
  return expand(pattern)
17255
18242
  }
17256
18243
 
18244
+ var MAX_PATTERN_LENGTH = 1024 * 64
18245
+ var assertValidPattern = function (pattern) {
18246
+ if (typeof pattern !== 'string') {
18247
+ throw new TypeError('invalid pattern')
18248
+ }
18249
+
18250
+ if (pattern.length > MAX_PATTERN_LENGTH) {
18251
+ throw new TypeError('pattern is too long')
18252
+ }
18253
+ }
18254
+
17257
18255
  // parse a component of the expanded set.
17258
18256
  // At this point, no pattern may contain "/" in it
17259
18257
  // so we're going to return a 2d array, where each entry is the full
@@ -17268,14 +18266,17 @@ function braceExpand (pattern, options) {
17268
18266
  Minimatch.prototype.parse = parse
17269
18267
  var SUBPARSE = {}
17270
18268
  function parse (pattern, isSub) {
17271
- if (pattern.length > 1024 * 64) {
17272
- throw new TypeError('pattern is too long')
17273
- }
18269
+ assertValidPattern(pattern)
17274
18270
 
17275
18271
  var options = this.options
17276
18272
 
17277
18273
  // shortcuts
17278
- if (!options.noglobstar && pattern === '**') return GLOBSTAR
18274
+ if (pattern === '**') {
18275
+ if (!options.noglobstar)
18276
+ return GLOBSTAR
18277
+ else
18278
+ pattern = '*'
18279
+ }
17279
18280
  if (pattern === '') return ''
17280
18281
 
17281
18282
  var re = ''
@@ -17331,10 +18332,12 @@ function parse (pattern, isSub) {
17331
18332
  }
17332
18333
 
17333
18334
  switch (c) {
17334
- case '/':
18335
+ /* istanbul ignore next */
18336
+ case '/': {
17335
18337
  // completely not allowed, even escaped.
17336
18338
  // Should already be path-split by now.
17337
18339
  return false
18340
+ }
17338
18341
 
17339
18342
  case '\\':
17340
18343
  clearStateChar()
@@ -17453,25 +18456,23 @@ function parse (pattern, isSub) {
17453
18456
 
17454
18457
  // handle the case where we left a class open.
17455
18458
  // "[z-a]" is valid, equivalent to "\[z-a\]"
17456
- if (inClass) {
17457
- // split where the last [ was, make sure we don't have
17458
- // an invalid re. if so, re-walk the contents of the
17459
- // would-be class to re-translate any characters that
17460
- // were passed through as-is
17461
- // TODO: It would probably be faster to determine this
17462
- // without a try/catch and a new RegExp, but it's tricky
17463
- // to do safely. For now, this is safe and works.
17464
- var cs = pattern.substring(classStart + 1, i)
17465
- try {
17466
- RegExp('[' + cs + ']')
17467
- } catch (er) {
17468
- // not a valid class!
17469
- var sp = this.parse(cs, SUBPARSE)
17470
- re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
17471
- hasMagic = hasMagic || sp[1]
17472
- inClass = false
17473
- continue
17474
- }
18459
+ // split where the last [ was, make sure we don't have
18460
+ // an invalid re. if so, re-walk the contents of the
18461
+ // would-be class to re-translate any characters that
18462
+ // were passed through as-is
18463
+ // TODO: It would probably be faster to determine this
18464
+ // without a try/catch and a new RegExp, but it's tricky
18465
+ // to do safely. For now, this is safe and works.
18466
+ var cs = pattern.substring(classStart + 1, i)
18467
+ try {
18468
+ RegExp('[' + cs + ']')
18469
+ } catch (er) {
18470
+ // not a valid class!
18471
+ var sp = this.parse(cs, SUBPARSE)
18472
+ re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
18473
+ hasMagic = hasMagic || sp[1]
18474
+ inClass = false
18475
+ continue
17475
18476
  }
17476
18477
 
17477
18478
  // finish up the class.
@@ -17555,9 +18556,7 @@ function parse (pattern, isSub) {
17555
18556
  // something that could conceivably capture a dot
17556
18557
  var addPatternStart = false
17557
18558
  switch (re.charAt(0)) {
17558
- case '.':
17559
- case '[':
17560
- case '(': addPatternStart = true
18559
+ case '[': case '.': case '(': addPatternStart = true
17561
18560
  }
17562
18561
 
17563
18562
  // Hack to work around lack of negative lookbehind in JS
@@ -17619,7 +18618,7 @@ function parse (pattern, isSub) {
17619
18618
  var flags = options.nocase ? 'i' : ''
17620
18619
  try {
17621
18620
  var regExp = new RegExp('^' + re + '$', flags)
17622
- } catch (er) {
18621
+ } catch (er) /* istanbul ignore next - should be impossible */ {
17623
18622
  // If it was an invalid regular expression, then it can't match
17624
18623
  // anything. This trick looks for a character after the end of
17625
18624
  // the string, which is of course impossible, except in multi-line
@@ -17677,7 +18676,7 @@ function makeRe () {
17677
18676
 
17678
18677
  try {
17679
18678
  this.regexp = new RegExp(re, flags)
17680
- } catch (ex) {
18679
+ } catch (ex) /* istanbul ignore next - should be impossible */ {
17681
18680
  this.regexp = false
17682
18681
  }
17683
18682
  return this.regexp
@@ -17695,8 +18694,8 @@ minimatch.match = function (list, pattern, options) {
17695
18694
  return list
17696
18695
  }
17697
18696
 
17698
- Minimatch.prototype.match = match
17699
- function match (f, partial) {
18697
+ Minimatch.prototype.match = function match (f, partial) {
18698
+ if (typeof partial === 'undefined') partial = this.partial
17700
18699
  this.debug('match', f, this.pattern)
17701
18700
  // short-circuit in the case of busted things.
17702
18701
  // comments, etc.
@@ -17778,6 +18777,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
17778
18777
 
17779
18778
  // should be impossible.
17780
18779
  // some invalid regexp stuff in the set.
18780
+ /* istanbul ignore if */
17781
18781
  if (p === false) return false
17782
18782
 
17783
18783
  if (p === GLOBSTAR) {
@@ -17851,6 +18851,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
17851
18851
  // no match was found.
17852
18852
  // However, in partial mode, we can't say this is necessarily over.
17853
18853
  // If there's more *pattern* left, then
18854
+ /* istanbul ignore if */
17854
18855
  if (partial) {
17855
18856
  // ran out of file
17856
18857
  this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
@@ -17864,11 +18865,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
17864
18865
  // patterns with magic have been turned into regexps.
17865
18866
  var hit
17866
18867
  if (typeof p === 'string') {
17867
- if (options.nocase) {
17868
- hit = f.toLowerCase() === p.toLowerCase()
17869
- } else {
17870
- hit = f === p
17871
- }
18868
+ hit = f === p
17872
18869
  this.debug('string match', p, f, hit)
17873
18870
  } else {
17874
18871
  hit = f.match(p)
@@ -17899,16 +18896,16 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
17899
18896
  // this is ok if we're doing the match as part of
17900
18897
  // a glob fs traversal.
17901
18898
  return partial
17902
- } else if (pi === pl) {
18899
+ } else /* istanbul ignore else */ if (pi === pl) {
17903
18900
  // ran out of pattern, still have file left.
17904
18901
  // this is only acceptable if we're on the very last
17905
18902
  // empty segment of a file with a trailing slash.
17906
18903
  // a/* should match a/b/
17907
- var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
17908
- return emptyFileEnd
18904
+ return (fi === fl - 1) && (file[fi] === '')
17909
18905
  }
17910
18906
 
17911
18907
  // should be unreachable.
18908
+ /* istanbul ignore next */
17912
18909
  throw new Error('wtf?')
17913
18910
  }
17914
18911
 
@@ -30169,6 +31166,84 @@ function bufferIncludes(buffer, content) {
30169
31166
  }
30170
31167
 
30171
31168
 
31169
+ /***/ }),
31170
+
31171
+ /***/ 9799:
31172
+ /***/ ((__unused_webpack_module, exports) => {
31173
+
31174
+ "use strict";
31175
+
31176
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
31177
+ exports.isSpawnError = exports.normalizeError = exports.errorToString = exports.isErrorLike = exports.isErrnoException = exports.isError = exports.isObject = void 0;
31178
+ /**
31179
+ * A simple type guard for objects.
31180
+ *
31181
+ * @param obj - A possible object
31182
+ */
31183
+ const isObject = (obj) => typeof obj === 'object' && obj !== null;
31184
+ exports.isObject = isObject;
31185
+ /**
31186
+ * A type guard for `try...catch` errors.
31187
+ *
31188
+ * This function is based on:
31189
+ * https://github.com/stdlib-js/assert-is-error
31190
+ */
31191
+ const isError = (error) => {
31192
+ if (!(0, exports.isObject)(error))
31193
+ return false;
31194
+ // Check for `Error` objects instantiated within the current global context.
31195
+ if (error instanceof Error)
31196
+ return true;
31197
+ // Walk the prototype tree until we find a matching object.
31198
+ while (error) {
31199
+ if (Object.prototype.toString.call(error) === '[object Error]')
31200
+ return true;
31201
+ error = Object.getPrototypeOf(error);
31202
+ }
31203
+ return false;
31204
+ };
31205
+ exports.isError = isError;
31206
+ const isErrnoException = (error) => {
31207
+ return (0, exports.isError)(error) && 'code' in error;
31208
+ };
31209
+ exports.isErrnoException = isErrnoException;
31210
+ /**
31211
+ * A type guard for error-like objects.
31212
+ */
31213
+ const isErrorLike = (error) => (0, exports.isObject)(error) && 'message' in error;
31214
+ exports.isErrorLike = isErrorLike;
31215
+ /**
31216
+ * Parses errors to string, useful for getting the error message in a
31217
+ * `try...catch` statement.
31218
+ */
31219
+ const errorToString = (error, fallback) => {
31220
+ if ((0, exports.isError)(error) || (0, exports.isErrorLike)(error))
31221
+ return error.message;
31222
+ if (typeof error === 'string')
31223
+ return error;
31224
+ return fallback ?? 'An unknown error has ocurred.';
31225
+ };
31226
+ exports.errorToString = errorToString;
31227
+ /**
31228
+ * Normalizes unknown errors to the Error type, useful for working with errors
31229
+ * in a `try...catch` statement.
31230
+ */
31231
+ const normalizeError = (error) => {
31232
+ if ((0, exports.isError)(error))
31233
+ return error;
31234
+ const errorMessage = (0, exports.errorToString)(error);
31235
+ // Copy over additional properties if the object is error-like.
31236
+ return (0, exports.isErrorLike)(error)
31237
+ ? Object.assign(new Error(errorMessage), error)
31238
+ : new Error(errorMessage);
31239
+ };
31240
+ exports.normalizeError = normalizeError;
31241
+ function isSpawnError(v) {
31242
+ return (0, exports.isErrnoException)(v) && 'spawnargs' in v;
31243
+ }
31244
+ exports.isSpawnError = isSpawnError;
31245
+ //# sourceMappingURL=index.js.map
31246
+
30172
31247
  /***/ }),
30173
31248
 
30174
31249
  /***/ 651:
@@ -30221,7 +31296,7 @@ exports.cloneEnv = cloneEnv;
30221
31296
  Object.defineProperty(exports, "__esModule", ({ value: true }));
30222
31297
  const get_platform_env_1 = __webpack_require__(7060);
30223
31298
  function debug(message, ...additional) {
30224
- if (get_platform_env_1.getPlatformEnv('BUILDER_DEBUG')) {
31299
+ if ((0, get_platform_env_1.getPlatformEnv)('BUILDER_DEBUG')) {
30225
31300
  console.log(message, ...additional);
30226
31301
  }
30227
31302
  else if (process.env.VERCEL_DEBUG_PREFIX) {
@@ -30368,16 +31443,16 @@ const assert_1 = __importDefault(__webpack_require__(2357));
30368
31443
  const into_stream_1 = __importDefault(__webpack_require__(6398));
30369
31444
  class FileBlob {
30370
31445
  constructor({ mode = 0o100644, contentType, data }) {
30371
- assert_1.default(typeof mode === 'number');
30372
- assert_1.default(typeof data === 'string' || Buffer.isBuffer(data));
31446
+ (0, assert_1.default)(typeof mode === 'number');
31447
+ (0, assert_1.default)(typeof data === 'string' || Buffer.isBuffer(data));
30373
31448
  this.type = 'FileBlob';
30374
31449
  this.mode = mode;
30375
31450
  this.contentType = contentType;
30376
31451
  this.data = data;
30377
31452
  }
30378
31453
  static async fromStream({ mode = 0o100644, contentType, stream, }) {
30379
- assert_1.default(typeof mode === 'number');
30380
- assert_1.default(typeof stream.pipe === 'function'); // is-stream
31454
+ (0, assert_1.default)(typeof mode === 'number');
31455
+ (0, assert_1.default)(typeof stream.pipe === 'function'); // is-stream
30381
31456
  const chunks = [];
30382
31457
  await new Promise((resolve, reject) => {
30383
31458
  stream.on('data', chunk => chunks.push(Buffer.from(chunk)));
@@ -30391,7 +31466,7 @@ class FileBlob {
30391
31466
  return this.toStream();
30392
31467
  }
30393
31468
  toStream() {
30394
- return into_stream_1.default(this.data);
31469
+ return (0, into_stream_1.default)(this.data);
30395
31470
  }
30396
31471
  }
30397
31472
  exports.default = FileBlob;
@@ -30417,8 +31492,8 @@ const DEFAULT_SEMA = 20;
30417
31492
  const semaToPreventEMFILE = new async_sema_1.default(parseInt(process.env.VERCEL_INTERNAL_FILE_FS_REF_SEMA || String(DEFAULT_SEMA), 10) || DEFAULT_SEMA);
30418
31493
  class FileFsRef {
30419
31494
  constructor({ mode = 0o100644, contentType, fsPath }) {
30420
- assert_1.default(typeof mode === 'number');
30421
- assert_1.default(typeof fsPath === 'string');
31495
+ (0, assert_1.default)(typeof mode === 'number');
31496
+ (0, assert_1.default)(typeof fsPath === 'string');
30422
31497
  this.type = 'FileFsRef';
30423
31498
  this.mode = mode;
30424
31499
  this.contentType = contentType;
@@ -30433,9 +31508,9 @@ class FileFsRef {
30433
31508
  return new FileFsRef({ mode: m, contentType, fsPath });
30434
31509
  }
30435
31510
  static async fromStream({ mode = 0o100644, contentType, stream, fsPath, }) {
30436
- assert_1.default(typeof mode === 'number');
30437
- assert_1.default(typeof stream.pipe === 'function'); // is-stream
30438
- assert_1.default(typeof fsPath === 'string');
31511
+ (0, assert_1.default)(typeof mode === 'number');
31512
+ (0, assert_1.default)(typeof stream.pipe === 'function'); // is-stream
31513
+ (0, assert_1.default)(typeof fsPath === 'string');
30439
31514
  await fs_extra_1.default.mkdirp(path_1.default.dirname(fsPath));
30440
31515
  await new Promise((resolve, reject) => {
30441
31516
  const dest = fs_extra_1.default.createWriteStream(fsPath, {
@@ -30459,7 +31534,7 @@ class FileFsRef {
30459
31534
  toStream() {
30460
31535
  let flag = false;
30461
31536
  // eslint-disable-next-line consistent-return
30462
- return multistream_1.default(cb => {
31537
+ return (0, multistream_1.default)(cb => {
30463
31538
  if (flag)
30464
31539
  return cb(null, null);
30465
31540
  flag = true;
@@ -30502,8 +31577,8 @@ class BailableError extends Error {
30502
31577
  }
30503
31578
  class FileRef {
30504
31579
  constructor({ mode = 0o100644, digest, contentType, mutable = false, }) {
30505
- assert_1.default(typeof mode === 'number');
30506
- assert_1.default(typeof digest === 'string');
31580
+ (0, assert_1.default)(typeof mode === 'number');
31581
+ (0, assert_1.default)(typeof digest === 'string');
30507
31582
  this.type = 'FileRef';
30508
31583
  this.mode = mode;
30509
31584
  this.digest = digest;
@@ -30534,8 +31609,8 @@ class FileRef {
30534
31609
  await semaToDownloadFromS3.acquire();
30535
31610
  // console.time(`downloading ${url}`);
30536
31611
  try {
30537
- return await async_retry_1.default(async () => {
30538
- const resp = await node_fetch_1.default(url);
31612
+ return await (0, async_retry_1.default)(async () => {
31613
+ const resp = await (0, node_fetch_1.default)(url);
30539
31614
  if (!resp.ok) {
30540
31615
  const error = new BailableError(`download: ${resp.status} ${resp.statusText} for ${url}`);
30541
31616
  if (resp.status === 403)
@@ -30553,7 +31628,7 @@ class FileRef {
30553
31628
  toStream() {
30554
31629
  let flag = false;
30555
31630
  // eslint-disable-next-line consistent-return
30556
- return multistream_1.default(cb => {
31631
+ return (0, multistream_1.default)(cb => {
30557
31632
  if (flag)
30558
31633
  return cb(null, null);
30559
31634
  flag = true;
@@ -30599,13 +31674,13 @@ function isSymbolicLink(mode) {
30599
31674
  }
30600
31675
  exports.isSymbolicLink = isSymbolicLink;
30601
31676
  async function prepareSymlinkTarget(file, fsPath) {
30602
- const mkdirPromise = fs_extra_1.mkdirp(path_1.default.dirname(fsPath));
31677
+ const mkdirPromise = (0, fs_extra_1.mkdirp)(path_1.default.dirname(fsPath));
30603
31678
  if (file.type === 'FileFsRef') {
30604
- const [target] = await Promise.all([fs_extra_1.readlink(file.fsPath), mkdirPromise]);
31679
+ const [target] = await Promise.all([(0, fs_extra_1.readlink)(file.fsPath), mkdirPromise]);
30605
31680
  return target;
30606
31681
  }
30607
31682
  if (file.type === 'FileRef' || file.type === 'FileBlob') {
30608
- const targetPathBufferPromise = stream_to_buffer_1.default(await file.toStreamAsync());
31683
+ const targetPathBufferPromise = (0, stream_to_buffer_1.default)(await file.toStreamAsync());
30609
31684
  const [targetPathBuffer] = await Promise.all([
30610
31685
  targetPathBufferPromise,
30611
31686
  mkdirPromise,
@@ -30617,8 +31692,8 @@ async function prepareSymlinkTarget(file, fsPath) {
30617
31692
  async function downloadFile(file, fsPath) {
30618
31693
  const { mode } = file;
30619
31694
  if (isDirectory(mode)) {
30620
- await fs_extra_1.mkdirp(fsPath);
30621
- await fs_extra_1.chmod(fsPath, mode);
31695
+ await (0, fs_extra_1.mkdirp)(fsPath);
31696
+ await (0, fs_extra_1.chmod)(fsPath, mode);
30622
31697
  return file_fs_ref_1.default.fromFsPath({ mode, fsPath });
30623
31698
  }
30624
31699
  // If the source is a symlink, try to create it instead of copying the file.
@@ -30626,7 +31701,7 @@ async function downloadFile(file, fsPath) {
30626
31701
  // enabled in the group policy. We may want to improve the error message.
30627
31702
  if (isSymbolicLink(mode)) {
30628
31703
  const target = await prepareSymlinkTarget(file, fsPath);
30629
- await fs_extra_1.symlink(target, fsPath);
31704
+ await (0, fs_extra_1.symlink)(target, fsPath);
30630
31705
  return file_fs_ref_1.default.fromFsPath({ mode, fsPath });
30631
31706
  }
30632
31707
  const stream = file.toStream();
@@ -30635,7 +31710,7 @@ async function downloadFile(file, fsPath) {
30635
31710
  exports.downloadFile = downloadFile;
30636
31711
  async function removeFile(basePath, fileMatched) {
30637
31712
  const file = path_1.default.join(basePath, fileMatched);
30638
- await fs_extra_1.remove(file);
31713
+ await (0, fs_extra_1.remove)(file);
30639
31714
  }
30640
31715
  async function download(files, basePath, meta) {
30641
31716
  const { isDev = false, skipDownload = false, filesChanged = null, filesRemoved = null, } = meta || {};
@@ -30645,7 +31720,7 @@ async function download(files, basePath, meta) {
30645
31720
  // source files are already available.
30646
31721
  return files;
30647
31722
  }
30648
- debug_1.default('Downloading deployment source files...');
31723
+ (0, debug_1.default)('Downloading deployment source files...');
30649
31724
  const start = Date.now();
30650
31725
  const files2 = {};
30651
31726
  const filenames = Object.keys(files);
@@ -30678,7 +31753,7 @@ async function download(files, basePath, meta) {
30678
31753
  files2[name] = await downloadFile(file, fsPath);
30679
31754
  }));
30680
31755
  const duration = Date.now() - start;
30681
- debug_1.default(`Downloaded ${filenames.length} source files: ${duration}ms`);
31756
+ (0, debug_1.default)(`Downloaded ${filenames.length} source files: ${duration}ms`);
30682
31757
  return files2;
30683
31758
  }
30684
31759
  exports.default = download;
@@ -30697,8 +31772,8 @@ const os_1 = __webpack_require__(2087);
30697
31772
  const fs_extra_1 = __webpack_require__(6365);
30698
31773
  async function getWritableDirectory() {
30699
31774
  const name = Math.floor(Math.random() * 0x7fffffff).toString(16);
30700
- const directory = path_1.join(os_1.tmpdir(), name);
30701
- await fs_extra_1.mkdirp(directory);
31775
+ const directory = (0, path_1.join)((0, os_1.tmpdir)(), name);
31776
+ await (0, fs_extra_1.mkdirp)(directory);
30702
31777
  return directory;
30703
31778
  }
30704
31779
  exports.default = getWritableDirectory;
@@ -30722,7 +31797,7 @@ const util_1 = __webpack_require__(1669);
30722
31797
  const fs_extra_1 = __webpack_require__(6365);
30723
31798
  const normalize_path_1 = __webpack_require__(6263);
30724
31799
  const file_fs_ref_1 = __importDefault(__webpack_require__(6274));
30725
- const vanillaGlob = util_1.promisify(glob_1.default);
31800
+ const vanillaGlob = (0, util_1.promisify)(glob_1.default);
30726
31801
  async function glob(pattern, opts, mountpoint) {
30727
31802
  const options = typeof opts === 'string' ? { cwd: opts } : opts;
30728
31803
  if (!options.cwd) {
@@ -30745,15 +31820,15 @@ async function glob(pattern, opts, mountpoint) {
30745
31820
  const dirsWithEntries = new Set();
30746
31821
  for (const relativePath of files) {
30747
31822
  const absPath = path_1.default.join(options.cwd, relativePath);
30748
- const fsPath = normalize_path_1.normalizePath(absPath);
31823
+ const fsPath = (0, normalize_path_1.normalizePath)(absPath);
30749
31824
  let stat = statCache[fsPath];
30750
- assert_1.default(stat, `statCache does not contain value for ${relativePath} (resolved to ${fsPath})`);
31825
+ (0, assert_1.default)(stat, `statCache does not contain value for ${relativePath} (resolved to ${fsPath})`);
30751
31826
  const isSymlink = symlinks[fsPath];
30752
31827
  // When `follow` mode is enabled, ensure that the entry is not a symlink
30753
31828
  // that points to outside of `cwd`
30754
31829
  if (options.follow &&
30755
- (isSymlink || (await fs_extra_1.lstat(fsPath)).isSymbolicLink())) {
30756
- const target = await fs_extra_1.readlink(absPath);
31830
+ (isSymlink || (await (0, fs_extra_1.lstat)(fsPath)).isSymbolicLink())) {
31831
+ const target = await (0, fs_extra_1.readlink)(absPath);
30757
31832
  const absTarget = path_1.default.resolve(path_1.default.dirname(absPath), target);
30758
31833
  if (path_1.default.relative(options.cwd, absTarget).startsWith(`..${path_1.default.sep}`)) {
30759
31834
  continue;
@@ -30761,7 +31836,7 @@ async function glob(pattern, opts, mountpoint) {
30761
31836
  }
30762
31837
  if (isSymlink || stat.isFile() || stat.isDirectory()) {
30763
31838
  if (isSymlink) {
30764
- stat = await fs_extra_1.lstat(absPath);
31839
+ stat = await (0, fs_extra_1.lstat)(absPath);
30765
31840
  }
30766
31841
  // Some bookkeeping to track which directories already have entries within
30767
31842
  const dirname = path_1.default.dirname(relativePath);
@@ -30786,7 +31861,7 @@ async function glob(pattern, opts, mountpoint) {
30786
31861
  if (mountpoint) {
30787
31862
  finalPath = path_1.default.join(mountpoint, finalPath);
30788
31863
  }
30789
- const fsPath = normalize_path_1.normalizePath(path_1.default.join(options.cwd, relativePath));
31864
+ const fsPath = (0, normalize_path_1.normalizePath)(path_1.default.join(options.cwd, relativePath));
30790
31865
  const stat = statCache[fsPath];
30791
31866
  results[finalPath] = new file_fs_ref_1.default({ mode: stat.mode, fsPath });
30792
31867
  }
@@ -30854,12 +31929,12 @@ exports.getDiscontinuedNodeVersions = getDiscontinuedNodeVersions;
30854
31929
  async function getSupportedNodeVersion(engineRange, isAuto = false) {
30855
31930
  let selection = getLatestNodeVersion();
30856
31931
  if (engineRange) {
30857
- const found = semver_1.validRange(engineRange) &&
31932
+ const found = (0, semver_1.validRange)(engineRange) &&
30858
31933
  getOptions().some(o => {
30859
31934
  // the array is already in order so return the first
30860
31935
  // match which will be the newest version of node
30861
31936
  selection = o;
30862
- return semver_1.intersects(o.range, engineRange);
31937
+ return (0, semver_1.intersects)(o.range, engineRange);
30863
31938
  });
30864
31939
  if (!found) {
30865
31940
  throw new errors_1.NowBuildError({
@@ -30877,7 +31952,7 @@ async function getSupportedNodeVersion(engineRange, isAuto = false) {
30877
31952
  message: `${intro} ${getHint(isAuto)}`,
30878
31953
  });
30879
31954
  }
30880
- debug_1.default(`Selected Node.js ${selection.range}`);
31955
+ (0, debug_1.default)(`Selected Node.js ${selection.range}`);
30881
31956
  if (selection.discontinueDate) {
30882
31957
  const d = selection.discontinueDate.toISOString().split('T')[0];
30883
31958
  console.warn(`Error: Node.js version ${selection.range} has reached End-of-Life. Deployments created on or after ${d} will fail to build. ${getHint(isAuto)}`);
@@ -30925,14 +32000,18 @@ exports.readConfigFile = void 0;
30925
32000
  const js_yaml_1 = __importDefault(__webpack_require__(1452));
30926
32001
  const toml_1 = __importDefault(__webpack_require__(207));
30927
32002
  const fs_extra_1 = __webpack_require__(6365);
32003
+ const error_utils_1 = __webpack_require__(9799);
30928
32004
  async function readFileOrNull(file) {
30929
32005
  try {
30930
- const data = await fs_extra_1.readFile(file);
32006
+ const data = await (0, fs_extra_1.readFile)(file);
30931
32007
  return data;
30932
32008
  }
30933
- catch (err) {
30934
- if (err.code !== 'ENOENT') {
30935
- throw err;
32009
+ catch (error) {
32010
+ if (!(0, error_utils_1.isErrnoException)(error)) {
32011
+ throw error;
32012
+ }
32013
+ if (error.code !== 'ENOENT') {
32014
+ throw error;
30936
32015
  }
30937
32016
  }
30938
32017
  return null;
@@ -31019,7 +32098,7 @@ function spawnAsync(command, args, opts = {}) {
31019
32098
  return new Promise((resolve, reject) => {
31020
32099
  const stderrLogs = [];
31021
32100
  opts = { stdio: 'inherit', ...opts };
31022
- const child = cross_spawn_1.default(command, args, opts);
32101
+ const child = (0, cross_spawn_1.default)(command, args, opts);
31023
32102
  if (opts.stdio === 'pipe' && child.stderr) {
31024
32103
  child.stderr.on('data', data => stderrLogs.push(data));
31025
32104
  }
@@ -31044,9 +32123,9 @@ exports.spawnAsync = spawnAsync;
31044
32123
  function spawnCommand(command, options = {}) {
31045
32124
  const opts = { ...options, prettyCommand: command };
31046
32125
  if (process.platform === 'win32') {
31047
- return cross_spawn_1.default('cmd.exe', ['/C', command], opts);
32126
+ return (0, cross_spawn_1.default)('cmd.exe', ['/C', command], opts);
31048
32127
  }
31049
- return cross_spawn_1.default('sh', ['-c', command], opts);
32128
+ return (0, cross_spawn_1.default)('sh', ['-c', command], opts);
31050
32129
  }
31051
32130
  exports.spawnCommand = spawnCommand;
31052
32131
  async function execCommand(command, options = {}) {
@@ -31075,7 +32154,7 @@ async function chmodPlusX(fsPath) {
31075
32154
  await fs_extra_1.default.chmod(fsPath, base8);
31076
32155
  }
31077
32156
  async function runShellScript(fsPath, args = [], spawnOpts) {
31078
- assert_1.default(path_1.default.isAbsolute(fsPath));
32157
+ (0, assert_1.default)(path_1.default.isAbsolute(fsPath));
31079
32158
  const destPath = path_1.default.dirname(fsPath);
31080
32159
  await chmodPlusX(fsPath);
31081
32160
  const command = `./${path_1.default.basename(fsPath)}`;
@@ -31089,7 +32168,7 @@ async function runShellScript(fsPath, args = [], spawnOpts) {
31089
32168
  exports.runShellScript = runShellScript;
31090
32169
  function getSpawnOptions(meta, nodeVersion) {
31091
32170
  const opts = {
31092
- env: clone_env_1.cloneEnv(process.env),
32171
+ env: (0, clone_env_1.cloneEnv)(process.env),
31093
32172
  };
31094
32173
  if (!meta.isDev) {
31095
32174
  let found = false;
@@ -31111,7 +32190,7 @@ function getSpawnOptions(meta, nodeVersion) {
31111
32190
  }
31112
32191
  exports.getSpawnOptions = getSpawnOptions;
31113
32192
  async function getNodeVersion(destPath, nodeVersionFallback = process.env.VERCEL_PROJECT_SETTINGS_NODE_VERSION, config = {}, meta = {}) {
31114
- const latest = node_version_1.getLatestNodeVersion();
32193
+ const latest = (0, node_version_1.getLatestNodeVersion)();
31115
32194
  if (meta.isDev) {
31116
32195
  // Use the system-installed version of `node` in PATH for `vercel dev`
31117
32196
  return { ...latest, runtime: 'nodejs' };
@@ -31121,23 +32200,23 @@ async function getNodeVersion(destPath, nodeVersionFallback = process.env.VERCEL
31121
32200
  let isAuto = true;
31122
32201
  if (packageJson?.engines?.node) {
31123
32202
  const { node } = packageJson.engines;
31124
- if (nodeVersion && semver_1.validRange(node) && !semver_1.intersects(nodeVersion, node)) {
32203
+ if (nodeVersion && (0, semver_1.validRange)(node) && !(0, semver_1.intersects)(nodeVersion, node)) {
31125
32204
  console.warn(`Warning: Due to "engines": { "node": "${node}" } in your \`package.json\` file, the Node.js Version defined in your Project Settings ("${nodeVersion}") will not apply. Learn More: http://vercel.link/node-version`);
31126
32205
  }
31127
- else if (semver_1.coerce(node)?.raw === node) {
32206
+ else if ((0, semver_1.coerce)(node)?.raw === node) {
31128
32207
  console.warn(`Warning: Detected "engines": { "node": "${node}" } in your \`package.json\` with major.minor.patch, but only major Node.js Version can be selected. Learn More: http://vercel.link/node-version`);
31129
32208
  }
31130
- else if (semver_1.validRange(node) && semver_1.intersects(`${latest.major + 1}.x`, node)) {
32209
+ else if ((0, semver_1.validRange)(node) && (0, semver_1.intersects)(`${latest.major + 1}.x`, node)) {
31131
32210
  console.warn(`Warning: Detected "engines": { "node": "${node}" } in your \`package.json\` that will automatically upgrade when a new major Node.js Version is released. Learn More: http://vercel.link/node-version`);
31132
32211
  }
31133
32212
  nodeVersion = node;
31134
32213
  isAuto = false;
31135
32214
  }
31136
- return node_version_1.getSupportedNodeVersion(nodeVersion, isAuto);
32215
+ return (0, node_version_1.getSupportedNodeVersion)(nodeVersion, isAuto);
31137
32216
  }
31138
32217
  exports.getNodeVersion = getNodeVersion;
31139
32218
  async function scanParentDirs(destPath, readPackageJson = false) {
31140
- assert_1.default(path_1.default.isAbsolute(destPath));
32219
+ (0, assert_1.default)(path_1.default.isAbsolute(destPath));
31141
32220
  const pkgJsonPath = await walkParentDirs({
31142
32221
  base: '/',
31143
32222
  start: destPath,
@@ -31157,10 +32236,10 @@ async function scanParentDirs(destPath, readPackageJson = false) {
31157
32236
  const [hasYarnLock, packageLockJson, pnpmLockYaml] = await Promise.all([
31158
32237
  Boolean(yarnLockPath),
31159
32238
  npmLockPath
31160
- ? read_config_file_1.readConfigFile(npmLockPath)
32239
+ ? (0, read_config_file_1.readConfigFile)(npmLockPath)
31161
32240
  : null,
31162
32241
  pnpmLockPath
31163
- ? read_config_file_1.readConfigFile(pnpmLockPath)
32242
+ ? (0, read_config_file_1.readConfigFile)(pnpmLockPath)
31164
32243
  : null,
31165
32244
  ]);
31166
32245
  // Priority order is Yarn > pnpm > npm
@@ -31189,8 +32268,8 @@ async function scanParentDirs(destPath, readPackageJson = false) {
31189
32268
  }
31190
32269
  exports.scanParentDirs = scanParentDirs;
31191
32270
  async function walkParentDirs({ base, start, filename, }) {
31192
- assert_1.default(path_1.default.isAbsolute(base), 'Expected "base" to be absolute path');
31193
- assert_1.default(path_1.default.isAbsolute(start), 'Expected "start" to be absolute path');
32271
+ (0, assert_1.default)(path_1.default.isAbsolute(base), 'Expected "base" to be absolute path');
32272
+ (0, assert_1.default)(path_1.default.isAbsolute(start), 'Expected "start" to be absolute path');
31194
32273
  let parent = '';
31195
32274
  for (let current = start; base.length <= current.length; current = parent) {
31196
32275
  const fullPath = path_1.default.join(current, filename);
@@ -31229,10 +32308,10 @@ function isSet(v) {
31229
32308
  }
31230
32309
  async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion) {
31231
32310
  if (meta?.isDev) {
31232
- debug_1.default('Skipping dependency installation because dev mode is enabled');
32311
+ (0, debug_1.default)('Skipping dependency installation because dev mode is enabled');
31233
32312
  return false;
31234
32313
  }
31235
- assert_1.default(path_1.default.isAbsolute(destPath));
32314
+ (0, assert_1.default)(path_1.default.isAbsolute(destPath));
31236
32315
  try {
31237
32316
  await runNpmInstallSema.acquire();
31238
32317
  const { cliType, packageJsonPath, lockfileVersion } = await scanParentDirs(destPath);
@@ -31253,9 +32332,9 @@ async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion)
31253
32332
  }
31254
32333
  const installTime = Date.now();
31255
32334
  console.log('Installing dependencies...');
31256
- debug_1.default(`Installing to ${destPath}`);
32335
+ (0, debug_1.default)(`Installing to ${destPath}`);
31257
32336
  const opts = { cwd: destPath, ...spawnOpts };
31258
- const env = clone_env_1.cloneEnv(opts.env || process.env);
32337
+ const env = (0, clone_env_1.cloneEnv)(opts.env || process.env);
31259
32338
  delete env.NODE_ENV;
31260
32339
  opts.env = getEnvForPackageManager({
31261
32340
  cliType,
@@ -31316,7 +32395,7 @@ async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion)
31316
32395
  throw err;
31317
32396
  }
31318
32397
  }
31319
- debug_1.default(`Install complete [${Date.now() - installTime}ms]`);
32398
+ (0, debug_1.default)(`Install complete [${Date.now() - installTime}ms]`);
31320
32399
  return true;
31321
32400
  }
31322
32401
  finally {
@@ -31378,7 +32457,7 @@ async function runCustomInstallCommand({ destPath, installCommand, nodeVersion,
31378
32457
  nodeVersion,
31379
32458
  env: spawnOpts?.env || {},
31380
32459
  });
31381
- debug_1.default(`Running with $PATH:`, env?.PATH || '');
32460
+ (0, debug_1.default)(`Running with $PATH:`, env?.PATH || '');
31382
32461
  await execCommand(installCommand, {
31383
32462
  ...spawnOpts,
31384
32463
  env,
@@ -31387,12 +32466,12 @@ async function runCustomInstallCommand({ destPath, installCommand, nodeVersion,
31387
32466
  }
31388
32467
  exports.runCustomInstallCommand = runCustomInstallCommand;
31389
32468
  async function runPackageJsonScript(destPath, scriptNames, spawnOpts) {
31390
- assert_1.default(path_1.default.isAbsolute(destPath));
32469
+ (0, assert_1.default)(path_1.default.isAbsolute(destPath));
31391
32470
  const { packageJson, cliType, lockfileVersion } = await scanParentDirs(destPath, true);
31392
32471
  const scriptName = getScriptName(packageJson, typeof scriptNames === 'string' ? [scriptNames] : scriptNames);
31393
32472
  if (!scriptName)
31394
32473
  return false;
31395
- debug_1.default('Running user script...');
32474
+ (0, debug_1.default)('Running user script...');
31396
32475
  const runScriptTime = Date.now();
31397
32476
  const opts = {
31398
32477
  cwd: destPath,
@@ -31401,7 +32480,7 @@ async function runPackageJsonScript(destPath, scriptNames, spawnOpts) {
31401
32480
  cliType,
31402
32481
  lockfileVersion,
31403
32482
  nodeVersion: undefined,
31404
- env: clone_env_1.cloneEnv(process.env, spawnOpts?.env),
32483
+ env: (0, clone_env_1.cloneEnv)(process.env, spawnOpts?.env),
31405
32484
  }),
31406
32485
  };
31407
32486
  if (cliType === 'npm') {
@@ -31415,26 +32494,26 @@ async function runPackageJsonScript(destPath, scriptNames, spawnOpts) {
31415
32494
  }
31416
32495
  console.log(`Running "${opts.prettyCommand}"`);
31417
32496
  await spawnAsync(cliType, ['run', scriptName], opts);
31418
- debug_1.default(`Script complete [${Date.now() - runScriptTime}ms]`);
32497
+ (0, debug_1.default)(`Script complete [${Date.now() - runScriptTime}ms]`);
31419
32498
  return true;
31420
32499
  }
31421
32500
  exports.runPackageJsonScript = runPackageJsonScript;
31422
32501
  async function runBundleInstall(destPath, args = [], spawnOpts, meta) {
31423
32502
  if (meta && meta.isDev) {
31424
- debug_1.default('Skipping dependency installation because dev mode is enabled');
32503
+ (0, debug_1.default)('Skipping dependency installation because dev mode is enabled');
31425
32504
  return;
31426
32505
  }
31427
- assert_1.default(path_1.default.isAbsolute(destPath));
32506
+ (0, assert_1.default)(path_1.default.isAbsolute(destPath));
31428
32507
  const opts = { ...spawnOpts, cwd: destPath, prettyCommand: 'bundle install' };
31429
32508
  await spawnAsync('bundle', args.concat(['install']), opts);
31430
32509
  }
31431
32510
  exports.runBundleInstall = runBundleInstall;
31432
32511
  async function runPipInstall(destPath, args = [], spawnOpts, meta) {
31433
32512
  if (meta && meta.isDev) {
31434
- debug_1.default('Skipping dependency installation because dev mode is enabled');
32513
+ (0, debug_1.default)('Skipping dependency installation because dev mode is enabled');
31435
32514
  return;
31436
32515
  }
31437
- assert_1.default(path_1.default.isAbsolute(destPath));
32516
+ (0, assert_1.default)(path_1.default.isAbsolute(destPath));
31438
32517
  const opts = { ...spawnOpts, cwd: destPath, prettyCommand: 'pip3 install' };
31439
32518
  await spawnAsync('pip3', ['install', '--disable-pip-version-check', ...args], opts);
31440
32519
  }
@@ -31454,7 +32533,7 @@ exports.getScriptName = getScriptName;
31454
32533
  * @deprecate installDependencies() is deprecated.
31455
32534
  * Please use runNpmInstall() instead.
31456
32535
  */
31457
- exports.installDependencies = util_1.deprecate(runNpmInstall, 'installDependencies() is deprecated. Please use runNpmInstall() instead.');
32536
+ exports.installDependencies = (0, util_1.deprecate)(runNpmInstall, 'installDependencies() is deprecated. Please use runNpmInstall() instead.');
31458
32537
 
31459
32538
 
31460
32539
  /***/ }),
@@ -31473,7 +32552,7 @@ function streamToBuffer(stream) {
31473
32552
  return new Promise((resolve, reject) => {
31474
32553
  const buffers = [];
31475
32554
  stream.on('data', buffers.push.bind(buffers));
31476
- end_of_stream_1.default(stream, err => {
32555
+ (0, end_of_stream_1.default)(stream, err => {
31477
32556
  if (err) {
31478
32557
  reject(err);
31479
32558
  return;
@@ -31549,7 +32628,7 @@ async function default_1(downloadPath, rootDirectory) {
31549
32628
  if (ignoreContents.length === 0) {
31550
32629
  return () => false;
31551
32630
  }
31552
- const ignoreFilter = ignore_1.default().add(clearRelative(ignoreContents[0]));
32631
+ const ignoreFilter = (0, ignore_1.default)().add(clearRelative(ignoreContents[0]));
31553
32632
  return function (p) {
31554
32633
  // we should not ignore now.json and vercel.json if it asked to.
31555
32634
  // we depend on these files for building the app with sourceless
@@ -31733,7 +32812,11 @@ async function linkOrCopy(srcFile, destFile) {
31733
32812
 
31734
32813
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
31735
32814
  if (k2 === undefined) k2 = k;
31736
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
32815
+ var desc = Object.getOwnPropertyDescriptor(m, k);
32816
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
32817
+ desc = { enumerable: true, get: function() { return m[k]; } };
32818
+ }
32819
+ Object.defineProperty(o, k2, desc);
31737
32820
  }) : (function(o, m, k, k2) {
31738
32821
  if (k2 === undefined) k2 = k;
31739
32822
  o[k2] = m[k];
@@ -31845,7 +32928,7 @@ exports.getLambdaOptionsFromFunction = exports.createZip = exports.createLambda
31845
32928
  const assert_1 = __importDefault(__webpack_require__(2357));
31846
32929
  const async_sema_1 = __importDefault(__webpack_require__(2219));
31847
32930
  const yazl_1 = __webpack_require__(3044);
31848
- const minimatch_1 = __importDefault(__webpack_require__(7767));
32931
+ const minimatch_1 = __importDefault(__webpack_require__(7345));
31849
32932
  const fs_extra_1 = __webpack_require__(6365);
31850
32933
  const download_1 = __webpack_require__(3166);
31851
32934
  const stream_to_buffer_1 = __importDefault(__webpack_require__(9688));
@@ -31853,39 +32936,39 @@ class Lambda {
31853
32936
  constructor(opts) {
31854
32937
  const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, supportsResponseStreaming, experimentalResponseStreaming, operationType, framework, } = opts;
31855
32938
  if ('files' in opts) {
31856
- assert_1.default(typeof opts.files === 'object', '"files" must be an object');
32939
+ (0, assert_1.default)(typeof opts.files === 'object', '"files" must be an object');
31857
32940
  }
31858
32941
  if ('zipBuffer' in opts) {
31859
- assert_1.default(Buffer.isBuffer(opts.zipBuffer), '"zipBuffer" must be a Buffer');
32942
+ (0, assert_1.default)(Buffer.isBuffer(opts.zipBuffer), '"zipBuffer" must be a Buffer');
31860
32943
  }
31861
- assert_1.default(typeof handler === 'string', '"handler" is not a string');
31862
- assert_1.default(typeof runtime === 'string', '"runtime" is not a string');
31863
- assert_1.default(typeof environment === 'object', '"environment" is not an object');
32944
+ (0, assert_1.default)(typeof handler === 'string', '"handler" is not a string');
32945
+ (0, assert_1.default)(typeof runtime === 'string', '"runtime" is not a string');
32946
+ (0, assert_1.default)(typeof environment === 'object', '"environment" is not an object');
31864
32947
  if (memory !== undefined) {
31865
- assert_1.default(typeof memory === 'number', '"memory" is not a number');
32948
+ (0, assert_1.default)(typeof memory === 'number', '"memory" is not a number');
31866
32949
  }
31867
32950
  if (maxDuration !== undefined) {
31868
- assert_1.default(typeof maxDuration === 'number', '"maxDuration" is not a number');
32951
+ (0, assert_1.default)(typeof maxDuration === 'number', '"maxDuration" is not a number');
31869
32952
  }
31870
32953
  if (allowQuery !== undefined) {
31871
- assert_1.default(Array.isArray(allowQuery), '"allowQuery" is not an Array');
31872
- assert_1.default(allowQuery.every(q => typeof q === 'string'), '"allowQuery" is not a string Array');
32954
+ (0, assert_1.default)(Array.isArray(allowQuery), '"allowQuery" is not an Array');
32955
+ (0, assert_1.default)(allowQuery.every(q => typeof q === 'string'), '"allowQuery" is not a string Array');
31873
32956
  }
31874
32957
  if (supportsMultiPayloads !== undefined) {
31875
- assert_1.default(typeof supportsMultiPayloads === 'boolean', '"supportsMultiPayloads" is not a boolean');
32958
+ (0, assert_1.default)(typeof supportsMultiPayloads === 'boolean', '"supportsMultiPayloads" is not a boolean');
31876
32959
  }
31877
32960
  if (supportsWrapper !== undefined) {
31878
- assert_1.default(typeof supportsWrapper === 'boolean', '"supportsWrapper" is not a boolean');
32961
+ (0, assert_1.default)(typeof supportsWrapper === 'boolean', '"supportsWrapper" is not a boolean');
31879
32962
  }
31880
32963
  if (regions !== undefined) {
31881
- assert_1.default(Array.isArray(regions), '"regions" is not an Array');
31882
- assert_1.default(regions.every(r => typeof r === 'string'), '"regions" is not a string Array');
32964
+ (0, assert_1.default)(Array.isArray(regions), '"regions" is not an Array');
32965
+ (0, assert_1.default)(regions.every(r => typeof r === 'string'), '"regions" is not a string Array');
31883
32966
  }
31884
32967
  if (framework !== undefined) {
31885
- assert_1.default(typeof framework === 'object', '"framework" is not an object');
31886
- assert_1.default(typeof framework.slug === 'string', '"framework.slug" is not a string');
32968
+ (0, assert_1.default)(typeof framework === 'object', '"framework" is not an object');
32969
+ (0, assert_1.default)(typeof framework.slug === 'string', '"framework.slug" is not a string');
31887
32970
  if (framework.version !== undefined) {
31888
- assert_1.default(typeof framework.version === 'string', '"framework.version" is not a string');
32971
+ (0, assert_1.default)(typeof framework.version === 'string', '"framework.version" is not a string');
31889
32972
  }
31890
32973
  }
31891
32974
  this.type = 'Lambda';
@@ -31949,8 +33032,8 @@ async function createZip(files) {
31949
33032
  const symlinkTargets = new Map();
31950
33033
  for (const name of names) {
31951
33034
  const file = files[name];
31952
- if (file.mode && download_1.isSymbolicLink(file.mode) && file.type === 'FileFsRef') {
31953
- const symlinkTarget = await fs_extra_1.readlink(file.fsPath);
33035
+ if (file.mode && (0, download_1.isSymbolicLink)(file.mode) && file.type === 'FileFsRef') {
33036
+ const symlinkTarget = await (0, fs_extra_1.readlink)(file.fsPath);
31954
33037
  symlinkTargets.set(name, symlinkTarget);
31955
33038
  }
31956
33039
  }
@@ -31963,7 +33046,7 @@ async function createZip(files) {
31963
33046
  if (typeof symlinkTarget === 'string') {
31964
33047
  zipFile.addBuffer(Buffer.from(symlinkTarget, 'utf8'), name, opts);
31965
33048
  }
31966
- else if (file.mode && download_1.isDirectory(file.mode)) {
33049
+ else if (file.mode && (0, download_1.isDirectory)(file.mode)) {
31967
33050
  zipFile.addEmptyDirectory(name, opts);
31968
33051
  }
31969
33052
  else {
@@ -31973,7 +33056,7 @@ async function createZip(files) {
31973
33056
  }
31974
33057
  }
31975
33058
  zipFile.end();
31976
- stream_to_buffer_1.default(zipFile.outputStream).then(resolve).catch(reject);
33059
+ (0, stream_to_buffer_1.default)(zipFile.outputStream).then(resolve).catch(reject);
31977
33060
  });
31978
33061
  return zipBuffer;
31979
33062
  }
@@ -31981,7 +33064,7 @@ exports.createZip = createZip;
31981
33064
  async function getLambdaOptionsFromFunction({ sourceFile, config, }) {
31982
33065
  if (config?.functions) {
31983
33066
  for (const [pattern, fn] of Object.entries(config.functions)) {
31984
- if (sourceFile === pattern || minimatch_1.default(sourceFile, pattern)) {
33067
+ if (sourceFile === pattern || (0, minimatch_1.default)(sourceFile, pattern)) {
31985
33068
  return {
31986
33069
  memory: fn.memory,
31987
33070
  maxDuration: fn.maxDuration,
@@ -32177,7 +33260,7 @@ const shouldServe = ({ entrypoint, files, requestPath, }) => {
32177
33260
  if (entrypoint === requestPath && hasProp(files, entrypoint)) {
32178
33261
  return true;
32179
33262
  }
32180
- const { dir, name } = path_1.parse(entrypoint);
33263
+ const { dir, name } = (0, path_1.parse)(entrypoint);
32181
33264
  if (name === 'index' && dir === requestPath && hasProp(files, entrypoint)) {
32182
33265
  return true;
32183
33266
  }