From 335c7e4348f5505fad33b8a78348a02a82b91426 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 3 Nov 2022 20:54:20 -0700 Subject: [PATCH] deps: cacache@17.0.2 --- DEPENDENCIES.md | 3 +- node_modules/.gitignore | 1 - node_modules/@npmcli/move-file/LICENSE.md | 22 --- node_modules/@npmcli/move-file/lib/index.js | 185 -------------------- node_modules/@npmcli/move-file/package.json | 48 ----- node_modules/cacache/lib/entry-index.js | 2 +- node_modules/cacache/lib/util/move-file.js | 2 +- node_modules/cacache/package.json | 9 +- package-lock.json | 24 +-- package.json | 2 +- workspaces/arborist/package.json | 2 +- 11 files changed, 15 insertions(+), 285 deletions(-) delete mode 100644 node_modules/@npmcli/move-file/LICENSE.md delete mode 100644 node_modules/@npmcli/move-file/lib/index.js delete mode 100644 node_modules/@npmcli/move-file/package.json diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index d4a82a0af1b43..c5b5cf39c9537 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -9,7 +9,6 @@ graph LR; bin-links-->write-file-atomic; cacache-->fs-minipass; cacache-->npmcli-fs["@npmcli/fs"]; - cacache-->npmcli-move-file["@npmcli/move-file"]; cacache-->ssri; cacache-->unique-filename; init-package-json-->npm-package-arg; @@ -759,4 +758,4 @@ packages higher up the chain. - @npmcli/git, make-fetch-happen, @npmcli/config, init-package-json - @npmcli/installed-package-contents, @npmcli/map-workspaces, cacache, npm-pick-manifest, @npmcli/run-script, read-package-json, promzard - @npmcli/docs, @npmcli/fs, npm-bundled, read-package-json-fast, unique-filename, npm-install-checks, npm-package-arg, npm-packlist, normalize-package-data, @npmcli/package-json, bin-links, nopt, npmlog, parse-conflict-json, read - - @npmcli/eslint-config, @npmcli/template-oss, ignore-walk, semver, npm-normalize-package-bin, @npmcli/name-from-folder, json-parse-even-better-errors, @npmcli/move-file, fs-minipass, ssri, unique-slug, @npmcli/promise-spawn, hosted-git-info, proc-log, validate-npm-package-name, @npmcli/node-gyp, minipass-fetch, @npmcli/query, cmd-shim, read-cmd-shim, write-file-atomic, abbrev, are-we-there-yet, gauge, treeverse, minify-registry-metadata, ini, @npmcli/disparity-colors, @npmcli/ci-detect, mute-stream, npm-audit-report, npm-user-validate + - @npmcli/eslint-config, @npmcli/template-oss, ignore-walk, semver, npm-normalize-package-bin, @npmcli/name-from-folder, json-parse-even-better-errors, fs-minipass, ssri, unique-slug, @npmcli/promise-spawn, hosted-git-info, proc-log, validate-npm-package-name, @npmcli/node-gyp, minipass-fetch, @npmcli/query, cmd-shim, read-cmd-shim, write-file-atomic, abbrev, are-we-there-yet, gauge, treeverse, minify-registry-metadata, ini, @npmcli/disparity-colors, @npmcli/ci-detect, mute-stream, npm-audit-report, npm-user-validate diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 292e3d4dd1bf8..b94e4bd99842c 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -23,7 +23,6 @@ !/@npmcli/installed-package-contents !/@npmcli/map-workspaces !/@npmcli/metavuln-calculator -!/@npmcli/move-file !/@npmcli/name-from-folder !/@npmcli/node-gyp !/@npmcli/package-json diff --git a/node_modules/@npmcli/move-file/LICENSE.md b/node_modules/@npmcli/move-file/LICENSE.md deleted file mode 100644 index 072bf20840acd..0000000000000 --- a/node_modules/@npmcli/move-file/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) -Copyright (c) npm, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@npmcli/move-file/lib/index.js b/node_modules/@npmcli/move-file/lib/index.js deleted file mode 100644 index 5789bb127e096..0000000000000 --- a/node_modules/@npmcli/move-file/lib/index.js +++ /dev/null @@ -1,185 +0,0 @@ -const { dirname, join, resolve, relative, isAbsolute } = require('path') -const rimraf_ = require('rimraf') -const { promisify } = require('util') -const { - access: access_, - accessSync, - copyFile: copyFile_, - copyFileSync, - readdir: readdir_, - readdirSync, - rename: rename_, - renameSync, - stat: stat_, - statSync, - lstat: lstat_, - lstatSync, - symlink: symlink_, - symlinkSync, - readlink: readlink_, - readlinkSync, -} = require('fs') - -const access = promisify(access_) -const copyFile = promisify(copyFile_) -const readdir = promisify(readdir_) -const rename = promisify(rename_) -const stat = promisify(stat_) -const lstat = promisify(lstat_) -const symlink = promisify(symlink_) -const readlink = promisify(readlink_) -const rimraf = promisify(rimraf_) -const rimrafSync = rimraf_.sync - -const mkdirp = require('mkdirp') - -const pathExists = async path => { - try { - await access(path) - return true - } catch (er) { - return er.code !== 'ENOENT' - } -} - -const pathExistsSync = path => { - try { - accessSync(path) - return true - } catch (er) { - return er.code !== 'ENOENT' - } -} - -const moveFile = async (source, destination, options = {}, root = true, symlinks = []) => { - if (!source || !destination) { - throw new TypeError('`source` and `destination` file required') - } - - options = { - overwrite: true, - ...options, - } - - if (!options.overwrite && await pathExists(destination)) { - throw new Error(`The destination file exists: ${destination}`) - } - - await mkdirp(dirname(destination)) - - try { - await rename(source, destination) - } catch (error) { - if (error.code === 'EXDEV' || error.code === 'EPERM') { - const sourceStat = await lstat(source) - if (sourceStat.isDirectory()) { - const files = await readdir(source) - await Promise.all(files.map((file) => - moveFile(join(source, file), join(destination, file), options, false, symlinks) - )) - } else if (sourceStat.isSymbolicLink()) { - symlinks.push({ source, destination }) - } else { - await copyFile(source, destination) - } - } else { - throw error - } - } - - if (root) { - await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => { - let target = await readlink(symSource) - // junction symlinks in windows will be absolute paths, so we need to - // make sure they point to the symlink destination - if (isAbsolute(target)) { - target = resolve(symDestination, relative(symSource, target)) - } - // try to determine what the actual file is so we can create the correct - // type of symlink in windows - let targetStat = 'file' - try { - targetStat = await stat(resolve(dirname(symSource), target)) - if (targetStat.isDirectory()) { - targetStat = 'junction' - } - } catch { - // targetStat remains 'file' - } - await symlink( - target, - symDestination, - targetStat - ) - })) - await rimraf(source) - } -} - -const moveFileSync = (source, destination, options = {}, root = true, symlinks = []) => { - if (!source || !destination) { - throw new TypeError('`source` and `destination` file required') - } - - options = { - overwrite: true, - ...options, - } - - if (!options.overwrite && pathExistsSync(destination)) { - throw new Error(`The destination file exists: ${destination}`) - } - - mkdirp.sync(dirname(destination)) - - try { - renameSync(source, destination) - } catch (error) { - if (error.code === 'EXDEV' || error.code === 'EPERM') { - const sourceStat = lstatSync(source) - if (sourceStat.isDirectory()) { - const files = readdirSync(source) - for (const file of files) { - moveFileSync(join(source, file), join(destination, file), options, false, symlinks) - } - } else if (sourceStat.isSymbolicLink()) { - symlinks.push({ source, destination }) - } else { - copyFileSync(source, destination) - } - } else { - throw error - } - } - - if (root) { - for (const { source: symSource, destination: symDestination } of symlinks) { - let target = readlinkSync(symSource) - // junction symlinks in windows will be absolute paths, so we need to - // make sure they point to the symlink destination - if (isAbsolute(target)) { - target = resolve(symDestination, relative(symSource, target)) - } - // try to determine what the actual file is so we can create the correct - // type of symlink in windows - let targetStat = 'file' - try { - targetStat = statSync(resolve(dirname(symSource), target)) - if (targetStat.isDirectory()) { - targetStat = 'junction' - } - } catch { - // targetStat remains 'file' - } - symlinkSync( - target, - symDestination, - targetStat - ) - } - rimrafSync(source) - } -} - -module.exports = moveFile -module.exports.sync = moveFileSync diff --git a/node_modules/@npmcli/move-file/package.json b/node_modules/@npmcli/move-file/package.json deleted file mode 100644 index a687ab2510c11..0000000000000 --- a/node_modules/@npmcli/move-file/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "@npmcli/move-file", - "version": "3.0.0", - "files": [ - "bin/", - "lib/" - ], - "main": "lib/index.js", - "description": "move a file (fork of move-file)", - "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "4.5.1", - "tap": "^16.0.1" - }, - "scripts": { - "test": "tap", - "snap": "tap", - "lint": "eslint \"**/*.js\"", - "postlint": "template-oss-check", - "template-oss-apply": "template-oss-apply --force", - "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/move-file.git" - }, - "tap": { - "check-coverage": true, - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - }, - "license": "MIT", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "author": "GitHub Inc.", - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.5.1" - } -} diff --git a/node_modules/cacache/lib/entry-index.js b/node_modules/cacache/lib/entry-index.js index e81ef525a778d..add15e3a22a32 100644 --- a/node_modules/cacache/lib/entry-index.js +++ b/node_modules/cacache/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/node_modules/cacache/lib/util/move-file.js b/node_modules/cacache/lib/util/move-file.js index 2d4de41cf8f91..eb3ba76107cd7 100644 --- a/node_modules/cacache/lib/util/move-file.js +++ b/node_modules/cacache/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/node_modules/cacache/package.json b/node_modules/cacache/package.json index ab5f13a027173..db6778ed4c038 100644 --- a/node_modules/cacache/package.json +++ b/node_modules/cacache/package.json @@ -1,6 +1,6 @@ { "name": "cacache", - "version": "17.0.1", + "version": "17.0.2", "cache-version": { "content": "2", "index": "5" @@ -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", @@ -62,7 +61,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.5.1", + "@npmcli/template-oss": "4.8.0", "tap": "^16.0.0" }, "engines": { @@ -71,7 +70,7 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "4.5.1" + "version": "4.8.0" }, "author": "GitHub Inc.", "tap": { diff --git a/package-lock.json b/package-lock.json index 9ad0f788aa454..dd400a887e32e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -93,7 +93,7 @@ "@npmcli/run-script": "^6.0.0", "abbrev": "^2.0.0", "archy": "~1.0.0", - "cacache": "^17.0.1", + "cacache": "^17.0.2", "chalk": "^4.1.2", "cli-columns": "^4.0.0", "cli-table3": "^0.6.3", @@ -2176,18 +2176,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/move-file": { - "version": "3.0.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/@npmcli/name-from-folder": { "version": "1.0.1", "inBundle": true, @@ -3099,12 +3087,12 @@ } }, "node_modules/cacache": { - "version": "17.0.1", + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.2.tgz", + "integrity": "sha512-rYUs2x4OjSgCQND7nTrh21AHIBFgd7s/ctAYvU3a8u+nK+R5YaX/SFPDYz4Azz7SGL6+6L9ZZWI4Kawpb7grzQ==", "inBundle": true, - "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", @@ -15034,7 +15022,7 @@ "@npmcli/query": "^3.0.0", "@npmcli/run-script": "^6.0.0", "bin-links": "^4.0.1", - "cacache": "^17.0.1", + "cacache": "^17.0.2", "common-ancestor-path": "^1.0.1", "hosted-git-info": "^6.1.1", "json-parse-even-better-errors": "^3.0.0", diff --git a/package.json b/package.json index ca303c5a48580..d6991d5106350 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@npmcli/run-script": "^6.0.0", "abbrev": "^2.0.0", "archy": "~1.0.0", - "cacache": "^17.0.1", + "cacache": "^17.0.2", "chalk": "^4.1.2", "cli-columns": "^4.0.0", "cli-table3": "^0.6.3", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 68d0d1e505c66..6af29ad02921f 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -14,7 +14,7 @@ "@npmcli/query": "^3.0.0", "@npmcli/run-script": "^6.0.0", "bin-links": "^4.0.1", - "cacache": "^17.0.1", + "cacache": "^17.0.2", "common-ancestor-path": "^1.0.1", "hosted-git-info": "^6.1.1", "json-parse-even-better-errors": "^3.0.0",