pacote 9.1.0 → 9.1.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,19 @@
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.1.1"></a>
6
+ ## [9.1.1](https://github.com/zkat/pacote/compare/v9.1.0...v9.1.1) (2018-10-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **deps:** bump protoduck to remove CC0-1.0 license in dep ([3d9d9a6](https://github.com/zkat/pacote/commit/3d9d9a6))
12
+ * **git:** Fix temp directory permissions for git fetcher ([#159](https://github.com/zkat/pacote/issues/159)) ([97c3aeb](https://github.com/zkat/pacote/commit/97c3aeb))
13
+ * **packument:** group together all registry specs in silly log ([2333a17](https://github.com/zkat/pacote/commit/2333a17))
14
+ * **standard:** standard --fix ([0ecb188](https://github.com/zkat/pacote/commit/0ecb188))
15
+
16
+
17
+
5
18
  <a name="9.1.0"></a>
6
19
  # [9.1.0](https://github.com/zkat/pacote/compare/v9.0.0...v9.1.0) (2018-08-15)
7
20
 
package/lib/fetch.js CHANGED
@@ -8,7 +8,7 @@ const Fetcher = duck.define(['spec', 'opts', 'manifest'], {
8
8
  tarball: ['spec', 'opts'],
9
9
  fromManifest: ['manifest', 'spec', 'opts'],
10
10
  clearMemoized () {}
11
- }, {name: 'Fetcher'})
11
+ }, { name: 'Fetcher' })
12
12
  module.exports = Fetcher
13
13
 
14
14
  module.exports.packument = packument
@@ -34,11 +34,11 @@ Fetcher.impl(fetchDirectory, {
34
34
  const pkgPath = path.join(spec.fetchSpec, 'package.json')
35
35
  const srPath = path.join(spec.fetchSpec, 'npm-shrinkwrap.json')
36
36
  return BB.join(
37
- readFileAsync(pkgPath).then(JSON.parse).catch({code: 'ENOENT'}, err => {
37
+ readFileAsync(pkgPath).then(JSON.parse).catch({ code: 'ENOENT' }, err => {
38
38
  err.code = 'ENOPACKAGEJSON'
39
39
  throw err
40
40
  }),
41
- readFileAsync(srPath).then(JSON.parse).catch({code: 'ENOENT'}, () => null),
41
+ readFileAsync(srPath).then(JSON.parse).catch({ code: 'ENOENT' }, () => null),
42
42
  (pkg, sr) => {
43
43
  pkg._shrinkwrap = sr
44
44
  pkg._hasShrinkwrap = !!sr
@@ -50,7 +50,7 @@ Fetcher.impl(fetchDirectory, {
50
50
  ).then(pkg => {
51
51
  if (!pkg.bin && pkg.directories && pkg.directories.bin) {
52
52
  const dirBin = pkg.directories.bin
53
- return glob(path.join(spec.fetchSpec, dirBin, '/**'), {nodir: true}).then(matches => {
53
+ return glob(path.join(spec.fetchSpec, dirBin, '/**'), { nodir: true }).then(matches => {
54
54
  matches.forEach(filePath => {
55
55
  const relative = path.relative(spec.fetchSpec, filePath)
56
56
  if (relative && relative[0] !== '.') {
@@ -43,9 +43,9 @@ Fetcher.impl(fetchFile, {
43
43
  opts.cache, `pacote:tarball:file:${src}`, data, {
44
44
  integrity: opts.integrity
45
45
  }
46
- ).then(integrity => ({data, integrity}))
46
+ ).then(integrity => ({ data, integrity }))
47
47
  } else {
48
- return {data}
48
+ return { data }
49
49
  }
50
50
  }).then(info => {
51
51
  if (info.integrity) { stream.emit('integrity', info.integrity) }
@@ -157,7 +157,7 @@ function resolve (url, spec, name, opts) {
157
157
  function withTmp (opts, cb) {
158
158
  if (opts.cache) {
159
159
  // cacache has a special facility for working in a tmp dir
160
- return cacache.tmp.withTmp(opts.cache, {tmpPrefix: 'git-clone'}, cb)
160
+ return cacache.tmp.withTmp(opts.cache, { tmpPrefix: 'git-clone', uid: opts.uid, gid: opts.gid }, cb)
161
161
  } else {
162
162
  const tmpDir = path.join(osenv.tmpdir(), 'pacote-git-tmp')
163
163
  const tmpName = uniqueFilename(tmpDir, 'git-clone')
@@ -48,7 +48,7 @@ function tarball (spec, opts) {
48
48
  module.exports.fromManifest = fromManifest
49
49
  function fromManifest (manifest, spec, opts) {
50
50
  opts = optCheck(opts)
51
- if (spec.scope) { opts = opts.concat({scope: spec.scope}) }
51
+ if (spec.scope) { opts = opts.concat({ scope: spec.scope }) }
52
52
  const stream = new PassThrough()
53
53
  const registry = fetch.pickRegistry(spec, opts)
54
54
  const uri = getTarballUrl(spec, registry, manifest, opts)
@@ -156,7 +156,7 @@ function tarballedProps (pkg, spec, opts) {
156
156
  needsShrinkwrap && jsonFromStream('npm-shrinkwrap.json', extracted),
157
157
  needsManifest && jsonFromStream('package.json', extracted),
158
158
  needsBin && getPaths(extracted),
159
- needsHash && ssri.fromStream(tarStream, {algorithms: ['sha1', 'sha512']}),
159
+ needsHash && ssri.fromStream(tarStream, { algorithms: ['sha1', 'sha512'] }),
160
160
  needsExtract && pipe(tarStream, extracted),
161
161
  (sr, mani, paths, hash) => {
162
162
  if (needsManifest && !mani) {
package/lib/util/git.js CHANGED
@@ -74,10 +74,10 @@ function fullClone (repo, committish, target, opts) {
74
74
  if (process.platform === 'win32') {
75
75
  gitArgs.push('--config', 'core.longpaths=true')
76
76
  }
77
- return execGit(gitArgs, {cwd: target}).then(() => {
78
- return execGit(['init'], {cwd: target})
77
+ return execGit(gitArgs, { cwd: target }).then(() => {
78
+ return execGit(['init'], { cwd: target })
79
79
  }).then(() => {
80
- return execGit(['checkout', committish || 'HEAD'], {cwd: target})
80
+ return execGit(['checkout', committish || 'HEAD'], { cwd: target })
81
81
  }).then(() => {
82
82
  return updateSubmodules(target, opts)
83
83
  }).then(() => headSha(target, opts))
@@ -110,7 +110,7 @@ function updateSubmodules (localRepo, opts) {
110
110
 
111
111
  function headSha (repo, opts) {
112
112
  opts = optCheck(opts)
113
- return execGit(['rev-parse', '--revs-only', 'HEAD'], {cwd: repo}, opts).spread(stdout => {
113
+ return execGit(['rev-parse', '--revs-only', 'HEAD'], { cwd: repo }, opts).spread(stdout => {
114
114
  return stdout.trim()
115
115
  })
116
116
  }
@@ -139,7 +139,7 @@ function revs (repo, opts) {
139
139
  if (!ref) { return revs } // ???
140
140
  if (ref.endsWith(CARET_BRACES)) { return revs } // refs/tags/x^{} crap
141
141
  const type = refType(line)
142
- const doc = {sha, ref, type}
142
+ const doc = { sha, ref, type }
143
143
 
144
144
  revs.refs[ref] = doc
145
145
  // We can check out shallow clones on specific SHAs if we have a ref
@@ -157,7 +157,7 @@ function revs (repo, opts) {
157
157
  }
158
158
 
159
159
  return revs
160
- }, {versions: {}, 'dist-tags': {}, refs: {}, shas: {}})
160
+ }, { versions: {}, 'dist-tags': {}, refs: {}, shas: {} })
161
161
  }, err => {
162
162
  err.message = `Error while executing:\n${GITPATH} ls-remote -h -t ${repo}\n\n${err.stderr}\n${err.message}`
163
163
  throw err
@@ -12,28 +12,28 @@ module.exports = figgyPudding({
12
12
  dirPacker: {},
13
13
  dmode: {},
14
14
  fmode: {},
15
- 'fetch-retries': {default: 2},
16
- 'fetch-retry-factor': {default: 10},
17
- 'fetch-retry-maxtimeout': {default: 60000},
18
- 'fetch-retry-mintimeout': {default: 10000},
15
+ 'fetch-retries': { default: 2 },
16
+ 'fetch-retry-factor': { default: 10 },
17
+ 'fetch-retry-maxtimeout': { default: 60000 },
18
+ 'fetch-retry-mintimeout': { default: 10000 },
19
19
  fullMetadata: 'full-metadata',
20
- 'full-metadata': {default: false},
20
+ 'full-metadata': { default: false },
21
21
  gid: {},
22
- includeDeprecated: {default: true},
22
+ includeDeprecated: { default: true },
23
23
  'include-deprecated': 'includeDeprecated',
24
24
  integrity: {},
25
- log: {default: logger},
25
+ log: { default: logger },
26
26
  memoize: {},
27
27
  offline: {},
28
28
  preferOffline: 'prefer-offline',
29
29
  'prefer-offline': {},
30
30
  preferOnline: 'prefer-online',
31
31
  'prefer-online': {},
32
- registry: {default: 'https://registry.npmjs.org/'},
32
+ registry: { default: 'https://registry.npmjs.org/' },
33
33
  resolved: {},
34
34
  retry: {},
35
35
  scope: {},
36
- tag: {default: 'latest'},
36
+ tag: { default: 'latest' },
37
37
  uid: {},
38
38
  umask: {},
39
39
  where: {}
@@ -33,7 +33,7 @@ function packDir (manifest, label, dir, target, opts) {
33
33
  }
34
34
 
35
35
  function mkPacker (dir) {
36
- return packlist({path: dir}).then(files => {
36
+ return packlist({ path: dir }).then(files => {
37
37
  return tar.c({
38
38
  cwd: dir,
39
39
  gzip: true,
@@ -36,7 +36,7 @@ function withTarballStream (spec, opts, streamHandler) {
36
36
  const file = path.resolve(opts.where || '.', opts.resolved.substr(5))
37
37
  return statAsync(file)
38
38
  .then(() => {
39
- const verifier = ssri.integrityStream({integrity: opts.integrity})
39
+ const verifier = ssri.integrityStream({ integrity: opts.integrity })
40
40
  const stream = fs.createReadStream(file)
41
41
  .on('error', err => verifier.emit('error', err))
42
42
  .pipe(verifier)
@@ -50,7 +50,7 @@ function withTarballStream (spec, opts, streamHandler) {
50
50
  throw err
51
51
  })
52
52
  })
53
- : BB.reject(Object.assign(new Error('no file!'), {code: 'ENOENT'}))
53
+ : BB.reject(Object.assign(new Error('no file!'), { code: 'ENOENT' }))
54
54
 
55
55
  const tryDigest = tryFile
56
56
  .catch(err => {
@@ -96,10 +96,10 @@ function withTarballStream (spec, opts, streamHandler) {
96
96
  const tardata = fetch.tarball(spec, opts)
97
97
  if (!opts.resolved) {
98
98
  tardata.on('manifest', m => {
99
- opts = opts.concat({resolved: m._resolved})
99
+ opts = opts.concat({ resolved: m._resolved })
100
100
  })
101
101
  tardata.on('integrity', i => {
102
- opts = opts.concat({integrity: i})
102
+ opts = opts.concat({ integrity: i })
103
103
  })
104
104
  }
105
105
  return BB.try(() => streamHandler(tardata))
@@ -117,7 +117,7 @@ function withTarballStream (spec, opts, streamHandler) {
117
117
  throw err
118
118
  }
119
119
  })
120
- }, {retries: 1}))
120
+ }, { retries: 1 }))
121
121
  }
122
122
  })
123
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacote",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "description": "JavaScript package downloader",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -41,44 +41,44 @@
41
41
  ],
42
42
  "license": "MIT",
43
43
  "dependencies": {
44
- "bluebird": "^3.5.1",
45
- "cacache": "^11.0.2",
46
- "figgy-pudding": "^3.2.1",
47
- "get-stream": "^3.0.0",
48
- "glob": "^7.1.2",
44
+ "bluebird": "^3.5.2",
45
+ "cacache": "^11.2.0",
46
+ "figgy-pudding": "^3.5.1",
47
+ "get-stream": "^4.1.0",
48
+ "glob": "^7.1.3",
49
49
  "lru-cache": "^4.1.3",
50
50
  "make-fetch-happen": "^4.0.1",
51
51
  "minimatch": "^3.0.4",
52
- "minipass": "^2.3.3",
52
+ "minipass": "^2.3.5",
53
53
  "mississippi": "^3.0.0",
54
54
  "mkdirp": "^0.5.1",
55
55
  "normalize-package-data": "^2.4.0",
56
56
  "npm-package-arg": "^6.1.0",
57
- "npm-packlist": "^1.1.10",
57
+ "npm-packlist": "^1.1.12",
58
58
  "npm-pick-manifest": "^2.1.0",
59
- "npm-registry-fetch": "^3.0.0",
59
+ "npm-registry-fetch": "^3.8.0",
60
60
  "osenv": "^0.1.5",
61
61
  "promise-inflight": "^1.0.1",
62
62
  "promise-retry": "^1.1.1",
63
- "protoduck": "^5.0.0",
63
+ "protoduck": "^5.0.1",
64
64
  "rimraf": "^2.6.2",
65
65
  "safe-buffer": "^5.1.2",
66
- "semver": "^5.5.0",
67
- "ssri": "^6.0.0",
68
- "tar": "^4.4.3",
69
- "unique-filename": "^1.1.0",
70
- "which": "^1.3.0"
66
+ "semver": "^5.6.0",
67
+ "ssri": "^6.0.1",
68
+ "tar": "^4.4.6",
69
+ "unique-filename": "^1.1.1",
70
+ "which": "^1.3.1"
71
71
  },
72
72
  "devDependencies": {
73
- "nock": "^9.2.6",
73
+ "nock": "^10.0.1",
74
74
  "npmlog": "^4.1.2",
75
- "nyc": "^11.8.0",
75
+ "nyc": "^13.1.0",
76
76
  "require-inject": "^1.4.3",
77
- "standard": "^11.0.1",
77
+ "standard": "^12.0.1",
78
78
  "standard-version": "^4.4.0",
79
- "tacks": "^1.2.6",
79
+ "tacks": "^1.2.7",
80
80
  "tap": "^12.0.1",
81
- "tar-stream": "^1.6.1",
81
+ "tar-stream": "^1.6.2",
82
82
  "weallbehave": "^1.2.0",
83
83
  "weallcontribute": "^1.0.7"
84
84
  }
package/packument.js CHANGED
@@ -23,7 +23,7 @@ function packument (spec, opts) {
23
23
  return fetchPackument(spec, opts)
24
24
  }).then(p => {
25
25
  const elapsedTime = Date.now() - startTime
26
- opts.log.silly('pacote', `${spec.type} packument for ${spec.name}@${spec.saveSpec || spec.fetchSpec} fetched in ${elapsedTime}ms`)
26
+ opts.log.silly('pacote', `${spec.registry ? 'registry' : spec.type} packument for ${spec.name}@${spec.saveSpec || spec.fetchSpec} fetched in ${elapsedTime}ms`)
27
27
  return p
28
28
  })
29
29
  }
package/prefetch.js CHANGED
@@ -15,7 +15,7 @@ function prefetch (spec, opts) {
15
15
  const startTime = Date.now()
16
16
  if (!opts.cache) {
17
17
  opts.log.info('prefetch', 'skipping prefetch: no cache provided')
18
- return BB.resolve({spec})
18
+ return BB.resolve({ spec })
19
19
  }
20
20
  if (opts.integrity && !opts.preferOnline) {
21
21
  opts.log.silly('prefetch', 'checking if', opts.integrity, 'is already cached')