@@ -23,20 +23,9 @@ module.exports = async (api, options, rootOptions) => {
23
23
// to simply change the file's extension
24
24
const jsOrTs = api . hasPlugin ( 'typescript' ) ? '.ts' : '.js' ;
25
25
26
- // These next two variables make it possible to match the template directory structure
27
- // with the answers to their corrosponding prompts and have the plugin automatically
28
- // know which paths to take to get the correct template. If we add template Types in the
29
- // future, hopefully no other work will need done to modify the plugin to accomdate
30
- // the pathing to the template directories.
31
- //
32
- // For example. A template type of 'simple' and a non NativeScript-Vue-Web project will
33
- // have a template path that equals: ./templates/simple/without-nvw
34
- // If it's a template type of 'simple' but is a NativeScript-Vue-Web project then it will
35
- // have a template path that equals: ./templates/simple/with-nvw
36
- const templateNVWPathModifier = options . isNVW === true ? 'without-nvw' : 'without-nvw'
26
+ // A template type of 'simple' project will have a template path that equals: ./templates/simple
37
27
const templateTypePathModifer = options . templateType ;
38
28
39
-
40
29
// New Project & Native Only -- should never be able to use Nativescript-Vue-Web
41
30
if ( options . isNativeOnly === 'native' && options . isNVW ) {
42
31
throw Error ( 'Invalid options chosen. You cannot have a Native only project and use Nativescript-Vue-Web' )
@@ -191,10 +180,10 @@ module.exports = async (api, options, rootOptions) => {
191
180
if ( options . isNativeOnly === 'dual' ) {
192
181
api . render ( async ( ) => {
193
182
// render src directory
194
- await renderDirectory ( api , jsOrTs , commonRenderOptions , path . join ( 'templates' , templateTypePathModifer , templateNVWPathModifier , 'src' ) , dirPathPrefix + 'src' ) ;
183
+ await renderDirectory ( api , jsOrTs , commonRenderOptions , path . join ( 'templates' , templateTypePathModifer , 'src' ) , dirPathPrefix + 'src' ) ;
195
184
196
185
// render app directory
197
- await renderDirectory ( api , jsOrTs , commonRenderOptions , path . join ( 'templates' , templateTypePathModifer , templateNVWPathModifier , 'app' ) , dirPathPrefix + 'app' ) ;
186
+ await renderDirectory ( api , jsOrTs , commonRenderOptions , path . join ( 'templates' , templateTypePathModifer , 'app' ) , dirPathPrefix + 'app' ) ;
198
187
199
188
// add router statements to src/main.*s
200
189
await vueRouterSetup ( api , dirPathPrefix , jsOrTs ) ;
@@ -206,34 +195,14 @@ module.exports = async (api, options, rootOptions) => {
206
195
} else { // Is Native Only
207
196
api . render ( async ( ) => {
208
197
// render app directory
209
- //await renderFilesIndividually(api, jsOrTs, appfiles, commonRenderOptions, './templates/simple/without-nvw/app', dirPathPrefix + 'app');
210
- await renderDirectory ( api , jsOrTs , commonRenderOptions , path . join ( 'templates' , templateTypePathModifer , templateNVWPathModifier , 'app' ) , dirPathPrefix + 'app' ) ;
198
+ await renderDirectory ( api , jsOrTs , commonRenderOptions , path . join ( 'templates' , templateTypePathModifer , 'app' ) , dirPathPrefix + 'app' ) ;
211
199
212
200
// add vuex statements to app/main.*s
213
201
await vuexSetup ( api , options , dirPathPrefix , jsOrTs ) ;
214
202
215
203
} )
216
204
}
217
205
218
- // } else { // once we integrate NativeScript-Vue-Web, we'll put options here
219
-
220
- // // render src directory
221
- // await renderDirectory(api, jsOrTs, commonRenderOptions, path.join('templates', templateTypePathModifer, templateNVWPathModifier, 'src'), dirPathPrefix + 'src');
222
-
223
- // // render app directory
224
- // await renderDirectory(api, jsOrTs, commonRenderOptions, path.join('templates', templateTypePathModifer, templateNVWPathModifier, 'app'), dirPathPrefix + 'app');
225
-
226
- // // add router statements to src/main.*s
227
- // await vueRouterSetup(api, dirPathPrefix, jsOrTs);
228
-
229
- // // add vuex statements to app/main.*s
230
- // await vuexSetup(api, options, dirPathPrefix, jsOrTs);
231
-
232
-
233
- // }
234
-
235
-
236
-
237
206
api . onCreateComplete ( ( ) => {
238
207
239
208
// make changes to .gitignore
0 commit comments