-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.js
58 lines (57 loc) · 1.45 KB
/
init.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
module.exports = {
destination: {
default(data) {
return data.packageName;
},
},
prompts: {
packageHumanName: {
message: "Human-readable Name (e.g., 'Intercom')",
validate(val) {
return true;
},
},
packageName: {
message: 'Package / GitHub project name',
default(data) {
return 'hull-' + data.packageHumanName.toLowerCase().replace(/ /, '-');
},
validate(val) {
return (
/^([a-z0-9]+-?)+$/.test(val.trim()) ||
'Must be lower + dash-cased string'
);
},
},
packageGitHubOrg: {
message: 'GitHub organization name',
default(data) {
return 'hull-ships';
},
validate(val) {
return (
/^([^\s])*$/.test(val) || 'Must be GitHub-valid organization username'
);
},
},
packageDescription: {
message: 'Package description',
default(data) {
return `Synchronize Data with ${data.packageHumanName}`;
},
},
licenseOrg: {
message: 'License organization (e.g., you or your company)',
default(data) {
return data.packageGitHubOrg;
},
validate(val) {
return !!val.trim() || 'Must enter a license organization';
},
},
},
// Derived fields are asynchronous functions that are given the previous user
// input data of the form: `function (data, cb)`. They callback with:
// `(err, value)`.
derived: {},
};