diff --git a/node_modules/@npmcli/fs/lib/common/owner-sync.js b/node_modules/@npmcli/fs/lib/common/owner-sync.js index 8fa18d5121eff..3704aa6d18e1e 100644 --- a/node_modules/@npmcli/fs/lib/common/owner-sync.js +++ b/node_modules/@npmcli/fs/lib/common/owner-sync.js @@ -50,11 +50,15 @@ const update = (path, uid, gid) => { if (uid === stat.uid && gid === stat.gid) { return } - } catch (err) {} + } catch { + // ignore errors + } try { fs.chownSync(path, uid, gid) - } catch (err) {} + } catch { + // ignore errors + } } // accepts a `path` and the `owner` property of an options object and normalizes diff --git a/node_modules/@npmcli/fs/lib/common/owner.js b/node_modules/@npmcli/fs/lib/common/owner.js index 3fe167cfc30aa..9f02d41a5e4b3 100644 --- a/node_modules/@npmcli/fs/lib/common/owner.js +++ b/node_modules/@npmcli/fs/lib/common/owner.js @@ -50,11 +50,15 @@ const update = async (path, uid, gid) => { if (uid === stat.uid && gid === stat.gid) { return } - } catch (err) {} + } catch { + // ignore errors + } try { await fs.chown(path, uid, gid) - } catch (err) {} + } catch { + // ignore errors + } } // accepts a `path` and the `owner` property of an options object and normalizes diff --git a/node_modules/@npmcli/fs/lib/with-temp-dir.js b/node_modules/@npmcli/fs/lib/with-temp-dir.js index ad08e6ee6e6d6..81db59dd054b4 100644 --- a/node_modules/@npmcli/fs/lib/with-temp-dir.js +++ b/node_modules/@npmcli/fs/lib/with-temp-dir.js @@ -27,7 +27,9 @@ const withTempDir = async (root, fn, opts) => { try { await rm(target, { force: true, recursive: true }) - } catch {} + } catch { + // ignore errors + } if (err) { throw err diff --git a/node_modules/@npmcli/fs/package.json b/node_modules/@npmcli/fs/package.json index 9e18028218d1a..1512fd6e4b0ac 100644 --- a/node_modules/@npmcli/fs/package.json +++ b/node_modules/@npmcli/fs/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/fs", - "version": "2.1.1", + "version": "2.1.2", "description": "filesystem utilities for the npm cli", "main": "lib/index.js", "files": [ diff --git a/node_modules/@npmcli/git/lib/which.js b/node_modules/@npmcli/git/lib/which.js index a2f690e1bce80..dc2a1ad212166 100644 --- a/node_modules/@npmcli/git/lib/which.js +++ b/node_modules/@npmcli/git/lib/which.js @@ -3,7 +3,9 @@ const which = require('which') let gitPath try { gitPath = which.sync('git') -} catch (e) {} +} catch { + // ignore errors +} module.exports = (opts = {}) => { if (opts.git) { diff --git a/node_modules/@npmcli/git/package.json b/node_modules/@npmcli/git/package.json index 08525ae99e8ec..86b8e85399266 100644 --- a/node_modules/@npmcli/git/package.json +++ b/node_modules/@npmcli/git/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/git", - "version": "3.0.1", + "version": "3.0.2", "main": "lib/index.js", "files": [ "bin/", @@ -31,7 +31,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.5.0", + "npm-package-arg": "^9.1.0", + "rimraf": "^3.0.2", "slash": "^3.0.0", "tap": "^16.0.1" }, @@ -52,6 +54,6 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "3.2.2" + "version": "3.5.0" } } diff --git a/node_modules/@npmcli/move-file/lib/index.js b/node_modules/@npmcli/move-file/lib/index.js index ecc55f0171da5..5789bb127e096 100644 --- a/node_modules/@npmcli/move-file/lib/index.js +++ b/node_modules/@npmcli/move-file/lib/index.js @@ -97,14 +97,19 @@ const moveFile = async (source, destination, options = {}, root = true, symlinks } // try to determine what the actual file is so we can create the correct // type of symlink in windows - let targetStat + let targetStat = 'file' try { targetStat = await stat(resolve(dirname(symSource), target)) - } catch (err) {} + if (targetStat.isDirectory()) { + targetStat = 'junction' + } + } catch { + // targetStat remains 'file' + } await symlink( target, symDestination, - targetStat && targetStat.isDirectory() ? 'junction' : 'file' + targetStat ) })) await rimraf(source) @@ -157,14 +162,19 @@ const moveFileSync = (source, destination, options = {}, root = true, symlinks = } // try to determine what the actual file is so we can create the correct // type of symlink in windows - let targetStat + let targetStat = 'file' try { targetStat = statSync(resolve(dirname(symSource), target)) - } catch (err) {} + if (targetStat.isDirectory()) { + targetStat = 'junction' + } + } catch { + // targetStat remains 'file' + } symlinkSync( target, symDestination, - targetStat && targetStat.isDirectory() ? 'junction' : 'file' + targetStat ) } rimrafSync(source) diff --git a/node_modules/@npmcli/move-file/package.json b/node_modules/@npmcli/move-file/package.json index 1b1d377b0c7b2..58793b93a9ca0 100644 --- a/node_modules/@npmcli/move-file/package.json +++ b/node_modules/@npmcli/move-file/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/move-file", - "version": "2.0.0", + "version": "2.0.1", "files": [ "bin/", "lib/" @@ -13,7 +13,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.5.0", "tap": "^16.0.1" }, "scripts": { @@ -42,6 +42,6 @@ "author": "GitHub Inc.", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.5.0" } } diff --git a/node_modules/bin-links/lib/link-gently.js b/node_modules/bin-links/lib/link-gently.js index 671ce38a586e7..d9ef25e7c5b0b 100644 --- a/node_modules/bin-links/lib/link-gently.js +++ b/node_modules/bin-links/lib/link-gently.js @@ -64,6 +64,8 @@ const linkGently = async ({ path, to, from, absFrom, force }) => { if (target.indexOf(path) === 0 || force) { return rm(to).then(() => CLOBBER) } + // neither skip nor clobber + return false }) } else { // doesn't exist, dir might not either diff --git a/node_modules/bin-links/lib/shim-bin.js b/node_modules/bin-links/lib/shim-bin.js index 70259a49e5b0c..bde328e510c53 100644 --- a/node_modules/bin-links/lib/shim-bin.js +++ b/node_modules/bin-links/lib/shim-bin.js @@ -56,12 +56,12 @@ const shimBin = ({ path, to, from, absFrom, force }) => { } if (force) { - return + return false } return Promise.all(shims.map((s, i) => [s, stats[i]]).map(([s, st]) => { if (!st) { - return + return false } return readCmdShim(s) .then(target => { @@ -69,6 +69,7 @@ const shimBin = ({ path, to, from, absFrom, force }) => { if (target.indexOf(resolve(path)) !== 0) { return failEEXIST({ from, to, path }) } + return false }, er => handleReadCmdShimError({ er, from, to })) })) }) diff --git a/node_modules/bin-links/package.json b/node_modules/bin-links/package.json index a86948de153c5..aba3d8f6c0908 100644 --- a/node_modules/bin-links/package.json +++ b/node_modules/bin-links/package.json @@ -1,6 +1,6 @@ { "name": "bin-links", - "version": "3.0.1", + "version": "3.0.2", "description": "JavaScript package binary linker", "main": "./lib/index.js", "scripts": { @@ -35,10 +35,10 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.5.0", "mkdirp": "^1.0.3", "require-inject": "^1.4.4", - "tap": "^15.0.10" + "tap": "^16.0.1" }, "tap": { "check-coverage": true, @@ -55,6 +55,6 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "3.2.2" + "version": "3.5.0" } } diff --git a/node_modules/cacache/lib/content/read.js b/node_modules/cacache/lib/content/read.js index 8367ccb205d0b..7c20c75257b4f 100644 --- a/node_modules/cacache/lib/content/read.js +++ b/node_modules/cacache/lib/content/read.js @@ -81,7 +81,7 @@ function readStream (cache, integrity, opts = {}) { return stream.emit('error', sizeError(size, stat.size)) } - readPipeline(cpath, stat.size, sri, stream) + return readPipeline(cpath, stat.size, sri, stream) }).catch(err => stream.emit('error', err)) return stream diff --git a/node_modules/cacache/lib/content/write.js b/node_modules/cacache/lib/content/write.js index 62388dc81d0fd..0e8c0f4936064 100644 --- a/node_modules/cacache/lib/content/write.js +++ b/node_modules/cacache/lib/content/write.js @@ -80,9 +80,11 @@ class CacacheWriteStream extends Flush { // defer this one tick by rejecting a promise on it. return Promise.reject(e).catch(cb) } + // eslint-disable-next-line promise/catch-or-return this.handleContentP.then( (res) => { res.integrity && this.emit('integrity', res.integrity) + // eslint-disable-next-line promise/always-return res.size !== null && this.emit('size', res.size) cb() }, diff --git a/node_modules/cacache/lib/entry-index.js b/node_modules/cacache/lib/entry-index.js index cbfa619099f90..1dc73a93f6b29 100644 --- a/node_modules/cacache/lib/entry-index.js +++ b/node_modules/cacache/lib/entry-index.js @@ -285,6 +285,7 @@ function lsStream (cache) { })) })) stream.end() + return stream }).catch(err => stream.emit('error', err)) return stream diff --git a/node_modules/cacache/lib/get.js b/node_modules/cacache/lib/get.js index cc9d8f6796647..254b4ecc38b57 100644 --- a/node_modules/cacache/lib/get.js +++ b/node_modules/cacache/lib/get.js @@ -155,6 +155,7 @@ function getStream (cache, key, opts = {}) { stream.unshift(memoStream) } stream.unshift(src) + return stream }).catch((err) => stream.emit('error', err)) return stream diff --git a/node_modules/cacache/package.json b/node_modules/cacache/package.json index bb5674dafca81..3f19d07d44166 100644 --- a/node_modules/cacache/package.json +++ b/node_modules/cacache/package.json @@ -1,6 +1,6 @@ { "name": "cacache", - "version": "16.1.1", + "version": "16.1.2", "cache-version": { "content": "2", "index": "5" diff --git a/node_modules/make-fetch-happen/lib/cache/entry.js b/node_modules/make-fetch-happen/lib/cache/entry.js index 4307962b889d0..dba89d715d8a5 100644 --- a/node_modules/make-fetch-happen/lib/cache/entry.js +++ b/node_modules/make-fetch-happen/lib/cache/entry.js @@ -288,6 +288,7 @@ class CacheEntry { // stick a flag on here so downstream users will know if they can expect integrity events tee.pipe(cacheStream) // TODO if the cache write fails, log a warning but return the response anyway + // eslint-disable-next-line promise/catch-or-return cacheStream.promise().then(cacheWriteResolve, cacheWriteReject) body.unshift(tee) body.unshift(this.response.body) diff --git a/node_modules/make-fetch-happen/package.json b/node_modules/make-fetch-happen/package.json index 8b21901f34fc1..fc491d1152e15 100644 --- a/node_modules/make-fetch-happen/package.json +++ b/node_modules/make-fetch-happen/package.json @@ -1,6 +1,6 @@ { "name": "make-fetch-happen", - "version": "10.2.0", + "version": "10.2.1", "description": "Opinionated, caching, retrying fetch client", "main": "lib/index.js", "files": [ diff --git a/node_modules/minipass-fetch/lib/body.js b/node_modules/minipass-fetch/lib/body.js index c7ffa5babcbc6..58893309e63f9 100644 --- a/node_modules/minipass-fetch/lib/body.js +++ b/node_modules/minipass-fetch/lib/body.js @@ -10,7 +10,9 @@ const FetchError = require('./fetch-error.js') let convert try { convert = require('encoding').convert -} catch (e) {} +} catch (e) { + // defer error until textConverted is called +} const INTERNALS = Symbol('Body internals') const CONSUME_BODY = Symbol('consumeBody') @@ -69,16 +71,16 @@ class Body { )) } - json () { - return this[CONSUME_BODY]().then(buf => { - try { - return JSON.parse(buf.toString()) - } catch (er) { - return Promise.reject(new FetchError( - `invalid json response body at ${ - this.url} reason: ${er.message}`, 'invalid-json')) - } - }) + async json () { + try { + const buf = await this[CONSUME_BODY]() + return JSON.parse(buf.toString()) + } catch (er) { + throw new FetchError( + `invalid json response body at ${this.url} reason: ${er.message}`, + 'invalid-json' + ) + } } text () { diff --git a/node_modules/minipass-fetch/package.json b/node_modules/minipass-fetch/package.json index 1f663b9245dea..b47077adc111a 100644 --- a/node_modules/minipass-fetch/package.json +++ b/node_modules/minipass-fetch/package.json @@ -1,6 +1,6 @@ { "name": "minipass-fetch", - "version": "2.1.0", + "version": "2.1.1", "description": "An implementation of window.fetch in Node.js using Minipass streams", "license": "MIT", "main": "lib/index.js", @@ -23,10 +23,11 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.1.2", + "@npmcli/template-oss": "3.5.0", "@ungap/url-search-params": "^0.2.2", "abort-controller": "^3.0.0", "abortcontroller-polyfill": "~1.7.3", + "encoding": "^0.1.13", "form-data": "^4.0.0", "nock": "^13.2.4", "parted": "^0.1.1", @@ -61,6 +62,6 @@ "author": "GitHub Inc.", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.1.2" + "version": "3.5.0" } } diff --git a/node_modules/normalize-package-data/lib/extract_description.js b/node_modules/normalize-package-data/lib/extract_description.js index bf9896812e5f5..631966b5f29af 100644 --- a/node_modules/normalize-package-data/lib/extract_description.js +++ b/node_modules/normalize-package-data/lib/extract_description.js @@ -11,12 +11,14 @@ function extractDescription (d) { // the first block of text before the first heading // that isn't the first line heading d = d.trim().split('\n') - for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s++) { - ; + let s = 0 + while (d[s] && d[s].trim().match(/^(#|$)/)) { + s++ } - var l = d.length - for (var e = s + 1; e < l && d[e].trim(); e++) { - ; + const l = d.length + let e = s + 1 + while (e < l && d[e].trim()) { + e++ } return d.slice(s, e).join(' ').trim() } diff --git a/node_modules/normalize-package-data/lib/fixer.js b/node_modules/normalize-package-data/lib/fixer.js index 0846f2c045a6e..bb78231d83ca9 100644 --- a/node_modules/normalize-package-data/lib/fixer.js +++ b/node_modules/normalize-package-data/lib/fixer.js @@ -121,17 +121,17 @@ module.exports = { this.warn('nonArrayBundleDependencies') delete data[bd] } else if (data[bd]) { - data[bd] = data[bd].filter(function (bd) { - if (!bd || typeof bd !== 'string') { - this.warn('nonStringBundleDependency', bd) + data[bd] = data[bd].filter(function (filtered) { + if (!filtered || typeof filtered !== 'string') { + this.warn('nonStringBundleDependency', filtered) return false } else { if (!data.dependencies) { data.dependencies = {} } - if (!Object.prototype.hasOwnProperty.call(data.dependencies, bd)) { - this.warn('nonDependencyBundleDependency', bd) - data.dependencies[bd] = '*' + if (!Object.prototype.hasOwnProperty.call(data.dependencies, filtered)) { + this.warn('nonDependencyBundleDependency', filtered) + data.dependencies[filtered] = '*' } return true } @@ -389,28 +389,28 @@ function unParsePerson (person) { } var name = person.name || '' var u = person.url || person.web - var url = u ? (' (' + u + ')') : '' + var wrappedUrl = u ? (' (' + u + ')') : '' var e = person.email || person.mail - var email = e ? (' <' + e + '>') : '' - return name + email + url + var wrappedEmail = e ? (' <' + e + '>') : '' + return name + wrappedEmail + wrappedUrl } function parsePerson (person) { if (typeof person !== 'string') { return person } - var name = person.match(/^([^(<]+)/) - var url = person.match(/\(([^()]+)\)/) - var email = person.match(/<([^<>]+)>/) + var matchedName = person.match(/^([^(<]+)/) + var matchedUrl = person.match(/\(([^()]+)\)/) + var matchedEmail = person.match(/<([^<>]+)>/) var obj = {} - if (name && name[0].trim()) { - obj.name = name[0].trim() + if (matchedName && matchedName[0].trim()) { + obj.name = matchedName[0].trim() } - if (email) { - obj.email = email[1] + if (matchedEmail) { + obj.email = matchedEmail[1] } - if (url) { - obj.url = url[1] + if (matchedUrl) { + obj.url = matchedUrl[1] } return obj } diff --git a/node_modules/normalize-package-data/package.json b/node_modules/normalize-package-data/package.json index a6f1244eb5a25..1bec9bb8645e7 100644 --- a/node_modules/normalize-package-data/package.json +++ b/node_modules/normalize-package-data/package.json @@ -1,12 +1,12 @@ { "name": "normalize-package-data", - "version": "4.0.0", + "version": "4.0.1", "author": "GitHub Inc.", "description": "Normalizes data that can be found in package.json files.", "license": "BSD-2-Clause", "repository": { "type": "git", - "url": "git://github.com/npm/normalize-package-data.git" + "url": "https://github.com/npm/normalize-package-data.git" }, "main": "lib/normalize.js", "scripts": { @@ -15,13 +15,13 @@ "preversion": "npm test", "test": "tap", "npmclilint": "npmcli-lint", - "lint": "eslint '**/*.js'", + "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", "posttest": "npm run lint", "postsnap": "npm run lintfix --", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force", - "snap": "tap" + "postlint": "template-oss-check", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force" }, "dependencies": { "hosted-git-info": "^5.0.0", @@ -30,18 +30,20 @@ "validate-npm-package-license": "^3.0.4" }, "devDependencies": { - "@npmcli/template-oss": "^2.9.2", - "tap": "^15.0.9" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.0.1" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { - "version": "2.9.2" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" }, "tap": { "branches": 86, diff --git a/node_modules/npm-registry-fetch/lib/check-response.js b/node_modules/npm-registry-fetch/lib/check-response.js index 714513908df40..066ac3c32420f 100644 --- a/node_modules/npm-registry-fetch/lib/check-response.js +++ b/node_modules/npm-registry-fetch/lib/check-response.js @@ -61,7 +61,9 @@ function checkErrors (method, res, startTime, opts) { let parsed = body try { parsed = JSON.parse(body.toString('utf8')) - } catch (e) {} + } catch { + // ignore errors + } if (res.status === 401 && res.headers.get('www-authenticate')) { const auth = res.headers.get('www-authenticate') .split(/,\s*/) diff --git a/node_modules/npm-registry-fetch/lib/clean-url.js b/node_modules/npm-registry-fetch/lib/clean-url.js index ba31dc462f3c5..a419b47d6a339 100644 --- a/node_modules/npm-registry-fetch/lib/clean-url.js +++ b/node_modules/npm-registry-fetch/lib/clean-url.js @@ -14,7 +14,9 @@ const cleanUrl = (str) => { if (url.password) { str = str.replace(url.password, replace) } - } catch {} + } catch { + // ignore errors + } return str .replace(tokenRegex, `npm_${replace}`) diff --git a/node_modules/npm-registry-fetch/package.json b/node_modules/npm-registry-fetch/package.json index 8a0189a9ef74d..7a3885ae12e88 100644 --- a/node_modules/npm-registry-fetch/package.json +++ b/node_modules/npm-registry-fetch/package.json @@ -1,6 +1,6 @@ { "name": "npm-registry-fetch", - "version": "13.3.0", + "version": "13.3.1", "description": "Fetch-based http client for use with npm registry APIs", "main": "lib", "files": [ @@ -46,8 +46,10 @@ "@npmcli/eslint-config": "^3.0.1", "@npmcli/template-oss": "3.5.0", "cacache": "^16.0.2", + "mkdirp": "^1.0.4", "nock": "^13.2.4", "require-inject": "^1.4.4", + "rimraf": "^3.0.2", "ssri": "^9.0.0", "tap": "^16.0.1" }, diff --git a/node_modules/pacote/lib/bin.js b/node_modules/pacote/lib/bin.js index 4a1f911e42bc5..f35b62ca71a53 100755 --- a/node_modules/pacote/lib/bin.js +++ b/node_modules/pacote/lib/bin.js @@ -18,10 +18,15 @@ const run = conf => { case 'tarball': if (!conf._[2] || conf._[2] === '-') { return pacote.tarball.stream(conf._[1], stream => { - stream.pipe(conf.testStdout || - /* istanbul ignore next */ process.stdout) + stream.pipe( + conf.testStdout || + /* istanbul ignore next */ + process.stdout + ) // make sure it resolves something falsey - return stream.promise().then(() => {}) + return stream.promise().then(() => { + return false + }) }, conf) } else { return pacote.tarball.file(conf._[1], conf._[2], conf) diff --git a/node_modules/pacote/lib/fetcher.js b/node_modules/pacote/lib/fetcher.js index 5f93e703bca4b..95b6d3ee432bb 100644 --- a/node_modules/pacote/lib/fetcher.js +++ b/node_modules/pacote/lib/fetcher.js @@ -254,6 +254,7 @@ class FetcherBase { cstream.on('error', err => stream.emit('error', err)) stream.pipe(cstream) + // eslint-disable-next-line promise/catch-or-return cstream.promise().catch(() => {}).then(() => middleStream.end()) return middleStream } @@ -269,7 +270,10 @@ class FetcherBase { } // override the types getter - get types () {} + get types () { + return false + } + [_assertType] () { if (this.types && !this.types.includes(this.spec.type)) { throw new TypeError(`Wrong spec type (${ diff --git a/node_modules/pacote/lib/git.js b/node_modules/pacote/lib/git.js index 9d84d95fa62ab..c4819b4fdf49c 100644 --- a/node_modules/pacote/lib/git.js +++ b/node_modules/pacote/lib/git.js @@ -239,7 +239,7 @@ class GitFetcher extends Fetcher { tarballOk = tarballOk && h && resolved === repoUrl(h, { noCommittish: false }) && h.tarball - return cacache.tmp.withTmp(this.cache, o, tmp => { + return cacache.tmp.withTmp(this.cache, o, async tmp => { // if we're resolved, and have a tarball url, shell out to RemoteFetcher if (tarballOk) { const nameat = this.spec.name ? `${this.spec.name}@` : '' @@ -259,16 +259,15 @@ class GitFetcher extends Fetcher { }) } - return ( + const sha = await ( h ? this[_cloneHosted](ref, tmp) : this[_cloneRepo](this.spec.fetchSpec, ref, tmp) - ).then(sha => { - this.resolvedSha = sha - if (!this.resolved) { - this[_addGitSha](sha) - } - }) - .then(() => handler(tmp)) + ) + this.resolvedSha = sha + if (!this.resolved) { + await this[_addGitSha](sha) + } + return handler(tmp) }) } diff --git a/node_modules/pacote/lib/remote.js b/node_modules/pacote/lib/remote.js index 6759dbba3ed2f..a361a9e89782e 100644 --- a/node_modules/pacote/lib/remote.js +++ b/node_modules/pacote/lib/remote.js @@ -41,6 +41,7 @@ class RemoteFetcher extends Fetcher { algorithms: [this.pickIntegrityAlgorithm()], } + // eslint-disable-next-line promise/always-return fetch(this.resolved, fetchOpts).then(res => { res.body.on('error', /* istanbul ignore next - exceedingly rare and hard to simulate */ diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index 696c925d35320..960530ec0b33d 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "13.6.1", + "version": "13.6.2", "description": "JavaScript package downloader", "author": "GitHub Inc.", "bin": { diff --git a/node_modules/write-file-atomic/lib/index.js b/node_modules/write-file-atomic/lib/index.js index 118666d2ce6d8..9d79d797a553f 100644 --- a/node_modules/write-file-atomic/lib/index.js +++ b/node_modules/write-file-atomic/lib/index.js @@ -39,7 +39,9 @@ function cleanupOnExit (tmpfile) { return () => { try { fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) - } catch (_) {} + } catch { + // ignore errors + } } } @@ -156,7 +158,7 @@ async function writeFileAsync (filename, data, options = {}) { } } -function writeFile (filename, data, options, callback) { +async function writeFile (filename, data, options, callback) { if (options instanceof Function) { callback = options options = {} @@ -164,7 +166,12 @@ function writeFile (filename, data, options, callback) { const promise = writeFileAsync(filename, data, options) if (callback) { - promise.then(callback, callback) + try { + const result = await promise + return callback(result) + } catch (err) { + return callback(err) + } } return promise diff --git a/node_modules/write-file-atomic/package.json b/node_modules/write-file-atomic/package.json index 7219f90b97be0..86e2a0fbadfeb 100644 --- a/node_modules/write-file-atomic/package.json +++ b/node_modules/write-file-atomic/package.json @@ -1,23 +1,23 @@ { "name": "write-file-atomic", - "version": "4.0.1", + "version": "4.0.2", "description": "Write files in an atomic fashion w/configurable ownership", "main": "./lib/index.js", "scripts": { "test": "tap", "posttest": "npm run lint", - "lint": "eslint '**/*.js'", - "postlint": "npm-template-check", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "lintfix": "npm run lint -- --fix", "snap": "tap", - "template-copy": "npm-template-copy --force" + "template-oss-apply": "template-oss-apply --force" }, "repository": { "type": "git", - "url": "git://github.com/npm/write-file-atomic.git" + "url": "https://github.com/npm/write-file-atomic.git" }, "keywords": [ "writeFile", @@ -34,20 +34,22 @@ "signal-exit": "^3.0.7" }, "devDependencies": { - "@npmcli/template-oss": "^2.7.1", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", "mkdirp": "^1.0.4", "rimraf": "^3.0.2", - "tap": "^15.1.6" + "tap": "^16.0.1" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "2.7.1" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index 9bb2d7a44f833..ba7a51e0a872f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -135,12 +135,12 @@ "npm-package-arg": "^9.1.0", "npm-pick-manifest": "^7.0.1", "npm-profile": "^6.2.0", - "npm-registry-fetch": "^13.3.0", + "npm-registry-fetch": "^13.3.1", "npm-user-validate": "^1.0.1", "npmlog": "^6.0.2", "opener": "^1.5.2", "p-map": "^4.0.0", - "pacote": "^13.6.1", + "pacote": "^13.6.2", "parse-conflict-json": "^2.0.2", "proc-log": "^2.0.1", "qrcode-terminal": "^0.12.0", @@ -916,9 +916,9 @@ } }, "node_modules/@npmcli/fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.1.tgz", - "integrity": "sha512-1Q0uzx6c/NVNGszePbr5Gc2riSU1zLpNlo/1YWntH+eaPmMgBssAW0qXofCVkpdj3ce4swZtlDYQu+NKiYcptg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz", + "integrity": "sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==", "inBundle": true, "dependencies": { "@gar/promisify": "^1.1.3", @@ -929,9 +929,9 @@ } }, "node_modules/@npmcli/git": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.1.tgz", - "integrity": "sha512-UU85F/T+F1oVn3IsB/L6k9zXIMpXBuUBE25QDH0SsURwT6IOBqkC7M16uqo2vVZIyji3X1K4XH9luip7YekH1A==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.2.tgz", + "integrity": "sha512-CAcd08y3DWBJqJDpfuVL0uijlq5oaXaOJEKHKc4wqrjd00gkvTZB+nFuLn+doOOKddaQS9JfqtNoFCO2LCvA3w==", "inBundle": true, "dependencies": { "@npmcli/promise-spawn": "^3.0.0", @@ -993,9 +993,9 @@ } }, "node_modules/@npmcli/move-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", - "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.1.tgz", + "integrity": "sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==", "inBundle": true, "dependencies": { "mkdirp": "^1.0.4", @@ -1484,9 +1484,9 @@ } }, "node_modules/bin-links": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.1.tgz", - "integrity": "sha512-9vx+ypzVhASvHTS6K+YSGf7nwQdANoz7v6MTC0aCtYnOEZ87YvMf81aY737EZnGZdpbRM3sfWjO9oWkKmuIvyQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.2.tgz", + "integrity": "sha512-+oSWBdbCUK6X4LOCSrU36fWRzZNaK7/evX7GozR9xwl2dyiVi3UOUwTyyOVYI1FstgugfsM9QESRrWo7gjCYbg==", "dependencies": { "cmd-shim": "^5.0.0", "mkdirp-infer-owner": "^2.0.0", @@ -1596,9 +1596,9 @@ } }, "node_modules/cacache": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz", - "integrity": "sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg==", + "version": "16.1.2", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.2.tgz", + "integrity": "sha512-Xx+xPlfCZIUHagysjjOAje9nRo8pRDczQCcXb4J2O0BLtH+xeVue6ba4y1kfJfQMAnM2mkcoMIAyOctlaRGWYA==", "inBundle": true, "dependencies": { "@npmcli/fs": "^2.1.0", @@ -4637,9 +4637,9 @@ "peer": true }, "node_modules/make-fetch-happen": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.0.tgz", - "integrity": "sha512-OnEfCLofQVJ5zgKwGk55GaqosqKjaR6khQlJY3dBAA+hM25Bc5CmX5rKUfVut+rYA3uidA7zb7AvcglU87rPRg==", + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.1.tgz", + "integrity": "sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==", "inBundle": true, "dependencies": { "agentkeepalive": "^4.2.1", @@ -4819,9 +4819,10 @@ } }, "node_modules/minipass-fetch": { - "version": "2.1.0", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.1.tgz", + "integrity": "sha512-/kgtXVGS10PTFET6dAbOBWQtgH+iDiI4NhRqAftojRlsOJhk0y45sVVxqCaRQC+AMFH7JkHiWpuKJKQ+mojKiA==", "inBundle": true, - "license": "MIT", "dependencies": { "minipass": "^3.1.6", "minipass-sized": "^1.0.3", @@ -5106,9 +5107,10 @@ } }, "node_modules/normalize-package-data": { - "version": "4.0.0", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.1.tgz", + "integrity": "sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==", "inBundle": true, - "license": "BSD-2-Clause", "dependencies": { "hosted-git-info": "^5.0.0", "is-core-module": "^2.8.1", @@ -5116,7 +5118,7 @@ "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/normalize-path": { @@ -5230,9 +5232,9 @@ } }, "node_modules/npm-registry-fetch": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.3.0.tgz", - "integrity": "sha512-10LJQ/1+VhKrZjIuY9I/+gQTvumqqlgnsCufoXETHAPFTS3+M+Z5CFhZRDHGavmJ6rOye3UvNga88vl8n1r6gg==", + "version": "13.3.1", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.3.1.tgz", + "integrity": "sha512-eukJPi++DKRTjSBRcDZSDDsGqRK3ehbxfFUcgaRd0Yp6kRwOwh2WVn0r+8rMB4nnuzvAk6rQVzl6K5CkYOmnvw==", "inBundle": true, "dependencies": { "make-fetch-happen": "^10.0.6", @@ -5598,9 +5600,9 @@ } }, "node_modules/pacote": { - "version": "13.6.1", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.6.1.tgz", - "integrity": "sha512-L+2BI1ougAPsFjXRyBhcKmfT016NscRFLv6Pz5EiNf1CCFJFU0pSKKQwsZTyAQB+sTuUL4TyFyp6J1Ork3dOqw==", + "version": "13.6.2", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.6.2.tgz", + "integrity": "sha512-Gu8fU3GsvOPkak2CkbojR7vjs3k3P9cA6uazKTHdsdV0gpCEQq2opelnEv30KRQWgVzP5Vd/5umjcedma3MKtg==", "inBundle": true, "dependencies": { "@npmcli/git": "^3.0.0", @@ -9823,15 +9825,16 @@ "license": "ISC" }, "node_modules/write-file-atomic": { - "version": "4.0.1", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "inBundle": true, - "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/ws": { diff --git a/package.json b/package.json index 3641c1475185f..49ddfa179b0cf 100644 --- a/package.json +++ b/package.json @@ -103,12 +103,12 @@ "npm-package-arg": "^9.1.0", "npm-pick-manifest": "^7.0.1", "npm-profile": "^6.2.0", - "npm-registry-fetch": "^13.3.0", + "npm-registry-fetch": "^13.3.1", "npm-user-validate": "^1.0.1", "npmlog": "^6.0.2", "opener": "^1.5.2", "p-map": "^4.0.0", - "pacote": "^13.6.1", + "pacote": "^13.6.2", "parse-conflict-json": "^2.0.2", "proc-log": "^2.0.1", "qrcode-terminal": "^0.12.0",