-
Notifications
You must be signed in to change notification settings - Fork 15
/
meta.js
48 lines (48 loc) · 1.3 KB
/
meta.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
module.exports = {
prompts: {
name: {
type: 'string',
required: true,
message: 'Application name'
},
label: {
type: 'string',
required: false,
message: 'Application conventional name',
default (data) {
return data.name.replace(/((?:^|-|_)+[a-z])/g, ($1) => $1.toUpperCase().replace('-', ''))
}
},
description: {
type: 'string',
required: false,
message: 'Application description',
default: 'A nwjs-vue application'
},
plugins: {
type: 'checkbox',
message: 'Select which Vue plugins to install',
choices: ['axios', 'vue-router', 'vuex'],
default: ['axios', 'vue-router', 'vuex']
}
},
helpers: {
isEnabled (list, check, opts) {
if (list[check]) return opts.fn(this)
else return opts.inverse(this)
}
},
filters: {
'app/main/router/**/*': 'plugins[\'vue-router\']',
'app/main/store/**/*': 'plugins[\'vuex\']'
},
complete (data) {
console.log()
console.log(' Welcome to your new nwjs-vue project!')
console.log()
console.log(' Next steps:')
if (!data.inPlace) console.log(` \x1b[33m$\x1b[0m cd ${data.destDirName}`)
console.log(' \x1b[33m$\x1b[0m npm install')
console.log(' \x1b[33m$\x1b[0m npm run dev')
}
}