From 58065bc679e6968742b5b15fa2fb82dd9e8ae988 Mon Sep 17 00:00:00 2001 From: nlf Date: Mon, 17 Oct 2022 13:47:28 -0700 Subject: [PATCH] feat: do not alter file ownership BREAKING CHANGE: this package no longer attempts to change file ownership automatically --- DEPENDENCIES.md | 1 - package-lock.json | 1 - workspaces/libnpmexec/lib/file-exists.js | 4 ++-- workspaces/libnpmexec/lib/index.js | 4 ++-- workspaces/libnpmexec/package.json | 1 - 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index aa54179c1059e..acb8867181ae2 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -544,7 +544,6 @@ graph LR; libnpmexec-->bin-links; libnpmexec-->chalk; libnpmexec-->minify-registry-metadata; - libnpmexec-->mkdirp-infer-owner; libnpmexec-->mkdirp; libnpmexec-->npm-package-arg; libnpmexec-->npmcli-arborist["@npmcli/arborist"]; diff --git a/package-lock.json b/package-lock.json index f4c108fcd4745..6ead07e402021 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13862,7 +13862,6 @@ "@npmcli/fs": "^2.1.1", "@npmcli/run-script": "^4.2.0", "chalk": "^4.1.0", - "mkdirp-infer-owner": "^2.0.0", "npm-package-arg": "^9.0.1", "npmlog": "^6.0.2", "pacote": "^14.0.0", diff --git a/workspaces/libnpmexec/lib/file-exists.js b/workspaces/libnpmexec/lib/file-exists.js index e5cd474dac388..0a8d79e83b256 100644 --- a/workspaces/libnpmexec/lib/file-exists.js +++ b/workspaces/libnpmexec/lib/file-exists.js @@ -1,10 +1,10 @@ const { resolve } = require('path') -const fs = require('@npmcli/fs') +const { stat } = require('fs/promises') const walkUp = require('walk-up-path') const fileExists = async (file) => { try { - const res = await fs.stat(file) + const res = await stat(file) return res.isFile() } catch { return false diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index 45c75d4715674..19733176040dc 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -1,12 +1,12 @@ 'use strict' +const { mkdir } = require('fs/promises') const { promisify } = require('util') const Arborist = require('@npmcli/arborist') const ciDetect = require('@npmcli/ci-detect') const crypto = require('crypto') const log = require('proc-log') -const mkdirp = require('mkdirp-infer-owner') const npa = require('npm-package-arg') const npmlog = require('npmlog') const pacote = require('pacote') @@ -205,7 +205,7 @@ const exec = async (opts) => { .digest('hex') .slice(0, 16) const installDir = resolve(npxCache, hash) - await mkdirp(installDir) + await mkdir(installDir, { recursive: true }) const npxArb = new Arborist({ ...flatOptions, path: installDir, diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index f5d9413569fa4..0679e190f9b6c 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -63,7 +63,6 @@ "@npmcli/fs": "^2.1.1", "@npmcli/run-script": "^4.2.0", "chalk": "^4.1.0", - "mkdirp-infer-owner": "^2.0.0", "npm-package-arg": "^9.0.1", "npmlog": "^6.0.2", "pacote": "^14.0.0",