pacote 8.1.2 → 8.1.6
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 +26 -0
- package/lib/extract-stream.js +28 -17
- package/lib/finalize-manifest.js +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
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="8.1.6"></a>
|
|
6
|
+
## [8.1.6](https://github.com/zkat/pacote/compare/v8.1.5...v8.1.6) (2018-05-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<a name="8.1.5"></a>
|
|
11
|
+
## [8.1.5](https://github.com/zkat/pacote/compare/v8.1.4...v8.1.5) (2018-05-22)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<a name="8.1.4"></a>
|
|
16
|
+
## [8.1.4](https://github.com/zkat/pacote/compare/v8.1.3...v8.1.4) (2018-05-22)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
<a name="8.1.3"></a>
|
|
21
|
+
## [8.1.3](https://github.com/zkat/pacote/compare/v8.1.2...v8.1.3) (2018-05-20)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **deps:** try reverting tar ([574ecff](https://github.com/zkat/pacote/commit/574ecff))
|
|
27
|
+
* **extract-stream:** address "write after end" issue ([#151](https://github.com/zkat/pacote/issues/151)) ([50ed408](https://github.com/zkat/pacote/commit/50ed408)), closes [#142](https://github.com/zkat/pacote/issues/142)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
5
31
|
<a name="8.1.2"></a>
|
|
6
32
|
## [8.1.2](https://github.com/zkat/pacote/compare/v8.1.1...v8.1.2) (2018-05-16)
|
|
7
33
|
|
package/lib/extract-stream.js
CHANGED
|
@@ -7,6 +7,33 @@ const tar = require('tar')
|
|
|
7
7
|
module.exports = extractStream
|
|
8
8
|
module.exports._computeMode = computeMode
|
|
9
9
|
|
|
10
|
+
class Transformer extends Minipass {
|
|
11
|
+
constructor (spec, opts) {
|
|
12
|
+
super()
|
|
13
|
+
this.spec = spec
|
|
14
|
+
this.opts = opts
|
|
15
|
+
this.str = ''
|
|
16
|
+
}
|
|
17
|
+
write (data) {
|
|
18
|
+
this.str += data
|
|
19
|
+
return true
|
|
20
|
+
}
|
|
21
|
+
end () {
|
|
22
|
+
const replaced = this.str.replace(
|
|
23
|
+
/}\s*$/,
|
|
24
|
+
`\n,"_resolved": ${
|
|
25
|
+
JSON.stringify(this.opts.resolved || '')
|
|
26
|
+
}\n,"_integrity": ${
|
|
27
|
+
JSON.stringify(this.opts.integrity || '')
|
|
28
|
+
}\n,"_from": ${
|
|
29
|
+
JSON.stringify(this.spec.toString())
|
|
30
|
+
}\n}`
|
|
31
|
+
)
|
|
32
|
+
super.write(replaced)
|
|
33
|
+
return super.end()
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
10
37
|
function computeMode (fileMode, optMode, umask) {
|
|
11
38
|
return (fileMode | optMode) & ~(umask || 0)
|
|
12
39
|
}
|
|
@@ -14,23 +41,7 @@ function computeMode (fileMode, optMode, umask) {
|
|
|
14
41
|
function pkgJsonTransform (spec, opts) {
|
|
15
42
|
return entry => {
|
|
16
43
|
if (entry.path === 'package.json') {
|
|
17
|
-
const transformed = new
|
|
18
|
-
let str = ''
|
|
19
|
-
entry.on('end', () => {
|
|
20
|
-
const replaced = str.replace(
|
|
21
|
-
/}\s*$/,
|
|
22
|
-
`\n,"_resolved": ${
|
|
23
|
-
JSON.stringify(opts.resolved || '')
|
|
24
|
-
}\n,"_integrity": ${
|
|
25
|
-
JSON.stringify(opts.integrity || '')
|
|
26
|
-
}\n,"_from": ${
|
|
27
|
-
JSON.stringify(spec.toString())
|
|
28
|
-
}\n}`
|
|
29
|
-
)
|
|
30
|
-
transformed.write(replaced, () => transformed.end())
|
|
31
|
-
})
|
|
32
|
-
entry.on('error', e => transformed.emit('error'))
|
|
33
|
-
entry.on('data', d => { str += d })
|
|
44
|
+
const transformed = new Transformer(spec, opts)
|
|
34
45
|
return transformed
|
|
35
46
|
}
|
|
36
47
|
}
|
package/lib/finalize-manifest.js
CHANGED
|
@@ -208,7 +208,6 @@ function jsonFromStream (filename, dataStream) {
|
|
|
208
208
|
entry.resume()
|
|
209
209
|
} else {
|
|
210
210
|
let data = ''
|
|
211
|
-
entry.on('data', d => { data += d })
|
|
212
211
|
entry.on('error', cb)
|
|
213
212
|
finished(entry).then(() => {
|
|
214
213
|
try {
|
|
@@ -219,6 +218,7 @@ function jsonFromStream (filename, dataStream) {
|
|
|
219
218
|
}, err => {
|
|
220
219
|
cb(err)
|
|
221
220
|
})
|
|
221
|
+
entry.on('data', d => { data += d })
|
|
222
222
|
}
|
|
223
223
|
})
|
|
224
224
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacote",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.6",
|
|
4
4
|
"description": "JavaScript package downloader",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"bluebird": "^3.5.1",
|
|
45
|
-
"cacache": "^11.0.
|
|
45
|
+
"cacache": "^11.0.2",
|
|
46
46
|
"get-stream": "^3.0.0",
|
|
47
47
|
"glob": "^7.1.2",
|
|
48
|
-
"lru-cache": "^4.1.
|
|
48
|
+
"lru-cache": "^4.1.3",
|
|
49
49
|
"make-fetch-happen": "^4.0.1",
|
|
50
50
|
"minimatch": "^3.0.4",
|
|
51
|
-
"minipass": "^2.3.
|
|
51
|
+
"minipass": "^2.3.3",
|
|
52
52
|
"mississippi": "^3.0.0",
|
|
53
53
|
"mkdirp": "^0.5.1",
|
|
54
54
|
"normalize-package-data": "^2.4.0",
|
|
@@ -60,23 +60,23 @@
|
|
|
60
60
|
"promise-retry": "^1.1.1",
|
|
61
61
|
"protoduck": "^5.0.0",
|
|
62
62
|
"rimraf": "^2.6.2",
|
|
63
|
-
"safe-buffer": "^5.1.
|
|
63
|
+
"safe-buffer": "^5.1.2",
|
|
64
64
|
"semver": "^5.5.0",
|
|
65
65
|
"ssri": "^6.0.0",
|
|
66
|
-
"tar": "^4.4.
|
|
66
|
+
"tar": "^4.4.3",
|
|
67
67
|
"unique-filename": "^1.1.0",
|
|
68
68
|
"which": "^1.3.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"nock": "^9.2.
|
|
71
|
+
"nock": "^9.2.6",
|
|
72
72
|
"npmlog": "^4.1.2",
|
|
73
73
|
"nyc": "^11.8.0",
|
|
74
|
-
"require-inject": "^1.4.
|
|
74
|
+
"require-inject": "^1.4.3",
|
|
75
75
|
"standard": "^11.0.1",
|
|
76
|
-
"standard-version": "^4.
|
|
76
|
+
"standard-version": "^4.4.0",
|
|
77
77
|
"tacks": "^1.2.6",
|
|
78
|
-
"tap": "^
|
|
79
|
-
"tar-stream": "^1.
|
|
78
|
+
"tap": "^12.0.1",
|
|
79
|
+
"tar-stream": "^1.6.1",
|
|
80
80
|
"weallbehave": "^1.2.0",
|
|
81
81
|
"weallcontribute": "^1.0.7"
|
|
82
82
|
}
|