-
Notifications
You must be signed in to change notification settings - Fork 0
/
meta.js
54 lines (53 loc) · 1.17 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
function CamelCase (str) {
if (!str) return ''
str = str.toLowerCase()
return str.replace(/([-_]|\s|\b)+([A-Za-z0-9])/g, (str, $1, $2) => {
return $2.toUpperCase()
})
}
module.exports = {
prompts: {
name: {
type: 'string',
required: true,
message: 'component name'
},
description: {
type: 'string',
required: false,
message: 'component description',
default: 'A Vue.js component',
},
author: {
type: 'string',
message: 'Author',
},
autoInstall: {
type: 'list',
message: 'Should we run `npm install` for you after the project has been created?',
choices: [
{
name: 'Yes, use NPM',
value: 'npm',
short: 'npm',
},
{
name: 'Yes, use Yarn',
value: 'yarn',
short: 'yarn',
},
{
name: 'No, I will handle that myself',
value: false,
short: 'no',
},
],
},
},
renames: {
'src/components/Component.vue': (fileName, options) => {
options.componentName = CamelCase(options.name)
return options.componentName + '.vue'
}
}
}