From 0421930693ba54d909e65fd77f1db845404b2cac Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 28 Jun 2019 16:32:38 -0700 Subject: [PATCH] pacote@9.5.1 --- node_modules/pacote/CHANGELOG.md | 12 ++++++++ node_modules/pacote/lib/util/git.js | 10 ++++--- .../pacote/lib/with-tarball-stream.js | 2 +- node_modules/pacote/package.json | 28 +++++++++---------- package-lock.json | 6 ++-- package.json | 2 +- 6 files changed, 37 insertions(+), 23 deletions(-) diff --git a/node_modules/pacote/CHANGELOG.md b/node_modules/pacote/CHANGELOG.md index 1c8feb9a79377..433c0f470f51c 100644 --- a/node_modules/pacote/CHANGELOG.md +++ b/node_modules/pacote/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [9.5.1](https://github.com/zkat/pacote/compare/v9.5.0...v9.5.1) (2019-06-17) + + +### Bug Fixes + +* **audit:** npm audit fix ([127a28b](https://github.com/zkat/pacote/commit/127a28b)) +* **errors:** Fix "TypeError: err.code.match is not a function" error ([#170](https://github.com/zkat/pacote/issues/170)) ([92f5e4c](https://github.com/zkat/pacote/commit/92f5e4c)) +* **git:** limit retry times, avoid unlimited retries ([#172](https://github.com/zkat/pacote/issues/172)) ([8bbd051](https://github.com/zkat/pacote/commit/8bbd051)) + + + # [9.5.0](https://github.com/zkat/pacote/compare/v9.4.1...v9.5.0) (2019-02-18) diff --git a/node_modules/pacote/lib/util/git.js b/node_modules/pacote/lib/util/git.js index 997404dd23cbd..7991833abed0e 100644 --- a/node_modules/pacote/lib/util/git.js +++ b/node_modules/pacote/lib/util/git.js @@ -40,8 +40,10 @@ const GIT_TRANSIENT_ERRORS = [ const GIT_TRANSIENT_ERROR_RE = new RegExp(GIT_TRANSIENT_ERRORS) -function shouldRetry (error) { - return GIT_TRANSIENT_ERROR_RE.test(error) +const GIT_TRANSIENT_ERROR_MAX_RETRY_NUMBER = 3 + +function shouldRetry (error, number) { + return GIT_TRANSIENT_ERROR_RE.test(error) && (number < GIT_TRANSIENT_ERROR_MAX_RETRY_NUMBER) } const GIT_ = 'GIT_' @@ -188,7 +190,7 @@ function execGit (gitArgs, gitOpts, opts) { opts.log.silly('pacote', 'Retrying git command: ' + gitArgs.join(' ') + ' attempt # ' + number) } return execFileAsync(gitPath, gitArgs, mkOpts(gitOpts, opts)).catch((err) => { - if (shouldRetry(err)) { + if (shouldRetry(err, number)) { retry(err) } else { throw err @@ -219,7 +221,7 @@ function spawnGit (gitArgs, gitOpts, opts) { child.stderr.on('data', d => { stderr += d }) return finished(child, true).catch(err => { - if (shouldRetry(stderr)) { + if (shouldRetry(stderr, number)) { retry(err) } else { err.stderr = stderr diff --git a/node_modules/pacote/lib/with-tarball-stream.js b/node_modules/pacote/lib/with-tarball-stream.js index abeba738a1c66..0d84696d66932 100644 --- a/node_modules/pacote/lib/with-tarball-stream.js +++ b/node_modules/pacote/lib/with-tarball-stream.js @@ -107,7 +107,7 @@ function withTarballStream (spec, opts, streamHandler) { // Retry once if we have a cache, to clear up any weird conditions. // Don't retry network errors, though -- make-fetch-happen has already // taken care of making sure we're all set on that front. - if (opts.cache && err.code && !err.code.match(/^E\d{3}$/)) { + if (opts.cache && err.code && !String(err.code).match(/^E\d{3}$/)) { if (err.code === 'EINTEGRITY' || err.code === 'Z_DATA_ERROR') { opts.log.warn('tarball', `tarball data for ${spec} (${opts.integrity}) seems to be corrupted. Trying one more time.`) } diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index 896afe5a77dd2..2fd3d4151f4e3 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,21 +1,21 @@ { - "_from": "pacote@latest", - "_id": "pacote@9.5.0", + "_from": "pacote@^9.5.1", + "_id": "pacote@9.5.1", "_inBundle": false, - "_integrity": "sha512-aUplXozRbzhaJO48FaaeClmN+2Mwt741MC6M3bevIGZwdCaP7frXzbUOfOWa91FPHoLITzG0hYaKY363lxO3bg==", + "_integrity": "sha512-Zqvczvf/zZ7QNosdE9uTC7SRuvSs9tFqRkF6cJl+2HH7COBnx4BRAGpeXJlrbN+mM0CMHpbi620xdEHhCflghA==", "_location": "/pacote", "_phantomChildren": { "safe-buffer": "5.1.2" }, "_requested": { - "type": "tag", + "type": "range", "registry": true, - "raw": "pacote@latest", + "raw": "pacote@^9.5.1", "name": "pacote", "escapedName": "pacote", - "rawSpec": "latest", + "rawSpec": "^9.5.1", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "^9.5.1" }, "_requiredBy": [ "#USER", @@ -23,10 +23,10 @@ "/libcipm", "/libnpm" ], - "_resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.0.tgz", - "_shasum": "85f3013a3f6dd51c108b0ccabd3de8102ddfaeda", - "_spec": "pacote@latest", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.1.tgz", + "_shasum": "adb0d23daeef6d0b813ab5891d0c6459ccec998d", + "_spec": "pacote@^9.5.1", + "_where": "/Users/isaacs/dev/npm/cli", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -79,12 +79,12 @@ "devDependencies": { "nock": "^10.0.3", "npmlog": "^4.1.2", - "nyc": "^13.1.0", + "nyc": "^14.1.1", "require-inject": "^1.4.3", "standard": "^12.0.1", "standard-version": "^4.4.0", "tacks": "^1.2.7", - "tap": "^12.1.0", + "tap": "^12.7.0", "tar-stream": "^1.6.2", "weallbehave": "^1.2.0", "weallcontribute": "^1.0.7" @@ -116,5 +116,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "9.5.0" + "version": "9.5.1" } diff --git a/package-lock.json b/package-lock.json index f3e930df2bac9..bacc152a0df8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4423,9 +4423,9 @@ } }, "pacote": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.0.tgz", - "integrity": "sha512-aUplXozRbzhaJO48FaaeClmN+2Mwt741MC6M3bevIGZwdCaP7frXzbUOfOWa91FPHoLITzG0hYaKY363lxO3bg==", + "version": "9.5.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.1.tgz", + "integrity": "sha512-Zqvczvf/zZ7QNosdE9uTC7SRuvSs9tFqRkF6cJl+2HH7COBnx4BRAGpeXJlrbN+mM0CMHpbi620xdEHhCflghA==", "requires": { "bluebird": "^3.5.3", "cacache": "^11.3.2", diff --git a/package.json b/package.json index 6773ff2ac8824..0acc8da40a42a 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "once": "~1.4.0", "opener": "^1.5.1", "osenv": "^0.1.5", - "pacote": "^9.5.0", + "pacote": "^9.5.1", "path-is-inside": "~1.0.2", "promise-inflight": "~1.0.1", "qrcode-terminal": "^0.12.0",