From bf901accd3e47316249ce7e9c865e30db26f4258 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Tue, 29 Aug 2023 22:45:00 -0700 Subject: [PATCH] Detect bun --- packages/what-pm/src/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/what-pm/src/index.ts b/packages/what-pm/src/index.ts index ebda90e..7bf9d25 100755 --- a/packages/what-pm/src/index.ts +++ b/packages/what-pm/src/index.ts @@ -54,6 +54,13 @@ export async function whatPM(pkgPath: string): Promise { isWorkspace } } + if (existsSync(join(pkgPath, 'bun.lockb'))) { + return { + name: 'bun', + version: '*', + isWorkspace + } + } const pm = await pmInfo(pkgPath) return ( pm && { @@ -99,6 +106,13 @@ export function whatPMSync(pkgPath: string): WhatPMResult | null { isWorkspace } } + if (existsSync(join(pkgPath, 'bun.lockb'))) { + return { + name: 'bun', + version: '*', + isWorkspace + } + } if (findUp.sync('pnpm-lock.yaml', { cwd: pkgPath })) { return { name: 'pnpm',