This repository has been archived by the owner on Nov 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sao.js
92 lines (90 loc) · 2.2 KB
/
sao.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
const superb = require('superb')
const slug = require('speakingurl')
const testCommands = {
tape: 'tape test/*.js | tap-spec',
jasmine: 'jasmine test',
mocha: 'mocha test',
ava: 'ava test'
}
module.exports = {
enforceNewFolder: true,
templateOptions: {
context: { slug }
},
prompts: {
name: {
message: 'What is the (unprefixed) name of the plugin?',
default: ':folderName:'
},
description: {
message: 'How would you describe the plugin?',
default: `my ${superb()} plugin for Taskr`
},
author: {
message: 'What is your name?',
default: ':gitUser:',
store: true
},
email: {
message: 'What is your email?',
default: ':gitEmail:',
store: true
},
username: {
message: 'What is your GitHub username or organization?',
default(answers) {
return slug(answers.author) || ':gitUser:'
},
store: true
},
website: {
message: 'The URL of your website?',
default({username}) {
return `github.com/${username}`
},
store: true
},
repo: {
message: "What is your GitHub repository's URL?",
default(answers) {
return `https://github.com/${answers.username}/${slug(slug(answers.name))}`;
},
store: true
},
testTool: {
type: 'list',
default: 'tape',
message: 'Set up default test?',
choices: [
{ name: 'Tape', value: 'tape' },
{ name: 'AVA', value: 'ava' },
{ name: 'Jasmine', value: 'jasmine' },
{ name: 'Mocha', value: 'mocha' }
]
}
},
data(answers) {
const slugName = slug(answers.name)
return add = {
slugName,
prefixedName: `taskr-${slugName}`,
testCommand: testCommands[answers.testTool]
}
},
move: {
'gitignore': '.gitignore',
'package': 'package.json',
'readme': 'readme.md',
'node_modules/**': false,
'.env': false,
},
filters: {
'test/test-tape.js': 'testTool === "tape"',
'test/test-ava.js': 'testTool === "ava"',
'test/test-jasmine.js': 'testTool === "jasmine"',
'test/test-mocha.js': 'testTool === "mocha"',
},
showTip: true,
gitInit: true,
installDependencies: true
}