forked from SimulatedGREG/electron-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meta.js
139 lines (130 loc) · 3.76 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
'use strict'
module.exports = {
prompts: {
name: {
type: 'string',
required: true,
message: 'Application Name'
},
description: {
type: 'string',
required: false,
message: 'Project description',
default: 'An electron-vue project'
},
vueVersion: {
type: 'list',
required: true,
message: 'Which version of Vue.js would you like installed?',
choices: ['2.x', '1.x']
},
plugins: {
type: 'checkbox',
message: 'Select which Vue plugins to install',
choices: ['vue-electron', 'vue-resource', 'vue-router', 'vuex'],
default: ['vue-electron', 'vue-resource', 'vue-router', 'vuex']
},
plugins: {
type: 'checkbox',
message: 'Select which Vue plugins to install',
choices: ['vue-electron', 'vue-resource', 'vue-router', 'vuex'],
default: ['vue-electron', 'vue-resource', 'vue-router', 'vuex']
},
eslint: {
type: 'confirm',
require: true,
message: 'Use linting with ESLint?',
default: true
},
eslintConfig: {
when: 'eslint',
type: 'list',
message: 'Which eslint config would you like to use?',
choices: [
{
name: 'Standard (https://github.com/feross/standard)',
value: 'standard',
short: 'Standard'
},
{
name: 'AirBNB (https://github.com/airbnb/javascript)',
value: 'airbnb',
short: 'AirBNB'
},
{
name: 'none (configure it yourself)',
value: 'none',
short: 'none'
}
]
},
unit: {
type: 'confirm',
message: 'Setup unit testing with Karma + Mocha?',
required: true
},
e2e: {
type: 'confirm',
message: 'Setup end-to-end testing with Spectron + Mocha?',
require: true
}
},
helpers: {
isEnabled (list, check, opts) {
if (list[check]) return opts.fn(this)
else return opts.inverse(this)
},
deps (plugins, version) {
let output = ''
let dependencies = {
'vue-electron': '^1.0.0',
'vue-resource': '^1.0.3',
'vue-router': version === '2.x' ? '^2.0.0' : '^0.7.13',
'vuex': version === '2.x' ? '^2.0.0' : '^1.0.0'
}
if (Object.keys(plugins).length > 0) output += ',\n'
Object.keys(plugins).forEach((p, i) => {
output += ` "${p}": "${dependencies[p]}"`
if (i !== Object.keys(plugins).length - 1) output += ',\n'
})
return output
},
ver (version, module) {
let output = ''
if (module === 'core') {
output += '"vue": "'
output += (version === '2.x') ? '^2.0.1' : '^1.0.28'
output += '"'
} else {
output += '"vue-loader": "'
output += (version === '2.x') ? '^9.5.1' : '^8.5.2'
output += '",'
}
return output
},
testing (unit, e2e, opts) {
if (unit || e2e) {
return opts.fn(this)
}
}
},
filters: {
'app/src/routes.js': 'plugins[\'vue-router\']',
'app/src/components/LandingPageView/CurrentPage.vue': 'plugins[\'vue-router\']',
'app/src/vuex/**/*': 'plugins[\'vuex\']',
'tasks/vue/**/*': 'plugins[\'vue-router\']',
'tasks/vuex/**/*': 'plugins[\'vuex\']',
'test/e2e/**/*': 'e2e',
'test/unit/**/*': 'unit',
'test/.eslintrc': 'e2e || unit',
'.eslintignore': 'eslint',
'.eslintrc.js': 'eslint'
},
completeMessage: `---
All set. More configurations can be made at \x1b[33m{{destDirName}}/config.js\x1b[0m.
Make sure to check out the documentation for this boilerplate at \x1b[33mhttps://simulatedgreg.gitbooks.io/electron-vue/content/index.html\x1b[0m.
Next steps:
1. \x1b[34mcd {{destDirName}}\x1b[0m
2. \x1b[34mnpm install\x1b[0m
3. \x1b[34mnpm run dev\x1b[0m`
}