@vercel/build-utils 6.7.1 → 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/debug.js +1 -1
- package/dist/file-blob.js +5 -5
- package/dist/file-fs-ref.js +6 -6
- package/dist/file-ref.js +5 -5
- package/dist/fs/download.js +9 -9
- package/dist/fs/get-writable-directory.js +2 -2
- package/dist/fs/glob.js +7 -7
- package/dist/fs/node-version.js +3 -3
- package/dist/fs/read-config-file.js +8 -4
- package/dist/fs/rename.d.ts +1 -1
- package/dist/fs/run-user-scripts.d.ts +1 -1
- package/dist/fs/run-user-scripts.js +30 -30
- package/dist/fs/stream-to-buffer.js +1 -1
- package/dist/get-ignore-filter.js +1 -1
- package/dist/get-prefixed-env-vars.d.ts +1 -1
- package/dist/index.js +1157 -98
- package/dist/lambda.d.ts +1 -1
- package/dist/lambda.js +21 -21
- package/dist/should-serve.js +1 -1
- package/dist/types.d.ts +12 -12
- package/package.json +4 -3
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__(
|
17859
|
+
_fs = __webpack_require__(7156)
|
16887
17860
|
} catch (_) {
|
16888
17861
|
_fs = __webpack_require__(5747)
|
16889
17862
|
}
|
@@ -30193,6 +31166,84 @@ function bufferIncludes(buffer, content) {
|
|
30193
31166
|
}
|
30194
31167
|
|
30195
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
|
+
|
30196
31247
|
/***/ }),
|
30197
31248
|
|
30198
31249
|
/***/ 651:
|
@@ -30245,7 +31296,7 @@ exports.cloneEnv = cloneEnv;
|
|
30245
31296
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
30246
31297
|
const get_platform_env_1 = __webpack_require__(7060);
|
30247
31298
|
function debug(message, ...additional) {
|
30248
|
-
if (get_platform_env_1.getPlatformEnv('BUILDER_DEBUG')) {
|
31299
|
+
if ((0, get_platform_env_1.getPlatformEnv)('BUILDER_DEBUG')) {
|
30249
31300
|
console.log(message, ...additional);
|
30250
31301
|
}
|
30251
31302
|
else if (process.env.VERCEL_DEBUG_PREFIX) {
|
@@ -30392,16 +31443,16 @@ const assert_1 = __importDefault(__webpack_require__(2357));
|
|
30392
31443
|
const into_stream_1 = __importDefault(__webpack_require__(6398));
|
30393
31444
|
class FileBlob {
|
30394
31445
|
constructor({ mode = 0o100644, contentType, data }) {
|
30395
|
-
assert_1.default(typeof mode === 'number');
|
30396
|
-
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));
|
30397
31448
|
this.type = 'FileBlob';
|
30398
31449
|
this.mode = mode;
|
30399
31450
|
this.contentType = contentType;
|
30400
31451
|
this.data = data;
|
30401
31452
|
}
|
30402
31453
|
static async fromStream({ mode = 0o100644, contentType, stream, }) {
|
30403
|
-
assert_1.default(typeof mode === 'number');
|
30404
|
-
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
|
30405
31456
|
const chunks = [];
|
30406
31457
|
await new Promise((resolve, reject) => {
|
30407
31458
|
stream.on('data', chunk => chunks.push(Buffer.from(chunk)));
|
@@ -30415,7 +31466,7 @@ class FileBlob {
|
|
30415
31466
|
return this.toStream();
|
30416
31467
|
}
|
30417
31468
|
toStream() {
|
30418
|
-
return into_stream_1.default(this.data);
|
31469
|
+
return (0, into_stream_1.default)(this.data);
|
30419
31470
|
}
|
30420
31471
|
}
|
30421
31472
|
exports.default = FileBlob;
|
@@ -30441,8 +31492,8 @@ const DEFAULT_SEMA = 20;
|
|
30441
31492
|
const semaToPreventEMFILE = new async_sema_1.default(parseInt(process.env.VERCEL_INTERNAL_FILE_FS_REF_SEMA || String(DEFAULT_SEMA), 10) || DEFAULT_SEMA);
|
30442
31493
|
class FileFsRef {
|
30443
31494
|
constructor({ mode = 0o100644, contentType, fsPath }) {
|
30444
|
-
assert_1.default(typeof mode === 'number');
|
30445
|
-
assert_1.default(typeof fsPath === 'string');
|
31495
|
+
(0, assert_1.default)(typeof mode === 'number');
|
31496
|
+
(0, assert_1.default)(typeof fsPath === 'string');
|
30446
31497
|
this.type = 'FileFsRef';
|
30447
31498
|
this.mode = mode;
|
30448
31499
|
this.contentType = contentType;
|
@@ -30457,9 +31508,9 @@ class FileFsRef {
|
|
30457
31508
|
return new FileFsRef({ mode: m, contentType, fsPath });
|
30458
31509
|
}
|
30459
31510
|
static async fromStream({ mode = 0o100644, contentType, stream, fsPath, }) {
|
30460
|
-
assert_1.default(typeof mode === 'number');
|
30461
|
-
assert_1.default(typeof stream.pipe === 'function'); // is-stream
|
30462
|
-
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');
|
30463
31514
|
await fs_extra_1.default.mkdirp(path_1.default.dirname(fsPath));
|
30464
31515
|
await new Promise((resolve, reject) => {
|
30465
31516
|
const dest = fs_extra_1.default.createWriteStream(fsPath, {
|
@@ -30483,7 +31534,7 @@ class FileFsRef {
|
|
30483
31534
|
toStream() {
|
30484
31535
|
let flag = false;
|
30485
31536
|
// eslint-disable-next-line consistent-return
|
30486
|
-
return multistream_1.default(cb => {
|
31537
|
+
return (0, multistream_1.default)(cb => {
|
30487
31538
|
if (flag)
|
30488
31539
|
return cb(null, null);
|
30489
31540
|
flag = true;
|
@@ -30526,8 +31577,8 @@ class BailableError extends Error {
|
|
30526
31577
|
}
|
30527
31578
|
class FileRef {
|
30528
31579
|
constructor({ mode = 0o100644, digest, contentType, mutable = false, }) {
|
30529
|
-
assert_1.default(typeof mode === 'number');
|
30530
|
-
assert_1.default(typeof digest === 'string');
|
31580
|
+
(0, assert_1.default)(typeof mode === 'number');
|
31581
|
+
(0, assert_1.default)(typeof digest === 'string');
|
30531
31582
|
this.type = 'FileRef';
|
30532
31583
|
this.mode = mode;
|
30533
31584
|
this.digest = digest;
|
@@ -30558,8 +31609,8 @@ class FileRef {
|
|
30558
31609
|
await semaToDownloadFromS3.acquire();
|
30559
31610
|
// console.time(`downloading ${url}`);
|
30560
31611
|
try {
|
30561
|
-
return await async_retry_1.default(async () => {
|
30562
|
-
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);
|
30563
31614
|
if (!resp.ok) {
|
30564
31615
|
const error = new BailableError(`download: ${resp.status} ${resp.statusText} for ${url}`);
|
30565
31616
|
if (resp.status === 403)
|
@@ -30577,7 +31628,7 @@ class FileRef {
|
|
30577
31628
|
toStream() {
|
30578
31629
|
let flag = false;
|
30579
31630
|
// eslint-disable-next-line consistent-return
|
30580
|
-
return multistream_1.default(cb => {
|
31631
|
+
return (0, multistream_1.default)(cb => {
|
30581
31632
|
if (flag)
|
30582
31633
|
return cb(null, null);
|
30583
31634
|
flag = true;
|
@@ -30623,13 +31674,13 @@ function isSymbolicLink(mode) {
|
|
30623
31674
|
}
|
30624
31675
|
exports.isSymbolicLink = isSymbolicLink;
|
30625
31676
|
async function prepareSymlinkTarget(file, fsPath) {
|
30626
|
-
const mkdirPromise = fs_extra_1.mkdirp(path_1.default.dirname(fsPath));
|
31677
|
+
const mkdirPromise = (0, fs_extra_1.mkdirp)(path_1.default.dirname(fsPath));
|
30627
31678
|
if (file.type === 'FileFsRef') {
|
30628
|
-
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]);
|
30629
31680
|
return target;
|
30630
31681
|
}
|
30631
31682
|
if (file.type === 'FileRef' || file.type === 'FileBlob') {
|
30632
|
-
const targetPathBufferPromise = stream_to_buffer_1.default(await file.toStreamAsync());
|
31683
|
+
const targetPathBufferPromise = (0, stream_to_buffer_1.default)(await file.toStreamAsync());
|
30633
31684
|
const [targetPathBuffer] = await Promise.all([
|
30634
31685
|
targetPathBufferPromise,
|
30635
31686
|
mkdirPromise,
|
@@ -30641,8 +31692,8 @@ async function prepareSymlinkTarget(file, fsPath) {
|
|
30641
31692
|
async function downloadFile(file, fsPath) {
|
30642
31693
|
const { mode } = file;
|
30643
31694
|
if (isDirectory(mode)) {
|
30644
|
-
await fs_extra_1.mkdirp(fsPath);
|
30645
|
-
await fs_extra_1.chmod(fsPath, mode);
|
31695
|
+
await (0, fs_extra_1.mkdirp)(fsPath);
|
31696
|
+
await (0, fs_extra_1.chmod)(fsPath, mode);
|
30646
31697
|
return file_fs_ref_1.default.fromFsPath({ mode, fsPath });
|
30647
31698
|
}
|
30648
31699
|
// If the source is a symlink, try to create it instead of copying the file.
|
@@ -30650,7 +31701,7 @@ async function downloadFile(file, fsPath) {
|
|
30650
31701
|
// enabled in the group policy. We may want to improve the error message.
|
30651
31702
|
if (isSymbolicLink(mode)) {
|
30652
31703
|
const target = await prepareSymlinkTarget(file, fsPath);
|
30653
|
-
await fs_extra_1.symlink(target, fsPath);
|
31704
|
+
await (0, fs_extra_1.symlink)(target, fsPath);
|
30654
31705
|
return file_fs_ref_1.default.fromFsPath({ mode, fsPath });
|
30655
31706
|
}
|
30656
31707
|
const stream = file.toStream();
|
@@ -30659,7 +31710,7 @@ async function downloadFile(file, fsPath) {
|
|
30659
31710
|
exports.downloadFile = downloadFile;
|
30660
31711
|
async function removeFile(basePath, fileMatched) {
|
30661
31712
|
const file = path_1.default.join(basePath, fileMatched);
|
30662
|
-
await fs_extra_1.remove(file);
|
31713
|
+
await (0, fs_extra_1.remove)(file);
|
30663
31714
|
}
|
30664
31715
|
async function download(files, basePath, meta) {
|
30665
31716
|
const { isDev = false, skipDownload = false, filesChanged = null, filesRemoved = null, } = meta || {};
|
@@ -30669,7 +31720,7 @@ async function download(files, basePath, meta) {
|
|
30669
31720
|
// source files are already available.
|
30670
31721
|
return files;
|
30671
31722
|
}
|
30672
|
-
debug_1.default('Downloading deployment source files...');
|
31723
|
+
(0, debug_1.default)('Downloading deployment source files...');
|
30673
31724
|
const start = Date.now();
|
30674
31725
|
const files2 = {};
|
30675
31726
|
const filenames = Object.keys(files);
|
@@ -30702,7 +31753,7 @@ async function download(files, basePath, meta) {
|
|
30702
31753
|
files2[name] = await downloadFile(file, fsPath);
|
30703
31754
|
}));
|
30704
31755
|
const duration = Date.now() - start;
|
30705
|
-
debug_1.default(`Downloaded ${filenames.length} source files: ${duration}ms`);
|
31756
|
+
(0, debug_1.default)(`Downloaded ${filenames.length} source files: ${duration}ms`);
|
30706
31757
|
return files2;
|
30707
31758
|
}
|
30708
31759
|
exports.default = download;
|
@@ -30721,8 +31772,8 @@ const os_1 = __webpack_require__(2087);
|
|
30721
31772
|
const fs_extra_1 = __webpack_require__(6365);
|
30722
31773
|
async function getWritableDirectory() {
|
30723
31774
|
const name = Math.floor(Math.random() * 0x7fffffff).toString(16);
|
30724
|
-
const directory = path_1.join(os_1.tmpdir(), name);
|
30725
|
-
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);
|
30726
31777
|
return directory;
|
30727
31778
|
}
|
30728
31779
|
exports.default = getWritableDirectory;
|
@@ -30746,7 +31797,7 @@ const util_1 = __webpack_require__(1669);
|
|
30746
31797
|
const fs_extra_1 = __webpack_require__(6365);
|
30747
31798
|
const normalize_path_1 = __webpack_require__(6263);
|
30748
31799
|
const file_fs_ref_1 = __importDefault(__webpack_require__(6274));
|
30749
|
-
const vanillaGlob = util_1.promisify(glob_1.default);
|
31800
|
+
const vanillaGlob = (0, util_1.promisify)(glob_1.default);
|
30750
31801
|
async function glob(pattern, opts, mountpoint) {
|
30751
31802
|
const options = typeof opts === 'string' ? { cwd: opts } : opts;
|
30752
31803
|
if (!options.cwd) {
|
@@ -30769,15 +31820,15 @@ async function glob(pattern, opts, mountpoint) {
|
|
30769
31820
|
const dirsWithEntries = new Set();
|
30770
31821
|
for (const relativePath of files) {
|
30771
31822
|
const absPath = path_1.default.join(options.cwd, relativePath);
|
30772
|
-
const fsPath = normalize_path_1.normalizePath(absPath);
|
31823
|
+
const fsPath = (0, normalize_path_1.normalizePath)(absPath);
|
30773
31824
|
let stat = statCache[fsPath];
|
30774
|
-
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})`);
|
30775
31826
|
const isSymlink = symlinks[fsPath];
|
30776
31827
|
// When `follow` mode is enabled, ensure that the entry is not a symlink
|
30777
31828
|
// that points to outside of `cwd`
|
30778
31829
|
if (options.follow &&
|
30779
|
-
(isSymlink || (await fs_extra_1.lstat(fsPath)).isSymbolicLink())) {
|
30780
|
-
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);
|
30781
31832
|
const absTarget = path_1.default.resolve(path_1.default.dirname(absPath), target);
|
30782
31833
|
if (path_1.default.relative(options.cwd, absTarget).startsWith(`..${path_1.default.sep}`)) {
|
30783
31834
|
continue;
|
@@ -30785,7 +31836,7 @@ async function glob(pattern, opts, mountpoint) {
|
|
30785
31836
|
}
|
30786
31837
|
if (isSymlink || stat.isFile() || stat.isDirectory()) {
|
30787
31838
|
if (isSymlink) {
|
30788
|
-
stat = await fs_extra_1.lstat(absPath);
|
31839
|
+
stat = await (0, fs_extra_1.lstat)(absPath);
|
30789
31840
|
}
|
30790
31841
|
// Some bookkeeping to track which directories already have entries within
|
30791
31842
|
const dirname = path_1.default.dirname(relativePath);
|
@@ -30810,7 +31861,7 @@ async function glob(pattern, opts, mountpoint) {
|
|
30810
31861
|
if (mountpoint) {
|
30811
31862
|
finalPath = path_1.default.join(mountpoint, finalPath);
|
30812
31863
|
}
|
30813
|
-
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));
|
30814
31865
|
const stat = statCache[fsPath];
|
30815
31866
|
results[finalPath] = new file_fs_ref_1.default({ mode: stat.mode, fsPath });
|
30816
31867
|
}
|
@@ -30878,12 +31929,12 @@ exports.getDiscontinuedNodeVersions = getDiscontinuedNodeVersions;
|
|
30878
31929
|
async function getSupportedNodeVersion(engineRange, isAuto = false) {
|
30879
31930
|
let selection = getLatestNodeVersion();
|
30880
31931
|
if (engineRange) {
|
30881
|
-
const found = semver_1.validRange(engineRange) &&
|
31932
|
+
const found = (0, semver_1.validRange)(engineRange) &&
|
30882
31933
|
getOptions().some(o => {
|
30883
31934
|
// the array is already in order so return the first
|
30884
31935
|
// match which will be the newest version of node
|
30885
31936
|
selection = o;
|
30886
|
-
return semver_1.intersects(o.range, engineRange);
|
31937
|
+
return (0, semver_1.intersects)(o.range, engineRange);
|
30887
31938
|
});
|
30888
31939
|
if (!found) {
|
30889
31940
|
throw new errors_1.NowBuildError({
|
@@ -30901,7 +31952,7 @@ async function getSupportedNodeVersion(engineRange, isAuto = false) {
|
|
30901
31952
|
message: `${intro} ${getHint(isAuto)}`,
|
30902
31953
|
});
|
30903
31954
|
}
|
30904
|
-
debug_1.default(`Selected Node.js ${selection.range}`);
|
31955
|
+
(0, debug_1.default)(`Selected Node.js ${selection.range}`);
|
30905
31956
|
if (selection.discontinueDate) {
|
30906
31957
|
const d = selection.discontinueDate.toISOString().split('T')[0];
|
30907
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)}`);
|
@@ -30949,14 +32000,18 @@ exports.readConfigFile = void 0;
|
|
30949
32000
|
const js_yaml_1 = __importDefault(__webpack_require__(1452));
|
30950
32001
|
const toml_1 = __importDefault(__webpack_require__(207));
|
30951
32002
|
const fs_extra_1 = __webpack_require__(6365);
|
32003
|
+
const error_utils_1 = __webpack_require__(9799);
|
30952
32004
|
async function readFileOrNull(file) {
|
30953
32005
|
try {
|
30954
|
-
const data = await fs_extra_1.readFile(file);
|
32006
|
+
const data = await (0, fs_extra_1.readFile)(file);
|
30955
32007
|
return data;
|
30956
32008
|
}
|
30957
|
-
catch (
|
30958
|
-
if (
|
30959
|
-
throw
|
32009
|
+
catch (error) {
|
32010
|
+
if (!(0, error_utils_1.isErrnoException)(error)) {
|
32011
|
+
throw error;
|
32012
|
+
}
|
32013
|
+
if (error.code !== 'ENOENT') {
|
32014
|
+
throw error;
|
30960
32015
|
}
|
30961
32016
|
}
|
30962
32017
|
return null;
|
@@ -31043,7 +32098,7 @@ function spawnAsync(command, args, opts = {}) {
|
|
31043
32098
|
return new Promise((resolve, reject) => {
|
31044
32099
|
const stderrLogs = [];
|
31045
32100
|
opts = { stdio: 'inherit', ...opts };
|
31046
|
-
const child = cross_spawn_1.default(command, args, opts);
|
32101
|
+
const child = (0, cross_spawn_1.default)(command, args, opts);
|
31047
32102
|
if (opts.stdio === 'pipe' && child.stderr) {
|
31048
32103
|
child.stderr.on('data', data => stderrLogs.push(data));
|
31049
32104
|
}
|
@@ -31068,9 +32123,9 @@ exports.spawnAsync = spawnAsync;
|
|
31068
32123
|
function spawnCommand(command, options = {}) {
|
31069
32124
|
const opts = { ...options, prettyCommand: command };
|
31070
32125
|
if (process.platform === 'win32') {
|
31071
|
-
return cross_spawn_1.default('cmd.exe', ['/C', command], opts);
|
32126
|
+
return (0, cross_spawn_1.default)('cmd.exe', ['/C', command], opts);
|
31072
32127
|
}
|
31073
|
-
return cross_spawn_1.default('sh', ['-c', command], opts);
|
32128
|
+
return (0, cross_spawn_1.default)('sh', ['-c', command], opts);
|
31074
32129
|
}
|
31075
32130
|
exports.spawnCommand = spawnCommand;
|
31076
32131
|
async function execCommand(command, options = {}) {
|
@@ -31099,7 +32154,7 @@ async function chmodPlusX(fsPath) {
|
|
31099
32154
|
await fs_extra_1.default.chmod(fsPath, base8);
|
31100
32155
|
}
|
31101
32156
|
async function runShellScript(fsPath, args = [], spawnOpts) {
|
31102
|
-
assert_1.default(path_1.default.isAbsolute(fsPath));
|
32157
|
+
(0, assert_1.default)(path_1.default.isAbsolute(fsPath));
|
31103
32158
|
const destPath = path_1.default.dirname(fsPath);
|
31104
32159
|
await chmodPlusX(fsPath);
|
31105
32160
|
const command = `./${path_1.default.basename(fsPath)}`;
|
@@ -31113,7 +32168,7 @@ async function runShellScript(fsPath, args = [], spawnOpts) {
|
|
31113
32168
|
exports.runShellScript = runShellScript;
|
31114
32169
|
function getSpawnOptions(meta, nodeVersion) {
|
31115
32170
|
const opts = {
|
31116
|
-
env: clone_env_1.cloneEnv(process.env),
|
32171
|
+
env: (0, clone_env_1.cloneEnv)(process.env),
|
31117
32172
|
};
|
31118
32173
|
if (!meta.isDev) {
|
31119
32174
|
let found = false;
|
@@ -31135,7 +32190,7 @@ function getSpawnOptions(meta, nodeVersion) {
|
|
31135
32190
|
}
|
31136
32191
|
exports.getSpawnOptions = getSpawnOptions;
|
31137
32192
|
async function getNodeVersion(destPath, nodeVersionFallback = process.env.VERCEL_PROJECT_SETTINGS_NODE_VERSION, config = {}, meta = {}) {
|
31138
|
-
const latest = node_version_1.getLatestNodeVersion();
|
32193
|
+
const latest = (0, node_version_1.getLatestNodeVersion)();
|
31139
32194
|
if (meta.isDev) {
|
31140
32195
|
// Use the system-installed version of `node` in PATH for `vercel dev`
|
31141
32196
|
return { ...latest, runtime: 'nodejs' };
|
@@ -31145,23 +32200,23 @@ async function getNodeVersion(destPath, nodeVersionFallback = process.env.VERCEL
|
|
31145
32200
|
let isAuto = true;
|
31146
32201
|
if (packageJson?.engines?.node) {
|
31147
32202
|
const { node } = packageJson.engines;
|
31148
|
-
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)) {
|
31149
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`);
|
31150
32205
|
}
|
31151
|
-
else if (semver_1.coerce(node)?.raw === node) {
|
32206
|
+
else if ((0, semver_1.coerce)(node)?.raw === node) {
|
31152
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`);
|
31153
32208
|
}
|
31154
|
-
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)) {
|
31155
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`);
|
31156
32211
|
}
|
31157
32212
|
nodeVersion = node;
|
31158
32213
|
isAuto = false;
|
31159
32214
|
}
|
31160
|
-
return node_version_1.getSupportedNodeVersion(nodeVersion, isAuto);
|
32215
|
+
return (0, node_version_1.getSupportedNodeVersion)(nodeVersion, isAuto);
|
31161
32216
|
}
|
31162
32217
|
exports.getNodeVersion = getNodeVersion;
|
31163
32218
|
async function scanParentDirs(destPath, readPackageJson = false) {
|
31164
|
-
assert_1.default(path_1.default.isAbsolute(destPath));
|
32219
|
+
(0, assert_1.default)(path_1.default.isAbsolute(destPath));
|
31165
32220
|
const pkgJsonPath = await walkParentDirs({
|
31166
32221
|
base: '/',
|
31167
32222
|
start: destPath,
|
@@ -31181,10 +32236,10 @@ async function scanParentDirs(destPath, readPackageJson = false) {
|
|
31181
32236
|
const [hasYarnLock, packageLockJson, pnpmLockYaml] = await Promise.all([
|
31182
32237
|
Boolean(yarnLockPath),
|
31183
32238
|
npmLockPath
|
31184
|
-
? read_config_file_1.readConfigFile(npmLockPath)
|
32239
|
+
? (0, read_config_file_1.readConfigFile)(npmLockPath)
|
31185
32240
|
: null,
|
31186
32241
|
pnpmLockPath
|
31187
|
-
? read_config_file_1.readConfigFile(pnpmLockPath)
|
32242
|
+
? (0, read_config_file_1.readConfigFile)(pnpmLockPath)
|
31188
32243
|
: null,
|
31189
32244
|
]);
|
31190
32245
|
// Priority order is Yarn > pnpm > npm
|
@@ -31213,8 +32268,8 @@ async function scanParentDirs(destPath, readPackageJson = false) {
|
|
31213
32268
|
}
|
31214
32269
|
exports.scanParentDirs = scanParentDirs;
|
31215
32270
|
async function walkParentDirs({ base, start, filename, }) {
|
31216
|
-
assert_1.default(path_1.default.isAbsolute(base), 'Expected "base" to be absolute path');
|
31217
|
-
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');
|
31218
32273
|
let parent = '';
|
31219
32274
|
for (let current = start; base.length <= current.length; current = parent) {
|
31220
32275
|
const fullPath = path_1.default.join(current, filename);
|
@@ -31253,10 +32308,10 @@ function isSet(v) {
|
|
31253
32308
|
}
|
31254
32309
|
async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion) {
|
31255
32310
|
if (meta?.isDev) {
|
31256
|
-
debug_1.default('Skipping dependency installation because dev mode is enabled');
|
32311
|
+
(0, debug_1.default)('Skipping dependency installation because dev mode is enabled');
|
31257
32312
|
return false;
|
31258
32313
|
}
|
31259
|
-
assert_1.default(path_1.default.isAbsolute(destPath));
|
32314
|
+
(0, assert_1.default)(path_1.default.isAbsolute(destPath));
|
31260
32315
|
try {
|
31261
32316
|
await runNpmInstallSema.acquire();
|
31262
32317
|
const { cliType, packageJsonPath, lockfileVersion } = await scanParentDirs(destPath);
|
@@ -31277,9 +32332,9 @@ async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion)
|
|
31277
32332
|
}
|
31278
32333
|
const installTime = Date.now();
|
31279
32334
|
console.log('Installing dependencies...');
|
31280
|
-
debug_1.default(`Installing to ${destPath}`);
|
32335
|
+
(0, debug_1.default)(`Installing to ${destPath}`);
|
31281
32336
|
const opts = { cwd: destPath, ...spawnOpts };
|
31282
|
-
const env = clone_env_1.cloneEnv(opts.env || process.env);
|
32337
|
+
const env = (0, clone_env_1.cloneEnv)(opts.env || process.env);
|
31283
32338
|
delete env.NODE_ENV;
|
31284
32339
|
opts.env = getEnvForPackageManager({
|
31285
32340
|
cliType,
|
@@ -31340,7 +32395,7 @@ async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion)
|
|
31340
32395
|
throw err;
|
31341
32396
|
}
|
31342
32397
|
}
|
31343
|
-
debug_1.default(`Install complete [${Date.now() - installTime}ms]`);
|
32398
|
+
(0, debug_1.default)(`Install complete [${Date.now() - installTime}ms]`);
|
31344
32399
|
return true;
|
31345
32400
|
}
|
31346
32401
|
finally {
|
@@ -31402,7 +32457,7 @@ async function runCustomInstallCommand({ destPath, installCommand, nodeVersion,
|
|
31402
32457
|
nodeVersion,
|
31403
32458
|
env: spawnOpts?.env || {},
|
31404
32459
|
});
|
31405
|
-
debug_1.default(`Running with $PATH:`, env?.PATH || '');
|
32460
|
+
(0, debug_1.default)(`Running with $PATH:`, env?.PATH || '');
|
31406
32461
|
await execCommand(installCommand, {
|
31407
32462
|
...spawnOpts,
|
31408
32463
|
env,
|
@@ -31411,12 +32466,12 @@ async function runCustomInstallCommand({ destPath, installCommand, nodeVersion,
|
|
31411
32466
|
}
|
31412
32467
|
exports.runCustomInstallCommand = runCustomInstallCommand;
|
31413
32468
|
async function runPackageJsonScript(destPath, scriptNames, spawnOpts) {
|
31414
|
-
assert_1.default(path_1.default.isAbsolute(destPath));
|
32469
|
+
(0, assert_1.default)(path_1.default.isAbsolute(destPath));
|
31415
32470
|
const { packageJson, cliType, lockfileVersion } = await scanParentDirs(destPath, true);
|
31416
32471
|
const scriptName = getScriptName(packageJson, typeof scriptNames === 'string' ? [scriptNames] : scriptNames);
|
31417
32472
|
if (!scriptName)
|
31418
32473
|
return false;
|
31419
|
-
debug_1.default('Running user script...');
|
32474
|
+
(0, debug_1.default)('Running user script...');
|
31420
32475
|
const runScriptTime = Date.now();
|
31421
32476
|
const opts = {
|
31422
32477
|
cwd: destPath,
|
@@ -31425,7 +32480,7 @@ async function runPackageJsonScript(destPath, scriptNames, spawnOpts) {
|
|
31425
32480
|
cliType,
|
31426
32481
|
lockfileVersion,
|
31427
32482
|
nodeVersion: undefined,
|
31428
|
-
env: clone_env_1.cloneEnv(process.env, spawnOpts?.env),
|
32483
|
+
env: (0, clone_env_1.cloneEnv)(process.env, spawnOpts?.env),
|
31429
32484
|
}),
|
31430
32485
|
};
|
31431
32486
|
if (cliType === 'npm') {
|
@@ -31439,26 +32494,26 @@ async function runPackageJsonScript(destPath, scriptNames, spawnOpts) {
|
|
31439
32494
|
}
|
31440
32495
|
console.log(`Running "${opts.prettyCommand}"`);
|
31441
32496
|
await spawnAsync(cliType, ['run', scriptName], opts);
|
31442
|
-
debug_1.default(`Script complete [${Date.now() - runScriptTime}ms]`);
|
32497
|
+
(0, debug_1.default)(`Script complete [${Date.now() - runScriptTime}ms]`);
|
31443
32498
|
return true;
|
31444
32499
|
}
|
31445
32500
|
exports.runPackageJsonScript = runPackageJsonScript;
|
31446
32501
|
async function runBundleInstall(destPath, args = [], spawnOpts, meta) {
|
31447
32502
|
if (meta && meta.isDev) {
|
31448
|
-
debug_1.default('Skipping dependency installation because dev mode is enabled');
|
32503
|
+
(0, debug_1.default)('Skipping dependency installation because dev mode is enabled');
|
31449
32504
|
return;
|
31450
32505
|
}
|
31451
|
-
assert_1.default(path_1.default.isAbsolute(destPath));
|
32506
|
+
(0, assert_1.default)(path_1.default.isAbsolute(destPath));
|
31452
32507
|
const opts = { ...spawnOpts, cwd: destPath, prettyCommand: 'bundle install' };
|
31453
32508
|
await spawnAsync('bundle', args.concat(['install']), opts);
|
31454
32509
|
}
|
31455
32510
|
exports.runBundleInstall = runBundleInstall;
|
31456
32511
|
async function runPipInstall(destPath, args = [], spawnOpts, meta) {
|
31457
32512
|
if (meta && meta.isDev) {
|
31458
|
-
debug_1.default('Skipping dependency installation because dev mode is enabled');
|
32513
|
+
(0, debug_1.default)('Skipping dependency installation because dev mode is enabled');
|
31459
32514
|
return;
|
31460
32515
|
}
|
31461
|
-
assert_1.default(path_1.default.isAbsolute(destPath));
|
32516
|
+
(0, assert_1.default)(path_1.default.isAbsolute(destPath));
|
31462
32517
|
const opts = { ...spawnOpts, cwd: destPath, prettyCommand: 'pip3 install' };
|
31463
32518
|
await spawnAsync('pip3', ['install', '--disable-pip-version-check', ...args], opts);
|
31464
32519
|
}
|
@@ -31478,7 +32533,7 @@ exports.getScriptName = getScriptName;
|
|
31478
32533
|
* @deprecate installDependencies() is deprecated.
|
31479
32534
|
* Please use runNpmInstall() instead.
|
31480
32535
|
*/
|
31481
|
-
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.');
|
31482
32537
|
|
31483
32538
|
|
31484
32539
|
/***/ }),
|
@@ -31497,7 +32552,7 @@ function streamToBuffer(stream) {
|
|
31497
32552
|
return new Promise((resolve, reject) => {
|
31498
32553
|
const buffers = [];
|
31499
32554
|
stream.on('data', buffers.push.bind(buffers));
|
31500
|
-
end_of_stream_1.default(stream, err => {
|
32555
|
+
(0, end_of_stream_1.default)(stream, err => {
|
31501
32556
|
if (err) {
|
31502
32557
|
reject(err);
|
31503
32558
|
return;
|
@@ -31573,7 +32628,7 @@ async function default_1(downloadPath, rootDirectory) {
|
|
31573
32628
|
if (ignoreContents.length === 0) {
|
31574
32629
|
return () => false;
|
31575
32630
|
}
|
31576
|
-
const ignoreFilter = ignore_1.default().add(clearRelative(ignoreContents[0]));
|
32631
|
+
const ignoreFilter = (0, ignore_1.default)().add(clearRelative(ignoreContents[0]));
|
31577
32632
|
return function (p) {
|
31578
32633
|
// we should not ignore now.json and vercel.json if it asked to.
|
31579
32634
|
// we depend on these files for building the app with sourceless
|
@@ -31757,7 +32812,11 @@ async function linkOrCopy(srcFile, destFile) {
|
|
31757
32812
|
|
31758
32813
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
31759
32814
|
if (k2 === undefined) k2 = k;
|
31760
|
-
Object.
|
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);
|
31761
32820
|
}) : (function(o, m, k, k2) {
|
31762
32821
|
if (k2 === undefined) k2 = k;
|
31763
32822
|
o[k2] = m[k];
|
@@ -31877,39 +32936,39 @@ class Lambda {
|
|
31877
32936
|
constructor(opts) {
|
31878
32937
|
const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, supportsResponseStreaming, experimentalResponseStreaming, operationType, framework, } = opts;
|
31879
32938
|
if ('files' in opts) {
|
31880
|
-
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');
|
31881
32940
|
}
|
31882
32941
|
if ('zipBuffer' in opts) {
|
31883
|
-
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');
|
31884
32943
|
}
|
31885
|
-
assert_1.default(typeof handler === 'string', '"handler" is not a string');
|
31886
|
-
assert_1.default(typeof runtime === 'string', '"runtime" is not a string');
|
31887
|
-
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');
|
31888
32947
|
if (memory !== undefined) {
|
31889
|
-
assert_1.default(typeof memory === 'number', '"memory" is not a number');
|
32948
|
+
(0, assert_1.default)(typeof memory === 'number', '"memory" is not a number');
|
31890
32949
|
}
|
31891
32950
|
if (maxDuration !== undefined) {
|
31892
|
-
assert_1.default(typeof maxDuration === 'number', '"maxDuration" is not a number');
|
32951
|
+
(0, assert_1.default)(typeof maxDuration === 'number', '"maxDuration" is not a number');
|
31893
32952
|
}
|
31894
32953
|
if (allowQuery !== undefined) {
|
31895
|
-
assert_1.default(Array.isArray(allowQuery), '"allowQuery" is not an Array');
|
31896
|
-
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');
|
31897
32956
|
}
|
31898
32957
|
if (supportsMultiPayloads !== undefined) {
|
31899
|
-
assert_1.default(typeof supportsMultiPayloads === 'boolean', '"supportsMultiPayloads" is not a boolean');
|
32958
|
+
(0, assert_1.default)(typeof supportsMultiPayloads === 'boolean', '"supportsMultiPayloads" is not a boolean');
|
31900
32959
|
}
|
31901
32960
|
if (supportsWrapper !== undefined) {
|
31902
|
-
assert_1.default(typeof supportsWrapper === 'boolean', '"supportsWrapper" is not a boolean');
|
32961
|
+
(0, assert_1.default)(typeof supportsWrapper === 'boolean', '"supportsWrapper" is not a boolean');
|
31903
32962
|
}
|
31904
32963
|
if (regions !== undefined) {
|
31905
|
-
assert_1.default(Array.isArray(regions), '"regions" is not an Array');
|
31906
|
-
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');
|
31907
32966
|
}
|
31908
32967
|
if (framework !== undefined) {
|
31909
|
-
assert_1.default(typeof framework === 'object', '"framework" is not an object');
|
31910
|
-
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');
|
31911
32970
|
if (framework.version !== undefined) {
|
31912
|
-
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');
|
31913
32972
|
}
|
31914
32973
|
}
|
31915
32974
|
this.type = 'Lambda';
|
@@ -31973,8 +33032,8 @@ async function createZip(files) {
|
|
31973
33032
|
const symlinkTargets = new Map();
|
31974
33033
|
for (const name of names) {
|
31975
33034
|
const file = files[name];
|
31976
|
-
if (file.mode && download_1.isSymbolicLink(file.mode) && file.type === 'FileFsRef') {
|
31977
|
-
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);
|
31978
33037
|
symlinkTargets.set(name, symlinkTarget);
|
31979
33038
|
}
|
31980
33039
|
}
|
@@ -31987,7 +33046,7 @@ async function createZip(files) {
|
|
31987
33046
|
if (typeof symlinkTarget === 'string') {
|
31988
33047
|
zipFile.addBuffer(Buffer.from(symlinkTarget, 'utf8'), name, opts);
|
31989
33048
|
}
|
31990
|
-
else if (file.mode && download_1.isDirectory(file.mode)) {
|
33049
|
+
else if (file.mode && (0, download_1.isDirectory)(file.mode)) {
|
31991
33050
|
zipFile.addEmptyDirectory(name, opts);
|
31992
33051
|
}
|
31993
33052
|
else {
|
@@ -31997,7 +33056,7 @@ async function createZip(files) {
|
|
31997
33056
|
}
|
31998
33057
|
}
|
31999
33058
|
zipFile.end();
|
32000
|
-
stream_to_buffer_1.default(zipFile.outputStream).then(resolve).catch(reject);
|
33059
|
+
(0, stream_to_buffer_1.default)(zipFile.outputStream).then(resolve).catch(reject);
|
32001
33060
|
});
|
32002
33061
|
return zipBuffer;
|
32003
33062
|
}
|
@@ -32005,7 +33064,7 @@ exports.createZip = createZip;
|
|
32005
33064
|
async function getLambdaOptionsFromFunction({ sourceFile, config, }) {
|
32006
33065
|
if (config?.functions) {
|
32007
33066
|
for (const [pattern, fn] of Object.entries(config.functions)) {
|
32008
|
-
if (sourceFile === pattern || minimatch_1.default(sourceFile, pattern)) {
|
33067
|
+
if (sourceFile === pattern || (0, minimatch_1.default)(sourceFile, pattern)) {
|
32009
33068
|
return {
|
32010
33069
|
memory: fn.memory,
|
32011
33070
|
maxDuration: fn.maxDuration,
|
@@ -32201,7 +33260,7 @@ const shouldServe = ({ entrypoint, files, requestPath, }) => {
|
|
32201
33260
|
if (entrypoint === requestPath && hasProp(files, entrypoint)) {
|
32202
33261
|
return true;
|
32203
33262
|
}
|
32204
|
-
const { dir, name } = path_1.parse(entrypoint);
|
33263
|
+
const { dir, name } = (0, path_1.parse)(entrypoint);
|
32205
33264
|
if (name === 'index' && dir === requestPath && hasProp(files, entrypoint)) {
|
32206
33265
|
return true;
|
32207
33266
|
}
|