cacache 10.0.0 → 10.0.4
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 +35 -0
- package/README.md +2 -2
- package/lib/content/read.js +10 -0
- package/lib/entry-index.js +4 -3
- package/lib/util/move-file.js +12 -16
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,41 @@
|
|
|
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="10.0.4"></a>
|
|
6
|
+
## [10.0.4](https://github.com/zkat/cacache/compare/v10.0.3...v10.0.4) (2018-02-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<a name="10.0.3"></a>
|
|
11
|
+
## [10.0.3](https://github.com/zkat/cacache/compare/v10.0.2...v10.0.3) (2018-02-16)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **content:** rethrow aggregate errors as ENOENT ([fa918f5](https://github.com/zkat/cacache/commit/fa918f5))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
<a name="10.0.2"></a>
|
|
21
|
+
## [10.0.2](https://github.com/zkat/cacache/compare/v10.0.1...v10.0.2) (2018-01-07)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **ls:** deleted entries could cause a premature stream EOF ([347dc36](https://github.com/zkat/cacache/commit/347dc36))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
<a name="10.0.1"></a>
|
|
31
|
+
## [10.0.1](https://github.com/zkat/cacache/compare/v10.0.0...v10.0.1) (2017-11-15)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* **move-file:** actually use the fallback to `move-concurrently` (#110) ([073fbe1](https://github.com/zkat/cacache/commit/073fbe1))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
5
40
|
<a name="10.0.0"></a>
|
|
6
41
|
# [10.0.0](https://github.com/zkat/cacache/compare/v9.3.0...v10.0.0) (2017-10-23)
|
|
7
42
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ concurrency, and it will never give you corrupted data, even if cache files
|
|
|
6
6
|
get corrupted or manipulated.
|
|
7
7
|
|
|
8
8
|
It was originally written to be used as [npm](https://npm.im)'s local cache, but
|
|
9
|
-
can just as easily be used on its own
|
|
9
|
+
can just as easily be used on its own.
|
|
10
10
|
|
|
11
11
|
_Translations: [español](README.es.md)_
|
|
12
12
|
|
|
@@ -117,7 +117,7 @@ translations. To use the English API as documented in this README, use
|
|
|
117
117
|
`require('cacache')`, but may change in the future.
|
|
118
118
|
|
|
119
119
|
cacache also supports other languages! You can find the list of currently
|
|
120
|
-
supported ones
|
|
120
|
+
supported ones by looking in `./locales` in the source directory. You can use
|
|
121
121
|
the API in that language with `require('cacache/<lang>')`.
|
|
122
122
|
|
|
123
123
|
Want to add support for a new language? Please go ahead! You should be able to
|
package/lib/content/read.js
CHANGED
|
@@ -95,6 +95,16 @@ function pickContentSri (cache, integrity) {
|
|
|
95
95
|
return BB.any(sri[sri.pickAlgorithm()].map(meta => {
|
|
96
96
|
return pickContentSri(cache, meta)
|
|
97
97
|
}))
|
|
98
|
+
.catch(err => {
|
|
99
|
+
if ([].some.call(err, e => e.code === 'ENOENT')) {
|
|
100
|
+
throw Object.assign(
|
|
101
|
+
new Error('No matching content found for ' + sri.toString()),
|
|
102
|
+
{code: 'ENOENT'}
|
|
103
|
+
)
|
|
104
|
+
} else {
|
|
105
|
+
throw err[0]
|
|
106
|
+
}
|
|
107
|
+
})
|
|
98
108
|
}
|
|
99
109
|
}
|
|
100
110
|
|
package/lib/entry-index.js
CHANGED
|
@@ -116,9 +116,10 @@ function lsStream (cache) {
|
|
|
116
116
|
}, new Map())
|
|
117
117
|
|
|
118
118
|
return getKeyToEntry.then(reduced => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
for (let entry of reduced.values()) {
|
|
120
|
+
const formatted = formatEntry(cache, entry)
|
|
121
|
+
formatted && stream.push(formatted)
|
|
122
|
+
}
|
|
122
123
|
}).catch({code: 'ENOENT'}, nop)
|
|
123
124
|
})
|
|
124
125
|
})
|
package/lib/util/move-file.js
CHANGED
|
@@ -34,22 +34,18 @@ function moveFile (src, dest) {
|
|
|
34
34
|
}).then(() => {
|
|
35
35
|
// content should never change for any reason, so make it read-only
|
|
36
36
|
return BB.join(unlink(src), process.platform !== 'win32' && chmod(dest, '0444'))
|
|
37
|
-
}).catch(
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// file doesn't already exist! let's try a rename -> copy fallback
|
|
49
|
-
if (!move) { move = require('move-concurrently') }
|
|
50
|
-
return move(src, dest, { BB, fs })
|
|
51
|
-
})
|
|
37
|
+
}).catch(() => {
|
|
38
|
+
if (!pinflight) { pinflight = require('promise-inflight') }
|
|
39
|
+
return pinflight('cacache-move-file:' + dest, () => {
|
|
40
|
+
return BB.promisify(fs.stat)(dest).catch(err => {
|
|
41
|
+
if (err.code !== 'ENOENT') {
|
|
42
|
+
// Something else is wrong here. Bail bail bail
|
|
43
|
+
throw err
|
|
44
|
+
}
|
|
45
|
+
// file doesn't already exist! let's try a rename -> copy fallback
|
|
46
|
+
if (!move) { move = require('move-concurrently') }
|
|
47
|
+
return move(src, dest, { BB, fs })
|
|
52
48
|
})
|
|
53
|
-
}
|
|
49
|
+
})
|
|
54
50
|
})
|
|
55
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cacache",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.4",
|
|
4
4
|
"cache-version": {
|
|
5
5
|
"content": "2",
|
|
6
6
|
"index": "5"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"benchmarks": "node test/benchmarks",
|
|
17
17
|
"prerelease": "npm t",
|
|
18
18
|
"postrelease": "npm publish && git push --follow-tags",
|
|
19
|
-
"pretest": "standard
|
|
19
|
+
"pretest": "standard",
|
|
20
20
|
"release": "standard-version -s",
|
|
21
21
|
"test": "cross-env CACACHE_UPDATE_LOCALE_FILES=true nyc --all -- tap -J test/*.js",
|
|
22
22
|
"test-docker": "docker run -it --rm --name pacotest -v \"$PWD\":/tmp -w /tmp node:latest npm test",
|
|
@@ -58,31 +58,31 @@
|
|
|
58
58
|
],
|
|
59
59
|
"license": "ISC",
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"bluebird": "^3.5.
|
|
61
|
+
"bluebird": "^3.5.1",
|
|
62
62
|
"chownr": "^1.0.1",
|
|
63
63
|
"glob": "^7.1.2",
|
|
64
64
|
"graceful-fs": "^4.1.11",
|
|
65
65
|
"lru-cache": "^4.1.1",
|
|
66
|
-
"mississippi": "^
|
|
66
|
+
"mississippi": "^2.0.0",
|
|
67
67
|
"mkdirp": "^0.5.1",
|
|
68
68
|
"move-concurrently": "^1.0.1",
|
|
69
69
|
"promise-inflight": "^1.0.1",
|
|
70
|
-
"rimraf": "^2.6.
|
|
71
|
-
"ssri": "^5.
|
|
70
|
+
"rimraf": "^2.6.2",
|
|
71
|
+
"ssri": "^5.2.4",
|
|
72
72
|
"unique-filename": "^1.1.0",
|
|
73
|
-
"y18n": "^
|
|
73
|
+
"y18n": "^4.0.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"benchmark": "^2.1.4",
|
|
77
|
-
"chalk": "^2.
|
|
78
|
-
"cross-env": "^5.
|
|
79
|
-
"nyc": "^11.1
|
|
77
|
+
"chalk": "^2.3.1",
|
|
78
|
+
"cross-env": "^5.1.3",
|
|
79
|
+
"nyc": "^11.4.1",
|
|
80
80
|
"require-inject": "^1.4.2",
|
|
81
81
|
"safe-buffer": "^5.1.1",
|
|
82
|
-
"standard": "^10.0.
|
|
83
|
-
"standard-version": "^4.
|
|
82
|
+
"standard": "^10.0.3",
|
|
83
|
+
"standard-version": "^4.3.0",
|
|
84
84
|
"tacks": "^1.2.2",
|
|
85
|
-
"tap": "^
|
|
85
|
+
"tap": "^11.1.0",
|
|
86
86
|
"weallbehave": "^1.2.0",
|
|
87
87
|
"weallcontribute": "^1.0.8"
|
|
88
88
|
},
|