From 8c5882f3eed305bbd3514d7143f9d92e9577e1b9 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 14 Nov 2023 09:56:27 -0800 Subject: [PATCH] deps: strip-ansi@7.1.0 --- lib/commands/outdated.js | 4 +- lib/commands/search.js | 2 +- lib/utils/format-search-stream.js | 16 +- node_modules/.gitignore | 25 +- .../cliui/node_modules/strip-ansi/index.js | 14 -- .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi}/license | 2 +- .../node_modules/strip-ansi/package.json | 17 +- .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 2 +- .../node_modules/strip-ansi/package.json | 17 +- .../gauge/node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 2 +- .../node_modules/strip-ansi/package.json | 54 +++++ .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 +++++ .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 +++++ node_modules/strip-ansi/index.js | 16 +- node_modules/strip-ansi/license | 2 +- .../node_modules/ansi-regex/index.js | 0 .../node_modules/ansi-regex/license | 0 .../node_modules/ansi-regex/package.json | 0 node_modules/strip-ansi/package.json | 17 +- .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 +++++ .../node_modules/ansi-regex/index.js | 8 - .../node_modules/ansi-regex/package.json | 58 ----- .../node_modules/strip-ansi/index.js | 14 -- package-lock.json | 216 +++++++++++++----- package.json | 2 +- test/lib/commands/hook.js | 6 +- test/lib/commands/org.js | 10 +- 36 files changed, 513 insertions(+), 204 deletions(-) delete mode 100644 node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js create mode 100644 node_modules/cli-columns/node_modules/strip-ansi/index.js rename node_modules/{wrap-ansi/node_modules/ansi-regex => cli-columns/node_modules/strip-ansi}/license (92%) rename node_modules/{wrap-ansi => cli-columns}/node_modules/strip-ansi/package.json (71%) create mode 100644 node_modules/columnify/node_modules/strip-ansi/index.js rename node_modules/{@isaacs/cliui => columnify}/node_modules/strip-ansi/license (92%) rename node_modules/{@isaacs/cliui => columnify}/node_modules/strip-ansi/package.json (71%) create mode 100644 node_modules/gauge/node_modules/strip-ansi/index.js rename node_modules/{wrap-ansi => gauge}/node_modules/strip-ansi/license (92%) create mode 100644 node_modules/gauge/node_modules/strip-ansi/package.json create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/index.js create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/license create mode 100644 node_modules/string-width-cjs/node_modules/strip-ansi/package.json create mode 100644 node_modules/string-width/node_modules/strip-ansi/index.js create mode 100644 node_modules/string-width/node_modules/strip-ansi/license create mode 100644 node_modules/string-width/node_modules/strip-ansi/package.json rename node_modules/{@isaacs/cliui => strip-ansi}/node_modules/ansi-regex/index.js (100%) rename node_modules/{@isaacs/cliui => strip-ansi}/node_modules/ansi-regex/license (100%) rename node_modules/{@isaacs/cliui => strip-ansi}/node_modules/ansi-regex/package.json (100%) create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license create mode 100644 node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json delete mode 100644 node_modules/wrap-ansi/node_modules/ansi-regex/index.js delete mode 100644 node_modules/wrap-ansi/node_modules/ansi-regex/package.json delete mode 100644 node_modules/wrap-ansi/node_modules/strip-ansi/index.js diff --git a/lib/commands/outdated.js b/lib/commands/outdated.js index 7e5805d41806c..9b9283e497727 100644 --- a/lib/commands/outdated.js +++ b/lib/commands/outdated.js @@ -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 { @@ -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 @@ -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)) } diff --git a/lib/commands/search.js b/lib/commands/search.js index 85ff7db2b7884..8d6744f591333 100644 --- a/lib/commands/search.js +++ b/lib/commands/search.js @@ -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, }) diff --git a/lib/utils/format-search-stream.js b/lib/utils/format-search-stream.js index 280e96b13fa8b..766028bddc797 100644 --- a/lib/utils/format-search-stream.js +++ b/lib/utils/format-search-stream.js @@ -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: // @@ -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) } @@ -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 && diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 1721943df922a..b2505dba10332 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -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/* @@ -72,6 +70,9 @@ !/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 @@ -79,6 +80,9 @@ !/color-name !/color-support !/columnify +!/columnify/node_modules/ +/columnify/node_modules/* +!/columnify/node_modules/strip-ansi !/common-ancestor-path !/console-control-strings !/cross-spawn @@ -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 @@ -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/ @@ -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 diff --git a/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js b/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js deleted file mode 100644 index ba19750e64e06..0000000000000 --- a/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import ansiRegex from 'ansi-regex'; - -const regex = ansiRegex(); - -export default function stripAnsi(string) { - if (typeof string !== 'string') { - throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); - } - - // Even though the regex is global, we don't need to reset the `.lastIndex` - // because unlike `.exec()` and `.test()`, `.replace()` does it automatically - // and doing it manually has a performance penalty. - return string.replace(regex, ''); -} diff --git a/node_modules/cli-columns/node_modules/strip-ansi/index.js b/node_modules/cli-columns/node_modules/strip-ansi/index.js new file mode 100644 index 0000000000000..9a593dfcd1fd5 --- /dev/null +++ b/node_modules/cli-columns/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/wrap-ansi/node_modules/ansi-regex/license b/node_modules/cli-columns/node_modules/strip-ansi/license similarity index 92% rename from node_modules/wrap-ansi/node_modules/ansi-regex/license rename to node_modules/cli-columns/node_modules/strip-ansi/license index fa7ceba3eb4a9..e7af2f77107d7 100644 --- a/node_modules/wrap-ansi/node_modules/ansi-regex/license +++ b/node_modules/cli-columns/node_modules/strip-ansi/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) Sindre Sorhus (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: diff --git a/node_modules/wrap-ansi/node_modules/strip-ansi/package.json b/node_modules/cli-columns/node_modules/strip-ansi/package.json similarity index 71% rename from node_modules/wrap-ansi/node_modules/strip-ansi/package.json rename to node_modules/cli-columns/node_modules/strip-ansi/package.json index e1f455c325b00..1a41108d42831 100644 --- a/node_modules/wrap-ansi/node_modules/strip-ansi/package.json +++ b/node_modules/cli-columns/node_modules/strip-ansi/package.json @@ -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" @@ -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" } } diff --git a/node_modules/columnify/node_modules/strip-ansi/index.js b/node_modules/columnify/node_modules/strip-ansi/index.js new file mode 100644 index 0000000000000..9a593dfcd1fd5 --- /dev/null +++ b/node_modules/columnify/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/@isaacs/cliui/node_modules/strip-ansi/license b/node_modules/columnify/node_modules/strip-ansi/license similarity index 92% rename from node_modules/@isaacs/cliui/node_modules/strip-ansi/license rename to node_modules/columnify/node_modules/strip-ansi/license index fa7ceba3eb4a9..e7af2f77107d7 100644 --- a/node_modules/@isaacs/cliui/node_modules/strip-ansi/license +++ b/node_modules/columnify/node_modules/strip-ansi/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) Sindre Sorhus (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: diff --git a/node_modules/@isaacs/cliui/node_modules/strip-ansi/package.json b/node_modules/columnify/node_modules/strip-ansi/package.json similarity index 71% rename from node_modules/@isaacs/cliui/node_modules/strip-ansi/package.json rename to node_modules/columnify/node_modules/strip-ansi/package.json index e1f455c325b00..1a41108d42831 100644 --- a/node_modules/@isaacs/cliui/node_modules/strip-ansi/package.json +++ b/node_modules/columnify/node_modules/strip-ansi/package.json @@ -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" @@ -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" } } diff --git a/node_modules/gauge/node_modules/strip-ansi/index.js b/node_modules/gauge/node_modules/strip-ansi/index.js new file mode 100644 index 0000000000000..9a593dfcd1fd5 --- /dev/null +++ b/node_modules/gauge/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/wrap-ansi/node_modules/strip-ansi/license b/node_modules/gauge/node_modules/strip-ansi/license similarity index 92% rename from node_modules/wrap-ansi/node_modules/strip-ansi/license rename to node_modules/gauge/node_modules/strip-ansi/license index fa7ceba3eb4a9..e7af2f77107d7 100644 --- a/node_modules/wrap-ansi/node_modules/strip-ansi/license +++ b/node_modules/gauge/node_modules/strip-ansi/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) Sindre Sorhus (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: diff --git a/node_modules/gauge/node_modules/strip-ansi/package.json b/node_modules/gauge/node_modules/strip-ansi/package.json new file mode 100644 index 0000000000000..1a41108d42831 --- /dev/null +++ b/node_modules/gauge/node_modules/strip-ansi/package.json @@ -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" + } +} diff --git a/node_modules/string-width-cjs/node_modules/strip-ansi/index.js b/node_modules/string-width-cjs/node_modules/strip-ansi/index.js new file mode 100644 index 0000000000000..9a593dfcd1fd5 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/string-width-cjs/node_modules/strip-ansi/license b/node_modules/string-width-cjs/node_modules/strip-ansi/license new file mode 100644 index 0000000000000..e7af2f77107d7 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/string-width-cjs/node_modules/strip-ansi/package.json b/node_modules/string-width-cjs/node_modules/strip-ansi/package.json new file mode 100644 index 0000000000000..1a41108d42831 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/strip-ansi/package.json @@ -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" + } +} diff --git a/node_modules/string-width/node_modules/strip-ansi/index.js b/node_modules/string-width/node_modules/strip-ansi/index.js new file mode 100644 index 0000000000000..9a593dfcd1fd5 --- /dev/null +++ b/node_modules/string-width/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/string-width/node_modules/strip-ansi/license b/node_modules/string-width/node_modules/strip-ansi/license new file mode 100644 index 0000000000000..e7af2f77107d7 --- /dev/null +++ b/node_modules/string-width/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/string-width/node_modules/strip-ansi/package.json b/node_modules/string-width/node_modules/strip-ansi/package.json new file mode 100644 index 0000000000000..1a41108d42831 --- /dev/null +++ b/node_modules/string-width/node_modules/strip-ansi/package.json @@ -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" + } +} diff --git a/node_modules/strip-ansi/index.js b/node_modules/strip-ansi/index.js index 9a593dfcd1fd5..ba19750e64e06 100644 --- a/node_modules/strip-ansi/index.js +++ b/node_modules/strip-ansi/index.js @@ -1,4 +1,14 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); +import ansiRegex from 'ansi-regex'; -module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; +const regex = ansiRegex(); + +export default function stripAnsi(string) { + if (typeof string !== 'string') { + throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); + } + + // Even though the regex is global, we don't need to reset the `.lastIndex` + // because unlike `.exec()` and `.test()`, `.replace()` does it automatically + // and doing it manually has a performance penalty. + return string.replace(regex, ''); +} diff --git a/node_modules/strip-ansi/license b/node_modules/strip-ansi/license index e7af2f77107d7..fa7ceba3eb4a9 100644 --- a/node_modules/strip-ansi/license +++ b/node_modules/strip-ansi/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://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: diff --git a/node_modules/@isaacs/cliui/node_modules/ansi-regex/index.js b/node_modules/strip-ansi/node_modules/ansi-regex/index.js similarity index 100% rename from node_modules/@isaacs/cliui/node_modules/ansi-regex/index.js rename to node_modules/strip-ansi/node_modules/ansi-regex/index.js diff --git a/node_modules/@isaacs/cliui/node_modules/ansi-regex/license b/node_modules/strip-ansi/node_modules/ansi-regex/license similarity index 100% rename from node_modules/@isaacs/cliui/node_modules/ansi-regex/license rename to node_modules/strip-ansi/node_modules/ansi-regex/license diff --git a/node_modules/@isaacs/cliui/node_modules/ansi-regex/package.json b/node_modules/strip-ansi/node_modules/ansi-regex/package.json similarity index 100% rename from node_modules/@isaacs/cliui/node_modules/ansi-regex/package.json rename to node_modules/strip-ansi/node_modules/ansi-regex/package.json diff --git a/node_modules/strip-ansi/package.json b/node_modules/strip-ansi/package.json index 1a41108d42831..e1f455c325b00 100644 --- a/node_modules/strip-ansi/package.json +++ b/node_modules/strip-ansi/package.json @@ -1,16 +1,19 @@ { "name": "strip-ansi", - "version": "6.0.1", + "version": "7.1.0", "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": "sindresorhus.com" + "url": "https://sindresorhus.com" }, + "type": "module", + "exports": "./index.js", "engines": { - "node": ">=8" + "node": ">=12" }, "scripts": { "test": "xo && ava && tsd" @@ -44,11 +47,11 @@ "text" ], "dependencies": { - "ansi-regex": "^5.0.1" + "ansi-regex": "^6.0.1" }, "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.10.0", - "xo": "^0.25.3" + "ava": "^3.15.0", + "tsd": "^0.17.0", + "xo": "^0.44.0" } } diff --git a/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js new file mode 100644 index 0000000000000..9a593dfcd1fd5 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license new file mode 100644 index 0000000000000..e7af2f77107d7 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json new file mode 100644 index 0000000000000..1a41108d42831 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json @@ -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" + } +} diff --git a/node_modules/wrap-ansi/node_modules/ansi-regex/index.js b/node_modules/wrap-ansi/node_modules/ansi-regex/index.js deleted file mode 100644 index 130a0929b8ce8..0000000000000 --- a/node_modules/wrap-ansi/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,8 +0,0 @@ -export default function ansiRegex({onlyFirst = false} = {}) { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, onlyFirst ? undefined : 'g'); -} diff --git a/node_modules/wrap-ansi/node_modules/ansi-regex/package.json b/node_modules/wrap-ansi/node_modules/ansi-regex/package.json deleted file mode 100644 index 7bbb563bf2a70..0000000000000 --- a/node_modules/wrap-ansi/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "ansi-regex", - "version": "6.0.1", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": "chalk/ansi-regex", - "funding": "https://github.com/chalk/ansi-regex?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "type": "module", - "exports": "./index.js", - "engines": { - "node": ">=12" - }, - "scripts": { - "test": "xo && ava && tsd", - "view-supported": "node fixtures/view-codes.js" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.14.0", - "xo": "^0.38.2" - } -} diff --git a/node_modules/wrap-ansi/node_modules/strip-ansi/index.js b/node_modules/wrap-ansi/node_modules/strip-ansi/index.js deleted file mode 100644 index ba19750e64e06..0000000000000 --- a/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import ansiRegex from 'ansi-regex'; - -const regex = ansiRegex(); - -export default function stripAnsi(string) { - if (typeof string !== 'string') { - throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); - } - - // Even though the regex is global, we don't need to reset the `.lastIndex` - // because unlike `.exec()` and `.test()`, `.replace()` does it automatically - // and doing it manually has a performance penalty. - return string.replace(regex, ''); -} diff --git a/package-lock.json b/package-lock.json index 975358e81d3fe..2c6623851c721 100644 --- a/package-lock.json +++ b/package-lock.json @@ -151,7 +151,7 @@ "semver": "^7.5.4", "spdx-expression-parse": "^3.0.1", "ssri": "^10.0.5", - "strip-ansi": "^6.0.1", + "strip-ansi": "^7.1.0", "supports-color": "^9.4.0", "tar": "^6.2.0", "text-table": "~0.2.0", @@ -1410,18 +1410,6 @@ "node": ">=12" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "inBundle": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -1445,21 +1433,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "inBundle": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz", @@ -3572,6 +3545,18 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/@npmcli/template-oss/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@npmcli/template-oss/node_modules/tuf-js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.7.tgz", @@ -4952,6 +4937,18 @@ "node": ">= 10" } }, + "node_modules/cli-columns/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "inBundle": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cli-table3": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", @@ -4981,6 +4978,18 @@ "node": ">=12" } }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -5098,6 +5107,18 @@ "node": "*" } }, + "node_modules/code-suggester/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/code-suggester/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -5173,6 +5194,18 @@ "node": ">=8.0.0" } }, + "node_modules/columnify/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "inBundle": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -6508,6 +6541,19 @@ "node": "*" } }, + "node_modules/eslint/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -7036,6 +7082,18 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/gauge/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "inBundle": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -9651,6 +9709,18 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/licensee/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/licensee/node_modules/tuf-js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.7.tgz", @@ -11729,6 +11799,18 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "node_modules/nyc/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/nyc/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -13808,6 +13890,30 @@ "node": ">=8" } }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "inBundle": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "inBundle": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/string.prototype.trim": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", @@ -13871,15 +13977,18 @@ } }, "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "inBundle": true, "dependencies": { - "ansi-regex": "^5.0.1" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/strip-ansi-cjs": { @@ -13895,6 +14004,18 @@ "node": ">=8" } }, + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "inBundle": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -17218,16 +17339,16 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "inBundle": true, - "engines": { - "node": ">=12" + "dependencies": { + "ansi-regex": "^5.0.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "engines": { + "node": ">=8" } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { @@ -17265,21 +17386,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "inBundle": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index d5d2f68ce0e1e..903db409ae91f 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "semver": "^7.5.4", "spdx-expression-parse": "^3.0.1", "ssri": "^10.0.5", - "strip-ansi": "^6.0.1", + "strip-ansi": "^7.1.0", "supports-color": "^9.4.0", "tar": "^6.2.0", "text-table": "~0.2.0", diff --git a/test/lib/commands/hook.js b/test/lib/commands/hook.js index d3de4f5c55efa..448045cdd6916 100644 --- a/test/lib/commands/hook.js +++ b/test/lib/commands/hook.js @@ -243,7 +243,8 @@ t.test('npm hook ls', async t => { 'received the correct arguments' ) t.equal(outputs[0][0], 'You have 3 hooks configured.', 'prints the correct header') - const out = require('strip-ansi')(outputs[1][0]) + const { default: stripAnsi } = await import('strip-ansi') + const out = stripAnsi(outputs[1][0]) t.match(out, /semver.*https:\/\/google.com.*\n.*\n.*never triggered/, 'prints package hook') t.match(out, /@npmcli.*https:\/\/google.com.*\n.*\n.*triggered just now/, 'prints scope hook') t.match(out, /~npm.*https:\/\/google.com.*\n.*\n.*never triggered/, 'prints owner hook') @@ -292,7 +293,8 @@ t.test('npm hook ls, single result', async t => { 'received the correct arguments' ) t.equal(outputs[0][0], 'You have one hook configured.', 'prints the correct header') - const out = require('strip-ansi')(outputs[1][0]) + const { default: stripAnsi } = await import('strip-ansi') + const out = stripAnsi(outputs[1][0]) t.match(out, /semver.*https:\/\/google.com.*\n.*\n.*never triggered/, 'prints package hook') }) diff --git a/test/lib/commands/org.js b/test/lib/commands/org.js index 5c239295c3343..ed8fb238c4b0d 100644 --- a/test/lib/commands/org.js +++ b/test/lib/commands/org.js @@ -1,5 +1,4 @@ const t = require('tap') -const ansiTrim = require('strip-ansi') const mockNpm = require('../../fixtures/mock-npm') const mockOrg = async (t, { orgSize = 1, orgList = {}, ...npmOpts } = {}) => { @@ -427,7 +426,8 @@ t.test('npm org ls', async t => { }, 'receieved the correct args' ) - const out = ansiTrim(outputs[0][0]) + const { default: stripAnsi } = await import('strip-ansi') + const out = stripAnsi(outputs[0][0]) t.match(out, /one.*developer/, 'contains the developer member') t.match(out, /two.*admin/, 'contains the admin member') t.match(out, /three.*owner/, 'contains the owner member') @@ -452,7 +452,8 @@ t.test('npm org ls - user filter', async t => { }, 'receieved the correct args' ) - const out = ansiTrim(outputs[0][0]) + const { default: stripAnsi } = await import('strip-ansi') + const out = stripAnsi(outputs[0][0]) t.match(out, /username.*admin/, 'contains the filtered member') t.notMatch(out, /missing.*admin/, 'does not contain other members') }) @@ -475,7 +476,8 @@ t.test('npm org ls - user filter, missing user', async t => { }, 'receieved the correct args' ) - const out = ansiTrim(outputs[0][0]) + const { default: stripAnsi } = await import('strip-ansi') + const out = stripAnsi(outputs[0][0]) t.notMatch(out, /username/, 'does not contain the requested member') t.notMatch(out, /missing.*admin/, 'does not contain other members') })