cacache 11.3.3 → 12.0.3
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 +221 -152
- package/README.md +34 -17
- package/lib/content/write.js +3 -3
- package/lib/entry-index.js +5 -7
- package/lib/util/fix-owner.js +73 -35
- package/lib/util/tmp.js +4 -7
- package/lib/verify.js +8 -8
- package/package.json +3 -2
- package/put.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,108 +2,177 @@
|
|
|
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
|
-
### [
|
|
5
|
+
### [12.0.3](https://github.com/npm/cacache/compare/v12.0.2...v12.0.3) (2019-08-19)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
### Bug Fixes
|
|
9
9
|
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
* do not chown if not running as root ([2d80af9](https://github.com/npm/cacache/commit/2d80af9))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### [12.0.2](https://github.com/npm/cacache/compare/v12.0.1...v12.0.2) (2019-07-19)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### [12.0.1](https://github.com/npm/cacache/compare/v12.0.0...v12.0.1) (2019-07-19)
|
|
19
|
+
|
|
20
|
+
* **deps** Abstracted out `lib/util/infer-owner.js` to
|
|
21
|
+
[@npmcli/infer-owner](https://www.npmjs.com/package/@npmcli/infer-owner)
|
|
22
|
+
so that it could be more easily used in other parts of the npm CLI.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [12.0.0](https://github.com/npm/cacache/compare/v11.3.3...v12.0.0) (2019-07-15)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* infer uid/gid instead of accepting as options ([ac84d14](https://github.com/npm/cacache/commit/ac84d14))
|
|
31
|
+
* **i18n:** add another error message ([676cb32](https://github.com/npm/cacache/commit/676cb32))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### BREAKING CHANGES
|
|
35
|
+
|
|
36
|
+
* the uid gid options are no longer respected or
|
|
37
|
+
necessary. As of this change, cacache will always match the cache
|
|
38
|
+
contents to the ownership of the cache directory (or its parent
|
|
39
|
+
directory), regardless of what the caller passes in.
|
|
40
|
+
|
|
41
|
+
Reasoning:
|
|
42
|
+
|
|
43
|
+
The number one reason to use a uid or gid option was to keep root-owned
|
|
44
|
+
files from causing problems in the cache. In npm's case, this meant
|
|
45
|
+
that CLI's ./lib/command.js had to work out the appropriate uid and gid,
|
|
46
|
+
then pass it to the libnpmcommand module, which had to in turn pass the
|
|
47
|
+
uid and gid to npm-registry-fetch, which then passed it to
|
|
48
|
+
make-fetch-happen, which passed it to cacache. (For package fetching,
|
|
49
|
+
pacote would be in that mix as well.)
|
|
50
|
+
|
|
51
|
+
Added to that, `cacache.rm()` will actually _write_ a file into the
|
|
52
|
+
cache index, but has no way to accept an option so that its call to
|
|
53
|
+
entry-index.js will write the index with the appropriate uid/gid.
|
|
54
|
+
Little ownership bugs were all over the place, and tricky to trace
|
|
55
|
+
through. (Why should make-fetch-happen even care about accepting or
|
|
56
|
+
passing uids and gids? It's an http library.)
|
|
57
|
+
|
|
58
|
+
This change allows us to keep the cache from having mixed ownership in
|
|
59
|
+
any situation.
|
|
60
|
+
|
|
61
|
+
Of course, this _does_ mean that if you have a root-owned but
|
|
62
|
+
user-writable folder (for example, `/tmp`), then the cache will try to
|
|
63
|
+
chown everything to root.
|
|
64
|
+
|
|
65
|
+
The solution is for the user to create a folder, make it user-owned, and
|
|
66
|
+
use that, rather than relying on cacache to create the root cache folder.
|
|
67
|
+
|
|
68
|
+
If we decide to restore the uid/gid opts, and use ownership inferrence
|
|
69
|
+
only when uid/gid are unset, then take care to also make rm take an
|
|
70
|
+
option object, and pass it through to entry-index.js.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### [11.3.3](https://github.com/npm/cacache/compare/v11.3.2...v11.3.3) (2019-06-17)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Bug Fixes
|
|
78
|
+
|
|
79
|
+
* **audit:** npm audit fix ([200a6d5](https://github.com/npm/cacache/commit/200a6d5))
|
|
80
|
+
* **config:** Add ssri config 'error' option ([#146](https://github.com/npm/cacache/issues/146)) ([47de8f5](https://github.com/npm/cacache/commit/47de8f5))
|
|
81
|
+
* **deps:** npm audit fix ([481a7dc](https://github.com/npm/cacache/commit/481a7dc))
|
|
82
|
+
* **standard:** standard --fix ([7799149](https://github.com/npm/cacache/commit/7799149))
|
|
83
|
+
* **write:** avoid another cb never called situation ([5156561](https://github.com/npm/cacache/commit/5156561))
|
|
15
84
|
|
|
16
85
|
|
|
17
86
|
|
|
18
87
|
<a name="11.3.2"></a>
|
|
19
|
-
## [11.3.2](https://github.com/
|
|
88
|
+
## [11.3.2](https://github.com/npm/cacache/compare/v11.3.1...v11.3.2) (2018-12-21)
|
|
20
89
|
|
|
21
90
|
|
|
22
91
|
### Bug Fixes
|
|
23
92
|
|
|
24
|
-
* **get:** make sure to handle errors in the .then ([b10bcd0](https://github.com/
|
|
93
|
+
* **get:** make sure to handle errors in the .then ([b10bcd0](https://github.com/npm/cacache/commit/b10bcd0))
|
|
25
94
|
|
|
26
95
|
|
|
27
96
|
|
|
28
97
|
<a name="11.3.1"></a>
|
|
29
|
-
## [11.3.1](https://github.com/
|
|
98
|
+
## [11.3.1](https://github.com/npm/cacache/compare/v11.3.0...v11.3.1) (2018-11-05)
|
|
30
99
|
|
|
31
100
|
|
|
32
101
|
### Bug Fixes
|
|
33
102
|
|
|
34
|
-
* **get:** export hasContent.sync properly ([d76c920](https://github.com/
|
|
103
|
+
* **get:** export hasContent.sync properly ([d76c920](https://github.com/npm/cacache/commit/d76c920))
|
|
35
104
|
|
|
36
105
|
|
|
37
106
|
|
|
38
107
|
<a name="11.3.0"></a>
|
|
39
|
-
# [11.3.0](https://github.com/
|
|
108
|
+
# [11.3.0](https://github.com/npm/cacache/compare/v11.2.0...v11.3.0) (2018-11-05)
|
|
40
109
|
|
|
41
110
|
|
|
42
111
|
### Features
|
|
43
112
|
|
|
44
|
-
* **get:** add sync API for reading ([db1e094](https://github.com/
|
|
113
|
+
* **get:** add sync API for reading ([db1e094](https://github.com/npm/cacache/commit/db1e094))
|
|
45
114
|
|
|
46
115
|
|
|
47
116
|
|
|
48
117
|
<a name="11.2.0"></a>
|
|
49
|
-
# [11.2.0](https://github.com/
|
|
118
|
+
# [11.2.0](https://github.com/npm/cacache/compare/v11.1.0...v11.2.0) (2018-08-08)
|
|
50
119
|
|
|
51
120
|
|
|
52
121
|
### Features
|
|
53
122
|
|
|
54
|
-
* **read:** add sync support to other internal read.js fns ([fe638b6](https://github.com/
|
|
123
|
+
* **read:** add sync support to other internal read.js fns ([fe638b6](https://github.com/npm/cacache/commit/fe638b6))
|
|
55
124
|
|
|
56
125
|
|
|
57
126
|
|
|
58
127
|
<a name="11.1.0"></a>
|
|
59
|
-
# [11.1.0](https://github.com/
|
|
128
|
+
# [11.1.0](https://github.com/npm/cacache/compare/v11.0.3...v11.1.0) (2018-08-01)
|
|
60
129
|
|
|
61
130
|
|
|
62
131
|
### Features
|
|
63
132
|
|
|
64
|
-
* **read:** add sync support for low-level content read ([b43af83](https://github.com/
|
|
133
|
+
* **read:** add sync support for low-level content read ([b43af83](https://github.com/npm/cacache/commit/b43af83))
|
|
65
134
|
|
|
66
135
|
|
|
67
136
|
|
|
68
137
|
<a name="11.0.3"></a>
|
|
69
|
-
## [11.0.3](https://github.com/
|
|
138
|
+
## [11.0.3](https://github.com/npm/cacache/compare/v11.0.2...v11.0.3) (2018-08-01)
|
|
70
139
|
|
|
71
140
|
|
|
72
141
|
### Bug Fixes
|
|
73
142
|
|
|
74
|
-
* **config:** add ssri config options ([#136](https://github.com/
|
|
75
|
-
* **perf:** refactor content.read to avoid lstats ([c5ac10e](https://github.com/
|
|
76
|
-
* **test:** oops when removing safe-buffer ([1950490](https://github.com/
|
|
143
|
+
* **config:** add ssri config options ([#136](https://github.com/npm/cacache/issues/136)) ([10d5d9a](https://github.com/npm/cacache/commit/10d5d9a))
|
|
144
|
+
* **perf:** refactor content.read to avoid lstats ([c5ac10e](https://github.com/npm/cacache/commit/c5ac10e))
|
|
145
|
+
* **test:** oops when removing safe-buffer ([1950490](https://github.com/npm/cacache/commit/1950490))
|
|
77
146
|
|
|
78
147
|
|
|
79
148
|
|
|
80
149
|
<a name="11.0.2"></a>
|
|
81
|
-
## [11.0.2](https://github.com/
|
|
150
|
+
## [11.0.2](https://github.com/npm/cacache/compare/v11.0.1...v11.0.2) (2018-05-07)
|
|
82
151
|
|
|
83
152
|
|
|
84
153
|
### Bug Fixes
|
|
85
154
|
|
|
86
|
-
* **verify:** size param no longer lost in a verify ([#131](https://github.com/
|
|
155
|
+
* **verify:** size param no longer lost in a verify ([#131](https://github.com/npm/cacache/issues/131)) ([c614a19](https://github.com/npm/cacache/commit/c614a19)), closes [#130](https://github.com/npm/cacache/issues/130)
|
|
87
156
|
|
|
88
157
|
|
|
89
158
|
|
|
90
159
|
<a name="11.0.1"></a>
|
|
91
|
-
## [11.0.1](https://github.com/
|
|
160
|
+
## [11.0.1](https://github.com/npm/cacache/compare/v11.0.0...v11.0.1) (2018-04-10)
|
|
92
161
|
|
|
93
162
|
|
|
94
163
|
|
|
95
164
|
<a name="11.0.0"></a>
|
|
96
|
-
# [11.0.0](https://github.com/
|
|
165
|
+
# [11.0.0](https://github.com/npm/cacache/compare/v10.0.4...v11.0.0) (2018-04-09)
|
|
97
166
|
|
|
98
167
|
|
|
99
168
|
### Features
|
|
100
169
|
|
|
101
|
-
* **opts:** use figgy-pudding for opts ([#128](https://github.com/
|
|
170
|
+
* **opts:** use figgy-pudding for opts ([#128](https://github.com/npm/cacache/issues/128)) ([33d4eed](https://github.com/npm/cacache/commit/33d4eed))
|
|
102
171
|
|
|
103
172
|
|
|
104
173
|
### meta
|
|
105
174
|
|
|
106
|
-
* drop support for node@4 ([529f347](https://github.com/
|
|
175
|
+
* drop support for node@4 ([529f347](https://github.com/npm/cacache/commit/529f347))
|
|
107
176
|
|
|
108
177
|
|
|
109
178
|
### BREAKING CHANGES
|
|
@@ -113,52 +182,52 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
113
182
|
|
|
114
183
|
|
|
115
184
|
<a name="10.0.4"></a>
|
|
116
|
-
## [10.0.4](https://github.com/
|
|
185
|
+
## [10.0.4](https://github.com/npm/cacache/compare/v10.0.3...v10.0.4) (2018-02-16)
|
|
117
186
|
|
|
118
187
|
|
|
119
188
|
|
|
120
189
|
<a name="10.0.3"></a>
|
|
121
|
-
## [10.0.3](https://github.com/
|
|
190
|
+
## [10.0.3](https://github.com/npm/cacache/compare/v10.0.2...v10.0.3) (2018-02-16)
|
|
122
191
|
|
|
123
192
|
|
|
124
193
|
### Bug Fixes
|
|
125
194
|
|
|
126
|
-
* **content:** rethrow aggregate errors as ENOENT ([fa918f5](https://github.com/
|
|
195
|
+
* **content:** rethrow aggregate errors as ENOENT ([fa918f5](https://github.com/npm/cacache/commit/fa918f5))
|
|
127
196
|
|
|
128
197
|
|
|
129
198
|
|
|
130
199
|
<a name="10.0.2"></a>
|
|
131
|
-
## [10.0.2](https://github.com/
|
|
200
|
+
## [10.0.2](https://github.com/npm/cacache/compare/v10.0.1...v10.0.2) (2018-01-07)
|
|
132
201
|
|
|
133
202
|
|
|
134
203
|
### Bug Fixes
|
|
135
204
|
|
|
136
|
-
* **ls:** deleted entries could cause a premature stream EOF ([347dc36](https://github.com/
|
|
205
|
+
* **ls:** deleted entries could cause a premature stream EOF ([347dc36](https://github.com/npm/cacache/commit/347dc36))
|
|
137
206
|
|
|
138
207
|
|
|
139
208
|
|
|
140
209
|
<a name="10.0.1"></a>
|
|
141
|
-
## [10.0.1](https://github.com/
|
|
210
|
+
## [10.0.1](https://github.com/npm/cacache/compare/v10.0.0...v10.0.1) (2017-11-15)
|
|
142
211
|
|
|
143
212
|
|
|
144
213
|
### Bug Fixes
|
|
145
214
|
|
|
146
|
-
* **move-file:** actually use the fallback to `move-concurrently` (#110) ([073fbe1](https://github.com/
|
|
215
|
+
* **move-file:** actually use the fallback to `move-concurrently` (#110) ([073fbe1](https://github.com/npm/cacache/commit/073fbe1))
|
|
147
216
|
|
|
148
217
|
|
|
149
218
|
|
|
150
219
|
<a name="10.0.0"></a>
|
|
151
|
-
# [10.0.0](https://github.com/
|
|
220
|
+
# [10.0.0](https://github.com/npm/cacache/compare/v9.3.0...v10.0.0) (2017-10-23)
|
|
152
221
|
|
|
153
222
|
|
|
154
223
|
### Features
|
|
155
224
|
|
|
156
|
-
* **license:** relicense to ISC (#111) ([fdbb4e5](https://github.com/
|
|
225
|
+
* **license:** relicense to ISC (#111) ([fdbb4e5](https://github.com/npm/cacache/commit/fdbb4e5))
|
|
157
226
|
|
|
158
227
|
|
|
159
228
|
### Performance Improvements
|
|
160
229
|
|
|
161
|
-
* more copyFile benchmarks ([63787bb](https://github.com/
|
|
230
|
+
* more copyFile benchmarks ([63787bb](https://github.com/npm/cacache/commit/63787bb))
|
|
162
231
|
|
|
163
232
|
|
|
164
233
|
### BREAKING CHANGES
|
|
@@ -168,132 +237,132 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
168
237
|
|
|
169
238
|
|
|
170
239
|
<a name="9.3.0"></a>
|
|
171
|
-
# [9.3.0](https://github.com/
|
|
240
|
+
# [9.3.0](https://github.com/npm/cacache/compare/v9.2.9...v9.3.0) (2017-10-07)
|
|
172
241
|
|
|
173
242
|
|
|
174
243
|
### Features
|
|
175
244
|
|
|
176
|
-
* **copy:** added cacache.get.copy api for fast copies (#107) ([067b5f6](https://github.com/
|
|
245
|
+
* **copy:** added cacache.get.copy api for fast copies (#107) ([067b5f6](https://github.com/npm/cacache/commit/067b5f6))
|
|
177
246
|
|
|
178
247
|
|
|
179
248
|
|
|
180
249
|
<a name="9.2.9"></a>
|
|
181
|
-
## [9.2.9](https://github.com/
|
|
250
|
+
## [9.2.9](https://github.com/npm/cacache/compare/v9.2.8...v9.2.9) (2017-06-17)
|
|
182
251
|
|
|
183
252
|
|
|
184
253
|
|
|
185
254
|
<a name="9.2.8"></a>
|
|
186
|
-
## [9.2.8](https://github.com/
|
|
255
|
+
## [9.2.8](https://github.com/npm/cacache/compare/v9.2.7...v9.2.8) (2017-06-05)
|
|
187
256
|
|
|
188
257
|
|
|
189
258
|
### Bug Fixes
|
|
190
259
|
|
|
191
|
-
* **ssri:** bump ssri for bugfix ([c3232ea](https://github.com/
|
|
260
|
+
* **ssri:** bump ssri for bugfix ([c3232ea](https://github.com/npm/cacache/commit/c3232ea))
|
|
192
261
|
|
|
193
262
|
|
|
194
263
|
|
|
195
264
|
<a name="9.2.7"></a>
|
|
196
|
-
## [9.2.7](https://github.com/
|
|
265
|
+
## [9.2.7](https://github.com/npm/cacache/compare/v9.2.6...v9.2.7) (2017-06-05)
|
|
197
266
|
|
|
198
267
|
|
|
199
268
|
### Bug Fixes
|
|
200
269
|
|
|
201
|
-
* **content:** make verified content completely read-only (#96) ([4131196](https://github.com/
|
|
270
|
+
* **content:** make verified content completely read-only (#96) ([4131196](https://github.com/npm/cacache/commit/4131196))
|
|
202
271
|
|
|
203
272
|
|
|
204
273
|
|
|
205
274
|
<a name="9.2.6"></a>
|
|
206
|
-
## [9.2.6](https://github.com/
|
|
275
|
+
## [9.2.6](https://github.com/npm/cacache/compare/v9.2.5...v9.2.6) (2017-05-31)
|
|
207
276
|
|
|
208
277
|
|
|
209
278
|
### Bug Fixes
|
|
210
279
|
|
|
211
|
-
* **node:** update ssri to prevent old node 4 crash ([5209ffe](https://github.com/
|
|
280
|
+
* **node:** update ssri to prevent old node 4 crash ([5209ffe](https://github.com/npm/cacache/commit/5209ffe))
|
|
212
281
|
|
|
213
282
|
|
|
214
283
|
|
|
215
284
|
<a name="9.2.5"></a>
|
|
216
|
-
## [9.2.5](https://github.com/
|
|
285
|
+
## [9.2.5](https://github.com/npm/cacache/compare/v9.2.4...v9.2.5) (2017-05-25)
|
|
217
286
|
|
|
218
287
|
|
|
219
288
|
### Bug Fixes
|
|
220
289
|
|
|
221
|
-
* **deps:** fix lockfile issues and bump ssri ([84e1d7e](https://github.com/
|
|
290
|
+
* **deps:** fix lockfile issues and bump ssri ([84e1d7e](https://github.com/npm/cacache/commit/84e1d7e))
|
|
222
291
|
|
|
223
292
|
|
|
224
293
|
|
|
225
294
|
<a name="9.2.4"></a>
|
|
226
|
-
## [9.2.4](https://github.com/
|
|
295
|
+
## [9.2.4](https://github.com/npm/cacache/compare/v9.2.3...v9.2.4) (2017-05-24)
|
|
227
296
|
|
|
228
297
|
|
|
229
298
|
### Bug Fixes
|
|
230
299
|
|
|
231
|
-
* **deps:** bumping deps ([bbccb12](https://github.com/
|
|
300
|
+
* **deps:** bumping deps ([bbccb12](https://github.com/npm/cacache/commit/bbccb12))
|
|
232
301
|
|
|
233
302
|
|
|
234
303
|
|
|
235
304
|
<a name="9.2.3"></a>
|
|
236
|
-
## [9.2.3](https://github.com/
|
|
305
|
+
## [9.2.3](https://github.com/npm/cacache/compare/v9.2.2...v9.2.3) (2017-05-24)
|
|
237
306
|
|
|
238
307
|
|
|
239
308
|
### Bug Fixes
|
|
240
309
|
|
|
241
|
-
* **rm:** stop crashing if content is missing on rm ([ac90bc0](https://github.com/
|
|
310
|
+
* **rm:** stop crashing if content is missing on rm ([ac90bc0](https://github.com/npm/cacache/commit/ac90bc0))
|
|
242
311
|
|
|
243
312
|
|
|
244
313
|
|
|
245
314
|
<a name="9.2.2"></a>
|
|
246
|
-
## [9.2.2](https://github.com/
|
|
315
|
+
## [9.2.2](https://github.com/npm/cacache/compare/v9.2.1...v9.2.2) (2017-05-14)
|
|
247
316
|
|
|
248
317
|
|
|
249
318
|
### Bug Fixes
|
|
250
319
|
|
|
251
|
-
* **i18n:** lets pretend this didn't happen ([519b4ee](https://github.com/
|
|
320
|
+
* **i18n:** lets pretend this didn't happen ([519b4ee](https://github.com/npm/cacache/commit/519b4ee))
|
|
252
321
|
|
|
253
322
|
|
|
254
323
|
|
|
255
324
|
<a name="9.2.1"></a>
|
|
256
|
-
## [9.2.1](https://github.com/
|
|
325
|
+
## [9.2.1](https://github.com/npm/cacache/compare/v9.2.0...v9.2.1) (2017-05-14)
|
|
257
326
|
|
|
258
327
|
|
|
259
328
|
### Bug Fixes
|
|
260
329
|
|
|
261
|
-
* **docs:** fixing translation messup ([bb9e4f9](https://github.com/
|
|
330
|
+
* **docs:** fixing translation messup ([bb9e4f9](https://github.com/npm/cacache/commit/bb9e4f9))
|
|
262
331
|
|
|
263
332
|
|
|
264
333
|
|
|
265
334
|
<a name="9.2.0"></a>
|
|
266
|
-
# [9.2.0](https://github.com/
|
|
335
|
+
# [9.2.0](https://github.com/npm/cacache/compare/v9.1.0...v9.2.0) (2017-05-14)
|
|
267
336
|
|
|
268
337
|
|
|
269
338
|
### Features
|
|
270
339
|
|
|
271
|
-
* **i18n:** add Spanish translation for API ([531f9a4](https://github.com/
|
|
340
|
+
* **i18n:** add Spanish translation for API ([531f9a4](https://github.com/npm/cacache/commit/531f9a4))
|
|
272
341
|
|
|
273
342
|
|
|
274
343
|
|
|
275
344
|
<a name="9.1.0"></a>
|
|
276
|
-
# [9.1.0](https://github.com/
|
|
345
|
+
# [9.1.0](https://github.com/npm/cacache/compare/v9.0.0...v9.1.0) (2017-05-14)
|
|
277
346
|
|
|
278
347
|
|
|
279
348
|
### Features
|
|
280
349
|
|
|
281
|
-
* **i18n:** Add Spanish translation and i18n setup (#91) ([323b90c](https://github.com/
|
|
350
|
+
* **i18n:** Add Spanish translation and i18n setup (#91) ([323b90c](https://github.com/npm/cacache/commit/323b90c))
|
|
282
351
|
|
|
283
352
|
|
|
284
353
|
|
|
285
354
|
<a name="9.0.0"></a>
|
|
286
|
-
# [9.0.0](https://github.com/
|
|
355
|
+
# [9.0.0](https://github.com/npm/cacache/compare/v8.0.0...v9.0.0) (2017-04-28)
|
|
287
356
|
|
|
288
357
|
|
|
289
358
|
### Bug Fixes
|
|
290
359
|
|
|
291
|
-
* **memoization:** actually use the LRU ([0e55dc9](https://github.com/
|
|
360
|
+
* **memoization:** actually use the LRU ([0e55dc9](https://github.com/npm/cacache/commit/0e55dc9))
|
|
292
361
|
|
|
293
362
|
|
|
294
363
|
### Features
|
|
295
364
|
|
|
296
|
-
* **memoization:** memoizers can be injected through opts.memoize (#90) ([e5614c7](https://github.com/
|
|
365
|
+
* **memoization:** memoizers can be injected through opts.memoize (#90) ([e5614c7](https://github.com/npm/cacache/commit/e5614c7))
|
|
297
366
|
|
|
298
367
|
|
|
299
368
|
### BREAKING CHANGES
|
|
@@ -303,12 +372,12 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
303
372
|
|
|
304
373
|
|
|
305
374
|
<a name="8.0.0"></a>
|
|
306
|
-
# [8.0.0](https://github.com/
|
|
375
|
+
# [8.0.0](https://github.com/npm/cacache/compare/v7.1.0...v8.0.0) (2017-04-22)
|
|
307
376
|
|
|
308
377
|
|
|
309
378
|
### Features
|
|
310
379
|
|
|
311
|
-
* **read:** change hasContent to return {sri, size} (#88) ([bad6c49](https://github.com/
|
|
380
|
+
* **read:** change hasContent to return {sri, size} (#88) ([bad6c49](https://github.com/npm/cacache/commit/bad6c49)), closes [#87](https://github.com/npm/cacache/issues/87)
|
|
312
381
|
|
|
313
382
|
|
|
314
383
|
### BREAKING CHANGES
|
|
@@ -318,78 +387,78 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
318
387
|
|
|
319
388
|
|
|
320
389
|
<a name="7.1.0"></a>
|
|
321
|
-
# [7.1.0](https://github.com/
|
|
390
|
+
# [7.1.0](https://github.com/npm/cacache/compare/v7.0.5...v7.1.0) (2017-04-20)
|
|
322
391
|
|
|
323
392
|
|
|
324
393
|
### Features
|
|
325
394
|
|
|
326
|
-
* **size:** handle content size info (#49) ([91230af](https://github.com/
|
|
395
|
+
* **size:** handle content size info (#49) ([91230af](https://github.com/npm/cacache/commit/91230af))
|
|
327
396
|
|
|
328
397
|
|
|
329
398
|
|
|
330
399
|
<a name="7.0.5"></a>
|
|
331
|
-
## [7.0.5](https://github.com/
|
|
400
|
+
## [7.0.5](https://github.com/npm/cacache/compare/v7.0.4...v7.0.5) (2017-04-18)
|
|
332
401
|
|
|
333
402
|
|
|
334
403
|
### Bug Fixes
|
|
335
404
|
|
|
336
|
-
* **integrity:** new ssri with fixed integrity stream ([6d13e8e](https://github.com/
|
|
337
|
-
* **write:** wrap stuff in promises to improve errors ([3624fc5](https://github.com/
|
|
405
|
+
* **integrity:** new ssri with fixed integrity stream ([6d13e8e](https://github.com/npm/cacache/commit/6d13e8e))
|
|
406
|
+
* **write:** wrap stuff in promises to improve errors ([3624fc5](https://github.com/npm/cacache/commit/3624fc5))
|
|
338
407
|
|
|
339
408
|
|
|
340
409
|
|
|
341
410
|
<a name="7.0.4"></a>
|
|
342
|
-
## [7.0.4](https://github.com/
|
|
411
|
+
## [7.0.4](https://github.com/npm/cacache/compare/v7.0.3...v7.0.4) (2017-04-15)
|
|
343
412
|
|
|
344
413
|
|
|
345
414
|
### Bug Fixes
|
|
346
415
|
|
|
347
|
-
* **fix-owner:** throw away ENOENTs on chownr ([d49bbcd](https://github.com/
|
|
416
|
+
* **fix-owner:** throw away ENOENTs on chownr ([d49bbcd](https://github.com/npm/cacache/commit/d49bbcd))
|
|
348
417
|
|
|
349
418
|
|
|
350
419
|
|
|
351
420
|
<a name="7.0.3"></a>
|
|
352
|
-
## [7.0.3](https://github.com/
|
|
421
|
+
## [7.0.3](https://github.com/npm/cacache/compare/v7.0.2...v7.0.3) (2017-04-05)
|
|
353
422
|
|
|
354
423
|
|
|
355
424
|
### Bug Fixes
|
|
356
425
|
|
|
357
|
-
* **read:** fixing error message for integrity verification failures ([9d4f0a5](https://github.com/
|
|
426
|
+
* **read:** fixing error message for integrity verification failures ([9d4f0a5](https://github.com/npm/cacache/commit/9d4f0a5))
|
|
358
427
|
|
|
359
428
|
|
|
360
429
|
|
|
361
430
|
<a name="7.0.2"></a>
|
|
362
|
-
## [7.0.2](https://github.com/
|
|
431
|
+
## [7.0.2](https://github.com/npm/cacache/compare/v7.0.1...v7.0.2) (2017-04-03)
|
|
363
432
|
|
|
364
433
|
|
|
365
434
|
### Bug Fixes
|
|
366
435
|
|
|
367
|
-
* **integrity:** use EINTEGRITY error code and update ssri ([8dc2e62](https://github.com/
|
|
436
|
+
* **integrity:** use EINTEGRITY error code and update ssri ([8dc2e62](https://github.com/npm/cacache/commit/8dc2e62))
|
|
368
437
|
|
|
369
438
|
|
|
370
439
|
|
|
371
440
|
<a name="7.0.1"></a>
|
|
372
|
-
## [7.0.1](https://github.com/
|
|
441
|
+
## [7.0.1](https://github.com/npm/cacache/compare/v7.0.0...v7.0.1) (2017-04-03)
|
|
373
442
|
|
|
374
443
|
|
|
375
444
|
### Bug Fixes
|
|
376
445
|
|
|
377
|
-
* **docs:** fix header name conflict in readme ([afcd456](https://github.com/
|
|
446
|
+
* **docs:** fix header name conflict in readme ([afcd456](https://github.com/npm/cacache/commit/afcd456))
|
|
378
447
|
|
|
379
448
|
|
|
380
449
|
|
|
381
450
|
<a name="7.0.0"></a>
|
|
382
|
-
# [7.0.0](https://github.com/
|
|
451
|
+
# [7.0.0](https://github.com/npm/cacache/compare/v6.3.0...v7.0.0) (2017-04-03)
|
|
383
452
|
|
|
384
453
|
|
|
385
454
|
### Bug Fixes
|
|
386
455
|
|
|
387
|
-
* **test:** fix content.write tests when running in docker ([d2e9b6a](https://github.com/
|
|
456
|
+
* **test:** fix content.write tests when running in docker ([d2e9b6a](https://github.com/npm/cacache/commit/d2e9b6a))
|
|
388
457
|
|
|
389
458
|
|
|
390
459
|
### Features
|
|
391
460
|
|
|
392
|
-
* **integrity:** subresource integrity support (#78) ([b1e731f](https://github.com/
|
|
461
|
+
* **integrity:** subresource integrity support (#78) ([b1e731f](https://github.com/npm/cacache/commit/b1e731f))
|
|
393
462
|
|
|
394
463
|
|
|
395
464
|
### BREAKING CHANGES
|
|
@@ -425,150 +494,150 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
425
494
|
|
|
426
495
|
|
|
427
496
|
<a name="6.3.0"></a>
|
|
428
|
-
# [6.3.0](https://github.com/
|
|
497
|
+
# [6.3.0](https://github.com/npm/cacache/compare/v6.2.0...v6.3.0) (2017-04-01)
|
|
429
498
|
|
|
430
499
|
|
|
431
500
|
### Bug Fixes
|
|
432
501
|
|
|
433
|
-
* **fixOwner:** ignore EEXIST race condition from mkdirp ([4670e9b](https://github.com/
|
|
434
|
-
* **index:** ignore index removal races when inserting ([b9d2fa2](https://github.com/
|
|
435
|
-
* **memo:** use lru-cache for better mem management (#75) ([d8ac5aa](https://github.com/
|
|
502
|
+
* **fixOwner:** ignore EEXIST race condition from mkdirp ([4670e9b](https://github.com/npm/cacache/commit/4670e9b))
|
|
503
|
+
* **index:** ignore index removal races when inserting ([b9d2fa2](https://github.com/npm/cacache/commit/b9d2fa2))
|
|
504
|
+
* **memo:** use lru-cache for better mem management (#75) ([d8ac5aa](https://github.com/npm/cacache/commit/d8ac5aa))
|
|
436
505
|
|
|
437
506
|
|
|
438
507
|
### Features
|
|
439
508
|
|
|
440
|
-
* **dependencies:** Switch to move-concurrently (#77) ([dc6482d](https://github.com/
|
|
509
|
+
* **dependencies:** Switch to move-concurrently (#77) ([dc6482d](https://github.com/npm/cacache/commit/dc6482d))
|
|
441
510
|
|
|
442
511
|
|
|
443
512
|
|
|
444
513
|
<a name="6.2.0"></a>
|
|
445
|
-
# [6.2.0](https://github.com/
|
|
514
|
+
# [6.2.0](https://github.com/npm/cacache/compare/v6.1.2...v6.2.0) (2017-03-15)
|
|
446
515
|
|
|
447
516
|
|
|
448
517
|
### Bug Fixes
|
|
449
518
|
|
|
450
|
-
* **index:** additional bucket entry verification with checksum (#72) ([f8e0f25](https://github.com/
|
|
451
|
-
* **verify:** return fixOwner.chownr promise ([6818521](https://github.com/
|
|
519
|
+
* **index:** additional bucket entry verification with checksum (#72) ([f8e0f25](https://github.com/npm/cacache/commit/f8e0f25))
|
|
520
|
+
* **verify:** return fixOwner.chownr promise ([6818521](https://github.com/npm/cacache/commit/6818521))
|
|
452
521
|
|
|
453
522
|
|
|
454
523
|
### Features
|
|
455
524
|
|
|
456
|
-
* **tmp:** safe tmp dir creation/management util (#73) ([c42da71](https://github.com/
|
|
525
|
+
* **tmp:** safe tmp dir creation/management util (#73) ([c42da71](https://github.com/npm/cacache/commit/c42da71))
|
|
457
526
|
|
|
458
527
|
|
|
459
528
|
|
|
460
529
|
<a name="6.1.2"></a>
|
|
461
|
-
## [6.1.2](https://github.com/
|
|
530
|
+
## [6.1.2](https://github.com/npm/cacache/compare/v6.1.1...v6.1.2) (2017-03-13)
|
|
462
531
|
|
|
463
532
|
|
|
464
533
|
### Bug Fixes
|
|
465
534
|
|
|
466
|
-
* **index:** set default hashAlgorithm ([d6eb2f0](https://github.com/
|
|
535
|
+
* **index:** set default hashAlgorithm ([d6eb2f0](https://github.com/npm/cacache/commit/d6eb2f0))
|
|
467
536
|
|
|
468
537
|
|
|
469
538
|
|
|
470
539
|
<a name="6.1.1"></a>
|
|
471
|
-
## [6.1.1](https://github.com/
|
|
540
|
+
## [6.1.1](https://github.com/npm/cacache/compare/v6.1.0...v6.1.1) (2017-03-13)
|
|
472
541
|
|
|
473
542
|
|
|
474
543
|
### Bug Fixes
|
|
475
544
|
|
|
476
|
-
* **coverage:** bumping coverage for verify (#71) ([0b7faf6](https://github.com/
|
|
477
|
-
* **deps:** glob should have been a regular dep :< ([0640bc4](https://github.com/
|
|
545
|
+
* **coverage:** bumping coverage for verify (#71) ([0b7faf6](https://github.com/npm/cacache/commit/0b7faf6))
|
|
546
|
+
* **deps:** glob should have been a regular dep :< ([0640bc4](https://github.com/npm/cacache/commit/0640bc4))
|
|
478
547
|
|
|
479
548
|
|
|
480
549
|
|
|
481
550
|
<a name="6.1.0"></a>
|
|
482
|
-
# [6.1.0](https://github.com/
|
|
551
|
+
# [6.1.0](https://github.com/npm/cacache/compare/v6.0.2...v6.1.0) (2017-03-12)
|
|
483
552
|
|
|
484
553
|
|
|
485
554
|
### Bug Fixes
|
|
486
555
|
|
|
487
|
-
* **coverage:** more coverage for content reads (#70) ([ef4f70a](https://github.com/
|
|
488
|
-
* **tests:** use safe-buffer because omfg (#69) ([6ab8132](https://github.com/
|
|
556
|
+
* **coverage:** more coverage for content reads (#70) ([ef4f70a](https://github.com/npm/cacache/commit/ef4f70a))
|
|
557
|
+
* **tests:** use safe-buffer because omfg (#69) ([6ab8132](https://github.com/npm/cacache/commit/6ab8132))
|
|
489
558
|
|
|
490
559
|
|
|
491
560
|
### Features
|
|
492
561
|
|
|
493
|
-
* **rm:** limited rm.all and fixed bugs (#66) ([d5d25ba](https://github.com/
|
|
494
|
-
* **verify:** tested, working cache verifier/gc (#68) ([45ad77a](https://github.com/
|
|
562
|
+
* **rm:** limited rm.all and fixed bugs (#66) ([d5d25ba](https://github.com/npm/cacache/commit/d5d25ba)), closes [#66](https://github.com/npm/cacache/issues/66)
|
|
563
|
+
* **verify:** tested, working cache verifier/gc (#68) ([45ad77a](https://github.com/npm/cacache/commit/45ad77a))
|
|
495
564
|
|
|
496
565
|
|
|
497
566
|
|
|
498
567
|
<a name="6.0.2"></a>
|
|
499
|
-
## [6.0.2](https://github.com/
|
|
568
|
+
## [6.0.2](https://github.com/npm/cacache/compare/v6.0.1...v6.0.2) (2017-03-11)
|
|
500
569
|
|
|
501
570
|
|
|
502
571
|
### Bug Fixes
|
|
503
572
|
|
|
504
|
-
* **index:** segment cache items with another subbucket (#64) ([c3644e5](https://github.com/
|
|
573
|
+
* **index:** segment cache items with another subbucket (#64) ([c3644e5](https://github.com/npm/cacache/commit/c3644e5))
|
|
505
574
|
|
|
506
575
|
|
|
507
576
|
|
|
508
577
|
<a name="6.0.1"></a>
|
|
509
|
-
## [6.0.1](https://github.com/
|
|
578
|
+
## [6.0.1](https://github.com/npm/cacache/compare/v6.0.0...v6.0.1) (2017-03-05)
|
|
510
579
|
|
|
511
580
|
|
|
512
581
|
### Bug Fixes
|
|
513
582
|
|
|
514
|
-
* **docs:** Missed spots in README ([8ffb7fa](https://github.com/
|
|
583
|
+
* **docs:** Missed spots in README ([8ffb7fa](https://github.com/npm/cacache/commit/8ffb7fa))
|
|
515
584
|
|
|
516
585
|
|
|
517
586
|
|
|
518
587
|
<a name="6.0.0"></a>
|
|
519
|
-
# [6.0.0](https://github.com/
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
### Bug Fixes
|
|
523
|
-
|
|
524
|
-
* **api:** keep memo cache mostly-internal ([2f72d0a](https://github.com/
|
|
525
|
-
* **content:** use the rest of the string, not the whole string ([fa8f3c3](https://github.com/
|
|
526
|
-
* **deps:** removed `format-number
|
|
527
|
-
* **deps:** removed inflight
|
|
528
|
-
* **deps:** rimraf
|
|
529
|
-
* **deps:** standard
|
|
530
|
-
* **deps:** tap
|
|
531
|
-
* **deps:** weallcontribute
|
|
532
|
-
* **docs:** add security note to hashKey ([03f81ba](https://github.com/
|
|
533
|
-
* **hashes:** change default hashAlgorithm to sha512 ([ea00ba6](https://github.com/
|
|
534
|
-
* **hashes:** missed a spot for hashAlgorithm defaults ([45997d8](https://github.com/
|
|
535
|
-
* **index:** add length header before JSON for verification ([fb8cb4d](https://github.com/
|
|
536
|
-
* **index:** change index filenames to sha1s of keys ([bbc5fca](https://github.com/
|
|
537
|
-
* **index:** who cares about race conditions anyway ([b1d3888](https://github.com/
|
|
538
|
-
* **perf:** bulk-read get+read for massive speed ([d26cdf9](https://github.com/
|
|
539
|
-
* **perf:** use bulk file reads for index reads ([79a8891](https://github.com/
|
|
540
|
-
* **put-stream:** remove tmp file on stream insert error ([65f6632](https://github.com/
|
|
541
|
-
* **put-stream:** robustified and predictibilized ([daf9e08](https://github.com/
|
|
542
|
-
* **put-stream:** use new promise API for moves ([1d36013](https://github.com/
|
|
543
|
-
* **readme:** updated to reflect new default hashAlgo ([c60a2fa](https://github.com/
|
|
544
|
-
* **verify:** tiny typo fix ([db22d05](https://github.com/
|
|
588
|
+
# [6.0.0](https://github.com/npm/cacache/compare/v5.0.3...v6.0.0) (2017-03-05)
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
### Bug Fixes
|
|
592
|
+
|
|
593
|
+
* **api:** keep memo cache mostly-internal ([2f72d0a](https://github.com/npm/cacache/commit/2f72d0a))
|
|
594
|
+
* **content:** use the rest of the string, not the whole string ([fa8f3c3](https://github.com/npm/cacache/commit/fa8f3c3))
|
|
595
|
+
* **deps:** removed `format-number@2.0.2` ([1187791](https://github.com/npm/cacache/commit/1187791))
|
|
596
|
+
* **deps:** removed inflight@1.0.6 ([0d1819c](https://github.com/npm/cacache/commit/0d1819c))
|
|
597
|
+
* **deps:** rimraf@2.6.1 ([9efab6b](https://github.com/npm/cacache/commit/9efab6b))
|
|
598
|
+
* **deps:** standard@9.0.0 ([4202cba](https://github.com/npm/cacache/commit/4202cba))
|
|
599
|
+
* **deps:** tap@10.3.0 ([aa03088](https://github.com/npm/cacache/commit/aa03088))
|
|
600
|
+
* **deps:** weallcontribute@1.0.8 ([ad4f4dc](https://github.com/npm/cacache/commit/ad4f4dc))
|
|
601
|
+
* **docs:** add security note to hashKey ([03f81ba](https://github.com/npm/cacache/commit/03f81ba))
|
|
602
|
+
* **hashes:** change default hashAlgorithm to sha512 ([ea00ba6](https://github.com/npm/cacache/commit/ea00ba6))
|
|
603
|
+
* **hashes:** missed a spot for hashAlgorithm defaults ([45997d8](https://github.com/npm/cacache/commit/45997d8))
|
|
604
|
+
* **index:** add length header before JSON for verification ([fb8cb4d](https://github.com/npm/cacache/commit/fb8cb4d))
|
|
605
|
+
* **index:** change index filenames to sha1s of keys ([bbc5fca](https://github.com/npm/cacache/commit/bbc5fca))
|
|
606
|
+
* **index:** who cares about race conditions anyway ([b1d3888](https://github.com/npm/cacache/commit/b1d3888))
|
|
607
|
+
* **perf:** bulk-read get+read for massive speed ([d26cdf9](https://github.com/npm/cacache/commit/d26cdf9))
|
|
608
|
+
* **perf:** use bulk file reads for index reads ([79a8891](https://github.com/npm/cacache/commit/79a8891))
|
|
609
|
+
* **put-stream:** remove tmp file on stream insert error ([65f6632](https://github.com/npm/cacache/commit/65f6632))
|
|
610
|
+
* **put-stream:** robustified and predictibilized ([daf9e08](https://github.com/npm/cacache/commit/daf9e08))
|
|
611
|
+
* **put-stream:** use new promise API for moves ([1d36013](https://github.com/npm/cacache/commit/1d36013))
|
|
612
|
+
* **readme:** updated to reflect new default hashAlgo ([c60a2fa](https://github.com/npm/cacache/commit/c60a2fa))
|
|
613
|
+
* **verify:** tiny typo fix ([db22d05](https://github.com/npm/cacache/commit/db22d05))
|
|
545
614
|
|
|
546
615
|
|
|
547
616
|
### Features
|
|
548
617
|
|
|
549
|
-
* **api:** converted external api ([7bf032f](https://github.com/
|
|
550
|
-
* **cacache:** exported clearMemoized() utility ([8d2c5b6](https://github.com/
|
|
551
|
-
* **cache:** add versioning to content and index ([31bc549](https://github.com/
|
|
552
|
-
* **content:** collate content files into subdirs ([c094d9f](https://github.com/
|
|
553
|
-
* **deps:**
|
|
554
|
-
* **deps:** bluebird
|
|
555
|
-
* **deps:** promise-inflight
|
|
556
|
-
* **get:** added memoization support for get ([c77d794](https://github.com/
|
|
557
|
-
* **get:** export hasContent ([2956ec3](https://github.com/
|
|
558
|
-
* **index:** add hashAlgorithm and format insert ret val ([b639746](https://github.com/
|
|
559
|
-
* **index:** collate index files into subdirs ([e8402a5](https://github.com/
|
|
560
|
-
* **index:** promisify entry index ([cda3335](https://github.com/
|
|
561
|
-
* **memo:** added memoization lib ([da07b92](https://github.com/
|
|
562
|
-
* **memo:** export memoization api ([954b1b3](https://github.com/
|
|
563
|
-
* **move-file:** add move fallback for weird errors ([5cf4616](https://github.com/
|
|
564
|
-
* **perf:** bulk content write api ([51b536e](https://github.com/
|
|
565
|
-
* **put:** added memoization support to put ([b613a70](https://github.com/
|
|
566
|
-
* **read:** switched to promises ([a869362](https://github.com/
|
|
567
|
-
* **rm:** added memoization support to rm ([4205cf0](https://github.com/
|
|
568
|
-
* **rm:** switched to promises ([a000d24](https://github.com/
|
|
569
|
-
* **util:** promise-inflight ownership fix requests ([9517cd7](https://github.com/
|
|
570
|
-
* **util:** use promises for api ([ae204bb](https://github.com/
|
|
571
|
-
* **verify:** converted to Promises ([f0b3974](https://github.com/
|
|
618
|
+
* **api:** converted external api ([7bf032f](https://github.com/npm/cacache/commit/7bf032f))
|
|
619
|
+
* **cacache:** exported clearMemoized() utility ([8d2c5b6](https://github.com/npm/cacache/commit/8d2c5b6))
|
|
620
|
+
* **cache:** add versioning to content and index ([31bc549](https://github.com/npm/cacache/commit/31bc549))
|
|
621
|
+
* **content:** collate content files into subdirs ([c094d9f](https://github.com/npm/cacache/commit/c094d9f))
|
|
622
|
+
* **deps:** `@npmcorp/move@1.0.0` ([bdd00bf](https://github.com/npm/cacache/commit/bdd00bf))
|
|
623
|
+
* **deps:** `bluebird@3.4.7` ([3a17aff](https://github.com/npm/cacache/commit/3a17aff))
|
|
624
|
+
* **deps:** `promise-inflight@1.0.1` ([a004fe6](https://github.com/npm/cacache/commit/a004fe6))
|
|
625
|
+
* **get:** added memoization support for get ([c77d794](https://github.com/npm/cacache/commit/c77d794))
|
|
626
|
+
* **get:** export hasContent ([2956ec3](https://github.com/npm/cacache/commit/2956ec3))
|
|
627
|
+
* **index:** add hashAlgorithm and format insert ret val ([b639746](https://github.com/npm/cacache/commit/b639746))
|
|
628
|
+
* **index:** collate index files into subdirs ([e8402a5](https://github.com/npm/cacache/commit/e8402a5))
|
|
629
|
+
* **index:** promisify entry index ([cda3335](https://github.com/npm/cacache/commit/cda3335))
|
|
630
|
+
* **memo:** added memoization lib ([da07b92](https://github.com/npm/cacache/commit/da07b92))
|
|
631
|
+
* **memo:** export memoization api ([954b1b3](https://github.com/npm/cacache/commit/954b1b3))
|
|
632
|
+
* **move-file:** add move fallback for weird errors ([5cf4616](https://github.com/npm/cacache/commit/5cf4616))
|
|
633
|
+
* **perf:** bulk content write api ([51b536e](https://github.com/npm/cacache/commit/51b536e))
|
|
634
|
+
* **put:** added memoization support to put ([b613a70](https://github.com/npm/cacache/commit/b613a70))
|
|
635
|
+
* **read:** switched to promises ([a869362](https://github.com/npm/cacache/commit/a869362))
|
|
636
|
+
* **rm:** added memoization support to rm ([4205cf0](https://github.com/npm/cacache/commit/4205cf0))
|
|
637
|
+
* **rm:** switched to promises ([a000d24](https://github.com/npm/cacache/commit/a000d24))
|
|
638
|
+
* **util:** promise-inflight ownership fix requests ([9517cd7](https://github.com/npm/cacache/commit/9517cd7))
|
|
639
|
+
* **util:** use promises for api ([ae204bb](https://github.com/npm/cacache/commit/ae204bb))
|
|
640
|
+
* **verify:** converted to Promises ([f0b3974](https://github.com/npm/cacache/commit/f0b3974))
|
|
572
641
|
|
|
573
642
|
|
|
574
643
|
### BREAKING CHANGES
|
package/README.md
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
# cacache [](https://npm.im/cacache) [](https://npm.im/cacache) [](https://npm.im/cacache) [](https://npm.im/cacache) [](https://travis-ci.org/npm/cacache) [](https://ci.appveyor.com/project/npm/cacache) [](https://coveralls.io/github/npm/cacache?branch=latest)
|
|
2
2
|
|
|
3
|
-
[`cacache`](https://github.com/
|
|
3
|
+
[`cacache`](https://github.com/npm/cacache) is a Node.js library for managing
|
|
4
4
|
local key and content address caches. It's really fast, really good at
|
|
5
5
|
concurrency, and it will never give you corrupted data, even if cache files
|
|
6
6
|
get corrupted or manipulated.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
On systems that support user and group settings on files, cacache will
|
|
9
|
+
match the `uid` and `gid` values to the folder where the cache lives, even
|
|
10
|
+
when running as `root`.
|
|
11
|
+
|
|
12
|
+
It was written to be used as [npm](https://npm.im)'s local cache, but can
|
|
13
|
+
just as easily be used on its own.
|
|
10
14
|
|
|
11
15
|
_Translations: [español](README.es.md)_
|
|
12
16
|
|
|
@@ -414,13 +418,6 @@ may also use any anagram of `'modnar'` to use this feature.
|
|
|
414
418
|
Currently only supports one algorithm at a time (i.e., an array length of
|
|
415
419
|
exactly `1`). Has no effect if `opts.integrity` is present.
|
|
416
420
|
|
|
417
|
-
##### `opts.uid`/`opts.gid`
|
|
418
|
-
|
|
419
|
-
If provided, cacache will do its best to make sure any new files added to the
|
|
420
|
-
cache use this particular `uid`/`gid` combination. This can be used,
|
|
421
|
-
for example, to drop permissions when someone uses `sudo`, but cacache makes
|
|
422
|
-
no assumptions about your needs here.
|
|
423
|
-
|
|
424
421
|
##### `opts.memoize`
|
|
425
422
|
|
|
426
423
|
Default: null
|
|
@@ -498,10 +495,11 @@ Completely resets the in-memory entry cache.
|
|
|
498
495
|
Returns a unique temporary directory inside the cache's `tmp` dir. This
|
|
499
496
|
directory will use the same safe user assignment that all the other stuff use.
|
|
500
497
|
|
|
501
|
-
Once the directory is made, it's the user's responsibility that all files
|
|
502
|
-
are
|
|
503
|
-
|
|
504
|
-
[`tmp.fix()`](#tmp-fix), which will fix all tmp directory
|
|
498
|
+
Once the directory is made, it's the user's responsibility that all files
|
|
499
|
+
within are given the appropriate `gid`/`uid` ownership settings to match
|
|
500
|
+
the rest of the cache. If not, you can ask cacache to do it for you by
|
|
501
|
+
calling [`tmp.fix()`](#tmp-fix), which will fix all tmp directory
|
|
502
|
+
permissions.
|
|
505
503
|
|
|
506
504
|
If you want automatic cleanup of this directory, use
|
|
507
505
|
[`tmp.withTmp()`](#with-tpm)
|
|
@@ -514,6 +512,27 @@ cacache.tmp.mkdir(cache).then(dir => {
|
|
|
514
512
|
})
|
|
515
513
|
```
|
|
516
514
|
|
|
515
|
+
#### <a name="tmp-fix"></a> `> tmp.fix(cache) -> Promise`
|
|
516
|
+
|
|
517
|
+
Sets the `uid` and `gid` properties on all files and folders within the tmp
|
|
518
|
+
folder to match the rest of the cache.
|
|
519
|
+
|
|
520
|
+
Use this after manually writing files into [`tmp.mkdir`](#tmp-mkdir) or
|
|
521
|
+
[`tmp.withTmp`](#with-tmp).
|
|
522
|
+
|
|
523
|
+
##### Example
|
|
524
|
+
|
|
525
|
+
```javascript
|
|
526
|
+
cacache.tmp.mkdir(cache).then(dir => {
|
|
527
|
+
writeFile(path.join(dir, 'file'), someData).then(() => {
|
|
528
|
+
// make sure we didn't just put a root-owned file in the cache
|
|
529
|
+
cacache.tmp.fix().then(() => {
|
|
530
|
+
// all uids and gids match now
|
|
531
|
+
})
|
|
532
|
+
})
|
|
533
|
+
})
|
|
534
|
+
```
|
|
535
|
+
|
|
517
536
|
#### <a name="with-tmp"></a> `> tmp.withTmp(cache, opts, cb) -> Promise`
|
|
518
537
|
|
|
519
538
|
Creates a temporary directory with [`tmp.mkdir()`](#tmp-mkdir) and calls `cb`
|
|
@@ -591,8 +610,6 @@ of entries removed, etc.
|
|
|
591
610
|
|
|
592
611
|
##### Options
|
|
593
612
|
|
|
594
|
-
* `opts.uid` - uid to assign to cache and its contents
|
|
595
|
-
* `opts.gid` - gid to assign to cache and its contents
|
|
596
613
|
* `opts.filter` - receives a formatted entry. Return false to remove it.
|
|
597
614
|
Note: might be called more than once on the same entry.
|
|
598
615
|
|
package/lib/content/write.js
CHANGED
|
@@ -121,7 +121,7 @@ function pipeToTmp (inputStream, cache, tmpTarget, opts, errCheck) {
|
|
|
121
121
|
function makeTmp (cache, opts) {
|
|
122
122
|
const tmpTarget = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix)
|
|
123
123
|
return fixOwner.mkdirfix(
|
|
124
|
-
path.dirname(tmpTarget)
|
|
124
|
+
cache, path.dirname(tmpTarget)
|
|
125
125
|
).then(() => ({
|
|
126
126
|
target: tmpTarget,
|
|
127
127
|
moved: false
|
|
@@ -134,14 +134,14 @@ function moveToDestination (tmp, cache, sri, opts, errCheck) {
|
|
|
134
134
|
const destDir = path.dirname(destination)
|
|
135
135
|
|
|
136
136
|
return fixOwner.mkdirfix(
|
|
137
|
-
|
|
137
|
+
cache, destDir
|
|
138
138
|
).then(() => {
|
|
139
139
|
errCheck && errCheck()
|
|
140
140
|
return moveFile(tmp.target, destination)
|
|
141
141
|
}).then(() => {
|
|
142
142
|
errCheck && errCheck()
|
|
143
143
|
tmp.moved = true
|
|
144
|
-
return fixOwner.chownr(
|
|
144
|
+
return fixOwner.chownr(cache, destination)
|
|
145
145
|
})
|
|
146
146
|
}
|
|
147
147
|
|
package/lib/entry-index.js
CHANGED
|
@@ -32,9 +32,7 @@ module.exports.NotFoundError = class NotFoundError extends Error {
|
|
|
32
32
|
|
|
33
33
|
const IndexOpts = figgyPudding({
|
|
34
34
|
metadata: {},
|
|
35
|
-
size: {}
|
|
36
|
-
uid: {},
|
|
37
|
-
gid: {}
|
|
35
|
+
size: {}
|
|
38
36
|
})
|
|
39
37
|
|
|
40
38
|
module.exports.insert = insert
|
|
@@ -49,7 +47,7 @@ function insert (cache, key, integrity, opts) {
|
|
|
49
47
|
metadata: opts.metadata
|
|
50
48
|
}
|
|
51
49
|
return fixOwner.mkdirfix(
|
|
52
|
-
path.dirname(bucket)
|
|
50
|
+
cache, path.dirname(bucket)
|
|
53
51
|
).then(() => {
|
|
54
52
|
const stringified = JSON.stringify(entry)
|
|
55
53
|
// NOTE - Cleverness ahoy!
|
|
@@ -63,7 +61,7 @@ function insert (cache, key, integrity, opts) {
|
|
|
63
61
|
bucket, `\n${hashEntry(stringified)}\t${stringified}`
|
|
64
62
|
)
|
|
65
63
|
}).then(
|
|
66
|
-
() => fixOwner.chownr(
|
|
64
|
+
() => fixOwner.chownr(cache, bucket)
|
|
67
65
|
).catch({ code: 'ENOENT' }, () => {
|
|
68
66
|
// There's a class of race conditions that happen when things get deleted
|
|
69
67
|
// during fixOwner, or between the two mkdirfix/chownr calls.
|
|
@@ -86,13 +84,13 @@ function insertSync (cache, key, integrity, opts) {
|
|
|
86
84
|
size: opts.size,
|
|
87
85
|
metadata: opts.metadata
|
|
88
86
|
}
|
|
89
|
-
fixOwner.mkdirfix.sync(path.dirname(bucket)
|
|
87
|
+
fixOwner.mkdirfix.sync(cache, path.dirname(bucket))
|
|
90
88
|
const stringified = JSON.stringify(entry)
|
|
91
89
|
fs.appendFileSync(
|
|
92
90
|
bucket, `\n${hashEntry(stringified)}\t${stringified}`
|
|
93
91
|
)
|
|
94
92
|
try {
|
|
95
|
-
fixOwner.chownr.sync(
|
|
93
|
+
fixOwner.chownr.sync(cache, bucket)
|
|
96
94
|
} catch (err) {
|
|
97
95
|
if (err.code !== 'ENOENT') {
|
|
98
96
|
throw err
|
package/lib/util/fix-owner.js
CHANGED
|
@@ -5,83 +5,121 @@ const BB = require('bluebird')
|
|
|
5
5
|
const chownr = BB.promisify(require('chownr'))
|
|
6
6
|
const mkdirp = BB.promisify(require('mkdirp'))
|
|
7
7
|
const inflight = require('promise-inflight')
|
|
8
|
+
const inferOwner = require('infer-owner')
|
|
9
|
+
|
|
10
|
+
// Memoize getuid()/getgid() calls.
|
|
11
|
+
// patch process.setuid/setgid to invalidate cached value on change
|
|
12
|
+
const self = { uid: null, gid: null }
|
|
13
|
+
const getSelf = () => {
|
|
14
|
+
if (typeof self.uid !== 'number') {
|
|
15
|
+
self.uid = process.getuid()
|
|
16
|
+
const setuid = process.setuid
|
|
17
|
+
process.setuid = (uid) => {
|
|
18
|
+
self.uid = null
|
|
19
|
+
process.setuid = setuid
|
|
20
|
+
return process.setuid(uid)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (typeof self.gid !== 'number') {
|
|
24
|
+
self.gid = process.getgid()
|
|
25
|
+
const setgid = process.setgid
|
|
26
|
+
process.setgid = (gid) => {
|
|
27
|
+
self.gid = null
|
|
28
|
+
process.setgid = setgid
|
|
29
|
+
return process.setgid(gid)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
8
33
|
|
|
9
34
|
module.exports.chownr = fixOwner
|
|
10
|
-
function fixOwner (
|
|
35
|
+
function fixOwner (cache, filepath) {
|
|
11
36
|
if (!process.getuid) {
|
|
12
37
|
// This platform doesn't need ownership fixing
|
|
13
38
|
return BB.resolve()
|
|
14
39
|
}
|
|
15
|
-
|
|
16
|
-
|
|
40
|
+
|
|
41
|
+
getSelf()
|
|
42
|
+
if (self.uid !== 0) {
|
|
43
|
+
// almost certainly can't chown anyway
|
|
17
44
|
return BB.resolve()
|
|
18
45
|
}
|
|
19
|
-
|
|
20
|
-
|
|
46
|
+
|
|
47
|
+
return BB.resolve(inferOwner(cache)).then(owner => {
|
|
48
|
+
const { uid, gid } = owner
|
|
49
|
+
|
|
21
50
|
// No need to override if it's already what we used.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
filepath,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
if (self.uid === uid && self.gid === gid) {
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return inflight(
|
|
56
|
+
'fixOwner: fixing ownership on ' + filepath,
|
|
57
|
+
() => chownr(
|
|
58
|
+
filepath,
|
|
59
|
+
typeof uid === 'number' ? uid : self.uid,
|
|
60
|
+
typeof gid === 'number' ? gid : self.gid
|
|
61
|
+
).catch({ code: 'ENOENT' }, () => null)
|
|
62
|
+
)
|
|
63
|
+
})
|
|
32
64
|
}
|
|
33
65
|
|
|
34
66
|
module.exports.chownr.sync = fixOwnerSync
|
|
35
|
-
function fixOwnerSync (
|
|
67
|
+
function fixOwnerSync (cache, filepath) {
|
|
36
68
|
if (!process.getuid) {
|
|
37
69
|
// This platform doesn't need ownership fixing
|
|
38
70
|
return
|
|
39
71
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
if ((typeof uid === 'number' && process.getuid() === uid) &&
|
|
45
|
-
(typeof gid === 'number' && process.getgid() === gid)) {
|
|
72
|
+
const { uid, gid } = inferOwner.sync(cache)
|
|
73
|
+
getSelf()
|
|
74
|
+
if (self.uid === uid && self.gid === gid) {
|
|
46
75
|
// No need to override if it's already what we used.
|
|
47
76
|
return
|
|
48
77
|
}
|
|
49
78
|
try {
|
|
50
79
|
chownr.sync(
|
|
51
80
|
filepath,
|
|
52
|
-
typeof uid === 'number' ? uid :
|
|
53
|
-
typeof gid === 'number' ? gid :
|
|
81
|
+
typeof uid === 'number' ? uid : self.uid,
|
|
82
|
+
typeof gid === 'number' ? gid : self.gid
|
|
54
83
|
)
|
|
55
84
|
} catch (err) {
|
|
85
|
+
// only catch ENOENT, any other error is a problem.
|
|
56
86
|
if (err.code === 'ENOENT') {
|
|
57
87
|
return null
|
|
58
88
|
}
|
|
89
|
+
throw err
|
|
59
90
|
}
|
|
60
91
|
}
|
|
61
92
|
|
|
62
93
|
module.exports.mkdirfix = mkdirfix
|
|
63
|
-
function mkdirfix (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
94
|
+
function mkdirfix (cache, p, cb) {
|
|
95
|
+
// we have to infer the owner _before_ making the directory, even though
|
|
96
|
+
// we aren't going to use the results, since the cache itself might not
|
|
97
|
+
// exist yet. If we mkdirp it, then our current uid/gid will be assumed
|
|
98
|
+
// to be correct if it creates the cache folder in the process.
|
|
99
|
+
return BB.resolve(inferOwner(cache)).then(() => {
|
|
100
|
+
return mkdirp(p).then(made => {
|
|
101
|
+
if (made) {
|
|
102
|
+
return fixOwner(cache, made).then(() => made)
|
|
103
|
+
}
|
|
104
|
+
}).catch({ code: 'EEXIST' }, () => {
|
|
105
|
+
// There's a race in mkdirp!
|
|
106
|
+
return fixOwner(cache, p).then(() => null)
|
|
107
|
+
})
|
|
71
108
|
})
|
|
72
109
|
}
|
|
73
110
|
|
|
74
111
|
module.exports.mkdirfix.sync = mkdirfixSync
|
|
75
|
-
function mkdirfixSync (
|
|
112
|
+
function mkdirfixSync (cache, p) {
|
|
76
113
|
try {
|
|
114
|
+
inferOwner.sync(cache)
|
|
77
115
|
const made = mkdirp.sync(p)
|
|
78
116
|
if (made) {
|
|
79
|
-
fixOwnerSync(
|
|
117
|
+
fixOwnerSync(cache, made)
|
|
80
118
|
return made
|
|
81
119
|
}
|
|
82
120
|
} catch (err) {
|
|
83
121
|
if (err.code === 'EEXIST') {
|
|
84
|
-
fixOwnerSync(
|
|
122
|
+
fixOwnerSync(cache, p)
|
|
85
123
|
return null
|
|
86
124
|
} else {
|
|
87
125
|
throw err
|
package/lib/util/tmp.js
CHANGED
|
@@ -9,16 +9,14 @@ const rimraf = BB.promisify(require('rimraf'))
|
|
|
9
9
|
const uniqueFilename = require('unique-filename')
|
|
10
10
|
|
|
11
11
|
const TmpOpts = figgyPudding({
|
|
12
|
-
tmpPrefix: {}
|
|
13
|
-
uid: {},
|
|
14
|
-
gid: {}
|
|
12
|
+
tmpPrefix: {}
|
|
15
13
|
})
|
|
16
14
|
|
|
17
15
|
module.exports.mkdir = mktmpdir
|
|
18
16
|
function mktmpdir (cache, opts) {
|
|
19
17
|
opts = TmpOpts(opts)
|
|
20
18
|
const tmpTarget = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix)
|
|
21
|
-
return fixOwner.mkdirfix(
|
|
19
|
+
return fixOwner.mkdirfix(cache, tmpTarget).then(() => {
|
|
22
20
|
return tmpTarget
|
|
23
21
|
})
|
|
24
22
|
}
|
|
@@ -34,7 +32,6 @@ function withTmp (cache, opts, cb) {
|
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
module.exports.fix = fixtmpdir
|
|
37
|
-
function fixtmpdir (cache
|
|
38
|
-
|
|
39
|
-
return fixOwner(path.join(cache, 'tmp'), opts.uid, opts.gid)
|
|
35
|
+
function fixtmpdir (cache) {
|
|
36
|
+
return fixOwner(cache, path.join(cache, 'tmp'))
|
|
40
37
|
}
|
package/lib/verify.js
CHANGED
|
@@ -22,9 +22,7 @@ const VerifyOpts = figgyPudding({
|
|
|
22
22
|
filter: {},
|
|
23
23
|
log: {
|
|
24
24
|
default: { silly () {} }
|
|
25
|
-
}
|
|
26
|
-
uid: {},
|
|
27
|
-
gid: {}
|
|
25
|
+
}
|
|
28
26
|
})
|
|
29
27
|
|
|
30
28
|
module.exports = verify
|
|
@@ -67,9 +65,9 @@ function markEndTime (cache, opts) {
|
|
|
67
65
|
|
|
68
66
|
function fixPerms (cache, opts) {
|
|
69
67
|
opts.log.silly('verify', 'fixing cache permissions')
|
|
70
|
-
return fixOwner.mkdirfix(cache,
|
|
68
|
+
return fixOwner.mkdirfix(cache, cache).then(() => {
|
|
71
69
|
// TODO - fix file permissions too
|
|
72
|
-
return fixOwner.chownr(cache,
|
|
70
|
+
return fixOwner.chownr(cache, cache)
|
|
73
71
|
}).then(() => null)
|
|
74
72
|
}
|
|
75
73
|
|
|
@@ -195,8 +193,6 @@ function rebuildBucket (cache, bucket, stats, opts) {
|
|
|
195
193
|
const content = contentPath(cache, entry.integrity)
|
|
196
194
|
return fs.statAsync(content).then(() => {
|
|
197
195
|
return index.insert(cache, entry.key, entry.integrity, {
|
|
198
|
-
uid: opts.uid,
|
|
199
|
-
gid: opts.gid,
|
|
200
196
|
metadata: entry.metadata,
|
|
201
197
|
size: entry.size
|
|
202
198
|
}).then(() => { stats.totalEntries++ })
|
|
@@ -216,7 +212,11 @@ function cleanTmp (cache, opts) {
|
|
|
216
212
|
function writeVerifile (cache, opts) {
|
|
217
213
|
const verifile = path.join(cache, '_lastverified')
|
|
218
214
|
opts.log.silly('verify', 'writing verifile to ' + verifile)
|
|
219
|
-
|
|
215
|
+
try {
|
|
216
|
+
return fs.writeFileAsync(verifile, '' + (+(new Date())))
|
|
217
|
+
} finally {
|
|
218
|
+
fixOwner.chownr.sync(cache, verifile)
|
|
219
|
+
}
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
module.exports.lastRun = lastRun
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cacache",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.3",
|
|
4
4
|
"cache-version": {
|
|
5
5
|
"content": "2",
|
|
6
6
|
"index": "5"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'",
|
|
24
24
|
"update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'"
|
|
25
25
|
},
|
|
26
|
-
"repository": "https://github.com/
|
|
26
|
+
"repository": "https://github.com/npm/cacache",
|
|
27
27
|
"keywords": [
|
|
28
28
|
"cache",
|
|
29
29
|
"caching",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"figgy-pudding": "^3.5.1",
|
|
64
64
|
"glob": "^7.1.4",
|
|
65
65
|
"graceful-fs": "^4.1.15",
|
|
66
|
+
"infer-owner": "^1.0.3",
|
|
66
67
|
"lru-cache": "^5.1.1",
|
|
67
68
|
"mississippi": "^3.0.0",
|
|
68
69
|
"mkdirp": "^0.5.1",
|