diff --git a/package-lock.json b/package-lock.json index 81fe0499..cbe9d059 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,7 @@ "semver-utils": "^1.1.4", "source-map-support": "^0.5.21", "spawn-please": "^2.0.1", + "strip-ansi": "^7.1.0", "strip-json-comments": "^5.0.1", "untildify": "^4.0.0", "update-notifier": "^6.0.2" @@ -95,7 +96,6 @@ "prettier": "^2.8.8", "should": "^13.2.3", "sinon": "^15.2.0", - "strip-ansi": "^7.1.0", "ts-node": "^10.9.1", "typescript": "5.1.6", "typescript-json-schema": "0.59.0", diff --git a/package.json b/package.json index 4b64d1de..effc604f 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "semver-utils": "^1.1.4", "source-map-support": "^0.5.21", "spawn-please": "^2.0.1", + "strip-ansi": "^7.1.0", "strip-json-comments": "^5.0.1", "untildify": "^4.0.0", "update-notifier": "^6.0.2" @@ -138,7 +139,6 @@ "prettier": "^2.8.8", "should": "^13.2.3", "sinon": "^15.2.0", - "strip-ansi": "^7.1.0", "ts-node": "^10.9.1", "typescript": "5.1.6", "typescript-json-schema": "0.59.0", diff --git a/src/package-managers/bun.ts b/src/package-managers/bun.ts index ae3d172c..ef4b82d1 100644 --- a/src/package-managers/bun.ts +++ b/src/package-managers/bun.ts @@ -32,6 +32,9 @@ async function spawnBun( * (Bun) Fetches the list of all installed packages. */ export const list = async (options: Options = {}): Promise> => { + const { default: stripAnsi } = await import('strip-ansi') + + // bun pm ls const stdout = await spawnBun( ['pm', 'ls'], { @@ -39,13 +42,21 @@ export const list = async (options: Options = {}): Promise { const match = line.match(/.* (.*?)@(.+)/) if (match) { diff --git a/test/package-managers/bun/index.test.ts b/test/package-managers/bun/index.test.ts index 4a87f3b7..618185cf 100644 --- a/test/package-managers/bun/index.test.ts +++ b/test/package-managers/bun/index.test.ts @@ -15,7 +15,6 @@ const describeSkipWindows = os.platform() === 'win32' ? describe.skip : describe describeSkipWindows('bun', function () { it('list', async () => { const result = await bun.list({ cwd: __dirname }) - console.log({ result }) result.should.have.property('ncu-test-v2') })