@@ -113,6 +113,7 @@ interface Responses {
113113 appName : string
114114 tauri : { window : { title : string } }
115115 recipeName : string
116+ installApi : boolean
116117}
117118
118119const allRecipes : Recipe [ ] = [ vanillajs , cra , vite , vuecli , ngcli , svelte ]
@@ -174,7 +175,8 @@ const runInit = async (argv: Argv): Promise<void> => {
174175 const defaults = {
175176 appName : 'tauri-app' ,
176177 tauri : { window : { title : 'Tauri App' } } ,
177- recipeName : 'vanillajs'
178+ recipeName : 'vanillajs' ,
179+ installApi : true
178180 }
179181
180182 // prompt initial questions
@@ -201,6 +203,13 @@ const runInit = async (argv: Argv): Promise<void> => {
201203 choices : recipeDescriptiveNames ,
202204 default : defaults . recipeName ,
203205 when : ! argv . ci && ! argv . r
206+ } ,
207+ {
208+ type : 'confirm' ,
209+ name : 'installApi' ,
210+ message : 'Add "@tauri-apps/api" npm package?' ,
211+ default : true ,
212+ when : ! argv . ci
204213 }
205214 ] )
206215 . catch ( ( error : { isTtyError : boolean } ) => {
@@ -218,6 +227,7 @@ const runInit = async (argv: Argv): Promise<void> => {
218227 const {
219228 appName,
220229 recipeName,
230+ installApi,
221231 tauri : {
222232 window : { title }
223233 }
@@ -334,7 +344,9 @@ const runInit = async (argv: Argv): Promise<void> => {
334344 logStep ( 'Installing any additional needed dependencies' )
335345 await install ( {
336346 appDir : appDirectory ,
337- dependencies : recipe . extraNpmDependencies ,
347+ dependencies : [ installApi ? '@tauri-apps/api@latest' : '' ] . concat (
348+ recipe . extraNpmDependencies
349+ ) ,
338350 devDependencies : [ `@tauri-apps/cli@${ tauriCLIVersion } ` ] . concat (
339351 recipe . extraNpmDevDependencies
340352 ) ,
0 commit comments