Unverified Commit 62227ee9 authored by Steven's avatar Steven Committed by GitHub

Bump `@vercel/nft` to 0.17.2 (#33048)

This bumps `@vercel/nft` to the latest version and consequently bumps `graceful-fs` to the latest version.

- Fixes #33003
- Related to https://github.com/vercel/nft/pull/258
- Related to https://github.com/browserify/resolve/issues/264Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
parent 26ddf32f
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -14068,12 +14068,16 @@ module.exports = function (glob, opts) { ...@@ -14068,12 +14068,16 @@ module.exports = function (glob, opts) {
module.exports = clone module.exports = clone
var getPrototypeOf = Object.getPrototypeOf || function (obj) {
return obj.__proto__
}
function clone (obj) { function clone (obj) {
if (obj === null || typeof obj !== 'object') if (obj === null || typeof obj !== 'object')
return obj return obj
if (obj instanceof Object) if (obj instanceof Object)
var copy = { __proto__: obj.__proto__ } var copy = { __proto__: getPrototypeOf(obj) }
else else
var copy = Object.create(null) var copy = Object.create(null)
...@@ -14146,7 +14150,7 @@ if (!fs[gracefulQueue]) { ...@@ -14146,7 +14150,7 @@ if (!fs[gracefulQueue]) {
return fs$close.call(fs, fd, function (err) { return fs$close.call(fs, fd, function (err) {
// This function uses the graceful-fs shared queue // This function uses the graceful-fs shared queue
if (!err) { if (!err) {
retry() resetQueue()
} }
if (typeof cb === 'function') if (typeof cb === 'function')
...@@ -14164,7 +14168,7 @@ if (!fs[gracefulQueue]) { ...@@ -14164,7 +14168,7 @@ if (!fs[gracefulQueue]) {
function closeSync (fd) { function closeSync (fd) {
// This function uses the graceful-fs shared queue // This function uses the graceful-fs shared queue
fs$closeSync.apply(fs, arguments) fs$closeSync.apply(fs, arguments)
retry() resetQueue()
} }
Object.defineProperty(closeSync, previousSymbol, { Object.defineProperty(closeSync, previousSymbol, {
...@@ -14206,14 +14210,13 @@ function patch (fs) { ...@@ -14206,14 +14210,13 @@ function patch (fs) {
return go$readFile(path, options, cb) return go$readFile(path, options, cb)
function go$readFile (path, options, cb) { function go$readFile (path, options, cb, startTime) {
return fs$readFile(path, options, function (err) { return fs$readFile(path, options, function (err) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
enqueue([go$readFile, [path, options, cb]]) enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])
else { else {
if (typeof cb === 'function') if (typeof cb === 'function')
cb.apply(this, arguments) cb.apply(this, arguments)
retry()
} }
}) })
} }
...@@ -14227,14 +14230,13 @@ function patch (fs) { ...@@ -14227,14 +14230,13 @@ function patch (fs) {
return go$writeFile(path, data, options, cb) return go$writeFile(path, data, options, cb)
function go$writeFile (path, data, options, cb) { function go$writeFile (path, data, options, cb, startTime) {
return fs$writeFile(path, data, options, function (err) { return fs$writeFile(path, data, options, function (err) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
enqueue([go$writeFile, [path, data, options, cb]]) enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
else { else {
if (typeof cb === 'function') if (typeof cb === 'function')
cb.apply(this, arguments) cb.apply(this, arguments)
retry()
} }
}) })
} }
...@@ -14249,14 +14251,35 @@ function patch (fs) { ...@@ -14249,14 +14251,35 @@ function patch (fs) {
return go$appendFile(path, data, options, cb) return go$appendFile(path, data, options, cb)
function go$appendFile (path, data, options, cb) { function go$appendFile (path, data, options, cb, startTime) {
return fs$appendFile(path, data, options, function (err) { return fs$appendFile(path, data, options, function (err) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
enqueue([go$appendFile, [path, data, options, cb]]) enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
else {
if (typeof cb === 'function')
cb.apply(this, arguments)
}
})
}
}
var fs$copyFile = fs.copyFile
if (fs$copyFile)
fs.copyFile = copyFile
function copyFile (src, dest, flags, cb) {
if (typeof flags === 'function') {
cb = flags
flags = 0
}
return go$copyFile(src, dest, flags, cb)
function go$copyFile (src, dest, flags, cb, startTime) {
return fs$copyFile(src, dest, flags, function (err) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])
else { else {
if (typeof cb === 'function') if (typeof cb === 'function')
cb.apply(this, arguments) cb.apply(this, arguments)
retry()
} }
}) })
} }
...@@ -14265,35 +14288,26 @@ function patch (fs) { ...@@ -14265,35 +14288,26 @@ function patch (fs) {
var fs$readdir = fs.readdir var fs$readdir = fs.readdir
fs.readdir = readdir fs.readdir = readdir
function readdir (path, options, cb) { function readdir (path, options, cb) {
var args = [path] if (typeof options === 'function')
if (typeof options !== 'function') { cb = options, options = null
args.push(options)
} else {
cb = options
}
args.push(go$readdir$cb)
return go$readdir(args)
function go$readdir$cb (err, files) { return go$readdir(path, options, cb)
if (files && files.sort)
files.sort()
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) function go$readdir (path, options, cb, startTime) {
enqueue([go$readdir, [args]]) return fs$readdir(path, options, function (err, files) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
enqueue([go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now()])
else {
if (files && files.sort)
files.sort()
else { if (typeof cb === 'function')
if (typeof cb === 'function') cb.call(this, err, files)
cb.apply(this, arguments) }
retry() })
}
} }
} }
function go$readdir (args) {
return fs$readdir.apply(fs, args)
}
if (process.version.substr(0, 4) === 'v0.8') { if (process.version.substr(0, 4) === 'v0.8') {
var legStreams = legacy(fs) var legStreams = legacy(fs)
ReadStream = legStreams.ReadStream ReadStream = legStreams.ReadStream
...@@ -14416,14 +14430,13 @@ function patch (fs) { ...@@ -14416,14 +14430,13 @@ function patch (fs) {
return go$open(path, flags, mode, cb) return go$open(path, flags, mode, cb)
function go$open (path, flags, mode, cb) { function go$open (path, flags, mode, cb, startTime) {
return fs$open(path, flags, mode, function (err, fd) { return fs$open(path, flags, mode, function (err, fd) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
enqueue([go$open, [path, flags, mode, cb]]) enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])
else { else {
if (typeof cb === 'function') if (typeof cb === 'function')
cb.apply(this, arguments) cb.apply(this, arguments)
retry()
} }
}) })
} }
...@@ -14435,13 +14448,79 @@ function patch (fs) { ...@@ -14435,13 +14448,79 @@ function patch (fs) {
function enqueue (elem) { function enqueue (elem) {
debug('ENQUEUE', elem[0].name, elem[1]) debug('ENQUEUE', elem[0].name, elem[1])
fs[gracefulQueue].push(elem) fs[gracefulQueue].push(elem)
retry()
}
// keep track of the timeout between retry() calls
var retryTimer
// reset the startTime and lastTime to now
// this resets the start of the 60 second overall timeout as well as the
// delay between attempts so that we'll retry these jobs sooner
function resetQueue () {
var now = Date.now()
for (var i = 0; i < fs[gracefulQueue].length; ++i) {
// entries that are only a length of 2 are from an older version, don't
// bother modifying those since they'll be retried anyway.
if (fs[gracefulQueue][i].length > 2) {
fs[gracefulQueue][i][3] = now // startTime
fs[gracefulQueue][i][4] = now // lastTime
}
}
// call retry to make sure we're actively processing the queue
retry()
} }
function retry () { function retry () {
// clear the timer and remove it to help prevent unintended concurrency
clearTimeout(retryTimer)
retryTimer = undefined
if (fs[gracefulQueue].length === 0)
return
var elem = fs[gracefulQueue].shift() var elem = fs[gracefulQueue].shift()
if (elem) { var fn = elem[0]
debug('RETRY', elem[0].name, elem[1]) var args = elem[1]
elem[0].apply(null, elem[1]) // these items may be unset if they were added by an older graceful-fs
var err = elem[2]
var startTime = elem[3]
var lastTime = elem[4]
// if we don't have a startTime we have no way of knowing if we've waited
// long enough, so go ahead and retry this item now
if (startTime === undefined) {
debug('RETRY', fn.name, args)
fn.apply(null, args)
} else if (Date.now() - startTime >= 60000) {
// it's been more than 60 seconds total, bail now
debug('TIMEOUT', fn.name, args)
var cb = args.pop()
if (typeof cb === 'function')
cb.call(null, err)
} else {
// the amount of time between the last attempt and right now
var sinceAttempt = Date.now() - lastTime
// the amount of time between when we first tried, and when we last tried
// rounded up to at least 1
var sinceStart = Math.max(lastTime - startTime, 1)
// backoff. wait longer than the total time we've been retrying, but only
// up to a maximum of 100ms
var desiredDelay = Math.min(sinceStart * 1.2, 100)
// it's been long enough since the last retry, do it again
if (sinceAttempt >= desiredDelay) {
debug('RETRY', fn.name, args)
fn.apply(null, args.concat([startTime]))
} else {
// if we can't do this job yet, push it to the end of the queue
// and let the next iteration check again
fs[gracefulQueue].push(elem)
}
}
// schedule our next run if one isn't already scheduled
if (retryTimer === undefined) {
retryTimer = setTimeout(retry, 0)
} }
} }
...@@ -14592,10 +14671,14 @@ try { ...@@ -14592,10 +14671,14 @@ try {
process.cwd() process.cwd()
} catch (er) {} } catch (er) {}
var chdir = process.chdir // This check is needed until node.js 12 is required
process.chdir = function(d) { if (typeof process.chdir === 'function') {
cwd = null var chdir = process.chdir
chdir.call(process, d) process.chdir = function (d) {
cwd = null
chdir.call(process, d)
}
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)
} }
module.exports = patch module.exports = patch
...@@ -14710,7 +14793,7 @@ function patch (fs) { ...@@ -14710,7 +14793,7 @@ function patch (fs) {
} }
// This ensures `util.promisify` works as it does for native `fs.read`. // This ensures `util.promisify` works as it does for native `fs.read`.
read.__proto__ = fs$read if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
return read return read
})(fs.read) })(fs.read)
...@@ -14884,8 +14967,10 @@ function patch (fs) { ...@@ -14884,8 +14967,10 @@ function patch (fs) {
return function (target, options) { return function (target, options) {
var stats = options ? orig.call(fs, target, options) var stats = options ? orig.call(fs, target, options)
: orig.call(fs, target) : orig.call(fs, target)
if (stats.uid < 0) stats.uid += 0x100000000 if (stats) {
if (stats.gid < 0) stats.gid += 0x100000000 if (stats.uid < 0) stats.uid += 0x100000000
if (stats.gid < 0) stats.gid += 0x100000000
}
return stats; return stats;
} }
} }
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
"@types/webpack-sources1": "npm:@types/webpack-sources@0.1.5", "@types/webpack-sources1": "npm:@types/webpack-sources@0.1.5",
"@types/ws": "8.2.0", "@types/ws": "8.2.0",
"@vercel/ncc": "0.33.1", "@vercel/ncc": "0.33.1",
"@vercel/nft": "0.17.1", "@vercel/nft": "0.17.2",
"acorn": "8.5.0", "acorn": "8.5.0",
"amphtml-validator": "1.0.33", "amphtml-validator": "1.0.33",
"arg": "4.1.0", "arg": "4.1.0",
......
...@@ -5126,17 +5126,17 @@ ...@@ -5126,17 +5126,17 @@
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.33.1.tgz#b240080a3c1ded9446a30955a06a79851bb38f71" resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.33.1.tgz#b240080a3c1ded9446a30955a06a79851bb38f71"
integrity sha512-Mlsps/P0PLZwsCFtSol23FGqT3FhBGb4B1AuGQ52JTAtXhak+b0Fh/4T55r0/SVQPeRiX9pNItOEHwakGPmZYA== integrity sha512-Mlsps/P0PLZwsCFtSol23FGqT3FhBGb4B1AuGQ52JTAtXhak+b0Fh/4T55r0/SVQPeRiX9pNItOEHwakGPmZYA==
"@vercel/nft@0.17.1": "@vercel/nft@0.17.2":
version "0.17.1" version "0.17.2"
resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.17.1.tgz#d1a22f9d25594b549d237d25d10595d62e60dd05" resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.17.2.tgz#88a8e088e0e91390c68ccce2180023c071bcdc77"
integrity sha512-z3zknfI7JaE0PPmmYDQVtf/TCEnAYT5Y2XrCO/BfAD1sP2Wdmg1PO0L1VRIyt0zjpr6PpBYitC0Nmy0rh+qEDA== integrity sha512-1ueYh62H/DmUc3PWV/HEk1x6J1c/KZq9zeNXhixn/C4lX3XOsouutUVpKhTseoDKTGlT81hx96W4TjIwpDiIAQ==
dependencies: dependencies:
"@mapbox/node-pre-gyp" "^1.0.5" "@mapbox/node-pre-gyp" "^1.0.5"
acorn "^8.6.0" acorn "^8.6.0"
bindings "^1.4.0" bindings "^1.4.0"
estree-walker "2.0.2" estree-walker "2.0.2"
glob "^7.1.3" glob "^7.1.3"
graceful-fs "^4.1.15" graceful-fs "^4.2.9"
micromatch "^4.0.2" micromatch "^4.0.2"
mkdirp "^0.5.1" mkdirp "^0.5.1"
node-gyp-build "^4.2.2" node-gyp-build "^4.2.2"
...@@ -10403,14 +10403,10 @@ got@^9.6.0: ...@@ -10403,14 +10403,10 @@ got@^9.6.0:
to-readable-stream "^1.0.0" to-readable-stream "^1.0.0"
url-parse-lax "^3.0.0" url-parse-lax "^3.0.0"
graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.3, graceful-fs@^4.2.4: graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.9:
version "4.2.4" version "4.2.9"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96"
integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==
graceful-fs@^4.2.2:
version "4.2.6"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==
"growl@~> 1.10.0": "growl@~> 1.10.0":
version "1.10.5" version "1.10.5"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment