From 79f79c7460be8a74f2b77c647100bcefd89b2efa Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Fri, 12 Apr 2024 15:30:26 -0700 Subject: [PATCH] deps: proc-log@4.0.0 --- lib/arborist-cmd.js | 2 +- lib/base-command.js | 2 +- lib/cli-entry.js | 2 +- lib/commands/adduser.js | 2 +- lib/commands/audit.js | 2 +- lib/commands/cache.js | 2 +- lib/commands/ci.js | 2 +- lib/commands/config.js | 2 +- lib/commands/diff.js | 2 +- lib/commands/dist-tag.js | 2 +- lib/commands/doctor.js | 2 +- lib/commands/explore.js | 2 +- lib/commands/init.js | 2 +- lib/commands/install.js | 2 +- lib/commands/login.js | 2 +- lib/commands/logout.js | 2 +- lib/commands/owner.js | 2 +- lib/commands/pack.js | 2 +- lib/commands/ping.js | 2 +- lib/commands/profile.js | 2 +- lib/commands/publish.js | 2 +- lib/commands/query.js | 2 +- lib/commands/run-script.js | 2 +- lib/commands/sbom.js | 2 +- lib/commands/search.js | 2 +- lib/commands/shrinkwrap.js | 2 +- lib/commands/star.js | 2 +- lib/commands/stars.js | 2 +- lib/commands/token.js | 2 +- lib/commands/unpublish.js | 2 +- lib/commands/update.js | 2 +- lib/commands/view.js | 2 +- lib/npm.js | 11 +- lib/package-url-cmd.js | 2 +- lib/utils/audit-error.js | 2 +- lib/utils/auth.js | 2 +- lib/utils/display.js | 8 +- lib/utils/error-message.js | 2 +- lib/utils/exit-handler.js | 2 +- lib/utils/log-file.js | 2 +- lib/utils/read-user-info.js | 2 +- lib/utils/reify-output.js | 2 +- lib/utils/tar.js | 2 +- lib/utils/timers.js | 52 ++--- node_modules/.gitignore | 19 +- .../git/node_modules/proc-log/lib/index.js | 62 ------ .../git/node_modules/proc-log/package.json | 45 ---- .../node_modules/proc-log/LICENSE | 15 -- .../node_modules/proc-log/lib/index.js | 62 ------ .../node_modules/proc-log/package.json | 45 ---- node_modules/color-name/test.js | 7 - .../node_modules/proc-log/LICENSE | 0 .../node_modules/proc-log/lib/index.js | 23 ++ .../node_modules/proc-log/package.json | 11 +- .../node_modules/proc-log/LICENSE | 15 -- .../node_modules/proc-log/lib/index.js | 62 ------ .../npm-profile/node_modules/proc-log/LICENSE | 15 -- .../node_modules/proc-log/lib/index.js | 62 ------ .../node_modules/proc-log/package.json | 45 ---- .../node_modules/proc-log/LICENSE | 15 -- .../node_modules/proc-log/lib/index.js | 62 ------ .../node_modules/proc-log/package.json | 45 ---- .../pacote/node_modules/proc-log/LICENSE | 15 -- .../pacote/node_modules/proc-log/lib/index.js | 62 ------ .../pacote/node_modules/proc-log/package.json | 45 ---- node_modules/proc-log/lib/index.js | 83 +++++-- node_modules/proc-log/package.json | 11 +- node_modules/signal-exit/index.js | 202 ------------------ node_modules/signal-exit/signals.js | 53 ----- package-lock.json | 99 ++++----- package.json | 2 +- scripts/create-node-pr.js | 2 +- scripts/dependency-graph.js | 2 +- scripts/publish.js | 2 +- scripts/util.js | 2 +- test/fixtures/mock-logs.js | 7 +- test/lib/utils/display.js | 2 +- test/lib/utils/read-user-info.js | 4 +- test/lib/utils/tar.js | 4 +- test/lib/utils/timers.js | 40 ++-- workspaces/arborist/bin/lib/logging.js | 2 +- workspaces/arborist/lib/add-rm-pkg-deps.js | 2 +- .../arborist/lib/arborist/build-ideal-tree.js | 2 +- workspaces/arborist/lib/arborist/index.js | 2 +- workspaces/arborist/lib/arborist/rebuild.js | 2 +- workspaces/arborist/lib/arborist/reify.js | 2 +- workspaces/arborist/lib/audit-report.js | 2 +- workspaces/arborist/lib/place-dep.js | 2 +- workspaces/arborist/lib/query-selector-all.js | 2 +- workspaces/arborist/lib/shrinkwrap.js | 2 +- workspaces/arborist/package.json | 2 +- workspaces/config/lib/index.js | 2 +- workspaces/config/package.json | 2 +- workspaces/libnpmexec/lib/index.js | 2 +- workspaces/libnpmexec/lib/run-script.js | 2 +- workspaces/libnpmexec/package.json | 2 +- workspaces/libnpmexec/test/local.js | 10 +- workspaces/libnpmexec/test/prompt.js | 28 +-- workspaces/libnpmexec/test/run-script.js | 16 +- workspaces/libnpmpublish/lib/publish.js | 2 +- workspaces/libnpmpublish/package.json | 2 +- workspaces/libnpmpublish/test/publish.js | 4 +- workspaces/libnpmversion/lib/enforce-clean.js | 2 +- workspaces/libnpmversion/lib/version.js | 2 +- workspaces/libnpmversion/package.json | 2 +- .../libnpmversion/test/enforce-clean.js | 2 +- workspaces/libnpmversion/test/version.js | 4 +- 107 files changed, 287 insertions(+), 1219 deletions(-) delete mode 100644 node_modules/@npmcli/git/node_modules/proc-log/lib/index.js delete mode 100644 node_modules/@npmcli/git/node_modules/proc-log/package.json delete mode 100644 node_modules/@npmcli/package-json/node_modules/proc-log/LICENSE delete mode 100644 node_modules/@npmcli/package-json/node_modules/proc-log/lib/index.js delete mode 100644 node_modules/@npmcli/package-json/node_modules/proc-log/package.json delete mode 100644 node_modules/color-name/test.js rename node_modules/{@npmcli/git => node-gyp}/node_modules/proc-log/LICENSE (100%) create mode 100644 node_modules/node-gyp/node_modules/proc-log/lib/index.js rename node_modules/{npm-package-arg => node-gyp}/node_modules/proc-log/package.json (82%) delete mode 100644 node_modules/npm-package-arg/node_modules/proc-log/LICENSE delete mode 100644 node_modules/npm-package-arg/node_modules/proc-log/lib/index.js delete mode 100644 node_modules/npm-profile/node_modules/proc-log/LICENSE delete mode 100644 node_modules/npm-profile/node_modules/proc-log/lib/index.js delete mode 100644 node_modules/npm-profile/node_modules/proc-log/package.json delete mode 100644 node_modules/npm-registry-fetch/node_modules/proc-log/LICENSE delete mode 100644 node_modules/npm-registry-fetch/node_modules/proc-log/lib/index.js delete mode 100644 node_modules/npm-registry-fetch/node_modules/proc-log/package.json delete mode 100644 node_modules/pacote/node_modules/proc-log/LICENSE delete mode 100644 node_modules/pacote/node_modules/proc-log/lib/index.js delete mode 100644 node_modules/pacote/node_modules/proc-log/package.json delete mode 100644 node_modules/signal-exit/index.js delete mode 100644 node_modules/signal-exit/signals.js diff --git a/lib/arborist-cmd.js b/lib/arborist-cmd.js index 2e300660ea468..d8cb25baf487e 100644 --- a/lib/arborist-cmd.js +++ b/lib/arborist-cmd.js @@ -1,4 +1,4 @@ -const log = require('proc-log') +const { log } = require('proc-log') // This is the base for all commands whose execWorkspaces just gets // a list of workspace names and passes it on to new Arborist() to diff --git a/lib/base-command.js b/lib/base-command.js index d7019001e43aa..1efda0fecba54 100644 --- a/lib/base-command.js +++ b/lib/base-command.js @@ -4,7 +4,7 @@ const { relative } = require('path') const { definitions } = require('@npmcli/config/lib/definitions') const { aliases: cmdAliases } = require('./utils/cmd-list') -const log = require('proc-log') +const { log } = require('proc-log') class BaseCommand { static workspaces = false diff --git a/lib/cli-entry.js b/lib/cli-entry.js index dd8e18add7ebc..3c8fc04ae832c 100644 --- a/lib/cli-entry.js +++ b/lib/cli-entry.js @@ -18,7 +18,7 @@ module.exports = async (process, validateEngines) => { exitHandler.setNpm(npm) // only log node and npm paths in argv initially since argv can contain sensitive info. a cleaned version will be logged later - const log = require('proc-log') + const { log } = require('proc-log') log.verbose('cli', process.argv.slice(0, 2).join(' ')) log.info('using', 'npm@%s', npm.version) log.info('using', 'node@%s', process.version) diff --git a/lib/commands/adduser.js b/lib/commands/adduser.js index 8dfa67555ec34..2ac4b7d3db4db 100644 --- a/lib/commands/adduser.js +++ b/lib/commands/adduser.js @@ -1,4 +1,4 @@ -const log = require('proc-log') +const { log } = require('proc-log') const { redactLog: replaceInfo } = require('@npmcli/redact') const auth = require('../utils/auth.js') diff --git a/lib/commands/audit.js b/lib/commands/audit.js index 9eece15c211f0..fd99459d1febd 100644 --- a/lib/commands/audit.js +++ b/lib/commands/audit.js @@ -8,7 +8,7 @@ const tufClient = require('@sigstore/tuf') const ArboristWorkspaceCmd = require('../arborist-cmd.js') const auditError = require('../utils/audit-error.js') -const log = require('proc-log') +const { log } = require('proc-log') const reifyFinish = require('../utils/reify-finish.js') const sortAlphabetically = (a, b) => localeCompare(a.name, b.name) diff --git a/lib/commands/cache.js b/lib/commands/cache.js index 1566d004ccc22..b6ab75a6265be 100644 --- a/lib/commands/cache.js +++ b/lib/commands/cache.js @@ -7,7 +7,7 @@ const BaseCommand = require('../base-command.js') const npa = require('npm-package-arg') const jsonParse = require('json-parse-even-better-errors') const localeCompare = require('@isaacs/string-locale-compare')('en') -const log = require('proc-log') +const { log } = require('proc-log') const searchCachePackage = async (path, parsed, cacheKeys) => { /* eslint-disable-next-line max-len */ diff --git a/lib/commands/ci.js b/lib/commands/ci.js index 13fd402516032..395b2167e41d9 100644 --- a/lib/commands/ci.js +++ b/lib/commands/ci.js @@ -1,7 +1,7 @@ const reifyFinish = require('../utils/reify-finish.js') const runScript = require('@npmcli/run-script') const fs = require('fs/promises') -const log = require('proc-log') +const { log } = require('proc-log') const validateLockfile = require('../utils/validate-lockfile.js') const ArboristWorkspaceCmd = require('../arborist-cmd.js') diff --git a/lib/commands/config.js b/lib/commands/config.js index ebe5a9990accb..fcd21cc1f8d51 100644 --- a/lib/commands/config.js +++ b/lib/commands/config.js @@ -6,7 +6,7 @@ const ini = require('ini') const localeCompare = require('@isaacs/string-locale-compare')('en') const pkgJson = require('@npmcli/package-json') const { defaults, definitions } = require('@npmcli/config/lib/definitions') -const log = require('proc-log') +const { log } = require('proc-log') // These are the configs that we can nerf-dart. Not all of them currently even // *have* config definitions so we have to explicitly validate them here diff --git a/lib/commands/diff.js b/lib/commands/diff.js index c6b93d025bb52..bdd72e4dec99a 100644 --- a/lib/commands/diff.js +++ b/lib/commands/diff.js @@ -4,7 +4,7 @@ const libnpmdiff = require('libnpmdiff') const npa = require('npm-package-arg') const pacote = require('pacote') const pickManifest = require('npm-pick-manifest') -const log = require('proc-log') +const { log } = require('proc-log') const pkgJson = require('@npmcli/package-json') const BaseCommand = require('../base-command.js') diff --git a/lib/commands/dist-tag.js b/lib/commands/dist-tag.js index 2b71d9a7a6444..c6b795c57b70c 100644 --- a/lib/commands/dist-tag.js +++ b/lib/commands/dist-tag.js @@ -1,7 +1,7 @@ const npa = require('npm-package-arg') const regFetch = require('npm-registry-fetch') const semver = require('semver') -const log = require('proc-log') +const { log } = require('proc-log') const otplease = require('../utils/otplease.js') const pkgJson = require('@npmcli/package-json') const BaseCommand = require('../base-command.js') diff --git a/lib/commands/doctor.js b/lib/commands/doctor.js index cc127287ae576..fc1eb42efc587 100644 --- a/lib/commands/doctor.js +++ b/lib/commands/doctor.js @@ -7,7 +7,7 @@ const pacote = require('pacote') const { resolve } = require('path') const semver = require('semver') const { promisify } = require('util') -const log = require('proc-log') +const { log } = require('proc-log') const ping = require('../utils/ping.js') const { defaults } = require('@npmcli/config/lib/definitions') const lstat = promisify(fs.lstat) diff --git a/lib/commands/explore.js b/lib/commands/explore.js index 23debc2743111..c9c5618a87cf6 100644 --- a/lib/commands/explore.js +++ b/lib/commands/explore.js @@ -4,7 +4,7 @@ const pkgJson = require('@npmcli/package-json') const runScript = require('@npmcli/run-script') const { join, relative } = require('path') -const log = require('proc-log') +const { log } = require('proc-log') const completion = require('../utils/completion/installed-shallow.js') const BaseCommand = require('../base-command.js') diff --git a/lib/commands/init.js b/lib/commands/init.js index ad3aba4d0c68c..d3d2efd60589d 100644 --- a/lib/commands/init.js +++ b/lib/commands/init.js @@ -6,7 +6,7 @@ const npa = require('npm-package-arg') const libexec = require('libnpmexec') const mapWorkspaces = require('@npmcli/map-workspaces') const PackageJson = require('@npmcli/package-json') -const log = require('proc-log') +const { log } = require('proc-log') const updateWorkspaces = require('../workspaces/update-workspaces.js') const posixPath = p => p.split('\\').join('/') diff --git a/lib/commands/install.js b/lib/commands/install.js index eb19c9cc76eb4..41e5f336f4232 100644 --- a/lib/commands/install.js +++ b/lib/commands/install.js @@ -3,7 +3,7 @@ const fs = require('fs') const util = require('util') const readdir = util.promisify(fs.readdir) const reifyFinish = require('../utils/reify-finish.js') -const log = require('proc-log') +const { log } = require('proc-log') const { resolve, join } = require('path') const runScript = require('@npmcli/run-script') const pacote = require('pacote') diff --git a/lib/commands/login.js b/lib/commands/login.js index 97a90d09ec331..87e598debcd31 100644 --- a/lib/commands/login.js +++ b/lib/commands/login.js @@ -1,4 +1,4 @@ -const log = require('proc-log') +const { log } = require('proc-log') const { redactLog: replaceInfo } = require('@npmcli/redact') const auth = require('../utils/auth.js') diff --git a/lib/commands/logout.js b/lib/commands/logout.js index 60921ee3ee9f4..338081cccd457 100644 --- a/lib/commands/logout.js +++ b/lib/commands/logout.js @@ -1,6 +1,6 @@ const npmFetch = require('npm-registry-fetch') const { getAuth } = npmFetch -const log = require('proc-log') +const { log } = require('proc-log') const BaseCommand = require('../base-command.js') class Logout extends BaseCommand { diff --git a/lib/commands/owner.js b/lib/commands/owner.js index e20d05dc15fab..ccb85fae91f55 100644 --- a/lib/commands/owner.js +++ b/lib/commands/owner.js @@ -1,7 +1,7 @@ const npa = require('npm-package-arg') const npmFetch = require('npm-registry-fetch') const pacote = require('pacote') -const log = require('proc-log') +const { log } = require('proc-log') const otplease = require('../utils/otplease.js') const pkgJson = require('@npmcli/package-json') const BaseCommand = require('../base-command.js') diff --git a/lib/commands/pack.js b/lib/commands/pack.js index e1eb3f2d57aa4..b482c54dc7ac4 100644 --- a/lib/commands/pack.js +++ b/lib/commands/pack.js @@ -1,7 +1,7 @@ const pacote = require('pacote') const libpack = require('libnpmpack') const npa = require('npm-package-arg') -const log = require('proc-log') +const { log } = require('proc-log') const { getContents, logTar } = require('../utils/tar.js') const BaseCommand = require('../base-command.js') diff --git a/lib/commands/ping.js b/lib/commands/ping.js index 21225bc4b5a6a..a16278fc3e130 100644 --- a/lib/commands/ping.js +++ b/lib/commands/ping.js @@ -1,5 +1,5 @@ const { redact } = require('@npmcli/redact') -const log = require('proc-log') +const { log } = require('proc-log') const pingUtil = require('../utils/ping.js') const BaseCommand = require('../base-command.js') diff --git a/lib/commands/profile.js b/lib/commands/profile.js index d43292f2dce09..5ef0d0dbe7c57 100644 --- a/lib/commands/profile.js +++ b/lib/commands/profile.js @@ -1,6 +1,6 @@ const inspect = require('util').inspect const { URL } = require('url') -const log = require('proc-log') +const { log } = require('proc-log') const npmProfile = require('npm-profile') const qrcodeTerminal = require('qrcode-terminal') const Table = require('cli-table3') diff --git a/lib/commands/publish.js b/lib/commands/publish.js index 6ff6f4d85c014..0e2607fb14af5 100644 --- a/lib/commands/publish.js +++ b/lib/commands/publish.js @@ -1,4 +1,4 @@ -const log = require('proc-log') +const { log } = require('proc-log') const semver = require('semver') const pack = require('libnpmpack') const libpub = require('libnpmpublish').publish diff --git a/lib/commands/query.js b/lib/commands/query.js index acf2fe3d9e9d1..6bee73d1ba2ad 100644 --- a/lib/commands/query.js +++ b/lib/commands/query.js @@ -2,7 +2,7 @@ const { resolve } = require('path') const BaseCommand = require('../base-command.js') -const log = require('proc-log') +const { log } = require('proc-log') class QuerySelectorItem { constructor (node) { diff --git a/lib/commands/run-script.js b/lib/commands/run-script.js index 58bd51e00c2ad..e6c9ceb1aacb8 100644 --- a/lib/commands/run-script.js +++ b/lib/commands/run-script.js @@ -1,7 +1,7 @@ const runScript = require('@npmcli/run-script') const { isServerPackage } = runScript const pkgJson = require('@npmcli/package-json') -const log = require('proc-log') +const { log } = require('proc-log') const didYouMean = require('../utils/did-you-mean.js') const { isWindowsShell } = require('../utils/is-windows.js') diff --git a/lib/commands/sbom.js b/lib/commands/sbom.js index d43c94826dc9b..aea94099ef3b9 100644 --- a/lib/commands/sbom.js +++ b/lib/commands/sbom.js @@ -2,7 +2,7 @@ const localeCompare = require('@isaacs/string-locale-compare')('en') const BaseCommand = require('../base-command.js') -const log = require('proc-log') +const { log } = require('proc-log') const { cyclonedxOutput } = require('../utils/sbom-cyclonedx.js') const { spdxOutput } = require('../utils/sbom-spdx.js') diff --git a/lib/commands/search.js b/lib/commands/search.js index 7f92e995cf2fd..d1db948b34ba9 100644 --- a/lib/commands/search.js +++ b/lib/commands/search.js @@ -1,7 +1,7 @@ const { Minipass } = require('minipass') const Pipeline = require('minipass-pipeline') const libSearch = require('libnpmsearch') -const log = require('proc-log') +const { log } = require('proc-log') const formatSearchStream = require('../utils/format-search-stream.js') diff --git a/lib/commands/shrinkwrap.js b/lib/commands/shrinkwrap.js index 7febc2f9b0460..01e1d5fdc1189 100644 --- a/lib/commands/shrinkwrap.js +++ b/lib/commands/shrinkwrap.js @@ -1,6 +1,6 @@ const { resolve, basename } = require('path') const { unlink } = require('fs').promises -const log = require('proc-log') +const { log } = require('proc-log') const BaseCommand = require('../base-command.js') class Shrinkwrap extends BaseCommand { static description = 'Lock down dependency versions for publication' diff --git a/lib/commands/star.js b/lib/commands/star.js index 4a84adf641b8d..54ebdb535865d 100644 --- a/lib/commands/star.js +++ b/lib/commands/star.js @@ -1,6 +1,6 @@ const fetch = require('npm-registry-fetch') const npa = require('npm-package-arg') -const log = require('proc-log') +const { log } = require('proc-log') const getIdentity = require('../utils/get-identity') const BaseCommand = require('../base-command.js') diff --git a/lib/commands/stars.js b/lib/commands/stars.js index 73b5dbb2d7f7f..f4a8321692f93 100644 --- a/lib/commands/stars.js +++ b/lib/commands/stars.js @@ -1,5 +1,5 @@ const fetch = require('npm-registry-fetch') -const log = require('proc-log') +const { log } = require('proc-log') const getIdentity = require('../utils/get-identity.js') const BaseCommand = require('../base-command.js') diff --git a/lib/commands/token.js b/lib/commands/token.js index 361dfe52e8006..d87949fd77af5 100644 --- a/lib/commands/token.js +++ b/lib/commands/token.js @@ -1,5 +1,5 @@ const Table = require('cli-table3') -const log = require('proc-log') +const { log } = require('proc-log') const profile = require('npm-profile') const otplease = require('../utils/otplease.js') diff --git a/lib/commands/unpublish.js b/lib/commands/unpublish.js index 0b351ef3e37f0..bf02d96712825 100644 --- a/lib/commands/unpublish.js +++ b/lib/commands/unpublish.js @@ -6,7 +6,7 @@ const pkgJson = require('@npmcli/package-json') const { flatten } = require('@npmcli/config/lib/definitions') const getIdentity = require('../utils/get-identity.js') -const log = require('proc-log') +const { log } = require('proc-log') const otplease = require('../utils/otplease.js') const LAST_REMAINING_VERSION_ERROR = 'Refusing to delete the last version of the package. ' + diff --git a/lib/commands/update.js b/lib/commands/update.js index 4799c635cae44..12b6ac153a588 100644 --- a/lib/commands/update.js +++ b/lib/commands/update.js @@ -1,6 +1,6 @@ const path = require('path') -const log = require('proc-log') +const { log } = require('proc-log') const reifyFinish = require('../utils/reify-finish.js') diff --git a/lib/commands/view.js b/lib/commands/view.js index 255766267caaa..25a45ab016758 100644 --- a/lib/commands/view.js +++ b/lib/commands/view.js @@ -1,7 +1,7 @@ const columns = require('cli-columns') const fs = require('fs') const jsonParse = require('json-parse-even-better-errors') -const log = require('proc-log') +const { log } = require('proc-log') const npa = require('npm-package-arg') const { resolve } = require('path') const formatBytes = require('../utils/format-bytes.js') diff --git a/lib/npm.js b/lib/npm.js index 912371a1afaf8..55e866bd492e7 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -11,7 +11,7 @@ const usage = require('./utils/npm-usage.js') const LogFile = require('./utils/log-file.js') const Timers = require('./utils/timers.js') const Display = require('./utils/display.js') -const log = require('proc-log') +const { log } = require('proc-log') const { redactLog: replaceInfo } = require('@npmcli/redact') const updateNotifier = require('./utils/update-notifier.js') const pkg = require('../package.json') @@ -50,14 +50,7 @@ class Npm { #display = null #logFile = new LogFile() - #timers = new Timers({ - start: 'npm', - listener: (name, ms) => { - const args = [name, `Completed in ${ms}ms`] - this.#logFile.log('timing', ...args) - this.#display.logTiming(...args) - }, - }) + #timers = new Timers({ start: 'npm' }) // all these options are only used by tests in order to make testing more // closely resemble real world usage. for now, npm has no programmatic API so diff --git a/lib/package-url-cmd.js b/lib/package-url-cmd.js index 6e43b8989c191..dc6b6f7c0b512 100644 --- a/lib/package-url-cmd.js +++ b/lib/package-url-cmd.js @@ -4,7 +4,7 @@ const pacote = require('pacote') const hostedGitInfo = require('hosted-git-info') const openUrl = require('./utils/open-url.js') -const log = require('proc-log') +const { log } = require('proc-log') const BaseCommand = require('./base-command.js') class PackageUrlCommand extends BaseCommand { diff --git a/lib/utils/audit-error.js b/lib/utils/audit-error.js index 69025506d674b..de3a026553dfc 100644 --- a/lib/utils/audit-error.js +++ b/lib/utils/audit-error.js @@ -1,4 +1,4 @@ -const log = require('proc-log') +const { log } = require('proc-log') const { redactLog: replaceInfo } = require('@npmcli/redact') // print an error or just nothing if the audit report has an error diff --git a/lib/utils/auth.js b/lib/utils/auth.js index 931c74c04f606..c38d7cc78e2ce 100644 --- a/lib/utils/auth.js +++ b/lib/utils/auth.js @@ -1,5 +1,5 @@ const profile = require('npm-profile') -const log = require('proc-log') +const { log } = require('proc-log') const openUrlPrompt = require('../utils/open-url-prompt.js') const read = require('../utils/read-user-info.js') const otplease = require('../utils/otplease.js') diff --git a/lib/utils/display.js b/lib/utils/display.js index c2e4918258afe..ba62ae5e0aee0 100644 --- a/lib/utils/display.js +++ b/lib/utils/display.js @@ -1,5 +1,5 @@ const proggy = require('proggy') -const log = require('proc-log') +const { log } = require('proc-log') const { explain } = require('./explain-eresolve.js') const { formatWithOptions, format } = require('./format') @@ -17,7 +17,7 @@ const COLOR_PALETTE = ({ chalk: c }) => ({ silly: c.inverse, }) -const LEVELS = ['timing', ...log.LEVELS].reduce((acc, key) => { +const LEVELS = log.LEVELS.reduce((acc, key) => { acc[key] = key return acc }, {}) @@ -139,10 +139,6 @@ class Display { } } - logTiming (...args) { - this.#logHandler(LEVELS.timing, ...args) - } - forceLog (level, ...args) { // This will show the log regardless of the current loglevel, except when silent this.#logHandler({ level, force: true }, ...args) diff --git a/lib/utils/error-message.js b/lib/utils/error-message.js index e68181bc0ea0b..c27b8a3447957 100644 --- a/lib/utils/error-message.js +++ b/lib/utils/error-message.js @@ -2,7 +2,7 @@ const { format } = require('util') const { resolve } = require('path') const { redactLog: replaceInfo } = require('@npmcli/redact') const { report } = require('./explain-eresolve.js') -const log = require('proc-log') +const { log } = require('proc-log') const messageText = msg => msg.map(line => line.slice(1).join(' ')).join('\n') diff --git a/lib/utils/exit-handler.js b/lib/utils/exit-handler.js index ab436a8f38951..3f2ffaaf0c807 100644 --- a/lib/utils/exit-handler.js +++ b/lib/utils/exit-handler.js @@ -1,7 +1,7 @@ const os = require('os') const fs = require('fs') -const log = require('proc-log') +const { log } = require('proc-log') const errorMessage = require('./error-message.js') const { redactLog: replaceInfo } = require('@npmcli/redact') diff --git a/lib/utils/log-file.js b/lib/utils/log-file.js index 4a5eaf9be0280..a3792abf91951 100644 --- a/lib/utils/log-file.js +++ b/lib/utils/log-file.js @@ -3,7 +3,7 @@ const { join, dirname, basename } = require('path') const { Minipass } = require('minipass') const fsMiniPass = require('fs-minipass') const fs = require('fs/promises') -const log = require('proc-log') +const { log } = require('proc-log') const { formatWithOptions } = require('./format') const padZero = (n, length) => n.toString().padStart(length.toString().length, '0') diff --git a/lib/utils/read-user-info.js b/lib/utils/read-user-info.js index 3c7817e3e491a..b2cd7374c17c3 100644 --- a/lib/utils/read-user-info.js +++ b/lib/utils/read-user-info.js @@ -1,6 +1,6 @@ const { read } = require('read') const userValidate = require('npm-user-validate') -const log = require('proc-log') +const { log } = require('proc-log') exports.otp = readOTP exports.password = readPassword diff --git a/lib/utils/reify-output.js b/lib/utils/reify-output.js index 3b2b69279e190..58cf76dda7837 100644 --- a/lib/utils/reify-output.js +++ b/lib/utils/reify-output.js @@ -9,7 +9,7 @@ // found 37 vulnerabilities (5 low, 7 moderate, 25 high) // run `npm audit fix` to fix them, or `npm audit` for details -const log = require('proc-log') +const { log } = require('proc-log') const { depth } = require('treeverse') const ms = require('ms') const npmAuditReport = require('npm-audit-report') diff --git a/lib/utils/tar.js b/lib/utils/tar.js index e03b4b65466e4..8883f231a8981 100644 --- a/lib/utils/tar.js +++ b/lib/utils/tar.js @@ -1,6 +1,6 @@ const tar = require('tar') const ssri = require('ssri') -const log = require('proc-log') +const { log } = require('proc-log') const formatBytes = require('./format-bytes.js') const columnify = require('columnify') const localeCompare = require('@isaacs/string-locale-compare')('en', { diff --git a/lib/utils/timers.js b/lib/utils/timers.js index c897757b697fd..58ff39b6a1d66 100644 --- a/lib/utils/timers.js +++ b/lib/utils/timers.js @@ -1,24 +1,20 @@ const EE = require('events') const fs = require('fs') -const log = require('proc-log') +const { log } = require('proc-log') + +const INITIAL_TIMER = 'npm' -// This is an event emiiter but on/off -// only listen on a single internal event that gets -// emitted whenever a timer ends class Timers extends EE { file = null #unfinished = new Map() #finished = {} - #onTimeEnd = Symbol('onTimeEnd') - #initialListener = null - #initialTimer = null - constructor ({ listener = null, start = 'npm' } = {}) { + constructor () { super() - this.#initialListener = listener - this.#initialTimer = start - this.#init() + this.on() + process.emit('time', INITIAL_TIMER) + this.started = this.#unfinished.get(INITIAL_TIMER) } get unfinished () { @@ -29,32 +25,14 @@ class Timers extends EE { return this.#finished } - #init () { - this.on() - if (this.#initialListener) { - this.on(this.#initialListener) - } - process.emit('time', this.#initialTimer) - this.started = this.#unfinished.get(this.#initialTimer) - } - - on (listener) { - if (listener) { - super.on(this.#onTimeEnd, listener) - } else { - process.on('time', this.#timeListener) - process.on('timeEnd', this.#timeEndListener) - } + on () { + process.on('time', this.#timeListener) + process.on('timeEnd', this.#timeEndListener) } - off (listener) { - if (listener) { - super.off(this.#onTimeEnd, listener) - } else { - this.removeAllListeners(this.#onTimeEnd) - process.off('time', this.#timeListener) - process.off('timeEnd', this.#timeEndListener) - } + off () { + process.off('time', this.#timeListener) + process.off('timeEnd', this.#timeEndListener) } time (name, fn) { @@ -80,7 +58,7 @@ class Timers extends EE { try { const globalStart = this.started - const globalEnd = this.#finished.npm || Date.now() + const globalEnd = this.#finished[INITIAL_TIMER] || Date.now() const content = { metadata, timers: this.#finished, @@ -106,7 +84,7 @@ class Timers extends EE { const ms = Date.now() - this.#unfinished.get(name) this.#finished[name] = ms this.#unfinished.delete(name) - this.emit(this.#onTimeEnd, name, ms) + log.timing(name, `Completed in ${ms}ms`) } else { log.silly('timing', "Tried to end timer that doesn't exist:", name) } diff --git a/node_modules/.gitignore b/node_modules/.gitignore index a787d61a16e8e..d0027e69cf656 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -25,9 +25,6 @@ !/@npmcli/disparity-colors/node_modules/ansi-styles !/@npmcli/fs !/@npmcli/git -!/@npmcli/git/node_modules/ -/@npmcli/git/node_modules/* -!/@npmcli/git/node_modules/proc-log !/@npmcli/installed-package-contents !/@npmcli/map-workspaces !/@npmcli/metavuln-calculator @@ -40,9 +37,6 @@ !/@npmcli/name-from-folder !/@npmcli/node-gyp !/@npmcli/package-json -!/@npmcli/package-json/node_modules/ -/@npmcli/package-json/node_modules/* -!/@npmcli/package-json/node_modules/proc-log !/@npmcli/promise-spawn !/@npmcli/query !/@npmcli/redact @@ -170,6 +164,9 @@ !/mute-stream !/negotiator !/node-gyp +!/node-gyp/node_modules/ +/node-gyp/node_modules/* +!/node-gyp/node_modules/proc-log !/nopt !/normalize-package-data !/npm-audit-report @@ -177,19 +174,10 @@ !/npm-install-checks !/npm-normalize-package-bin !/npm-package-arg -!/npm-package-arg/node_modules/ -/npm-package-arg/node_modules/* -!/npm-package-arg/node_modules/proc-log !/npm-packlist !/npm-pick-manifest !/npm-profile -!/npm-profile/node_modules/ -/npm-profile/node_modules/* -!/npm-profile/node_modules/proc-log !/npm-registry-fetch -!/npm-registry-fetch/node_modules/ -/npm-registry-fetch/node_modules/* -!/npm-registry-fetch/node_modules/proc-log !/npm-user-validate !/p-map !/pacote @@ -198,7 +186,6 @@ !/pacote/node_modules/@npmcli/ /pacote/node_modules/@npmcli/* !/pacote/node_modules/@npmcli/run-script -!/pacote/node_modules/proc-log !/parse-conflict-json !/path-key !/path-scurry diff --git a/node_modules/@npmcli/git/node_modules/proc-log/lib/index.js b/node_modules/@npmcli/git/node_modules/proc-log/lib/index.js deleted file mode 100644 index 2a049e6bd16b2..0000000000000 --- a/node_modules/@npmcli/git/node_modules/proc-log/lib/index.js +++ /dev/null @@ -1,62 +0,0 @@ -module.exports = { - output: { - LEVELS: [ - 'standard', - 'error', - 'buffer', - ], - standard: function (...args) { - return process.emit('output', 'standard', ...args) - }, - error: function (...args) { - return process.emit('output', 'error', ...args) - }, - buffer: function (...args) { - return process.emit('output', 'buffer', ...args) - }, - }, - log: { - LEVELS: [ - 'notice', - 'error', - 'warn', - 'info', - 'verbose', - 'http', - 'silly', - 'timing', - 'pause', - 'resume', - ], - error: function (...args) { - return process.emit('log', 'error', ...args) - }, - notice: function (...args) { - return process.emit('log', 'notice', ...args) - }, - warn: function (...args) { - return process.emit('log', 'warn', ...args) - }, - info: function (...args) { - return process.emit('log', 'info', ...args) - }, - verbose: function (...args) { - return process.emit('log', 'verbose', ...args) - }, - http: function (...args) { - return process.emit('log', 'http', ...args) - }, - silly: function (...args) { - return process.emit('log', 'silly', ...args) - }, - timing: function (...args) { - return process.emit('log', 'timing', ...args) - }, - pause: function (...args) { - return process.emit('log', 'pause', ...args) - }, - resume: function (...args) { - return process.emit('log', 'resume', ...args) - }, - }, -} diff --git a/node_modules/@npmcli/git/node_modules/proc-log/package.json b/node_modules/@npmcli/git/node_modules/proc-log/package.json deleted file mode 100644 index 405e3c433acbb..0000000000000 --- a/node_modules/@npmcli/git/node_modules/proc-log/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "proc-log", - "version": "4.0.0", - "files": [ - "bin/", - "lib/" - ], - "main": "lib/index.js", - "description": "just emit 'log' events on the process object", - "repository": { - "type": "git", - "url": "https://github.com/npm/proc-log.git" - }, - "author": "GitHub Inc.", - "license": "ISC", - "scripts": { - "test": "tap", - "snap": "tap", - "posttest": "npm run lint", - "postsnap": "eslint index.js test/*.js --fix", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "template-oss-apply": "template-oss-apply --force" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.21.3", - "tap": "^16.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.21.3", - "publish": true - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - } -} diff --git a/node_modules/@npmcli/package-json/node_modules/proc-log/LICENSE b/node_modules/@npmcli/package-json/node_modules/proc-log/LICENSE deleted file mode 100644 index 83837797202b7..0000000000000 --- a/node_modules/@npmcli/package-json/node_modules/proc-log/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) GitHub, Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/@npmcli/package-json/node_modules/proc-log/lib/index.js b/node_modules/@npmcli/package-json/node_modules/proc-log/lib/index.js deleted file mode 100644 index 2a049e6bd16b2..0000000000000 --- a/node_modules/@npmcli/package-json/node_modules/proc-log/lib/index.js +++ /dev/null @@ -1,62 +0,0 @@ -module.exports = { - output: { - LEVELS: [ - 'standard', - 'error', - 'buffer', - ], - standard: function (...args) { - return process.emit('output', 'standard', ...args) - }, - error: function (...args) { - return process.emit('output', 'error', ...args) - }, - buffer: function (...args) { - return process.emit('output', 'buffer', ...args) - }, - }, - log: { - LEVELS: [ - 'notice', - 'error', - 'warn', - 'info', - 'verbose', - 'http', - 'silly', - 'timing', - 'pause', - 'resume', - ], - error: function (...args) { - return process.emit('log', 'error', ...args) - }, - notice: function (...args) { - return process.emit('log', 'notice', ...args) - }, - warn: function (...args) { - return process.emit('log', 'warn', ...args) - }, - info: function (...args) { - return process.emit('log', 'info', ...args) - }, - verbose: function (...args) { - return process.emit('log', 'verbose', ...args) - }, - http: function (...args) { - return process.emit('log', 'http', ...args) - }, - silly: function (...args) { - return process.emit('log', 'silly', ...args) - }, - timing: function (...args) { - return process.emit('log', 'timing', ...args) - }, - pause: function (...args) { - return process.emit('log', 'pause', ...args) - }, - resume: function (...args) { - return process.emit('log', 'resume', ...args) - }, - }, -} diff --git a/node_modules/@npmcli/package-json/node_modules/proc-log/package.json b/node_modules/@npmcli/package-json/node_modules/proc-log/package.json deleted file mode 100644 index 405e3c433acbb..0000000000000 --- a/node_modules/@npmcli/package-json/node_modules/proc-log/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "proc-log", - "version": "4.0.0", - "files": [ - "bin/", - "lib/" - ], - "main": "lib/index.js", - "description": "just emit 'log' events on the process object", - "repository": { - "type": "git", - "url": "https://github.com/npm/proc-log.git" - }, - "author": "GitHub Inc.", - "license": "ISC", - "scripts": { - "test": "tap", - "snap": "tap", - "posttest": "npm run lint", - "postsnap": "eslint index.js test/*.js --fix", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "template-oss-apply": "template-oss-apply --force" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.21.3", - "tap": "^16.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.21.3", - "publish": true - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - } -} diff --git a/node_modules/color-name/test.js b/node_modules/color-name/test.js deleted file mode 100644 index 6e6bf30bcd622..0000000000000 --- a/node_modules/color-name/test.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -var names = require('./'); -var assert = require('assert'); - -assert.deepEqual(names.red, [255,0,0]); -assert.deepEqual(names.aliceblue, [240,248,255]); diff --git a/node_modules/@npmcli/git/node_modules/proc-log/LICENSE b/node_modules/node-gyp/node_modules/proc-log/LICENSE similarity index 100% rename from node_modules/@npmcli/git/node_modules/proc-log/LICENSE rename to node_modules/node-gyp/node_modules/proc-log/LICENSE diff --git a/node_modules/node-gyp/node_modules/proc-log/lib/index.js b/node_modules/node-gyp/node_modules/proc-log/lib/index.js new file mode 100644 index 0000000000000..7c5dfad3b7ba3 --- /dev/null +++ b/node_modules/node-gyp/node_modules/proc-log/lib/index.js @@ -0,0 +1,23 @@ +// emits 'log' events on the process +const LEVELS = [ + 'notice', + 'error', + 'warn', + 'info', + 'verbose', + 'http', + 'silly', + 'pause', + 'resume', +] + +const log = level => (...args) => process.emit('log', level, ...args) + +const logger = {} +for (const level of LEVELS) { + logger[level] = log(level) +} + +logger.LEVELS = LEVELS + +module.exports = logger diff --git a/node_modules/npm-package-arg/node_modules/proc-log/package.json b/node_modules/node-gyp/node_modules/proc-log/package.json similarity index 82% rename from node_modules/npm-package-arg/node_modules/proc-log/package.json rename to node_modules/node-gyp/node_modules/proc-log/package.json index 405e3c433acbb..d335fa965ace5 100644 --- a/node_modules/npm-package-arg/node_modules/proc-log/package.json +++ b/node_modules/node-gyp/node_modules/proc-log/package.json @@ -1,6 +1,6 @@ { "name": "proc-log", - "version": "4.0.0", + "version": "3.0.0", "files": [ "bin/", "lib/" @@ -18,14 +18,14 @@ "snap": "tap", "posttest": "npm run lint", "postsnap": "eslint index.js test/*.js --fix", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "lint": "eslint \"**/*.js\"", "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.21.3", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "4.5.1", "tap": "^16.0.1" }, "engines": { @@ -33,8 +33,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.21.3", - "publish": true + "version": "4.5.1" }, "tap": { "nyc-arg": [ diff --git a/node_modules/npm-package-arg/node_modules/proc-log/LICENSE b/node_modules/npm-package-arg/node_modules/proc-log/LICENSE deleted file mode 100644 index 83837797202b7..0000000000000 --- a/node_modules/npm-package-arg/node_modules/proc-log/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) GitHub, Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/npm-package-arg/node_modules/proc-log/lib/index.js b/node_modules/npm-package-arg/node_modules/proc-log/lib/index.js deleted file mode 100644 index 2a049e6bd16b2..0000000000000 --- a/node_modules/npm-package-arg/node_modules/proc-log/lib/index.js +++ /dev/null @@ -1,62 +0,0 @@ -module.exports = { - output: { - LEVELS: [ - 'standard', - 'error', - 'buffer', - ], - standard: function (...args) { - return process.emit('output', 'standard', ...args) - }, - error: function (...args) { - return process.emit('output', 'error', ...args) - }, - buffer: function (...args) { - return process.emit('output', 'buffer', ...args) - }, - }, - log: { - LEVELS: [ - 'notice', - 'error', - 'warn', - 'info', - 'verbose', - 'http', - 'silly', - 'timing', - 'pause', - 'resume', - ], - error: function (...args) { - return process.emit('log', 'error', ...args) - }, - notice: function (...args) { - return process.emit('log', 'notice', ...args) - }, - warn: function (...args) { - return process.emit('log', 'warn', ...args) - }, - info: function (...args) { - return process.emit('log', 'info', ...args) - }, - verbose: function (...args) { - return process.emit('log', 'verbose', ...args) - }, - http: function (...args) { - return process.emit('log', 'http', ...args) - }, - silly: function (...args) { - return process.emit('log', 'silly', ...args) - }, - timing: function (...args) { - return process.emit('log', 'timing', ...args) - }, - pause: function (...args) { - return process.emit('log', 'pause', ...args) - }, - resume: function (...args) { - return process.emit('log', 'resume', ...args) - }, - }, -} diff --git a/node_modules/npm-profile/node_modules/proc-log/LICENSE b/node_modules/npm-profile/node_modules/proc-log/LICENSE deleted file mode 100644 index 83837797202b7..0000000000000 --- a/node_modules/npm-profile/node_modules/proc-log/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) GitHub, Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/npm-profile/node_modules/proc-log/lib/index.js b/node_modules/npm-profile/node_modules/proc-log/lib/index.js deleted file mode 100644 index 2a049e6bd16b2..0000000000000 --- a/node_modules/npm-profile/node_modules/proc-log/lib/index.js +++ /dev/null @@ -1,62 +0,0 @@ -module.exports = { - output: { - LEVELS: [ - 'standard', - 'error', - 'buffer', - ], - standard: function (...args) { - return process.emit('output', 'standard', ...args) - }, - error: function (...args) { - return process.emit('output', 'error', ...args) - }, - buffer: function (...args) { - return process.emit('output', 'buffer', ...args) - }, - }, - log: { - LEVELS: [ - 'notice', - 'error', - 'warn', - 'info', - 'verbose', - 'http', - 'silly', - 'timing', - 'pause', - 'resume', - ], - error: function (...args) { - return process.emit('log', 'error', ...args) - }, - notice: function (...args) { - return process.emit('log', 'notice', ...args) - }, - warn: function (...args) { - return process.emit('log', 'warn', ...args) - }, - info: function (...args) { - return process.emit('log', 'info', ...args) - }, - verbose: function (...args) { - return process.emit('log', 'verbose', ...args) - }, - http: function (...args) { - return process.emit('log', 'http', ...args) - }, - silly: function (...args) { - return process.emit('log', 'silly', ...args) - }, - timing: function (...args) { - return process.emit('log', 'timing', ...args) - }, - pause: function (...args) { - return process.emit('log', 'pause', ...args) - }, - resume: function (...args) { - return process.emit('log', 'resume', ...args) - }, - }, -} diff --git a/node_modules/npm-profile/node_modules/proc-log/package.json b/node_modules/npm-profile/node_modules/proc-log/package.json deleted file mode 100644 index 405e3c433acbb..0000000000000 --- a/node_modules/npm-profile/node_modules/proc-log/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "proc-log", - "version": "4.0.0", - "files": [ - "bin/", - "lib/" - ], - "main": "lib/index.js", - "description": "just emit 'log' events on the process object", - "repository": { - "type": "git", - "url": "https://github.com/npm/proc-log.git" - }, - "author": "GitHub Inc.", - "license": "ISC", - "scripts": { - "test": "tap", - "snap": "tap", - "posttest": "npm run lint", - "postsnap": "eslint index.js test/*.js --fix", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "template-oss-apply": "template-oss-apply --force" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.21.3", - "tap": "^16.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.21.3", - "publish": true - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - } -} diff --git a/node_modules/npm-registry-fetch/node_modules/proc-log/LICENSE b/node_modules/npm-registry-fetch/node_modules/proc-log/LICENSE deleted file mode 100644 index 83837797202b7..0000000000000 --- a/node_modules/npm-registry-fetch/node_modules/proc-log/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) GitHub, Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/npm-registry-fetch/node_modules/proc-log/lib/index.js b/node_modules/npm-registry-fetch/node_modules/proc-log/lib/index.js deleted file mode 100644 index 2a049e6bd16b2..0000000000000 --- a/node_modules/npm-registry-fetch/node_modules/proc-log/lib/index.js +++ /dev/null @@ -1,62 +0,0 @@ -module.exports = { - output: { - LEVELS: [ - 'standard', - 'error', - 'buffer', - ], - standard: function (...args) { - return process.emit('output', 'standard', ...args) - }, - error: function (...args) { - return process.emit('output', 'error', ...args) - }, - buffer: function (...args) { - return process.emit('output', 'buffer', ...args) - }, - }, - log: { - LEVELS: [ - 'notice', - 'error', - 'warn', - 'info', - 'verbose', - 'http', - 'silly', - 'timing', - 'pause', - 'resume', - ], - error: function (...args) { - return process.emit('log', 'error', ...args) - }, - notice: function (...args) { - return process.emit('log', 'notice', ...args) - }, - warn: function (...args) { - return process.emit('log', 'warn', ...args) - }, - info: function (...args) { - return process.emit('log', 'info', ...args) - }, - verbose: function (...args) { - return process.emit('log', 'verbose', ...args) - }, - http: function (...args) { - return process.emit('log', 'http', ...args) - }, - silly: function (...args) { - return process.emit('log', 'silly', ...args) - }, - timing: function (...args) { - return process.emit('log', 'timing', ...args) - }, - pause: function (...args) { - return process.emit('log', 'pause', ...args) - }, - resume: function (...args) { - return process.emit('log', 'resume', ...args) - }, - }, -} diff --git a/node_modules/npm-registry-fetch/node_modules/proc-log/package.json b/node_modules/npm-registry-fetch/node_modules/proc-log/package.json deleted file mode 100644 index 405e3c433acbb..0000000000000 --- a/node_modules/npm-registry-fetch/node_modules/proc-log/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "proc-log", - "version": "4.0.0", - "files": [ - "bin/", - "lib/" - ], - "main": "lib/index.js", - "description": "just emit 'log' events on the process object", - "repository": { - "type": "git", - "url": "https://github.com/npm/proc-log.git" - }, - "author": "GitHub Inc.", - "license": "ISC", - "scripts": { - "test": "tap", - "snap": "tap", - "posttest": "npm run lint", - "postsnap": "eslint index.js test/*.js --fix", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "template-oss-apply": "template-oss-apply --force" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.21.3", - "tap": "^16.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.21.3", - "publish": true - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - } -} diff --git a/node_modules/pacote/node_modules/proc-log/LICENSE b/node_modules/pacote/node_modules/proc-log/LICENSE deleted file mode 100644 index 83837797202b7..0000000000000 --- a/node_modules/pacote/node_modules/proc-log/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) GitHub, Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/pacote/node_modules/proc-log/lib/index.js b/node_modules/pacote/node_modules/proc-log/lib/index.js deleted file mode 100644 index 2a049e6bd16b2..0000000000000 --- a/node_modules/pacote/node_modules/proc-log/lib/index.js +++ /dev/null @@ -1,62 +0,0 @@ -module.exports = { - output: { - LEVELS: [ - 'standard', - 'error', - 'buffer', - ], - standard: function (...args) { - return process.emit('output', 'standard', ...args) - }, - error: function (...args) { - return process.emit('output', 'error', ...args) - }, - buffer: function (...args) { - return process.emit('output', 'buffer', ...args) - }, - }, - log: { - LEVELS: [ - 'notice', - 'error', - 'warn', - 'info', - 'verbose', - 'http', - 'silly', - 'timing', - 'pause', - 'resume', - ], - error: function (...args) { - return process.emit('log', 'error', ...args) - }, - notice: function (...args) { - return process.emit('log', 'notice', ...args) - }, - warn: function (...args) { - return process.emit('log', 'warn', ...args) - }, - info: function (...args) { - return process.emit('log', 'info', ...args) - }, - verbose: function (...args) { - return process.emit('log', 'verbose', ...args) - }, - http: function (...args) { - return process.emit('log', 'http', ...args) - }, - silly: function (...args) { - return process.emit('log', 'silly', ...args) - }, - timing: function (...args) { - return process.emit('log', 'timing', ...args) - }, - pause: function (...args) { - return process.emit('log', 'pause', ...args) - }, - resume: function (...args) { - return process.emit('log', 'resume', ...args) - }, - }, -} diff --git a/node_modules/pacote/node_modules/proc-log/package.json b/node_modules/pacote/node_modules/proc-log/package.json deleted file mode 100644 index 405e3c433acbb..0000000000000 --- a/node_modules/pacote/node_modules/proc-log/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "proc-log", - "version": "4.0.0", - "files": [ - "bin/", - "lib/" - ], - "main": "lib/index.js", - "description": "just emit 'log' events on the process object", - "repository": { - "type": "git", - "url": "https://github.com/npm/proc-log.git" - }, - "author": "GitHub Inc.", - "license": "ISC", - "scripts": { - "test": "tap", - "snap": "tap", - "posttest": "npm run lint", - "postsnap": "eslint index.js test/*.js --fix", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "template-oss-apply": "template-oss-apply --force" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.21.3", - "tap": "^16.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.21.3", - "publish": true - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - } -} diff --git a/node_modules/proc-log/lib/index.js b/node_modules/proc-log/lib/index.js index 7c5dfad3b7ba3..2a049e6bd16b2 100644 --- a/node_modules/proc-log/lib/index.js +++ b/node_modules/proc-log/lib/index.js @@ -1,23 +1,62 @@ -// emits 'log' events on the process -const LEVELS = [ - 'notice', - 'error', - 'warn', - 'info', - 'verbose', - 'http', - 'silly', - 'pause', - 'resume', -] - -const log = level => (...args) => process.emit('log', level, ...args) - -const logger = {} -for (const level of LEVELS) { - logger[level] = log(level) +module.exports = { + output: { + LEVELS: [ + 'standard', + 'error', + 'buffer', + ], + standard: function (...args) { + return process.emit('output', 'standard', ...args) + }, + error: function (...args) { + return process.emit('output', 'error', ...args) + }, + buffer: function (...args) { + return process.emit('output', 'buffer', ...args) + }, + }, + log: { + LEVELS: [ + 'notice', + 'error', + 'warn', + 'info', + 'verbose', + 'http', + 'silly', + 'timing', + 'pause', + 'resume', + ], + error: function (...args) { + return process.emit('log', 'error', ...args) + }, + notice: function (...args) { + return process.emit('log', 'notice', ...args) + }, + warn: function (...args) { + return process.emit('log', 'warn', ...args) + }, + info: function (...args) { + return process.emit('log', 'info', ...args) + }, + verbose: function (...args) { + return process.emit('log', 'verbose', ...args) + }, + http: function (...args) { + return process.emit('log', 'http', ...args) + }, + silly: function (...args) { + return process.emit('log', 'silly', ...args) + }, + timing: function (...args) { + return process.emit('log', 'timing', ...args) + }, + pause: function (...args) { + return process.emit('log', 'pause', ...args) + }, + resume: function (...args) { + return process.emit('log', 'resume', ...args) + }, + }, } - -logger.LEVELS = LEVELS - -module.exports = logger diff --git a/node_modules/proc-log/package.json b/node_modules/proc-log/package.json index d335fa965ace5..405e3c433acbb 100644 --- a/node_modules/proc-log/package.json +++ b/node_modules/proc-log/package.json @@ -1,6 +1,6 @@ { "name": "proc-log", - "version": "3.0.0", + "version": "4.0.0", "files": [ "bin/", "lib/" @@ -18,14 +18,14 @@ "snap": "tap", "posttest": "npm run lint", "postsnap": "eslint index.js test/*.js --fix", - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "4.5.1", + "@npmcli/eslint-config": "^4.0.0", + "@npmcli/template-oss": "4.21.3", "tap": "^16.0.1" }, "engines": { @@ -33,7 +33,8 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.5.1" + "version": "4.21.3", + "publish": true }, "tap": { "nyc-arg": [ diff --git a/node_modules/signal-exit/index.js b/node_modules/signal-exit/index.js deleted file mode 100644 index 93703f369265c..0000000000000 --- a/node_modules/signal-exit/index.js +++ /dev/null @@ -1,202 +0,0 @@ -// Note: since nyc uses this module to output coverage, any lines -// that are in the direct sync flow of nyc's outputCoverage are -// ignored, since we can never get coverage for them. -// grab a reference to node's real process object right away -var process = global.process - -const processOk = function (process) { - return process && - typeof process === 'object' && - typeof process.removeListener === 'function' && - typeof process.emit === 'function' && - typeof process.reallyExit === 'function' && - typeof process.listeners === 'function' && - typeof process.kill === 'function' && - typeof process.pid === 'number' && - typeof process.on === 'function' -} - -// some kind of non-node environment, just no-op -/* istanbul ignore if */ -if (!processOk(process)) { - module.exports = function () { - return function () {} - } -} else { - var assert = require('assert') - var signals = require('./signals.js') - var isWin = /^win/i.test(process.platform) - - var EE = require('events') - /* istanbul ignore if */ - if (typeof EE !== 'function') { - EE = EE.EventEmitter - } - - var emitter - if (process.__signal_exit_emitter__) { - emitter = process.__signal_exit_emitter__ - } else { - emitter = process.__signal_exit_emitter__ = new EE() - emitter.count = 0 - emitter.emitted = {} - } - - // Because this emitter is a global, we have to check to see if a - // previous version of this library failed to enable infinite listeners. - // I know what you're about to say. But literally everything about - // signal-exit is a compromise with evil. Get used to it. - if (!emitter.infinite) { - emitter.setMaxListeners(Infinity) - emitter.infinite = true - } - - module.exports = function (cb, opts) { - /* istanbul ignore if */ - if (!processOk(global.process)) { - return function () {} - } - assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') - - if (loaded === false) { - load() - } - - var ev = 'exit' - if (opts && opts.alwaysLast) { - ev = 'afterexit' - } - - var remove = function () { - emitter.removeListener(ev, cb) - if (emitter.listeners('exit').length === 0 && - emitter.listeners('afterexit').length === 0) { - unload() - } - } - emitter.on(ev, cb) - - return remove - } - - var unload = function unload () { - if (!loaded || !processOk(global.process)) { - return - } - loaded = false - - signals.forEach(function (sig) { - try { - process.removeListener(sig, sigListeners[sig]) - } catch (er) {} - }) - process.emit = originalProcessEmit - process.reallyExit = originalProcessReallyExit - emitter.count -= 1 - } - module.exports.unload = unload - - var emit = function emit (event, code, signal) { - /* istanbul ignore if */ - if (emitter.emitted[event]) { - return - } - emitter.emitted[event] = true - emitter.emit(event, code, signal) - } - - // { : , ... } - var sigListeners = {} - signals.forEach(function (sig) { - sigListeners[sig] = function listener () { - /* istanbul ignore if */ - if (!processOk(global.process)) { - return - } - // If there are no other listeners, an exit is coming! - // Simplest way: remove us and then re-send the signal. - // We know that this will kill the process, so we can - // safely emit now. - var listeners = process.listeners(sig) - if (listeners.length === emitter.count) { - unload() - emit('exit', null, sig) - /* istanbul ignore next */ - emit('afterexit', null, sig) - /* istanbul ignore next */ - if (isWin && sig === 'SIGHUP') { - // "SIGHUP" throws an `ENOSYS` error on Windows, - // so use a supported signal instead - sig = 'SIGINT' - } - /* istanbul ignore next */ - process.kill(process.pid, sig) - } - } - }) - - module.exports.signals = function () { - return signals - } - - var loaded = false - - var load = function load () { - if (loaded || !processOk(global.process)) { - return - } - loaded = true - - // This is the number of onSignalExit's that are in play. - // It's important so that we can count the correct number of - // listeners on signals, and don't wait for the other one to - // handle it instead of us. - emitter.count += 1 - - signals = signals.filter(function (sig) { - try { - process.on(sig, sigListeners[sig]) - return true - } catch (er) { - return false - } - }) - - process.emit = processEmit - process.reallyExit = processReallyExit - } - module.exports.load = load - - var originalProcessReallyExit = process.reallyExit - var processReallyExit = function processReallyExit (code) { - /* istanbul ignore if */ - if (!processOk(global.process)) { - return - } - process.exitCode = code || /* istanbul ignore next */ 0 - emit('exit', process.exitCode, null) - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null) - /* istanbul ignore next */ - originalProcessReallyExit.call(process, process.exitCode) - } - - var originalProcessEmit = process.emit - var processEmit = function processEmit (ev, arg) { - if (ev === 'exit' && processOk(global.process)) { - /* istanbul ignore else */ - if (arg !== undefined) { - process.exitCode = arg - } - var ret = originalProcessEmit.apply(this, arguments) - /* istanbul ignore next */ - emit('exit', process.exitCode, null) - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null) - /* istanbul ignore next */ - return ret - } else { - return originalProcessEmit.apply(this, arguments) - } - } -} diff --git a/node_modules/signal-exit/signals.js b/node_modules/signal-exit/signals.js deleted file mode 100644 index 3bd67a8a554e3..0000000000000 --- a/node_modules/signal-exit/signals.js +++ /dev/null @@ -1,53 +0,0 @@ -// This is not the set of all possible signals. -// -// It IS, however, the set of all signals that trigger -// an exit on either Linux or BSD systems. Linux is a -// superset of the signal names supported on BSD, and -// the unknown signals just fail to register, so we can -// catch that easily enough. -// -// Don't bother with SIGKILL. It's uncatchable, which -// means that we can't fire any callbacks anyway. -// -// If a user does happen to register a handler on a non- -// fatal signal like SIGWINCH or something, and then -// exit, it'll end up firing `process.emit('exit')`, so -// the handler will be fired anyway. -// -// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised -// artificially, inherently leave the process in a -// state from which it is not safe to try and enter JS -// listeners. -module.exports = [ - 'SIGABRT', - 'SIGALRM', - 'SIGHUP', - 'SIGINT', - 'SIGTERM' -] - -if (process.platform !== 'win32') { - module.exports.push( - 'SIGVTALRM', - 'SIGXCPU', - 'SIGXFSZ', - 'SIGUSR2', - 'SIGTRAP', - 'SIGSYS', - 'SIGQUIT', - 'SIGIOT' - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ) -} - -if (process.platform === 'linux') { - module.exports.push( - 'SIGIO', - 'SIGPOLL', - 'SIGPWR', - 'SIGSTKFLT', - 'SIGUNUSED' - ) -} diff --git a/package-lock.json b/package-lock.json index 482939a320ed8..ee971e33b0179 100644 --- a/package-lock.json +++ b/package-lock.json @@ -145,7 +145,7 @@ "p-map": "^4.0.0", "pacote": "^18.0.0", "parse-conflict-json": "^3.0.1", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "proggy": "^2.0.0", "qrcode-terminal": "^0.12.0", "read": "^3.0.1", @@ -1719,15 +1719,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/@npmcli/git/node_modules/proc-log": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.0.0.tgz", - "integrity": "sha512-v1lzmYxGDs2+OZnmYtYZK3DG8zogt+CbQ+o/iqqtTfpyCmGWulCTEQu5GIbivf7OjgIkH2Nr8SH8UxAGugZNbg==", - "inBundle": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/@npmcli/installed-package-contents": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", @@ -1877,15 +1868,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/@npmcli/package-json/node_modules/proc-log": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.0.0.tgz", - "integrity": "sha512-v1lzmYxGDs2+OZnmYtYZK3DG8zogt+CbQ+o/iqqtTfpyCmGWulCTEQu5GIbivf7OjgIkH2Nr8SH8UxAGugZNbg==", - "inBundle": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/@npmcli/promise-spawn": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-7.0.1.tgz", @@ -1983,6 +1965,15 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/@npmcli/template-oss/node_modules/proc-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", + "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@octokit/auth-token": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.4.tgz", @@ -8313,6 +8304,15 @@ "node": ">=8" } }, + "node_modules/licensee/node_modules/proc-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", + "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/licensee/node_modules/promise-call-limit": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/promise-call-limit/-/promise-call-limit-1.0.2.tgz", @@ -10007,6 +10007,15 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/node-gyp/node_modules/proc-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", + "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", + "inBundle": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/node-html-parser": { "version": "6.1.13", "resolved": "https://registry.npmjs.org/node-html-parser/-/node-html-parser-6.1.13.tgz", @@ -10137,15 +10146,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm-package-arg/node_modules/proc-log": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.0.0.tgz", - "integrity": "sha512-v1lzmYxGDs2+OZnmYtYZK3DG8zogt+CbQ+o/iqqtTfpyCmGWulCTEQu5GIbivf7OjgIkH2Nr8SH8UxAGugZNbg==", - "inBundle": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/npm-packlist": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-8.0.2.tgz", @@ -10186,15 +10186,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm-profile/node_modules/proc-log": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.0.0.tgz", - "integrity": "sha512-v1lzmYxGDs2+OZnmYtYZK3DG8zogt+CbQ+o/iqqtTfpyCmGWulCTEQu5GIbivf7OjgIkH2Nr8SH8UxAGugZNbg==", - "inBundle": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/npm-registry-fetch": { "version": "16.2.1", "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-16.2.1.tgz", @@ -10214,15 +10205,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm-registry-fetch/node_modules/proc-log": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.0.0.tgz", - "integrity": "sha512-v1lzmYxGDs2+OZnmYtYZK3DG8zogt+CbQ+o/iqqtTfpyCmGWulCTEQu5GIbivf7OjgIkH2Nr8SH8UxAGugZNbg==", - "inBundle": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -10799,15 +10781,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/proc-log": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.0.0.tgz", - "integrity": "sha512-v1lzmYxGDs2+OZnmYtYZK3DG8zogt+CbQ+o/iqqtTfpyCmGWulCTEQu5GIbivf7OjgIkH2Nr8SH8UxAGugZNbg==", - "inBundle": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -11061,9 +11034,9 @@ } }, "node_modules/proc-log": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", - "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.0.0.tgz", + "integrity": "sha512-v1lzmYxGDs2+OZnmYtYZK3DG8zogt+CbQ+o/iqqtTfpyCmGWulCTEQu5GIbivf7OjgIkH2Nr8SH8UxAGugZNbg==", "inBundle": true, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -16271,7 +16244,7 @@ "npm-registry-fetch": "^16.2.1", "pacote": "^18.0.0", "parse-conflict-json": "^3.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "proggy": "^2.0.0", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^3.0.1", @@ -16307,7 +16280,7 @@ "ci-info": "^4.0.0", "ini": "^4.1.2", "nopt": "^7.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "read-package-json-fast": "^3.0.2", "semver": "^7.3.5", "walk-up-path": "^3.0.1" @@ -16372,7 +16345,7 @@ "ci-info": "^4.0.0", "npm-package-arg": "^11.0.2", "pacote": "^18.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "read": "^3.0.1", "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", @@ -16470,7 +16443,7 @@ "normalize-package-data": "^6.0.0", "npm-package-arg": "^11.0.2", "npm-registry-fetch": "^16.2.1", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "semver": "^7.3.7", "sigstore": "^2.2.0", "ssri": "^10.0.5" @@ -16527,7 +16500,7 @@ "@npmcli/git": "^5.0.6", "@npmcli/run-script": "^7.0.2", "json-parse-even-better-errors": "^3.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "semver": "^7.3.7" }, "devDependencies": { diff --git a/package.json b/package.json index 3939bf6a3cbbe..1a19a9f2f8565 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "p-map": "^4.0.0", "pacote": "^18.0.0", "parse-conflict-json": "^3.0.1", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "proggy": "^2.0.0", "qrcode-terminal": "^0.12.0", "read": "^3.0.1", diff --git a/scripts/create-node-pr.js b/scripts/create-node-pr.js index 3509512a305ad..b0b4856c0192f 100644 --- a/scripts/create-node-pr.js +++ b/scripts/create-node-pr.js @@ -3,7 +3,7 @@ const fsp = require('fs/promises') const hgi = require('hosted-git-info') const semver = require('semver') const pacote = require('pacote') -const log = require('proc-log') +const { log } = require('proc-log') const tar = require('tar') const { cp, withTempDir } = require('@npmcli/fs') const { CWD, run, spawn, git, fs, gh } = require('./util.js') diff --git a/scripts/dependency-graph.js b/scripts/dependency-graph.js index 8c5f9af50c6a2..6b92c65296f0a 100644 --- a/scripts/dependency-graph.js +++ b/scripts/dependency-graph.js @@ -2,7 +2,7 @@ const Arborist = require('@npmcli/arborist') const os = require('os') const { readFileSync } = require('fs') const { join } = require('path') -const log = require('proc-log') +const { log } = require('proc-log') const { run, CWD, pkg, fs, EOL } = require('./util.js') // Generates our dependency graph documents in DEPENDENCIES.md. diff --git a/scripts/publish.js b/scripts/publish.js index 12f77625fc69e..f27b07fb8e658 100644 --- a/scripts/publish.js +++ b/scripts/publish.js @@ -1,5 +1,5 @@ const semver = require('semver') -const log = require('proc-log') +const { log } = require('proc-log') const pacote = require('pacote') const { read } = require('read') const Table = require('cli-table3') diff --git a/scripts/util.js b/scripts/util.js index b2e9add674714..c842bd26004f3 100644 --- a/scripts/util.js +++ b/scripts/util.js @@ -1,7 +1,7 @@ const fsp = require('fs/promises') const { resolve, join, relative } = require('path') const { formatWithOptions } = require('util') -const log = require('proc-log') +const { log } = require('proc-log') const nopt = require('nopt') const npmGit = require('@npmcli/git') const promiseSpawn = require('@npmcli/promise-spawn') diff --git a/test/fixtures/mock-logs.js b/test/fixtures/mock-logs.js index 3f25737ef4501..c29928130088c 100644 --- a/test/fixtures/mock-logs.js +++ b/test/fixtures/mock-logs.js @@ -1,14 +1,13 @@ -const { LEVELS: PROC_LOC_LEVELS } = require('proc-log') +const { log: { LEVELS } } = require('proc-log') const { stripVTControlCharacters: stripAnsi } = require('util') -const levels = ['timing', ...PROC_LOC_LEVELS] const labels = new Map([ ['error', 'ERR!'], ['warn', 'WARN'], ['verbose', 'verb'], ['silly', 'sill'], ].reduce((acc, v) => acc.concat([v, v.slice(0).reverse()]), [])) -const logPrefix = new RegExp(`^npm (${levels.map(l => labels.get(l) ?? l).join('|')})\\s`) +const logPrefix = new RegExp(`^npm (${LEVELS.map(l => labels.get(l) ?? l).join('|')})\\s`) const isLog = (str) => logPrefix.test(stripAnsi(str)) // We only strip trailing newlines since some output will @@ -35,7 +34,7 @@ module.exports = () => { const levelLogs = [] const logs = Object.defineProperties([], { ...logsByTitle(levelLogs), - ...levels.reduce((acc, level) => { + ...LEVELS.reduce((acc, level) => { acc[level] = { get () { const byLevel = levelLogs.filter((l) => l.level === level) diff --git a/test/lib/utils/display.js b/test/lib/utils/display.js index 9f6b77259feba..a10b0dd621e60 100644 --- a/test/lib/utils/display.js +++ b/test/lib/utils/display.js @@ -5,7 +5,7 @@ const { inspect } = require('util') const mockDisplay = async (t, { mocks, load } = {}) => { const { Chalk } = await import('chalk') - const log = require('proc-log') + const { log } = require('proc-log') const logs = mockLogs() const Display = tmock(t, '{LIB}/utils/display', mocks) const display = new Display(logs.streams) diff --git a/test/lib/utils/read-user-info.js b/test/lib/utils/read-user-info.js index da771ccdf4a98..854277783bb6b 100644 --- a/test/lib/utils/read-user-info.js +++ b/test/lib/utils/read-user-info.js @@ -29,7 +29,9 @@ let logMsg = null const readUserInfo = tmock(t, '{LIB}/utils/read-user-info.js', { read, 'proc-log': { - warn: (msg) => logMsg = msg, + log: { + warn: (msg) => logMsg = msg, + }, }, 'npm-user-validate': npmUserValidate, }) diff --git a/test/lib/utils/tar.js b/test/lib/utils/tar.js index 9653e6058492f..45ba720ac54ed 100644 --- a/test/lib/utils/tar.js +++ b/test/lib/utils/tar.js @@ -9,7 +9,9 @@ t.cleanSnapshot = data => cleanZlib(data) const mockTar = ({ notice }) => tmock(t, '{LIB}/utils/tar.js', { 'proc-log': { - notice, + log: { + notice, + }, }, }) diff --git a/test/lib/utils/timers.js b/test/lib/utils/timers.js index 31f73b5aca408..c395a92a0a3e7 100644 --- a/test/lib/utils/timers.js +++ b/test/lib/utils/timers.js @@ -1,22 +1,24 @@ const t = require('tap') const { resolve, join } = require('path') const fs = require('graceful-fs') -const { format } = require('util') +const { log } = require('proc-log') const tmock = require('../../fixtures/tmock') const mockTimers = (t, options) => { - const logs = { - warn: [], - silly: [], + const logs = log.LEVELS.reduce((acc, l) => { + acc[l] = [] + return acc + }, {}) + const logHandler = (level, ...args) => { + logs[level].push(args.join(' ')) } - const Timers = tmock(t, '{LIB}/utils/timers', { - 'proc-log': { - warn: (...args) => logs.warn.push(args.map((a) => format(a)).join(' ')), - silly: (...args) => logs.silly.push(args.map((a) => format(a)).join(' ')), - }, - }) + process.on('log', logHandler) + const Timers = tmock(t, '{LIB}/utils/timers') const timers = new Timers(options) - t.teardown(() => timers.off()) + t.teardown(() => { + timers.off() + process.off('log', logHandler) + }) return { timers, logs } } @@ -43,23 +45,23 @@ t.test('convenience time method', async (t) => { t.match(timers.finished, { later: Number, sync: Number, async: Number }) }) -t.test('initial timer', async (t) => { - const { timers } = mockTimers(t, { start: 'foo' }) - process.emit('timeEnd', 'foo') - t.match(timers.finished, { foo: Number }) +t.test('initial timer is named npm', async (t) => { + const { timers } = mockTimers(t) + process.emit('timeEnd', 'npm') + t.match(timers.finished, { npm: Number }) }) -t.test('initial listener', async (t) => { +t.test('logs timing events', async (t) => { const events = [] const listener = (...args) => events.push(args) - const { timers } = mockTimers(t, { listener }) + const { timers, logs } = mockTimers(t, { listener }) process.emit('time', 'foo') process.emit('time', 'bar') process.emit('timeEnd', 'bar') timers.off(listener) process.emit('timeEnd', 'foo') - t.equal(events.length, 1) - t.match(events, [['bar', Number]]) + t.equal(logs.timing.length, 1) + t.match(logs.timing[0], /^bar Completed in [0-9]ms/) }) t.test('finish unstarted timer', async (t) => { diff --git a/workspaces/arborist/bin/lib/logging.js b/workspaces/arborist/bin/lib/logging.js index ffb5544b21463..f06716735de74 100644 --- a/workspaces/arborist/bin/lib/logging.js +++ b/workspaces/arborist/bin/lib/logging.js @@ -1,4 +1,4 @@ -const log = require('proc-log') +const { log } = require('proc-log') const fs = require('fs') const { dirname } = require('path') const os = require('os') diff --git a/workspaces/arborist/lib/add-rm-pkg-deps.js b/workspaces/arborist/lib/add-rm-pkg-deps.js index c5cdc097a9fab..2e30eb1de7626 100644 --- a/workspaces/arborist/lib/add-rm-pkg-deps.js +++ b/workspaces/arborist/lib/add-rm-pkg-deps.js @@ -1,6 +1,6 @@ // add and remove dependency specs to/from pkg manifest -const log = require('proc-log') +const { log } = require('proc-log') const localeCompare = require('@isaacs/string-locale-compare')('en') const add = ({ pkg, add, saveBundle, saveType }) => { diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 75e4d373259a0..1daf03b0b466c 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -11,7 +11,7 @@ const treeCheck = require('../tree-check.js') const { readdirScoped } = require('@npmcli/fs') const { lstat, readlink } = require('fs/promises') const { depth } = require('treeverse') -const log = require('proc-log') +const { log } = require('proc-log') const { redact } = require('@npmcli/redact') const { diff --git a/workspaces/arborist/lib/arborist/index.js b/workspaces/arborist/lib/arborist/index.js index 358f3e1b1a759..0f02e1df1582f 100644 --- a/workspaces/arborist/lib/arborist/index.js +++ b/workspaces/arborist/lib/arborist/index.js @@ -30,7 +30,7 @@ const { resolve } = require('path') const { homedir } = require('os') const { depth } = require('treeverse') const mapWorkspaces = require('@npmcli/map-workspaces') -const log = require('proc-log') +const { log } = require('proc-log') const { saveTypeMap } = require('../add-rm-pkg-deps.js') const AuditReport = require('../audit-report.js') diff --git a/workspaces/arborist/lib/arborist/rebuild.js b/workspaces/arborist/lib/arborist/rebuild.js index 422819b2104b7..36dc6ae790fe6 100644 --- a/workspaces/arborist/lib/arborist/rebuild.js +++ b/workspaces/arborist/lib/arborist/rebuild.js @@ -13,7 +13,7 @@ const { isNodeGypPackage, defaultGypInstallScript, } = require('@npmcli/node-gyp') -const log = require('proc-log') +const { log } = require('proc-log') const boolEnv = b => b ? '1' : '' const sortNodes = (a, b) => diff --git a/workspaces/arborist/lib/arborist/reify.js b/workspaces/arborist/lib/arborist/reify.js index a70e21821ecb8..81b81cfd2d665 100644 --- a/workspaces/arborist/lib/arborist/reify.js +++ b/workspaces/arborist/lib/arborist/reify.js @@ -7,7 +7,7 @@ const npa = require('npm-package-arg') const semver = require('semver') const debug = require('../debug.js') const { walkUp } = require('walk-up-path') -const log = require('proc-log') +const { log } = require('proc-log') const hgi = require('hosted-git-info') const rpj = require('read-package-json-fast') diff --git a/workspaces/arborist/lib/audit-report.js b/workspaces/arborist/lib/audit-report.js index 387919f610829..7e5ac2071dcbe 100644 --- a/workspaces/arborist/lib/audit-report.js +++ b/workspaces/arborist/lib/audit-report.js @@ -13,7 +13,7 @@ const _fixAvailable = Symbol('fixAvailable') const _checkTopNode = Symbol('checkTopNode') const _init = Symbol('init') const _omit = Symbol('omit') -const log = require('proc-log') +const { log } = require('proc-log') const fetch = require('npm-registry-fetch') diff --git a/workspaces/arborist/lib/place-dep.js b/workspaces/arborist/lib/place-dep.js index bf0fef6525343..fca36eb685613 100644 --- a/workspaces/arborist/lib/place-dep.js +++ b/workspaces/arborist/lib/place-dep.js @@ -8,7 +8,7 @@ // a result. const localeCompare = require('@isaacs/string-locale-compare')('en') -const log = require('proc-log') +const { log } = require('proc-log') const { redact } = require('@npmcli/redact') const deepestNestingTarget = require('./deepest-nesting-target.js') const CanPlaceDep = require('./can-place-dep.js') diff --git a/workspaces/arborist/lib/query-selector-all.js b/workspaces/arborist/lib/query-selector-all.js index c8ec866f0f969..d001a5cced83d 100644 --- a/workspaces/arborist/lib/query-selector-all.js +++ b/workspaces/arborist/lib/query-selector-all.js @@ -3,7 +3,7 @@ const { resolve } = require('path') const { parser, arrayDelimiter } = require('@npmcli/query') const localeCompare = require('@isaacs/string-locale-compare')('en') -const log = require('proc-log') +const { log } = require('proc-log') const { minimatch } = require('minimatch') const npa = require('npm-package-arg') const pacote = require('pacote') diff --git a/workspaces/arborist/lib/shrinkwrap.js b/workspaces/arborist/lib/shrinkwrap.js index 275043d1208b7..026abc55ccba1 100644 --- a/workspaces/arborist/lib/shrinkwrap.js +++ b/workspaces/arborist/lib/shrinkwrap.js @@ -33,7 +33,7 @@ const mismatch = (a, b) => a && b && a !== b // After calling this.commit(), any nodes not present in the tree will have // been removed from the shrinkwrap data as well. -const log = require('proc-log') +const { log } = require('proc-log') const YarnLock = require('./yarn-lock.js') const { readFile, diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index d81c8774cddf5..404117ff8c695 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -28,7 +28,7 @@ "npm-registry-fetch": "^16.2.1", "pacote": "^18.0.0", "parse-conflict-json": "^3.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "proggy": "^2.0.0", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^3.0.1", diff --git a/workspaces/config/lib/index.js b/workspaces/config/lib/index.js index 1ff19c128696c..0d7ba3eb21f4e 100644 --- a/workspaces/config/lib/index.js +++ b/workspaces/config/lib/index.js @@ -2,7 +2,7 @@ const { walkUp } = require('walk-up-path') const ini = require('ini') const nopt = require('nopt') -const log = require('proc-log') +const { log } = require('proc-log') const { resolve, dirname, join } = require('node:path') const { homedir } = require('node:os') diff --git a/workspaces/config/package.json b/workspaces/config/package.json index 797c32f7ee4a6..bbfca367a1c24 100644 --- a/workspaces/config/package.json +++ b/workspaces/config/package.json @@ -40,7 +40,7 @@ "ci-info": "^4.0.0", "ini": "^4.1.2", "nopt": "^7.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "read-package-json-fast": "^3.0.2", "semver": "^7.3.5", "walk-up-path": "^3.0.1" diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index af4d6e738779a..8d7dfa27dd42b 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -4,7 +4,7 @@ const { mkdir } = require('fs/promises') const Arborist = require('@npmcli/arborist') const ciInfo = require('ci-info') const crypto = require('crypto') -const log = require('proc-log') +const { log } = require('proc-log') const npa = require('npm-package-arg') const pacote = require('pacote') const { read } = require('read') diff --git a/workspaces/libnpmexec/lib/run-script.js b/workspaces/libnpmexec/lib/run-script.js index 65fabfc480b8c..2e8f728c204ae 100644 --- a/workspaces/libnpmexec/lib/run-script.js +++ b/workspaces/libnpmexec/lib/run-script.js @@ -1,7 +1,7 @@ const ciInfo = require('ci-info') const runScript = require('@npmcli/run-script') const readPackageJson = require('read-package-json-fast') -const log = require('proc-log') +const { log } = require('proc-log') const noTTY = require('./no-tty.js') const run = async ({ diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index e6c43c893897e..53765d7237668 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -64,7 +64,7 @@ "ci-info": "^4.0.0", "npm-package-arg": "^11.0.2", "pacote": "^18.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "read": "^3.0.1", "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", diff --git a/workspaces/libnpmexec/test/local.js b/workspaces/libnpmexec/test/local.js index 19595187e265f..ddfb8f5429e1a 100644 --- a/workspaces/libnpmexec/test/local.js +++ b/workspaces/libnpmexec/test/local.js @@ -1,4 +1,4 @@ -const log = require('proc-log') +const { log } = require('proc-log') const { resolve } = require('path') const t = require('tap') const fs = require('fs/promises') @@ -283,9 +283,11 @@ t.test('local file system path', async t => { mocks: { 'ci-info': { isCI: true }, 'proc-log': { - ...log, - warn () { - t.fail('should not warn about local file package install') + log: { + ...log, + warn () { + t.fail('should not warn about local file package install') + }, }, }, }, diff --git a/workspaces/libnpmexec/test/prompt.js b/workspaces/libnpmexec/test/prompt.js index d1f4ec48e6b98..5edcff9a3d9cb 100644 --- a/workspaces/libnpmexec/test/prompt.js +++ b/workspaces/libnpmexec/test/prompt.js @@ -1,4 +1,4 @@ -const log = require('proc-log') +const { log } = require('proc-log') const { resolve } = require('path') const t = require('tap') const fs = require('fs/promises') @@ -146,18 +146,20 @@ t.test('no prompt if CI, multiple packages', async t => { mocks: { 'ci-info': { isCI: true }, 'proc-log': { - ...log, - warn (title, msg) { - t.equal(title, 'exec', 'should warn exec title') - // this message is nondeterministic as it queries manifests so we just - // test the constituent parts - t.match( - msg, - 'The following packages were not found and will be installed:', - 'should warn installing packages' - ) - t.match(msg, '@npmcli/create-index@1.0.0', 'includes package being installed') - t.match(msg, '@npmcli/create-test@1.0.0', 'includes package being installed') + log: { + ...log, + warn (title, msg) { + t.equal(title, 'exec', 'should warn exec title') + // this message is nondeterministic as it queries manifests so we just + // test the constituent parts + t.match( + msg, + 'The following packages were not found and will be installed:', + 'should warn installing packages' + ) + t.match(msg, '@npmcli/create-index@1.0.0', 'includes package being installed') + t.match(msg, '@npmcli/create-test@1.0.0', 'includes package being installed') + }, }, }, }, diff --git a/workspaces/libnpmexec/test/run-script.js b/workspaces/libnpmexec/test/run-script.js index e7c83466334fd..1197b0a6da0aa 100644 --- a/workspaces/libnpmexec/test/run-script.js +++ b/workspaces/libnpmexec/test/run-script.js @@ -101,13 +101,15 @@ t.test('ci env', async t => { }, '../lib/no-tty.js': () => false, 'proc-log': { - warn (title, msg) { - t.equal(title, 'exec', 'should have expected title') - t.equal( - msg, - 'Interactive mode disabled in CI environment', - 'should have expected ci environment message' - ) + log: { + warn (title, msg) { + t.equal(title, 'exec', 'should have expected title') + t.equal( + msg, + 'Interactive mode disabled in CI environment', + 'should have expected ci environment message' + ) + }, }, }, }) diff --git a/workspaces/libnpmpublish/lib/publish.js b/workspaces/libnpmpublish/lib/publish.js index b0ef782a166c6..9ffbc93426309 100644 --- a/workspaces/libnpmpublish/lib/publish.js +++ b/workspaces/libnpmpublish/lib/publish.js @@ -1,7 +1,7 @@ const { fixer } = require('normalize-package-data') const npmFetch = require('npm-registry-fetch') const npa = require('npm-package-arg') -const log = require('proc-log') +const { log } = require('proc-log') const semver = require('semver') const { URL } = require('url') const ssri = require('ssri') diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index afbf8d5b6df7a..d485e99b68ae0 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -42,7 +42,7 @@ "normalize-package-data": "^6.0.0", "npm-package-arg": "^11.0.2", "npm-registry-fetch": "^16.2.1", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "semver": "^7.3.7", "sigstore": "^2.2.0", "ssri": "^10.0.5" diff --git a/workspaces/libnpmpublish/test/publish.js b/workspaces/libnpmpublish/test/publish.js index 584508d34fe03..b9875097bf538 100644 --- a/workspaces/libnpmpublish/test/publish.js +++ b/workspaces/libnpmpublish/test/publish.js @@ -385,7 +385,7 @@ t.test('publish existing package with provenance in gha', async t => { const log = [] const { publish } = t.mock('..', { 'ci-info': t.mock('ci-info'), - 'proc-log': { notice: (...msg) => log.push(['notice', ...msg]) }, + 'proc-log': { log: { notice: (...msg) => log.push(['notice', ...msg]) } }, }) const registry = new MockRegistry({ tap: t, @@ -944,7 +944,7 @@ t.test('publish existing package with provenance in gitlab', async t => { const log = [] const { publish } = t.mock('..', { 'ci-info': t.mock('ci-info'), - 'proc-log': { notice: (...msg) => log.push(['notice', ...msg]) }, + 'proc-log': { log: { notice: (...msg) => log.push(['notice', ...msg]) } }, }) const registry = new MockRegistry({ tap: t, diff --git a/workspaces/libnpmversion/lib/enforce-clean.js b/workspaces/libnpmversion/lib/enforce-clean.js index 721f146221c15..25ebb5590e917 100644 --- a/workspaces/libnpmversion/lib/enforce-clean.js +++ b/workspaces/libnpmversion/lib/enforce-clean.js @@ -1,5 +1,5 @@ const git = require('@npmcli/git') -const log = require('proc-log') +const { log } = require('proc-log') // returns true if it's cool to do git stuff // throws if it's unclean, and not forced. diff --git a/workspaces/libnpmversion/lib/version.js b/workspaces/libnpmversion/lib/version.js index f14b95e3233f0..499a864bb71c0 100644 --- a/workspaces/libnpmversion/lib/version.js +++ b/workspaces/libnpmversion/lib/version.js @@ -8,7 +8,7 @@ const readJson = require('./read-json.js') const git = require('@npmcli/git') const commit = require('./commit.js') const tag = require('./tag.js') -const log = require('proc-log') +const { log } = require('proc-log') const runScript = require('@npmcli/run-script') diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index c33e628222e88..1cac7e02e00ba 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -40,7 +40,7 @@ "@npmcli/git": "^5.0.6", "@npmcli/run-script": "^7.0.2", "json-parse-even-better-errors": "^3.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "semver": "^7.3.7" }, "engines": { diff --git a/workspaces/libnpmversion/test/enforce-clean.js b/workspaces/libnpmversion/test/enforce-clean.js index 3badf47ea5bc4..a4af3061116bd 100644 --- a/workspaces/libnpmversion/test/enforce-clean.js +++ b/workspaces/libnpmversion/test/enforce-clean.js @@ -16,7 +16,7 @@ const enforceClean = requireInject('../lib/enforce-clean.js', { } }, }, - 'proc-log': { warn: (...msg) => warnings.push(msg) }, + 'proc-log': { log: { warn: (...msg) => warnings.push(msg) } }, }) const warnings = [] diff --git a/workspaces/libnpmversion/test/version.js b/workspaces/libnpmversion/test/version.js index 2cbd615c56916..e026de900a627 100644 --- a/workspaces/libnpmversion/test/version.js +++ b/workspaces/libnpmversion/test/version.js @@ -23,7 +23,9 @@ const version = requireInject('../lib/version.js', { '@npmcli/git': gitMock, '@npmcli/run-script': async opt => actionLog.push(['run-script', opt.event, opt.env, opt]), 'proc-log': { - verbose: (...msg) => actionLog.push(['verbose', ...msg]), + log: { + verbose: (...msg) => actionLog.push(['verbose', ...msg]), + }, }, })