avancement planning

This commit is contained in:
2026-05-26 11:58:39 +02:00
parent 619a2b240a
commit 150b97cd2e
4892 changed files with 99214 additions and 429382 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ const Pipeline = require('minipass-pipeline')
const Flush = require('minipass-flush')
const path = require('path')
const ssri = require('ssri')
const uniqueFilename = require('unique-filename')
const { tmpName } = require('../util/tmp')
const fsm = require('fs-minipass')
module.exports = write
@@ -152,7 +152,7 @@ async function pipeToTmp (inputStream, cache, tmpTarget, opts) {
}
async function makeTmp (cache, opts) {
const tmpTarget = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix)
const tmpTarget = tmpName(cache, opts.tmpPrefix)
await fs.mkdir(path.dirname(tmpTarget), { recursive: true })
return {
target: tmpTarget,
+2 -2
View File
@@ -12,7 +12,7 @@ const {
const { Minipass } = require('minipass')
const path = require('path')
const ssri = require('ssri')
const uniqueFilename = require('unique-filename')
const { tmpName } = require('./util/tmp')
const contentPath = require('./content/path')
const hashToSegments = require('./util/hash-to-segments')
@@ -69,7 +69,7 @@ async function compact (cache, key, matchFn, opts = {}) {
}).join('\n')
const setup = async () => {
const target = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix)
const target = tmpName(cache, opts.tmpPrefix)
await mkdir(path.dirname(target), { recursive: true })
return {
target,
+6
View File
@@ -1,11 +1,17 @@
'use strict'
const crypto = require('crypto')
const { withTempDir } = require('@npmcli/fs')
const fs = require('fs/promises')
const path = require('path')
module.exports.mkdir = mktmpdir
module.exports.tmpName = function tmpName (cache, tmpPrefix) {
const id = crypto.randomUUID()
return path.join(cache, 'tmp', tmpPrefix ? `${tmpPrefix}-${id}` : id)
}
async function mktmpdir (cache, opts = {}) {
const { tmpPrefix } = opts
const tmpDir = path.join(cache, 'tmp')