forked from atapas/webapis-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plopfile.js
73 lines (73 loc) · 1.8 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
module.exports = plop => {
// demo generator
plop.setGenerator('demo', {
description: 'add new demo',
prompts: [
{
type: 'input',
name: 'id',
message:
'Give us a demo id(Any string without space. Example - _payment_request_):',
},
{
type: 'input',
name: 'emoji',
message: 'Please provide a emoji thats represet the demo - 📺):',
},
{
type: 'input',
name: 'title',
message: 'Please provide a demo title(Example - Payment Request API):',
},
{
type: 'input',
name: 'description',
message: 'Tell us more about the demo(Max 1024 characters):',
},
{
type: 'input',
name: 'canIUseURL',
message:
'Give us the feature url from https://caniuse.com/(Example - https://caniuse.com/payment-request):',
},
{
type: 'input',
name: 'author',
message: 'Tell us your name:',
},
{
type: 'input',
name: 'twitter',
message: 'Your Twitter handle (Without the @):',
},
{
type: 'input',
name: 'email',
message: 'Your e-mail address:',
},
{
type: 'input',
name: 'github',
message: 'Your github username:',
},
],
actions: [
{
type: 'add',
path: 'src/modules/demos/{{dashCase id}}/index.tsx',
templateFile: 'plop-templates/page.hbs',
},
{
type: 'add',
path: 'src/modules/apis/{{dashCase id}}/index.ts',
templateFile: 'plop-templates/api.hbs',
},
{
type: 'modify',
path: 'src/modules/apis/data.ts',
pattern: /\/\/replace item here/gi,
templateFile: 'plop-templates/demo.hbs',
},
],
});
};