pacote 13.1.0 → 13.3.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/lib/fetcher.js +9 -2
- package/lib/registry.js +3 -0
- package/lib/remote.js +8 -5
- package/package.json +5 -5
package/lib/fetcher.js
CHANGED
|
@@ -105,8 +105,15 @@ class FetcherBase {
|
|
|
105
105
|
this[_readPackageJson] = readPackageJsonFast
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
// config values: npmjs (default), never
|
|
109
|
-
|
|
108
|
+
// config values: npmjs (default), never, always
|
|
109
|
+
// we don't want to mutate the original value
|
|
110
|
+
if (opts.replaceRegistryHost !== 'never'
|
|
111
|
+
&& opts.replaceRegistryHost !== 'always'
|
|
112
|
+
) {
|
|
113
|
+
this.replaceRegistryHost = 'npmjs'
|
|
114
|
+
} else {
|
|
115
|
+
this.replaceRegistryHost = opts.replaceRegistryHost
|
|
116
|
+
}
|
|
110
117
|
|
|
111
118
|
this.defaultTag = opts.defaultTag || 'latest'
|
|
112
119
|
this.registry = removeTrailingSlashes(opts.registry || 'https://registry.npmjs.org')
|
package/lib/registry.js
CHANGED
|
@@ -165,6 +165,9 @@ class RegistryFetcher extends Fetcher {
|
|
|
165
165
|
}
|
|
166
166
|
if (this.integrity) {
|
|
167
167
|
mani._integrity = String(this.integrity)
|
|
168
|
+
if (dist.signatures) {
|
|
169
|
+
mani._signatures = dist.signatures
|
|
170
|
+
}
|
|
168
171
|
}
|
|
169
172
|
this.package = rpj.normalize(mani)
|
|
170
173
|
return this.package
|
package/lib/remote.js
CHANGED
|
@@ -5,7 +5,7 @@ const pacoteVersion = require('../package.json').version
|
|
|
5
5
|
const fetch = require('npm-registry-fetch')
|
|
6
6
|
const Minipass = require('minipass')
|
|
7
7
|
// The default registry URL is a string of great magic.
|
|
8
|
-
const
|
|
8
|
+
const magicHost = 'https://registry.npmjs.org'
|
|
9
9
|
|
|
10
10
|
const _cacheFetches = Symbol.for('pacote.Fetcher._cacheFetches')
|
|
11
11
|
const _headers = Symbol('_headers')
|
|
@@ -13,10 +13,13 @@ class RemoteFetcher extends Fetcher {
|
|
|
13
13
|
constructor (spec, opts) {
|
|
14
14
|
super(spec, opts)
|
|
15
15
|
this.resolved = this.spec.fetchSpec
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const resolvedURL = new URL(this.resolved)
|
|
17
|
+
if (
|
|
18
|
+
(this.replaceRegistryHost === 'npmjs'
|
|
19
|
+
&& resolvedURL.origin === magicHost)
|
|
20
|
+
|| this.replaceRegistryHost === 'always'
|
|
21
|
+
) {
|
|
22
|
+
this.resolved = new URL(resolvedURL.pathname, this.registry).href
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
// nam is a fermented pork sausage that is good to eat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacote",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.3.0",
|
|
4
4
|
"description": "JavaScript package downloader",
|
|
5
5
|
"author": "GitHub Inc.",
|
|
6
6
|
"bin": {
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@npmcli/eslint-config": "^3.0.1",
|
|
29
|
-
"@npmcli/template-oss": "3.
|
|
29
|
+
"@npmcli/template-oss": "3.4.3",
|
|
30
30
|
"hosted-git-info": "^5.0.0",
|
|
31
31
|
"mutate-fs": "^2.1.1",
|
|
32
32
|
"nock": "^13.2.4",
|
|
33
|
-
"npm-registry-mock": "^1.3.
|
|
33
|
+
"npm-registry-mock": "^1.3.2",
|
|
34
34
|
"tap": "^16.0.1"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"minipass": "^3.1.6",
|
|
55
55
|
"mkdirp": "^1.0.4",
|
|
56
56
|
"npm-package-arg": "^9.0.0",
|
|
57
|
-
"npm-packlist": "^
|
|
57
|
+
"npm-packlist": "^5.0.0",
|
|
58
58
|
"npm-pick-manifest": "^7.0.0",
|
|
59
59
|
"npm-registry-fetch": "^13.0.1",
|
|
60
60
|
"proc-log": "^2.0.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"templateOSS": {
|
|
76
76
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
77
|
-
"version": "3.
|
|
77
|
+
"version": "3.4.3",
|
|
78
78
|
"windowsCI": false
|
|
79
79
|
}
|
|
80
80
|
}
|