forked from atapas/webapis-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plopfile.js
69 lines (69 loc) · 1.71 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
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: '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: 'path',
message:
'Please provide the demo folder name(Any string without space. Example - payment-request):',
},
{
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:',
},
],
actions: [
{
type: 'add',
path: 'pages/demos/{{path}}/index.js',
templateFile: 'plop-templates/page.hbs',
},
{
type: 'add',
path: 'web-apis/{{path}}/index.js',
templateFile: 'plop-templates/api.hbs',
},
{
type: 'modify',
path: 'utils/data/demos.js',
pattern: /\/\/replace item here/gi,
templateFile: 'plop-templates/demo.hbs',
},
],
});
};