-
Notifications
You must be signed in to change notification settings - Fork 202
/
Copy pathsaofile.js
80 lines (78 loc) · 1.93 KB
/
saofile.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
module.exports = {
transformer: 'handlebars',
prompts() {
return [
{
name: 'name',
required: true,
message: 'Project name',
default: this.outFolder
},
{
name: 'description',
required: false,
message: 'Project description',
default: 'My Superb Vue Project'
},
{
name: 'author',
message: 'Author',
default: this.gitUser.name
},
{
name: 'eslint',
type: 'confirm',
message: 'Do you want to support ESLint?'
},
{
name: 'jsx',
type: 'confirm',
message: 'Generate components in JSX format?',
default: false
},
{
name: 'electron',
type: 'confirm',
message: 'Support Electron?',
default: false
},
{
name: 'testcafe',
type: 'confirm',
message: 'Add testcafe to run integration tests?',
default: false
}
]
},
actions() {
return [
{
type: 'add',
files: '**',
filters: {
'client/components/*.vue': '!jsx',
'client/components/**/*.{js,css}': 'jsx',
'client/views/*.vue': '!jsx',
'client/views/**/*.{js,css}': 'jsx',
'app/*': 'electron',
'.eslintrc': 'eslint',
'test/e2e/*': 'testcafe'
},
transformExclude: 'build/index.html'
}
]
},
async completed() {
const { logger, gitInit, npmInstall, chalk, outFolder } = this
gitInit.call(this)
await npmInstall.call(this)
logger.success(`Your new Vue project has been successfully generated in ${chalk.underline(outFolder)}!`)
console.log()
console.log(chalk.bold(` To get started:\n`))
console.log(` cd ${outFolder}`)
console.log(` yarn`)
console.log(` yarn dev\n`)
console.log(chalk.bold(` To build for production:\n`))
console.log(` yarn build\n`)
}
}