Skip to content

Commit

Permalink
deps: strip-ansi@7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Nov 14, 2023
1 parent cd0c649 commit 8c5882f
Show file tree
Hide file tree
Showing 36 changed files with 513 additions and 204 deletions.
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
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
25 changes: 21 additions & 4 deletions node_modules/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
!/@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/*
Expand Down Expand Up @@ -72,13 +70,19 @@
!/cidr-regex
!/clean-stack
!/cli-columns
!/cli-columns/node_modules/
/cli-columns/node_modules/*
!/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/strip-ansi
!/common-ancestor-path
!/console-control-strings
!/cross-spawn
Expand Down Expand Up @@ -106,6 +110,9 @@
!/fs-minipass
!/function-bind
!/gauge
!/gauge/node_modules/
/gauge/node_modules/*
!/gauge/node_modules/strip-ansi
!/glob
!/graceful-fs
!/has-unicode
Expand Down Expand Up @@ -219,9 +226,18 @@
!/ssri
!/string_decoder
!/string-width-cjs
!/string-width-cjs/node_modules/
/string-width-cjs/node_modules/*
!/string-width-cjs/node_modules/strip-ansi
!/string-width
!/string-width/node_modules/
/string-width/node_modules/*
!/string-width/node_modules/strip-ansi
!/strip-ansi-cjs
!/strip-ansi
!/strip-ansi/node_modules/
/strip-ansi/node_modules/*
!/strip-ansi/node_modules/ansi-regex
!/supports-color
!/tar
!/tar/node_modules/
Expand All @@ -248,14 +264,15 @@
!/which/node_modules/isexe
!/wide-align
!/wrap-ansi-cjs
!/wrap-ansi-cjs/node_modules/
/wrap-ansi-cjs/node_modules/*
!/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
14 changes: 0 additions & 14 deletions node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js

This file was deleted.

4 changes: 4 additions & 0 deletions node_modules/cli-columns/node_modules/strip-ansi/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';
const ansiRegex = require('ansi-regex');

module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{
"name": "strip-ansi",
"version": "7.1.0",
"version": "6.0.1",
"description": "Strip ANSI escape codes from a string",
"license": "MIT",
"repository": "chalk/strip-ansi",
"funding": "https://github.com/chalk/strip-ansi?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
"url": "sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
Expand Down Expand Up @@ -47,11 +44,11 @@
"text"
],
"dependencies": {
"ansi-regex": "^6.0.1"
"ansi-regex": "^5.0.1"
},
"devDependencies": {
"ava": "^3.15.0",
"tsd": "^0.17.0",
"xo": "^0.44.0"
"ava": "^2.4.0",
"tsd": "^0.10.0",
"xo": "^0.25.3"
}
}
4 changes: 4 additions & 0 deletions node_modules/columnify/node_modules/strip-ansi/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';
const ansiRegex = require('ansi-regex');

module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{
"name": "strip-ansi",
"version": "7.1.0",
"version": "6.0.1",
"description": "Strip ANSI escape codes from a string",
"license": "MIT",
"repository": "chalk/strip-ansi",
"funding": "https://github.com/chalk/strip-ansi?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
"url": "sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
Expand Down Expand Up @@ -47,11 +44,11 @@
"text"
],
"dependencies": {
"ansi-regex": "^6.0.1"
"ansi-regex": "^5.0.1"
},
"devDependencies": {
"ava": "^3.15.0",
"tsd": "^0.17.0",
"xo": "^0.44.0"
"ava": "^2.4.0",
"tsd": "^0.10.0",
"xo": "^0.25.3"
}
}
4 changes: 4 additions & 0 deletions node_modules/gauge/node_modules/strip-ansi/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';
const ansiRegex = require('ansi-regex');

module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
54 changes: 54 additions & 0 deletions node_modules/gauge/node_modules/strip-ansi/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "strip-ansi",
"version": "6.0.1",
"description": "Strip ANSI escape codes from a string",
"license": "MIT",
"repository": "chalk/strip-ansi",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"strip",
"trim",
"remove",
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"dependencies": {
"ansi-regex": "^5.0.1"
},
"devDependencies": {
"ava": "^2.4.0",
"tsd": "^0.10.0",
"xo": "^0.25.3"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';
const ansiRegex = require('ansi-regex');

module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
9 changes: 9 additions & 0 deletions node_modules/string-width-cjs/node_modules/strip-ansi/license
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 8c5882f

Please sign in to comment.