Skip to content

Commit

Permalink
fix: replace @npmcli/move-file with @npmcli/fs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Nov 4, 2022
1 parent 106e518 commit 4a7382f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/entry-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/util/move-file.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion test/entry-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 4a7382f

Please sign in to comment.