Skip to content

Commit

Permalink
deps: remove strip-ansi
Browse files Browse the repository at this point in the history
Only removes from direct dependencies, is still a non-dev subdependency
  • Loading branch information
wraithgar committed Jan 19, 2024
1 parent d4ebfba commit 739634d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
1 change: 0 additions & 1 deletion DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ graph LR;
npm-->spawk;
npm-->spdx-expression-parse;
npm-->ssri;
npm-->strip-ansi;
npm-->supports-color;
npm-->tap;
npm-->tar;
Expand Down
2 changes: 0 additions & 2 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"semver",
"spdx-expression-parse",
"ssri",
"strip-ansi",
"supports-color",
"tar",
"text-table",
Expand Down Expand Up @@ -151,7 +150,6 @@
"semver": "^7.5.4",
"spdx-expression-parse": "^3.0.1",
"ssri": "^10.0.5",
"strip-ansi": "^7.1.0",
"supports-color": "^9.4.0",
"tar": "^6.2.0",
"text-table": "~0.2.0",
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
"semver": "^7.5.4",
"spdx-expression-parse": "^3.0.1",
"ssri": "^10.0.5",
"strip-ansi": "^7.1.0",
"supports-color": "^9.4.0",
"tar": "^6.2.0",
"text-table": "~0.2.0",
Expand Down Expand Up @@ -186,7 +185,6 @@
"semver",
"spdx-expression-parse",
"ssri",
"strip-ansi",
"supports-color",
"tar",
"text-table",
Expand Down
7 changes: 3 additions & 4 deletions test/lib/commands/hook.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const t = require('tap')
const mockNpm = require('../../fixtures/mock-npm')
const { stripVTControlCharacters } = require('node:util')

const mockHook = async (t, { hookResponse, ...npmOpts } = {}) => {
const now = Date.now()
Expand Down Expand Up @@ -243,8 +244,7 @@ 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 { default: stripAnsi } = await import('strip-ansi')
const out = stripAnsi(outputs[1][0])
const out = stripVTControlCharacters(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')
Expand Down Expand Up @@ -293,8 +293,7 @@ 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 { default: stripAnsi } = await import('strip-ansi')
const out = stripAnsi(outputs[1][0])
const out = stripVTControlCharacters(outputs[1][0])
t.match(out, /semver.*https:\/\/google.com.*\n.*\n.*never triggered/, 'prints package hook')
})

Expand Down
10 changes: 4 additions & 6 deletions test/lib/commands/org.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const t = require('tap')
const mockNpm = require('../../fixtures/mock-npm')
const { stripVTControlCharacters } = require('node:util')

const mockOrg = async (t, { orgSize = 1, orgList = {}, ...npmOpts } = {}) => {
let setArgs = null
Expand Down Expand Up @@ -426,8 +427,7 @@ t.test('npm org ls', async t => {
},
'receieved the correct args'
)
const { default: stripAnsi } = await import('strip-ansi')
const out = stripAnsi(outputs[0][0])
const out = stripVTControlCharacters(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')
Expand All @@ -452,8 +452,7 @@ t.test('npm org ls - user filter', async t => {
},
'receieved the correct args'
)
const { default: stripAnsi } = await import('strip-ansi')
const out = stripAnsi(outputs[0][0])
const out = stripVTControlCharacters(outputs[0][0])
t.match(out, /username.*admin/, 'contains the filtered member')
t.notMatch(out, /missing.*admin/, 'does not contain other members')
})
Expand All @@ -476,8 +475,7 @@ t.test('npm org ls - user filter, missing user', async t => {
},
'receieved the correct args'
)
const { default: stripAnsi } = await import('strip-ansi')
const out = stripAnsi(outputs[0][0])
const out = stripVTControlCharacters(outputs[0][0])
t.notMatch(out, /username/, 'does not contain the requested member')
t.notMatch(out, /missing.*admin/, 'does not contain other members')
})
Expand Down

0 comments on commit 739634d

Please sign in to comment.