diff --git a/packages/schema/src/utils/pkg-utils.ts b/packages/schema/src/utils/pkg-utils.ts index 067810a8e..e58d1e956 100644 --- a/packages/schema/src/utils/pkg-utils.ts +++ b/packages/schema/src/utils/pkg-utils.ts @@ -67,7 +67,7 @@ export function findNodeModulesFile(name: string, cwd: string = process.cwd()) { } export function getPackageManager(searchStartPath = '.') { - const lockFile = findUp(['yarn.lock', 'pnpm-lock.yaml', 'package-lock.json'], searchStartPath); + const lockFile = findUp(['yarn.lock', 'bun.lock', 'pnpm-lock.yaml', 'package-lock.json'], searchStartPath); if (!lockFile) { // default use npm @@ -77,6 +77,7 @@ export function getPackageManager(searchStartPath = '.') { const packageManager = match(path.basename(lockFile)) .with('yarn.lock', () => 'yarn') .with('pnpm-lock.yaml', () => 'pnpm') + .with('bun.lock', () => 'bun') .otherwise(() => 'npm'); return { packageManager, lockFile, projectRoot: path.dirname(lockFile) }; @@ -99,6 +100,14 @@ export function installPackage( ); break; + case 'bun': + execSync( + `bun install --cwd "${projectPath}" ${exactVersion ? '--exact' : ''} ${ + dev ? ' --dev' : '' + } ${pkg}@${tag}` + ); + break; + case 'pnpm': execSync( `pnpm add -C "${projectPath}" ${exactVersion ? '--save-exact' : ''} ${ diff --git a/packages/sdk/src/code-gen.ts b/packages/sdk/src/code-gen.ts index 07d6a9430..8803887f2 100644 --- a/packages/sdk/src/code-gen.ts +++ b/packages/sdk/src/code-gen.ts @@ -15,6 +15,8 @@ export function createProject(options?: CompilerOptions) { skipLibCheck: true, noEmitOnError: true, noImplicitAny: false, + skipDefaultLibCheck: true, + types: [], ...options, }, });