pacote 9.5.0 → 9.5.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  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.
4
4
 
5
+ <a name="9.5.1"></a>
6
+ ## [9.5.1](https://github.com/zkat/pacote/compare/v9.5.0...v9.5.1) (2019-06-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **audit:** npm audit fix ([127a28b](https://github.com/zkat/pacote/commit/127a28b))
12
+ * **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))
13
+ * **git:** limit retry times, avoid unlimited retries ([#172](https://github.com/zkat/pacote/issues/172)) ([8bbd051](https://github.com/zkat/pacote/commit/8bbd051))
14
+
15
+
16
+
5
17
  <a name="9.5.0"></a>
6
18
  # [9.5.0](https://github.com/zkat/pacote/compare/v9.4.1...v9.5.0) (2019-02-18)
7
19
 
package/lib/util/git.js CHANGED
@@ -40,8 +40,10 @@ const GIT_TRANSIENT_ERRORS = [
40
40
 
41
41
  const GIT_TRANSIENT_ERROR_RE = new RegExp(GIT_TRANSIENT_ERRORS)
42
42
 
43
- function shouldRetry (error) {
44
- return GIT_TRANSIENT_ERROR_RE.test(error)
43
+ const GIT_TRANSIENT_ERROR_MAX_RETRY_NUMBER = 3
44
+
45
+ function shouldRetry (error, number) {
46
+ return GIT_TRANSIENT_ERROR_RE.test(error) && (number < GIT_TRANSIENT_ERROR_MAX_RETRY_NUMBER)
45
47
  }
46
48
 
47
49
  const GIT_ = 'GIT_'
@@ -188,7 +190,7 @@ function execGit (gitArgs, gitOpts, opts) {
188
190
  opts.log.silly('pacote', 'Retrying git command: ' + gitArgs.join(' ') + ' attempt # ' + number)
189
191
  }
190
192
  return execFileAsync(gitPath, gitArgs, mkOpts(gitOpts, opts)).catch((err) => {
191
- if (shouldRetry(err)) {
193
+ if (shouldRetry(err, number)) {
192
194
  retry(err)
193
195
  } else {
194
196
  throw err
@@ -219,7 +221,7 @@ function spawnGit (gitArgs, gitOpts, opts) {
219
221
  child.stderr.on('data', d => { stderr += d })
220
222
 
221
223
  return finished(child, true).catch(err => {
222
- if (shouldRetry(stderr)) {
224
+ if (shouldRetry(stderr, number)) {
223
225
  retry(err)
224
226
  } else {
225
227
  err.stderr = stderr
@@ -107,7 +107,7 @@ function withTarballStream (spec, opts, streamHandler) {
107
107
  // Retry once if we have a cache, to clear up any weird conditions.
108
108
  // Don't retry network errors, though -- make-fetch-happen has already
109
109
  // taken care of making sure we're all set on that front.
110
- if (opts.cache && err.code && !err.code.match(/^E\d{3}$/)) {
110
+ if (opts.cache && err.code && !String(err.code).match(/^E\d{3}$/)) {
111
111
  if (err.code === 'EINTEGRITY' || err.code === 'Z_DATA_ERROR') {
112
112
  opts.log.warn('tarball', `tarball data for ${spec} (${opts.integrity}) seems to be corrupted. Trying one more time.`)
113
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacote",
3
- "version": "9.5.0",
3
+ "version": "9.5.1",
4
4
  "description": "JavaScript package downloader",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -72,12 +72,12 @@
72
72
  "devDependencies": {
73
73
  "nock": "^10.0.3",
74
74
  "npmlog": "^4.1.2",
75
- "nyc": "^13.1.0",
75
+ "nyc": "^14.1.1",
76
76
  "require-inject": "^1.4.3",
77
77
  "standard": "^12.0.1",
78
78
  "standard-version": "^4.4.0",
79
79
  "tacks": "^1.2.7",
80
- "tap": "^12.1.0",
80
+ "tap": "^12.7.0",
81
81
  "tar-stream": "^1.6.2",
82
82
  "weallbehave": "^1.2.0",
83
83
  "weallcontribute": "^1.0.7"