Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLuke Karrys <luke@lukekarrys.com>2022-10-18 02:07:10 +0300
committerLuke Karrys <luke@lukekarrys.com>2022-10-19 00:12:42 +0300
commitaa010722996ef6de46e1bb937c6f8a94dc2844fa (patch)
treedfd845c3f845ff829dac29f31aed065e883bba2e /lib
parent38dc7f62dcee948bd834ddf59a9c24692bc98d90 (diff)
deps: update the following dependencies
- @npmcli/config@6.0.1 - @npmcli/disparity-colors@3.0.0 - @npmcli/git@4.0.1 - @npmcli/installed-package-contents@2.0.0 - @npmcli/map-workspaces@3.0.0 - @npmcli/metavuln-calculator@5.0.0 - @npmcli/move-file@3.0.0 - @npmcli/node-gyp@3.0.0 - @npmcli/package-json@3.0.0 - @npmcli/promise-spawn@4.0.0 - @npmcli/query@3.0.0 - @npmcli/run-script@5.0.0 - bin-links@4.0.1 - cacache@17.0.1 - ignore-walk@6.0.0 - init-package-json@4.0.1 - json-parse-even-better-errors@3.0.0 - make-fetch-happen@11.0.1 - normalize-package-data@5.0.0 - npm-audit-report@4.0.0 - npm-install-checks@6.0.0 - npm-packlist@7.0.1 - npm-pick-manifest@8.0.1 - npm-profile@7.0.1 - npm-registry-fetch@14.0.2 - npmlog@7.0.0 - pacote@15.0.1 - parse-conflict-json@3.0.0 - proc-log@3.0.0 - read-package-json-fast@3.0.1 - read-package-json@6.0.0 - ssri@10.0.0 - treeverse@3.0.0 - validate-npm-package-name@5.0.0 - write-file-atomic@5.0.0 Removed dependencies: - `@npmcli/fs`
Diffstat (limited to 'lib')
-rw-r--r--lib/commands/completion.js2
-rw-r--r--lib/npm.js6
-rw-r--r--lib/utils/exit-handler.js8
-rw-r--r--lib/utils/log-file.js7
-rw-r--r--lib/utils/timers.js8
5 files changed, 9 insertions, 22 deletions
diff --git a/lib/commands/completion.js b/lib/commands/completion.js
index 7571a1442..3fc27c524 100644
--- a/lib/commands/completion.js
+++ b/lib/commands/completion.js
@@ -29,7 +29,7 @@
// as an array.
//
-const fs = require('@npmcli/fs')
+const fs = require('fs/promises')
const nopt = require('nopt')
const { definitions, shorthands } = require('../utils/config/index.js')
diff --git a/lib/npm.js b/lib/npm.js
index a922aafaf..763c9b7a3 100644
--- a/lib/npm.js
+++ b/lib/npm.js
@@ -4,7 +4,7 @@ const { resolve, dirname, join } = require('path')
const Config = require('@npmcli/config')
const chalk = require('chalk')
const which = require('which')
-const fs = require('@npmcli/fs')
+const fs = require('fs/promises')
// Patch the global fs module here at the app level
require('graceful-fs').gracefulify(require('fs'))
@@ -246,13 +246,13 @@ class Npm extends EventEmitter {
// a cache dir, but we don't want to fail immediately since
// the command might not need a cache dir (like `npm --version`)
await this.time('npm:load:mkdirpcache', () =>
- fs.mkdir(this.cache, { recursive: true, owner: 'inherit' })
+ fs.mkdir(this.cache, { recursive: true })
.catch((e) => log.verbose('cache', `could not create cache: ${e}`)))
// its ok if this fails. user might have specified an invalid dir
// which we will tell them about at the end
await this.time('npm:load:mkdirplogs', () =>
- fs.mkdir(this.logsDir, { recursive: true, owner: 'inherit' })
+ fs.mkdir(this.logsDir, { recursive: true })
.catch((e) => log.verbose('logfile', `could not create logs-dir: ${e}`)))
// note: this MUST be shorter than the actual argv length, because it
diff --git a/lib/utils/exit-handler.js b/lib/utils/exit-handler.js
index f1843347b..2574a83fc 100644
--- a/lib/utils/exit-handler.js
+++ b/lib/utils/exit-handler.js
@@ -1,5 +1,5 @@
const os = require('os')
-const fs = require('@npmcli/fs')
+const fs = require('fs')
const log = require('./log-shim.js')
const errorMessage = require('./error-message.js')
@@ -186,11 +186,7 @@ const exitHandler = err => {
file = `${npm.logPath}${file}`
content = `'Log files:\n${npm.logFiles.join('\n')}\n\n${content.trim()}\n`
try {
- fs.withOwnerSync(
- file,
- () => fs.writeFileSync(file, content),
- { owner: 'inherit' }
- )
+ fs.writeFileSync(file, content)
detail.push(['', `\n\nFor a full report see:\n${file}`])
} catch (err) {
log.warn('', `Could not write error message to ${file} due to ${err}`)
diff --git a/lib/utils/log-file.js b/lib/utils/log-file.js
index 3351ae6cd..2935697ac 100644
--- a/lib/utils/log-file.js
+++ b/lib/utils/log-file.js
@@ -5,7 +5,6 @@ const rimraf = promisify(require('rimraf'))
const glob = promisify(require('glob'))
const MiniPass = require('minipass')
const fsMiniPass = require('fs-minipass')
-const fs = require('@npmcli/fs')
const log = require('./log-shim')
const padZero = (n, length) => n.toString().padStart(length.toString().length, '0')
@@ -174,11 +173,7 @@ class LogFiles {
// during process.on('exit') which has to be synchronous. So in order
// to never drop log messages, it is easiest to make it sync all the time
// and this was measured to be about 1.5% slower for 40k lines of output
- const logStream = fs.withOwnerSync(
- f,
- () => new fsMiniPass.WriteStreamSync(f, { flags: 'a' }),
- { owner: 'inherit' }
- )
+ const logStream = new fsMiniPass.WriteStreamSync(f, { flags: 'a' })
if (count > 0) {
// Reset file log count if we are opening
// after our first file
diff --git a/lib/utils/timers.js b/lib/utils/timers.js
index c84bbba38..c215fe926 100644
--- a/lib/utils/timers.js
+++ b/lib/utils/timers.js
@@ -1,5 +1,5 @@
const EE = require('events')
-const fs = require('@npmcli/fs')
+const fs = require('fs')
const log = require('./log-shim')
// This is an event emiiter but on/off
@@ -90,11 +90,7 @@ class Timers extends EE {
return acc
}, {}),
}
- fs.withOwnerSync(
- this.file,
- () => fs.writeFileSync(this.file, JSON.stringify(content) + '\n'),
- { owner: 'inherit' }
- )
+ fs.writeFileSync(this.file, JSON.stringify(content) + '\n')
} catch (e) {
this.file = null
log.warn('timing', `could not write timing file: ${e}`)