diff --git a/lib/entry-index.js b/lib/entry-index.js index e81ef525..add15e3a 100644 --- a/lib/entry-index.js +++ b/lib/entry-index.js @@ -17,7 +17,7 @@ const uniqueFilename = require('unique-filename') const contentPath = require('./content/path') const hashToSegments = require('./util/hash-to-segments') const indexV = require('../package.json')['cache-version'].index -const moveFile = require('@npmcli/move-file') +const { moveFile } = require('@npmcli/fs') module.exports.NotFoundError = class NotFoundError extends Error { constructor (cache, key) { diff --git a/lib/util/move-file.js b/lib/util/move-file.js index 2d4de41c..eb3ba761 100644 --- a/lib/util/move-file.js +++ b/lib/util/move-file.js @@ -1,7 +1,7 @@ 'use strict' const fs = require('fs/promises') -const move = require('@npmcli/move-file') +const { moveFile: move } = require('@npmcli/fs') const pinflight = require('promise-inflight') module.exports = moveFile diff --git a/package.json b/package.json index 3bc0289f..b6f8a720 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,7 @@ ], "license": "ISC", "dependencies": { - "@npmcli/fs": "^3.0.0", - "@npmcli/move-file": "^3.0.0", + "@npmcli/fs": "^3.1.0", "fs-minipass": "^2.1.0", "glob": "^8.0.1", "lru-cache": "^7.7.1", diff --git a/test/entry-index.js b/test/entry-index.js index 24382a47..744b2ea3 100644 --- a/test/entry-index.js +++ b/test/entry-index.js @@ -141,7 +141,7 @@ t.test('compact: error in moveFile removes temp', async (t) => { ]) const { compact } = getEntryIndex(t, { - '@npmcli/move-file': () => Promise.reject(new Error('foo')), + '@npmcli/fs': { moveFile: () => Promise.reject(new Error('foo')) }, }) const filter = (entryA, entryB) => entryA.metadata.rev === entryB.metadata.rev await t.rejects(compact(cache, KEY, filter), { message: 'foo' }, 'promise rejected')