Skip to content

Commit

Permalink
fix(typecheck): use bunx if is running on bun
Browse files Browse the repository at this point in the history
  • Loading branch information
HigherOrderLogic committed Oct 4, 2024
1 parent 40e8461 commit 5087a53
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/commands/typecheck.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { execa } from 'execa'
import { resolve } from 'pathe'
import { defineCommand } from 'citty'
import { isBun } from 'std-env'

// we are deliberately inlining this code as a backup in case user has `@nuxt/schema<3.7`
import { writeTypes as writeTypesLegacy } from '@nuxt/kit'
Expand Down Expand Up @@ -55,11 +56,25 @@ export default defineCommand({
})
}
else {
await execa(
'npx',
'-p vue-tsc -p typescript vue-tsc --noEmit'.split(' '),
{ stdio: 'inherit', cwd },
)
if (isBun) {
await execa(
'bun',
'install typescript vue-tsc --global --silent'.split(' '),
{ stdio: 'inherit', cwd },
)

await execa('bunx', 'vue-tsc --noEmit'.split(' '), {
stdio: 'inherit',
cwd,
})
}
else {
await execa(
'npx',
'-p vue-tsc -p typescript vue-tsc --noEmit'.split(' '),
{ stdio: 'inherit', cwd },
)
}
}
},
})

0 comments on commit 5087a53

Please sign in to comment.