-
Notifications
You must be signed in to change notification settings - Fork 2
/
prompts.js
131 lines (128 loc) · 2.46 KB
/
prompts.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
// https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli/lib/promptModules/vuex.js
// module.exports = cli => {
// cli.injectFeature({
// name: 'cssPreprocessor',
// type: 'list',
// ...
// })
// cli.injectPrompt({
// name: 'routerHistoryMode',
// when: answers => answers.features.includes('router'),
// type: 'confirm',
// ...
// })
// cli.onPromptComplete((answers, options) => {
// if (answers.features.includes('router')) {
// options.router = true
// options.routerHistoryMode = answers.routerHistoryMode
// }
// })
// }
module.exports = [
{
name: 'cssPreprocessor',
type: 'list',
message: 'Add support for CSS pre-processors like Sass or Less',
choices: [
{
name: 'Less',
value: 'less'
},
{
name: 'Sass/SCSS',
value: 'sass'
}
],
default: 'less'
},
{
name: 'Vue Router mode',
type: 'list',
message: 'Choice Vue Router History mode',
choices: [
{
name: 'Hash',
value: 'hash'
},
{
name: 'history',
value: 'history'
}
],
default: 'hash'
},
{
name: 'Typescript',
type: 'confirm',
message: 'Add support for the TypeScript language (default: None)',
default: false
},
{
name: 'pwa',
type: 'confirm',
message: 'Progressive Web App (PWA) Support (default: None)',
default: false
},
{
name: 'SSR',
type: 'list',
message: 'Add support for Server-Side Rendering',
choices: [
{
name: 'None',
value: 'none'
},
{
name: 'Nuxt',
value: 'nuxt'
}
// ,
// {
// name: 'egg.js',
// value: 'egg'
// }
],
default: 'none'
},
{
name: 'ui-framework',
type: 'list',
message: 'choice UI Framework',
choices: [
{
name: 'iView',
value: 'iview'
},
{
name: 'Element UI',
value: 'element-ui'
}
],
default: 'iview'
},
{
name: 'Mock Server',
type: 'list',
message: 'choice mock server',
choices: [
{
name: 'Easy Mock',
value: 'easymock'
},
{
name: 'Kuaizi db',
value: 'kzdb'
}
],
default: 'easymock'
},
{
name: 'Server Port',
type: 'input',
message: 'Input DevServer Port(default: 8081)',
default: '8081',
validate: (n) => {
return !isNaN(+n)
}
}
]