-
Notifications
You must be signed in to change notification settings - Fork 2
/
plopfile.js
57 lines (56 loc) · 1.3 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
module.exports = plop => {
plop.setGenerator('config', {
description: 'Create a config',
prompts: [
{
type: 'input',
name: 'name',
message: `What's the name? (ex: "seo-mobile")`
},
{
type: 'input',
name: 'type',
message: `What type? (ex: "groups")`
},
],
actions: [
{
type: 'add',
path: 'src/config/{{type}}/{{name}}.ts',
templateFile: 'templates/standardConfig.ts.hbs'
},
]
});
plop.setGenerator('auditConfig', {
description: 'Create an audit config',
prompts: [
{
type: 'input',
name: 'id',
message: `What is the id? (ex: "aria-roles")`
},
{
type: 'input',
name: 'path',
message: `What is the path? (ex: "accessibility/aria-roles")`
},
],
actions: [
{
type: 'add',
path: 'src/@types/lighthouse-audit-{{id}}.d.ts',
templateFile: 'templates/auditConfigType.ts.hbs'
},
{
type: 'add',
path: 'src/__tests__/config/audits/{{id}}.test.ts',
templateFile: 'templates/auditConfigTest.ts.hbs'
},
{
type: 'add',
path: 'src/config/audits/{{id}}.ts',
templateFile: 'templates/auditConfig.ts.hbs'
},
],
});
};