pacote 9.2.0 → 9.4.0
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 +41 -0
- package/lib/extract-stream.js +1 -0
- package/lib/fetchers/file.js +1 -1
- package/lib/fetchers/git.js +1 -1
- package/lib/fetchers/registry/manifest.js +6 -4
- package/lib/fetchers/registry/packument.js +9 -1
- package/lib/util/git.js +9 -7
- package/lib/util/opt-check.js +1 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,47 @@
|
|
|
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.4.0"></a>
|
|
6
|
+
# [9.4.0](https://github.com/zkat/pacote/compare/v9.3.0...v9.4.0) (2019-01-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **registry:** fall back to fullfat if something might be wrong with corgis ([0e71d6b](https://github.com/zkat/pacote/commit/0e71d6b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<a name="9.3.0"></a>
|
|
16
|
+
# [9.3.0](https://github.com/zkat/pacote/compare/v9.2.3...v9.3.0) (2018-12-21)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **git, file:** properly catch otherwise unhandled errors ([89d4897](https://github.com/zkat/pacote/commit/89d4897))
|
|
22
|
+
* **test:** set umask opt to fix extract-stream 'accepts dmode/fmode/umask opts' ([e51de83](https://github.com/zkat/pacote/commit/e51de83))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **git:** accept git path option ([#164](https://github.com/zkat/pacote/issues/164)) ([f06c8c5](https://github.com/zkat/pacote/commit/f06c8c5))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<a name="9.2.3"></a>
|
|
32
|
+
## [9.2.3](https://github.com/zkat/pacote/compare/v9.2.2...v9.2.3) (2018-10-31)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<a name="9.2.2"></a>
|
|
37
|
+
## [9.2.2](https://github.com/zkat/pacote/compare/v9.2.1...v9.2.2) (2018-10-31)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<a name="9.2.1"></a>
|
|
42
|
+
## [9.2.1](https://github.com/zkat/pacote/compare/v9.2.0...v9.2.1) (2018-10-31)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
5
46
|
<a name="9.2.0"></a>
|
|
6
47
|
# [9.2.0](https://github.com/zkat/pacote/compare/v9.1.1...v9.2.0) (2018-10-30)
|
|
7
48
|
|
package/lib/extract-stream.js
CHANGED
|
@@ -57,6 +57,7 @@ function extractStream (spec, dest, opts) {
|
|
|
57
57
|
onwarn: msg => opts.log && opts.log.warn('tar', msg),
|
|
58
58
|
uid: opts.uid,
|
|
59
59
|
gid: opts.gid,
|
|
60
|
+
umask: opts.umask,
|
|
60
61
|
transform: opts.resolved && pkgJsonTransform(spec, opts),
|
|
61
62
|
onentry (entry) {
|
|
62
63
|
if (entry.type.toLowerCase() === 'file') {
|
package/lib/fetchers/file.js
CHANGED
package/lib/fetchers/git.js
CHANGED
|
@@ -16,9 +16,10 @@ function manifest (spec, opts) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function getManifest (spec, opts) {
|
|
19
|
-
|
|
19
|
+
opts = opts.concat({
|
|
20
20
|
fullMetadata: opts.enjoyBy ? true : opts.fullMetadata
|
|
21
|
-
})
|
|
21
|
+
})
|
|
22
|
+
return fetchPackument(spec, opts).then(packument => {
|
|
22
23
|
try {
|
|
23
24
|
return pickManifest(packument, spec.fetchSpec, {
|
|
24
25
|
defaultTag: opts.defaultTag,
|
|
@@ -29,14 +30,15 @@ function getManifest (spec, opts) {
|
|
|
29
30
|
if (err.code === 'ETARGET' && packument._cached && !opts.offline) {
|
|
30
31
|
opts.log.silly(
|
|
31
32
|
'registry:manifest',
|
|
32
|
-
`no matching version for ${spec.name}@${spec.fetchSpec} in the cache. Forcing revalidation
|
|
33
|
+
`no matching version for ${spec.name}@${spec.fetchSpec} in the cache. Forcing revalidation.`
|
|
33
34
|
)
|
|
34
35
|
opts = opts.concat({
|
|
35
36
|
preferOffline: false,
|
|
36
37
|
preferOnline: true
|
|
37
38
|
})
|
|
38
39
|
return fetchPackument(spec, opts.concat({
|
|
39
|
-
|
|
40
|
+
// Fetch full metadata in case ETARGET was due to corgi delay
|
|
41
|
+
fullMetadata: true
|
|
40
42
|
})).then(packument => {
|
|
41
43
|
return pickManifest(packument, spec.fetchSpec, {
|
|
42
44
|
defaultTag: opts.defaultTag,
|
|
@@ -59,7 +59,15 @@ function fetchPackument (uri, registry, spec, opts) {
|
|
|
59
59
|
mem.set(memoKey, packument)
|
|
60
60
|
}
|
|
61
61
|
return packument
|
|
62
|
-
}))
|
|
62
|
+
})).catch(err => {
|
|
63
|
+
if (err.code === 'E404' && !opts.fullMetadata) {
|
|
64
|
+
return fetchPackument(uri, registry, spec, opts.concat({
|
|
65
|
+
fullMetadata: true
|
|
66
|
+
}))
|
|
67
|
+
} else {
|
|
68
|
+
throw err
|
|
69
|
+
}
|
|
70
|
+
})
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
class ObjProxy {
|
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 }, opts).then(() => {
|
|
78
|
+
return execGit(['init'], { cwd: target }, opts)
|
|
79
79
|
}).then(() => {
|
|
80
|
-
return execGit(['checkout', committish || 'HEAD'], { cwd: target })
|
|
80
|
+
return execGit(['checkout', committish || 'HEAD'], { cwd: target }, opts)
|
|
81
81
|
}).then(() => {
|
|
82
82
|
return updateSubmodules(target, opts)
|
|
83
83
|
}).then(() => headSha(target, opts))
|
|
@@ -182,7 +182,7 @@ function revs (repo, opts) {
|
|
|
182
182
|
module.exports._exec = execGit
|
|
183
183
|
function execGit (gitArgs, gitOpts, opts) {
|
|
184
184
|
opts = optCheck(opts)
|
|
185
|
-
return checkGit().then(gitPath => {
|
|
185
|
+
return checkGit(opts).then(gitPath => {
|
|
186
186
|
return promiseRetry((retry, number) => {
|
|
187
187
|
if (number !== 1) {
|
|
188
188
|
opts.log.silly('pacote', 'Retrying git command: ' + gitArgs.join(' ') + ' attempt # ' + number)
|
|
@@ -206,7 +206,7 @@ function execGit (gitArgs, gitOpts, opts) {
|
|
|
206
206
|
module.exports._spawn = spawnGit
|
|
207
207
|
function spawnGit (gitArgs, gitOpts, opts) {
|
|
208
208
|
opts = optCheck(opts)
|
|
209
|
-
return checkGit().then(gitPath => {
|
|
209
|
+
return checkGit(opts).then(gitPath => {
|
|
210
210
|
return promiseRetry((retry, number) => {
|
|
211
211
|
if (number !== 1) {
|
|
212
212
|
opts.log.silly('pacote', 'Retrying git command: ' + gitArgs.join(' ') + ' attempt # ' + number)
|
|
@@ -246,8 +246,10 @@ function mkOpts (_gitOpts, opts) {
|
|
|
246
246
|
return gitOpts
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
function checkGit () {
|
|
250
|
-
if (
|
|
249
|
+
function checkGit (opts) {
|
|
250
|
+
if (opts.git) {
|
|
251
|
+
return BB.resolve(opts.git)
|
|
252
|
+
} else if (!GITPATH) {
|
|
251
253
|
const err = new Error('No git binary found in $PATH')
|
|
252
254
|
err.code = 'ENOGIT'
|
|
253
255
|
return BB.reject(err)
|
package/lib/util/opt-check.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacote",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.0",
|
|
4
4
|
"description": "JavaScript package downloader",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
],
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"bluebird": "^3.5.
|
|
45
|
-
"cacache": "^11.2
|
|
44
|
+
"bluebird": "^3.5.3",
|
|
45
|
+
"cacache": "^11.3.2",
|
|
46
46
|
"figgy-pudding": "^3.5.1",
|
|
47
47
|
"get-stream": "^4.1.0",
|
|
48
48
|
"glob": "^7.1.3",
|
|
49
|
-
"lru-cache": "^
|
|
49
|
+
"lru-cache": "^5.1.1",
|
|
50
50
|
"make-fetch-happen": "^4.0.1",
|
|
51
51
|
"minimatch": "^3.0.4",
|
|
52
52
|
"minipass": "^2.3.5",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"normalize-package-data": "^2.4.0",
|
|
56
56
|
"npm-package-arg": "^6.1.0",
|
|
57
57
|
"npm-packlist": "^1.1.12",
|
|
58
|
-
"npm-pick-manifest": "^2.2.
|
|
58
|
+
"npm-pick-manifest": "^2.2.3",
|
|
59
59
|
"npm-registry-fetch": "^3.8.0",
|
|
60
60
|
"osenv": "^0.1.5",
|
|
61
61
|
"promise-inflight": "^1.0.1",
|
|
@@ -65,19 +65,19 @@
|
|
|
65
65
|
"safe-buffer": "^5.1.2",
|
|
66
66
|
"semver": "^5.6.0",
|
|
67
67
|
"ssri": "^6.0.1",
|
|
68
|
-
"tar": "^4.4.
|
|
68
|
+
"tar": "^4.4.8",
|
|
69
69
|
"unique-filename": "^1.1.1",
|
|
70
70
|
"which": "^1.3.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"nock": "^10.0.
|
|
73
|
+
"nock": "^10.0.3",
|
|
74
74
|
"npmlog": "^4.1.2",
|
|
75
75
|
"nyc": "^13.1.0",
|
|
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.0
|
|
80
|
+
"tap": "^12.1.0",
|
|
81
81
|
"tar-stream": "^1.6.2",
|
|
82
82
|
"weallbehave": "^1.2.0",
|
|
83
83
|
"weallcontribute": "^1.0.7"
|