cacache 20.0.3 → 21.0.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/content/write.js +2 -2
- package/lib/entry-index.js +2 -2
- package/lib/util/tmp.js +6 -0
- package/package.json +6 -7
package/lib/content/write.js
CHANGED
|
@@ -10,7 +10,7 @@ const Pipeline = require('minipass-pipeline')
|
|
|
10
10
|
const Flush = require('minipass-flush')
|
|
11
11
|
const path = require('path')
|
|
12
12
|
const ssri = require('ssri')
|
|
13
|
-
const
|
|
13
|
+
const { tmpName } = require('../util/tmp')
|
|
14
14
|
const fsm = require('fs-minipass')
|
|
15
15
|
|
|
16
16
|
module.exports = write
|
|
@@ -152,7 +152,7 @@ async function pipeToTmp (inputStream, cache, tmpTarget, opts) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
async function makeTmp (cache, opts) {
|
|
155
|
-
const tmpTarget =
|
|
155
|
+
const tmpTarget = tmpName(cache, opts.tmpPrefix)
|
|
156
156
|
await fs.mkdir(path.dirname(tmpTarget), { recursive: true })
|
|
157
157
|
return {
|
|
158
158
|
target: tmpTarget,
|
package/lib/entry-index.js
CHANGED
|
@@ -12,7 +12,7 @@ const {
|
|
|
12
12
|
const { Minipass } = require('minipass')
|
|
13
13
|
const path = require('path')
|
|
14
14
|
const ssri = require('ssri')
|
|
15
|
-
const
|
|
15
|
+
const { tmpName } = require('./util/tmp')
|
|
16
16
|
|
|
17
17
|
const contentPath = require('./content/path')
|
|
18
18
|
const hashToSegments = require('./util/hash-to-segments')
|
|
@@ -69,7 +69,7 @@ async function compact (cache, key, matchFn, opts = {}) {
|
|
|
69
69
|
}).join('\n')
|
|
70
70
|
|
|
71
71
|
const setup = async () => {
|
|
72
|
-
const target =
|
|
72
|
+
const target = tmpName(cache, opts.tmpPrefix)
|
|
73
73
|
await mkdir(path.dirname(target), { recursive: true })
|
|
74
74
|
return {
|
|
75
75
|
target,
|
package/lib/util/tmp.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const crypto = require('crypto')
|
|
3
4
|
const { withTempDir } = require('@npmcli/fs')
|
|
4
5
|
const fs = require('fs/promises')
|
|
5
6
|
const path = require('path')
|
|
6
7
|
|
|
7
8
|
module.exports.mkdir = mktmpdir
|
|
8
9
|
|
|
10
|
+
module.exports.tmpName = function tmpName (cache, tmpPrefix) {
|
|
11
|
+
const id = crypto.randomUUID()
|
|
12
|
+
return path.join(cache, 'tmp', tmpPrefix ? `${tmpPrefix}-${id}` : id)
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
async function mktmpdir (cache, opts = {}) {
|
|
10
16
|
const { tmpPrefix } = opts
|
|
11
17
|
const tmpDir = path.join(cache, 'tmp')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cacache",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"cache-version": {
|
|
5
5
|
"content": "2",
|
|
6
6
|
"index": "5"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
],
|
|
47
47
|
"license": "ISC",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@npmcli/fs": "^
|
|
49
|
+
"@npmcli/fs": "^6.0.0",
|
|
50
50
|
"fs-minipass": "^3.0.0",
|
|
51
51
|
"glob": "^13.0.0",
|
|
52
52
|
"lru-cache": "^11.1.0",
|
|
@@ -55,21 +55,20 @@
|
|
|
55
55
|
"minipass-flush": "^1.0.5",
|
|
56
56
|
"minipass-pipeline": "^1.2.4",
|
|
57
57
|
"p-map": "^7.0.2",
|
|
58
|
-
"ssri": "^
|
|
59
|
-
"unique-filename": "^5.0.0"
|
|
58
|
+
"ssri": "^14.0.0"
|
|
60
59
|
},
|
|
61
60
|
"devDependencies": {
|
|
62
61
|
"@npmcli/eslint-config": "^6.0.1",
|
|
63
|
-
"@npmcli/template-oss": "
|
|
62
|
+
"@npmcli/template-oss": "5.1.0",
|
|
64
63
|
"tap": "^16.0.0"
|
|
65
64
|
},
|
|
66
65
|
"engines": {
|
|
67
|
-
"node": "^
|
|
66
|
+
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
|
68
67
|
},
|
|
69
68
|
"templateOSS": {
|
|
70
69
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
71
70
|
"windowsCI": false,
|
|
72
|
-
"version": "
|
|
71
|
+
"version": "5.1.0",
|
|
73
72
|
"publish": "true"
|
|
74
73
|
},
|
|
75
74
|
"author": "GitHub Inc.",
|