forked from vuetifyjs/vue-cli-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prompts.js
83 lines (80 loc) · 1.74 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
const path = require('path')
const resolve = file => path.resolve(__dirname, file)
const iconfonts = require(resolve('./util/iconfonts.js'))
const presets = require(resolve('./util/presets.js'))
const locales = require(resolve('./util/locales.js'))
function isCustom (answers) {
return answers.preset === 'configure'
}
module.exports = [
{
name: 'preset',
message: 'Choose a preset:',
type: 'list',
choices: [
...presets,
{ name: 'Configure (advanced)', value: 'configure' }
],
default: 'default'
},
{
name: 'replaceComponents',
type: 'confirm',
message: 'Use a pre-made template? (will replace App.vue and HelloWorld.vue)',
default: true,
when: isCustom
},
{
name: 'useTheme',
type: 'confirm',
message: 'Use custom theme?',
default: false,
when: isCustom
},
{
name: 'useCustomProperties',
type: 'confirm',
message: 'Use custom properties (CSS variables)?',
default: false,
when: isCustom
},
{
name: 'iconFont',
type: 'list',
message: 'Select icon font',
choices: iconfonts,
default: 'mdi',
when: isCustom
},
{
name: 'installFonts',
type: 'confirm',
message: 'Use fonts as a dependency (for Electron or offline)?',
default: false,
when: isCustom
},
{
name: 'useAlaCarte',
type: 'confirm',
message: 'Use a-la-carte components?',
default: true,
when: isCustom
},
{
name: 'usePolyfill',
type: 'confirm',
message: 'Use babel/polyfill?',
default: true,
when: answers => {
return isCustom(answers) && !answers.useAlaCarte
}
},
{
name: 'locale',
type: 'list',
message: 'Select locale',
choices: locales,
default: 'en',
when: isCustom
}
]