@@ -44,11 +44,12 @@ export class CreateProjectCommand implements ICommand {
44
44
this . $options . ng ||
45
45
this . $options . vue ||
46
46
this . $options . react ||
47
+ this . $options . svelte ||
47
48
this . $options . js ) &&
48
49
this . $options . template
49
50
) {
50
51
this . $errors . failWithHelp (
51
- "You cannot use a flavor option like --ng, --vue, --react, --tsc and --js together with --template."
52
+ "You cannot use a flavor option like --ng, --vue, --react, --svelte, -- tsc and --js together with --template."
52
53
) ;
53
54
}
54
55
@@ -64,6 +65,8 @@ export class CreateProjectCommand implements ICommand {
64
65
selectedTemplate = constants . VUE_NAME ;
65
66
} else if ( this . $options . react ) {
66
67
selectedTemplate = constants . REACT_NAME ;
68
+ } else if ( this . $options . svelte ) {
69
+ selectedTemplate = constants . SVELTE_NAME ;
67
70
} else {
68
71
selectedTemplate = this . $options . template ;
69
72
}
@@ -132,6 +135,10 @@ export class CreateProjectCommand implements ICommand {
132
135
key : constants . VueFlavorName ,
133
136
description : "Learn more at https://nativescript.org/vue" ,
134
137
} ,
138
+ {
139
+ key : constants . SvelteFlavorName ,
140
+ description : "Learn more at https://svelte-native.technology" ,
141
+ } ,
135
142
{
136
143
key : constants . TsFlavorName ,
137
144
description : "Learn more at https://nativescript.org/typescript" ,
@@ -152,7 +159,7 @@ export class CreateProjectCommand implements ICommand {
152
159
this . $logger . printMarkdown ( `# Let’s create a NativeScript app!` ) ;
153
160
this . $logger . printMarkdown ( `
154
161
Answer the following questions to help us build the right app for you. (Note: you
155
- can skip this prompt next time using the --template option, or the --ng, --react, --vue, --ts, or --js flags.)
162
+ can skip this prompt next time using the --template option, or the --ng, --react, --vue, --svelte, -- ts, or --js flags.)
156
163
` ) ;
157
164
}
158
165
}
@@ -180,6 +187,10 @@ can skip this prompt next time using the --template option, or the --ng, --react
180
187
selectedFlavorTemplates . push ( ...this . getVueTemplates ( ) ) ;
181
188
break ;
182
189
}
190
+ case constants . SvelteFlavorName : {
191
+ selectedFlavorTemplates . push ( ...this . getSvelteTemplates ( ) ) ;
192
+ break ;
193
+ }
183
194
case constants . TsFlavorName : {
184
195
selectedFlavorTemplates . push ( ...this . getTsTemplates ( ) ) ;
185
196
break ;
@@ -285,6 +296,18 @@ can skip this prompt next time using the --template option, or the --ng, --react
285
296
return templates ;
286
297
}
287
298
299
+ private getSvelteTemplates ( ) {
300
+ const templates = [
301
+ {
302
+ key : CreateProjectCommand . HelloWorldTemplateKey ,
303
+ value : constants . RESERVED_TEMPLATE_NAMES . svelte ,
304
+ description : CreateProjectCommand . HelloWorldTemplateDescription ,
305
+ } ,
306
+ ] ;
307
+
308
+ return templates ;
309
+ }
310
+
288
311
private getVueTemplates ( ) {
289
312
const templates = [
290
313
{
0 commit comments