forked from SimulatedGREG/electron-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meta.js
130 lines (123 loc) · 3.51 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
'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'
},
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
},
builder: {
type: 'list',
message: 'What build tool would you like to use?',
choices: [
{
name: 'electron-packager (https://github.com/electron-userland/electron-packager)',
value: 'packager',
short: 'packager'
},
{
name: 'electron-builder (https://github.com/electron-userland/electron-builder)',
value: 'builder',
short: 'builder'
}
]
}
},
helpers: {
isEnabled (list, check, opts) {
if (list[check]) return opts.fn(this)
else return opts.inverse(this)
},
deps (plugins) {
let output = ''
let dependencies = {
'vue-electron': '^1.0.6',
'vue-resource': '^1.0.3',
'vue-router': '^2.1.2',
'vuex': '^2.1.1'
}
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
},
testing (unit, e2e, opts) {
if (unit || e2e) {
return opts.fn(this)
}
}
},
filters: {
'app/src/renderer/routes.js': 'plugins[\'vue-router\']',
'app/src/renderer/components/LandingPageView/CurrentPage.vue': 'plugins[\'vue-router\']',
'app/src/renderer/vuex/**/*': 'plugins[\'vuex\']',
'builds/**/*': 'builder === \'packager\'',
'tasks/vue/**/*': 'plugins[\'vue-router\']',
'tasks/vuex/**/*': 'plugins[\'vuex\']',
'test/e2e/**/*': 'e2e',
'test/unit/**/*': 'unit',
'tasks/release.js': 'builder === \'packager\'',
'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`
}