File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -324,17 +324,27 @@ async function init() {
324324
325325 if ( customCommand ) {
326326 const fullCustomCommand = customCommand
327- . replace ( / ^ n p m c r e a t e / , `${ pkgManager } create` )
327+ . replace ( / ^ n p m c r e a t e / , ( ) => {
328+ // `bun create` uses it's own set of templates,
329+ // the closest alternative is using `bun x` directly on the package
330+ if ( pkgManager === 'bun' ) {
331+ return 'bun x create-'
332+ }
333+ return `${ pkgManager } create `
334+ } )
328335 // Only Yarn 1.x doesn't support `@version` in the `create` command
329336 . replace ( '@latest' , ( ) => ( isYarn1 ? '' : '@latest' ) )
330337 . replace ( / ^ n p m e x e c / , ( ) => {
331- // Prefer `pnpm dlx` or `yarn dlx`
338+ // Prefer `pnpm dlx`, `yarn dlx`, or `bun x `
332339 if ( pkgManager === 'pnpm' ) {
333340 return 'pnpm dlx'
334341 }
335342 if ( pkgManager === 'yarn' && ! isYarn1 ) {
336343 return 'yarn dlx'
337344 }
345+ if ( pkgManager === 'bun' ) {
346+ return 'bun x'
347+ }
338348 // Use `npm exec` in all other cases,
339349 // including Yarn 1.x and other custom npm clients.
340350 return 'npm exec'
You can’t perform that action at this time.
0 commit comments