@@ -44,11 +44,12 @@ export class CreateProjectCommand implements ICommand {
4444 this . $options . ng ||
4545 this . $options . vue ||
4646 this . $options . react ||
47+ this . $options . svelte ||
4748 this . $options . js ) &&
4849 this . $options . template
4950 ) {
5051 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."
5253 ) ;
5354 }
5455
@@ -64,6 +65,8 @@ export class CreateProjectCommand implements ICommand {
6465 selectedTemplate = constants . VUE_NAME ;
6566 } else if ( this . $options . react ) {
6667 selectedTemplate = constants . REACT_NAME ;
68+ } else if ( this . $options . svelte ) {
69+ selectedTemplate = constants . SVELTE_NAME ;
6770 } else {
6871 selectedTemplate = this . $options . template ;
6972 }
@@ -132,6 +135,10 @@ export class CreateProjectCommand implements ICommand {
132135 key : constants . VueFlavorName ,
133136 description : "Learn more at https://nativescript.org/vue" ,
134137 } ,
138+ {
139+ key : constants . SvelteFlavorName ,
140+ description : "Learn more at https://svelte-native.technology" ,
141+ } ,
135142 {
136143 key : constants . TsFlavorName ,
137144 description : "Learn more at https://nativescript.org/typescript" ,
@@ -152,7 +159,7 @@ export class CreateProjectCommand implements ICommand {
152159 this . $logger . printMarkdown ( `# Let’s create a NativeScript app!` ) ;
153160 this . $logger . printMarkdown ( `
154161Answer 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.)
156163` ) ;
157164 }
158165 }
@@ -180,6 +187,10 @@ can skip this prompt next time using the --template option, or the --ng, --react
180187 selectedFlavorTemplates . push ( ...this . getVueTemplates ( ) ) ;
181188 break ;
182189 }
190+ case constants . SvelteFlavorName : {
191+ selectedFlavorTemplates . push ( ...this . getSvelteTemplates ( ) ) ;
192+ break ;
193+ }
183194 case constants . TsFlavorName : {
184195 selectedFlavorTemplates . push ( ...this . getTsTemplates ( ) ) ;
185196 break ;
@@ -285,6 +296,18 @@ can skip this prompt next time using the --template option, or the --ng, --react
285296 return templates ;
286297 }
287298
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+
288311 private getVueTemplates ( ) {
289312 const templates = [
290313 {
0 commit comments