Skip to content

Commit 5796f8e

Browse files
committed
removed the without-nvw structure from the simple template
changed the generator from even considering with or without nvw
1 parent d9590ed commit 5796f8e

26 files changed

+4
-61
lines changed

Diff for: generator/index.js

+4-35
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,9 @@ module.exports = async (api, options, rootOptions) => {
2323
// to simply change the file's extension
2424
const jsOrTs = api.hasPlugin('typescript') ? '.ts' : '.js';
2525

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
3727
const templateTypePathModifer = options.templateType;
3828

39-
4029
// New Project & Native Only -- should never be able to use Nativescript-Vue-Web
4130
if (options.isNativeOnly === 'native' && options.isNVW) {
4231
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) => {
191180
if (options.isNativeOnly === 'dual') {
192181
api.render(async () => {
193182
// 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');
195184

196185
// 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');
198187

199188
// add router statements to src/main.*s
200189
await vueRouterSetup(api, dirPathPrefix, jsOrTs);
@@ -206,34 +195,14 @@ module.exports = async (api, options, rootOptions) => {
206195
} else { // Is Native Only
207196
api.render(async () => {
208197
// 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');
211199

212200
// add vuex statements to app/main.*s
213201
await vuexSetup(api, options, dirPathPrefix, jsOrTs);
214202

215203
})
216204
}
217205

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-
237206
api.onCreateComplete(() => {
238207

239208
// make changes to .gitignore

Diff for: index.js

-26
Original file line numberDiff line numberDiff line change
@@ -489,32 +489,6 @@ const nativeConfig = (api, projectOptions, env, platform, jsOrTs) => {
489489
.use(ForkTsCheckerWebpackPlugin, [forTSPluginConfig])
490490
.end();
491491
}
492-
493-
// // // // causes error on compile at the moment
494-
// // // config.plugin('extract-css').tap(args => {
495-
// // // if (!args.length) return args;
496-
497-
// // // args[0].filename = 'app.css'
498-
// // // args[0].chunkFilename = 'vendor.css'
499-
500-
// // // return args;
501-
// // // })
502-
503-
// // // // causes error on compile at the moment
504-
// // // const nodeModulesPath = api.resolve('node_modules')
505-
// // // config.externals((context, request, callback) => {
506-
// // // if (context.startsWith(nodeModulesPath)) {
507-
// // // const module = context.replace(nodeModulesPath, '').split(path.sep).find(p => !!p)
508-
// // // try {
509-
// // // const pkg = require(path.resolve(nodeModulesPath, module, 'package.json'))
510-
// // // if(pkg.nativescript) {
511-
// // // return callback(null, 'commonjs ' + request)
512-
// // // }
513-
// // // } catch (e) {
514-
// // // }
515-
// // // }
516-
// // // callback()
517-
// // // })
518492
})
519493

520494

0 commit comments

Comments
 (0)