File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { CodeBlock } from './CodeBlock'
77import type { Framework } from '~/libraries/types'
88
99type PackageManager = 'bun' | 'npm' | 'pnpm' | 'yarn'
10- type InstallMode = 'install' | 'dev-install' | 'local-install'
10+ type InstallMode = 'install' | 'dev-install' | 'local-install' | 'create'
1111
1212// Use zustand for cross-component synchronization
1313// This ensures all PackageManagerTabs instances on the page stay in sync
@@ -41,6 +41,26 @@ function getInstallCommand(
4141) : string [ ] {
4242 const commands : string [ ] = [ ]
4343
44+ if ( mode === 'create' ) {
45+ for ( const packages of packageGroups ) {
46+ const pkgStr = packages . join ( ' ' )
47+ switch ( packageManager ) {
48+ case 'npm' :
49+ commands . push ( `npm create ${ pkgStr } ` )
50+ break
51+ case 'pnpm' :
52+ commands . push ( `pnpm create ${ pkgStr } ` )
53+ break
54+ case 'yarn' :
55+ commands . push ( `yarn create ${ pkgStr } ` )
56+ break
57+ case 'bun' :
58+ commands . push ( `bun create ${ pkgStr } ` )
59+ break
60+ }
61+ }
62+ }
63+
4464 if ( mode === 'local-install' ) {
4565 // Each group becomes one command line
4666 for ( const packages of packageGroups ) {
You can’t perform that action at this time.
0 commit comments