forked from fluctuo/multicycles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plopfile.js
50 lines (49 loc) · 1.36 KB
/
plopfile.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
module.exports = plop => {
plop.addHelper('totalyLower', name => {
return name.toLowerCase().replace(' ', '')
})
plop.setGenerator('provider', {
description: 'Create a provider',
prompts: [
{
type: 'input',
name: 'provider',
message: 'Provider name'
}
],
actions: [
{
type: 'addMany',
destination: 'providers/{{ totalyLower provider}}/',
templateFiles: 'templates/provider/**/*',
base: 'templates/provider/',
force: true,
abortOnFail: true
},
function customAction(answers) {
return [
'Go to work now:',
'= Provider =',
'+ Customise provider `getBicyclesByLatLng`',
' ',
'= Front =',
'+ run `npm run fragments`',
plop.renderString(
'+ Create `front/static/marker-{{ totalyLower provider }}.png` & `front/static/marker-{{ totalyLower provider }}-2x.png`',
answers
),
plop.renderString(
'+ Create `front/src/assets/providers/{{ totalyLower provider }}.jpg` logo 50px x 50px ',
answers
),
' ',
'= Developer',
'+ Add to Type developer/pages/docs.vue',
' ',
'= Status =',
'+ Add new components on status website'
].join('\n')
}
]
})
}