Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps updates #7449

Merged
merged 5 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ graph LR;
make-fetch-happen-->cacache;
make-fetch-happen-->minipass-fetch;
make-fetch-happen-->npmcli-agent["@npmcli/agent"];
make-fetch-happen-->proc-log;
hashtagchris marked this conversation as resolved.
Show resolved Hide resolved
make-fetch-happen-->ssri;
nopt-->abbrev;
normalize-package-data-->hosted-git-info;
Expand Down Expand Up @@ -427,6 +428,7 @@ graph LR;
make-fetch-happen-->minipass;
make-fetch-happen-->negotiator;
make-fetch-happen-->npmcli-agent["@npmcli/agent"];
make-fetch-happen-->proc-log;
make-fetch-happen-->promise-retry;
make-fetch-happen-->ssri;
minimatch-->brace-expansion;
Expand Down
2 changes: 1 addition & 1 deletion bin/npx-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const removed = new Set([

const { definitions, shorthands } = require('@npmcli/config/lib/definitions')
const npmSwitches = Object.entries(definitions)
.filter(([key, { type }]) => type === Boolean ||
.filter(([, { type }]) => type === Boolean ||
(Array.isArray(type) && type.includes(Boolean)))
.map(([key]) => key)

Expand Down
2 changes: 1 addition & 1 deletion docs/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const replaceConfig = (src, { path }) => {
}

const allConfig = Object.entries(definitions).sort(sort)
.map(([_, def]) => def.describe())
.map(([, def]) => def.describe())
.join('\n\n')

return src.replace(replacer, allConfig)
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/adduser.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AddUser extends BaseCommand {
'auth-type',
]

async exec (args) {
async exec () {
const scope = this.npm.config.get('scope')
let registry = this.npm.config.get('registry')

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CI extends ArboristWorkspaceCmd {
await time.start('npm-ci:rm', async () => {
const path = `${where}/node_modules`
// get the list of entries so we can skip the glob for performance
const entries = await fs.readdir(path, null).catch(er => [])
const entries = await fs.readdir(path, null).catch(() => [])
return Promise.all(entries.map(f => fs.rm(`${path}/${f}`,
{ force: true, recursive: true })))
})
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const configCompl = opts => {

// expand with the valid values of various config values.
// not yet implemented.
const configValueCompl = opts => []
const configValueCompl = () => []

// check if the thing is a flag or not.
const isFlag = word => {
Expand All @@ -265,7 +265,7 @@ const isFlag = word => {

// complete against the npm commands
// if they all resolve to the same thing, just return the thing it already is
const cmdCompl = (opts, npm) => {
const cmdCompl = (opts) => {
const allCommands = commands.concat(Object.keys(aliases))
const matches = allCommands.filter(c => c.startsWith(opts.partialWord))
if (!matches.length) {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/dedupe.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Dedupe extends ArboristWorkspaceCmd {
...super.params,
]

async exec (args) {
async exec () {
if (this.npm.global) {
const er = new Error('`npm dedupe` does not work in global mode.')
er.code = 'EDEDUPEGLOBAL'
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Diff extends BaseCommand {

// get the package name from the packument at `path`
// throws if no packument is present OR if it does not have `name` attribute
async packageName (path) {
async packageName () {
let name
try {
const { content: pkg } = await pkgJson.normalize(this.prefix)
Expand All @@ -103,7 +103,7 @@ class Diff extends BaseCommand {
// no arguments, defaults to comparing cwd
// to its latest published registry version
if (!a) {
const pkgName = await this.packageName(this.prefix)
const pkgName = await this.packageName()
return [
`${pkgName}@${this.npm.config.get('tag')}`,
`file:${this.prefix.replace(/#/g, '%23')}`,
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/doctor.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class Doctor extends BaseCommand {
}

if (st.isDirectory()) {
const entries = await readdir(f).catch(er => {
const entries = await readdir(f).catch(() => {
ok = false
log.warn('doctor', 'checkFilesPermission', 'error reading directory ' + f)
return []
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/find-dupes.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class FindDupes extends ArboristWorkspaceCmd {
...super.params,
]

async exec (args) {
async exec () {
this.npm.config.set('dry-run', true)
return this.npm.exec('dedupe', [])
}
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/help-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class HelpSearch extends BaseCommand {
// preserve glob@8 behavior
files = files.sort((a, b) => a.localeCompare(b, 'en'))
const data = await this.readFiles(files)
const results = await this.searchFiles(args, data, files)
const results = await this.searchFiles(args, data)
const formatted = this.formatResults(args, results)
if (!formatted.trim()) {
output.standard(`No matches in help for: ${args.join(' ')}\n`)
Expand All @@ -40,7 +40,7 @@ class HelpSearch extends BaseCommand {
return res
}

async searchFiles (args, data, files) {
async searchFiles (args, data) {
const results = []
for (const [file, content] of Object.entries(data)) {
const lowerCase = content.toLowerCase()
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Login extends BaseCommand {
'auth-type',
]

async exec (args) {
async exec () {
const scope = this.npm.config.get('scope')
let registry = this.npm.config.get('registry')

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Logout extends BaseCommand {
'scope',
]

async exec (args) {
async exec () {
const registry = this.npm.config.get('registry')
const scope = this.npm.config.get('scope')
const regRef = scope ? `${scope}:registry` : 'registry'
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/outdated.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class Outdated extends ArboristWorkspaceCmd {
this.edges.add(edge)
}

getWorkspacesEdges (node) {
getWorkspacesEdges () {
if (this.npm.global) {
return
}
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Ping extends BaseCommand {
static params = ['registry']
static name = 'ping'

async exec (args) {
async exec () {
const cleanRegistry = redact(this.npm.config.get('registry'))
log.notice('PING', cleanRegistry)
const start = Date.now()
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Prefix extends BaseCommand {
static params = ['global']
static usage = ['[-g]']

async exec (args) {
async exec () {
return output.standard(this.npm.prefix)
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class Profile extends BaseCommand {
}
}

async disable2fa (args) {
async disable2fa () {
const conf = { ...this.npm.flatOptions }
const info = await npmProfile.get(conf)

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Publish extends BaseCommand {
return pkgContents
}

async execWorkspaces (args) {
async execWorkspaces () {
// Suppresses JSON output in publish() so we can handle it here
this.suppressOutput = true

Expand Down
6 changes: 3 additions & 3 deletions lib/commands/run-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RunScript extends BaseCommand {
const argv = opts.conf.argv.remain
if (argv.length === 2) {
const { content: { scripts = {} } } = await pkgJson.normalize(npm.localPrefix)
.catch(er => ({ content: {} }))
.catch(() => ({ content: {} }))
if (opts.isFish) {
return Object.keys(scripts).map(s => `${s}\t${scripts[s].slice(0, 30)}`)
}
Expand Down Expand Up @@ -185,7 +185,7 @@ class RunScript extends BaseCommand {
return allScripts
}

async runWorkspaces (args, filters) {
async runWorkspaces (args) {
const res = []
await this.setWorkspaces()

Expand All @@ -205,7 +205,7 @@ class RunScript extends BaseCommand {
}
}

async listWorkspaces (args, filters) {
async listWorkspaces (args) {
await this.setWorkspaces()

if (this.npm.silent) {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Token extends BaseCommand {
}
}

async create (args) {
async create () {
const json = this.npm.config.get('json')
const parseable = this.npm.config.get('parseable')
const cidr = this.npm.config.get('cidr')
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/whoami.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Whoami extends BaseCommand {
static name = 'whoami'
static params = ['registry']

async exec (args) {
async exec () {
const username = await getIdentity(this.npm, { ...this.npm.flatOptions })
output.standard(
this.npm.config.get('json') ? JSON.stringify(username) : username
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const adduser = async (npm, { creds, ...opts }) => {
// password, it's effectively a login, and if that account has otp you'll
// be prompted for it.
res = await otplease(npm, opts, (reqOpts) =>
profile.adduserCouch(username, email, password, opts)
profile.adduserCouch(username, email, password, reqOpts)
)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/explain-dep.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const explainLinksIn = ({ linksIn }, depth, chalk) => {
return str.split('\n').join('\n ')
}

const explainDependents = ({ name, dependents }, depth, chalk) => {
const explainDependents = ({ dependents }, depth, chalk) => {
if (!dependents || !dependents.length || depth <= 0) {
return ''
}
Expand Down
2 changes: 1 addition & 1 deletion mock-registry/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class MockRegistry {
})
}

webadduser ({ username, password, token = 'npm_default-test-token' }) {
webadduser ({ token = 'npm_default-test-token' }) {
const doneUrl = new URL('/npm-cli-test/done', this.origin).href
const loginUrl = new URL('/npm-cli-test/login', this.origin).href
this.nock = this.nock
Expand Down
4 changes: 1 addition & 3 deletions node_modules/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@
!/ini
!/init-package-json
!/ip-address
!/ip-address/node_modules/
/ip-address/node_modules/*
!/ip-address/node_modules/sprintf-js
!/ip-regex
!/is-cidr
!/is-core-module
Expand Down Expand Up @@ -199,6 +196,7 @@
!/spdx-exceptions
!/spdx-expression-parse
!/spdx-license-ids
!/sprintf-js
hashtagchris marked this conversation as resolved.
Show resolved Hide resolved
!/ssri
!/string-width-cjs
!/string-width
Expand Down
2 changes: 2 additions & 0 deletions node_modules/lru-cache/dist/commonjs/index.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions node_modules/lru-cache/dist/esm/index.min.js

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions node_modules/lru-cache/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lru-cache",
"description": "A cache object that deletes the least-recently-used items.",
"version": "10.2.0",
"version": "10.2.2",
"author": "Isaac Z. Schlueter <i@izs.me>",
"keywords": [
"mru",
Expand All @@ -11,8 +11,7 @@
"sideEffects": false,
"scripts": {
"build": "npm run prepare",
"prepare": "tshy",
"postprepare": "bash fixup.sh",
"prepare": "tshy && bash fixup.sh",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "tap",
Expand All @@ -35,8 +34,8 @@
".": "./src/index.ts",
"./min": {
"import": {
"types": "./dist/mjs/index.d.ts",
"default": "./dist/mjs/index.min.js"
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.min.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
Expand Down Expand Up @@ -105,8 +104,8 @@
},
"./min": {
"import": {
"types": "./dist/mjs/index.d.ts",
"default": "./dist/mjs/index.min.js"
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.min.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions node_modules/make-fetch-happen/lib/cache/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ class CacheEntry {
const cacheWritePromise = new Promise((resolve, reject) => {
cacheWriteResolve = resolve
cacheWriteReject = reject
}).catch((err) => {
body.emit('error', err)
})

body = new CachingMinipassPipeline({ events: ['integrity', 'size'] }, new MinipassFlush({
Expand Down
4 changes: 4 additions & 0 deletions node_modules/make-fetch-happen/lib/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { Minipass } = require('minipass')
const fetch = require('minipass-fetch')
const promiseRetry = require('promise-retry')
const ssri = require('ssri')
const { log } = require('proc-log')

const CachingMinipassPipeline = require('./pipeline.js')
const { getAgent } = require('@npmcli/agent')
Expand Down Expand Up @@ -89,6 +90,8 @@ const remoteFetch = (request, options) => {
options.onRetry(res)
}

/* eslint-disable-next-line max-len */
log.http('fetch', `${req.method} ${req.url} attempt ${attemptNum} failed with ${res.status}`)
return retryHandler(res)
}

Expand All @@ -112,6 +115,7 @@ const remoteFetch = (request, options) => {
options.onRetry(err)
}

log.http('fetch', `${req.method} ${req.url} attempt ${attemptNum} failed with ${err.code}`)
return retryHandler(err)
}
}, options.retry).catch((err) => {
Expand Down
Loading
Loading