This repository has been archived by the owner on Feb 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmeta.js
139 lines (138 loc) · 3.39 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
const os = require('os')
const githubAccountDefault = os.userInfo().username
module.exports = {
prompts: {
name: {
type: 'string',
required: true,
message: 'Plugin name'
},
description: {
type: 'string',
required: false,
message: 'Plugin description',
default: 'A Vue.js Plugin'
},
version: {
type: 'string',
required: false,
message: 'Initial version',
default: '0.0.0'
},
author: {
type: 'string',
message: 'Author'
},
branch: {
type: 'string',
required: true,
message: 'Development main branch name',
default: 'dev'
},
githubAccount: {
type: 'string',
required: false,
message: 'GitHub Account',
default: githubAccountDefault
},
e2e: {
type: 'confirm',
message: 'Setup e2e tests?'
},
coverage: {
type: 'confirm',
message: 'Setup coverage services?'
},
coverageConfig: {
when: 'coverage',
type: 'list',
message: 'Choice a coverage service',
choices: [
'coveralls',
'codecov'
],
default: ['codecov']
},
sauce: {
type: 'confirm',
message: 'Setup sauce tests?'
},
ci: {
type: 'confirm',
message: 'Setup CI services?'
},
ciConfig: {
when: 'ci',
type: 'list',
message: 'Choice a CI service',
choices: [
'travis',
'circleci'
],
default: ['circleci']
},
conventional: {
type: 'confirm',
message: 'Setup conventional-changelog tasks?'
},
conventionalConfig: {
when: 'conventional',
type: 'list',
message: 'Choice a conventional-changelog preset',
choices: [
{ name: 'none (configure it youreself)', value: 'none' },
{ name: 'angular', value: 'angular' },
{ name: 'atom', value: 'atom' },
{ name: 'codemirror', value: 'codemirror' },
{ name: 'ember', value: 'ember' },
{ name: 'eslint', value: 'eslint' },
{ name: 'express', value: 'express' },
{ name: 'jquery', value: 'jquery' },
{ name: 'jshint', value: 'jshint' }
]
},
docs: {
type: 'confirm',
message: 'Setup documentation?'
},
issue: {
type: 'confirm',
message: 'Setup issue guide?'
},
contribution: {
type: 'confirm',
message: 'Setup contribution guide?'
}
},
filters: {
"examples/**/*": 'e2e',
"test/e2e/**/*": 'e2e',
"test/e2e/**/*": 'e2e',
".travis.yml": "ciConfig === 'travis'",
"circle.yml": "ciConfig === 'circleci'",
"config/karma.coveralls.conf.js": "coverageConfig === 'coveralls'",
"docs/**/**": 'docs',
"config/version.js": 'docs',
".github/ISSUE_TEMPLATE.md": 'issue',
"CONTRIBUTING.md": "contribution"
},
helpers: {
nowYear: function () {
return new Date().getFullYear()
},
authorFullNameFrom: function (author) {
const startPosition = author.indexOf('<')
return author.slice(0, startPosition - 1)
},
authorEmailFrom: function (author) {
const startPosition = author.indexOf('<')
const endPosition = author.indexOf('>')
return author.slice(startPosition + 1, endPosition)
},
classify: function (str) {
return str.replace(/(?:^|[-_\/])(\w)/g, function (_, c) {
return c ? c.toUpperCase() : ''
})
}
}
}