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 #6994

Merged
merged 11 commits into from
Nov 14, 2023
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
5 changes: 3 additions & 2 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ graph LR;
glob-->minimatch;
glob-->minipass;
glob-->path-scurry;
has-->function-bind;
hasown-->function-bind;
hosted-git-info-->lru-cache;
http-proxy-agent-->agent-base;
http-proxy-agent-->debug;
Expand All @@ -334,7 +334,7 @@ graph LR;
init-package-json-->validate-npm-package-license;
init-package-json-->validate-npm-package-name;
is-cidr-->cidr-regex;
is-core-module-->has;
is-core-module-->hasown;
isaacs-cliui-->string-width-cjs;
isaacs-cliui-->string-width;
isaacs-cliui-->strip-ansi-cjs;
Expand Down Expand Up @@ -441,6 +441,7 @@ graph LR;
libnpmversion-->require-inject;
libnpmversion-->semver;
libnpmversion-->tap;
lru-cache-->semver;
lru-cache-->yallist;
make-fetch-happen-->cacache;
make-fetch-happen-->http-cache-semantics;
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/outdated.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const npa = require('npm-package-arg')
const pickManifest = require('npm-pick-manifest')
const localeCompare = require('@isaacs/string-locale-compare')('en')

const ansiTrim = require('strip-ansi')
const ArboristWorkspaceCmd = require('../arborist-cmd.js')

class Outdated extends ArboristWorkspaceCmd {
Expand All @@ -23,6 +22,7 @@ class Outdated extends ArboristWorkspaceCmd {
]

async exec (args) {
const { default: stripAnsi } = await import('strip-ansi')
const global = resolve(this.npm.globalDir, '..')
const where = this.npm.global
? global
Expand Down Expand Up @@ -106,7 +106,7 @@ class Outdated extends ArboristWorkspaceCmd {

const tableOpts = {
align: ['l', 'r', 'r', 'r', 'l'],
stringLength: s => ansiTrim(s).length,
stringLength: s => stripAnsi(s).length,
}
this.npm.output(table(outTable, tableOpts))
}
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Search extends BaseCommand {

// Grab a configured output stream that will spit out packages in the
// desired format.
const outputStream = formatSearchStream({
const outputStream = await formatSearchStream({
args, // --searchinclude options are not highlighted
...opts,
})
Expand Down
16 changes: 9 additions & 7 deletions lib/utils/format-search-stream.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { Minipass } = require('minipass')
const columnify = require('columnify')
const ansiTrim = require('strip-ansi')

// This module consumes package data in the following format:
//
Expand All @@ -16,7 +15,10 @@ const ansiTrim = require('strip-ansi')
// The returned stream will format this package data
// into a byte stream of formatted, displayable output.

module.exports = (opts) => {
let stripAnsi
module.exports = async (opts) => {
stripAnsi = await import('strip-ansi')
stripAnsi = stripAnsi.default
lukekarrys marked this conversation as resolved.
Show resolved Hide resolved
return opts.json ? new JSONOutputStream() : new TextOutputStream(opts)
}

Expand Down Expand Up @@ -142,13 +144,13 @@ function highlightSearchTerms (str, terms) {

function normalizePackage (data, opts) {
return {
name: ansiTrim(data.name),
description: ansiTrim(data.description ?? ''),
author: data.maintainers.map((m) => `=${ansiTrim(m.username)}`).join(' '),
name: stripAnsi(data.name),
description: stripAnsi(data.description ?? ''),
author: data.maintainers.map((m) => `=${stripAnsi(m.username)}`).join(' '),
keywords: Array.isArray(data.keywords)
? data.keywords.map(ansiTrim).join(' ')
? data.keywords.map(stripAnsi).join(' ')
: typeof data.keywords === 'string'
? ansiTrim(data.keywords.replace(/[,\s]+/, ' '))
? stripAnsi(data.keywords.replace(/[,\s]+/, ' '))
: '',
version: data.version,
date: (data.date &&
Expand Down
48 changes: 36 additions & 12 deletions node_modules/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,16 @@
!/@isaacs/cliui
!/@isaacs/cliui/node_modules/
/@isaacs/cliui/node_modules/*
!/@isaacs/cliui/node_modules/ansi-regex
!/@isaacs/cliui/node_modules/emoji-regex
!/@isaacs/cliui/node_modules/string-width
!/@isaacs/cliui/node_modules/strip-ansi
!/@isaacs/string-locale-compare
!/@npmcli/
/@npmcli/*
!/@npmcli/agent
!/@npmcli/agent/node_modules/
/@npmcli/agent/node_modules/*
!/@npmcli/agent/node_modules/agent-base
!/@npmcli/agent/node_modules/http-proxy-agent
!/@npmcli/agent/node_modules/https-proxy-agent
!/@npmcli/agent/node_modules/socks-proxy-agent
!/@npmcli/disparity-colors
!/@npmcli/disparity-colors/node_modules/
/@npmcli/disparity-colors/node_modules/*
!/@npmcli/disparity-colors/node_modules/ansi-styles
!/@npmcli/fs
!/@npmcli/git
!/@npmcli/installed-package-contents
Expand All @@ -52,6 +47,7 @@
!/@tufjs/models
!/abbrev
!/abort-controller
!/agent-base
!/aggregate-error
!/ansi-regex
!/ansi-styles
Expand All @@ -72,13 +68,21 @@
!/cidr-regex
!/clean-stack
!/cli-columns
!/cli-columns/node_modules/
/cli-columns/node_modules/*
!/cli-columns/node_modules/ansi-regex
!/cli-columns/node_modules/strip-ansi
!/cli-table3
!/clone
!/cmd-shim
!/color-convert
!/color-name
!/color-support
!/columnify
!/columnify/node_modules/
/columnify/node_modules/*
!/columnify/node_modules/ansi-regex
!/columnify/node_modules/strip-ansi
!/common-ancestor-path
!/console-control-strings
!/cross-spawn
Expand Down Expand Up @@ -106,12 +110,18 @@
!/fs-minipass
!/function-bind
!/gauge
!/gauge/node_modules/
/gauge/node_modules/*
!/gauge/node_modules/ansi-regex
!/gauge/node_modules/strip-ansi
!/glob
!/graceful-fs
!/has-unicode
!/has
!/hasown
!/hosted-git-info
!/http-cache-semantics
!/http-proxy-agent
!/https-proxy-agent
!/iconv-lite
!/ieee754
!/ignore-walk
Expand Down Expand Up @@ -211,6 +221,7 @@
!/signal-exit
!/sigstore
!/smart-buffer
!/socks-proxy-agent
!/socks
!/spdx-correct
!/spdx-exceptions
Expand All @@ -219,8 +230,19 @@
!/ssri
!/string_decoder
!/string-width-cjs
!/string-width-cjs/node_modules/
/string-width-cjs/node_modules/*
!/string-width-cjs/node_modules/ansi-regex
!/string-width-cjs/node_modules/strip-ansi
!/string-width
!/string-width/node_modules/
/string-width/node_modules/*
!/string-width/node_modules/ansi-regex
!/string-width/node_modules/strip-ansi
!/strip-ansi-cjs
!/strip-ansi-cjs/node_modules/
/strip-ansi-cjs/node_modules/*
!/strip-ansi-cjs/node_modules/ansi-regex
!/strip-ansi
!/supports-color
!/tar
Expand Down Expand Up @@ -248,14 +270,16 @@
!/which/node_modules/isexe
!/wide-align
!/wrap-ansi-cjs
!/wrap-ansi-cjs/node_modules/
/wrap-ansi-cjs/node_modules/*
!/wrap-ansi-cjs/node_modules/ansi-regex
!/wrap-ansi-cjs/node_modules/ansi-styles
!/wrap-ansi-cjs/node_modules/strip-ansi
!/wrap-ansi
!/wrap-ansi/node_modules/
/wrap-ansi/node_modules/*
!/wrap-ansi/node_modules/ansi-regex
!/wrap-ansi/node_modules/ansi-styles
!/wrap-ansi/node_modules/emoji-regex
!/wrap-ansi/node_modules/string-width
!/wrap-ansi/node_modules/strip-ansi
!/write-file-atomic
!/yallist
# Always ignore some specific patterns within any allowed package
Expand Down
8 changes: 0 additions & 8 deletions node_modules/@isaacs/cliui/node_modules/ansi-regex/index.js

This file was deleted.

14 changes: 0 additions & 14 deletions node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js

This file was deleted.

Loading
Loading