@@ -54,10 +54,27 @@ export function cli({
54
54
// await initAddOn('overlay')
55
55
// })
56
56
57
+ program . argument ( '[project-name]' , 'name of the project' )
58
+
59
+ if ( ! forcedMode ) {
60
+ program . option < 'typescript' | 'javascript' | 'file-router' > (
61
+ '--template <type>' ,
62
+ 'project template (typescript, javascript, file-router)' ,
63
+ ( value ) => {
64
+ if (
65
+ value !== 'typescript' &&
66
+ value !== 'javascript' &&
67
+ value !== 'file-router'
68
+ ) {
69
+ throw new InvalidArgumentError (
70
+ `Invalid template: ${ value } . Only the following are allowed: typescript, javascript, file-router` ,
71
+ )
72
+ }
73
+ return value
74
+ } ,
75
+ )
76
+ }
57
77
program
58
- . argument ( '[project-name]' , 'name of the project' )
59
- . option ( '--no-git' , 'do not create a git repository' )
60
- . option ( '--target-dir <path>' , 'the directory to create the project in' )
61
78
. option < Framework > (
62
79
'--framework <type>' ,
63
80
'project framework (solid, react)' ,
@@ -73,6 +90,7 @@ export function cli({
73
90
} ,
74
91
DEFAULT_FRAMEWORK ,
75
92
)
93
+ // .option('--overlay [url]', 'add an overlay from a URL', false)
76
94
. option < PackageManager > (
77
95
`--package-manager <${ SUPPORTED_PACKAGE_MANAGERS . join ( '|' ) } >` ,
78
96
`Explicitly tell the CLI to use this package manager` ,
@@ -114,29 +132,11 @@ export function cli({
114
132
} ,
115
133
)
116
134
. option ( '--list-add-ons' , 'list all available add-ons' , false )
117
- // .option('--overlay [url]', 'add an overlay from a URL', false)
135
+ . option ( '--no-git' , 'do not create a git repository' )
136
+ . option ( '--target-dir <path>' , 'the directory to create the project in' )
118
137
. option ( '--mcp' , 'run the MCP server' , false )
119
138
. option ( '--mcp-sse' , 'run the MCP server in SSE mode' , false )
120
139
121
- if ( ! forcedMode ) {
122
- program . option < 'typescript' | 'javascript' | 'file-router' > (
123
- '--template <type>' ,
124
- 'project template (typescript, javascript, file-router)' ,
125
- ( value ) => {
126
- if (
127
- value !== 'typescript' &&
128
- value !== 'javascript' &&
129
- value !== 'file-router'
130
- ) {
131
- throw new InvalidArgumentError (
132
- `Invalid template: ${ value } . Only the following are allowed: typescript, javascript, file-router` ,
133
- )
134
- }
135
- return value
136
- } ,
137
- )
138
- }
139
-
140
140
program . action ( async ( projectName : string , options : CliOptions ) => {
141
141
if ( options . listAddOns ) {
142
142
await listAddOns ( options , {
0 commit comments