generated from ExpediaGroup/new-project
-
Notifications
You must be signed in to change notification settings - Fork 28
/
plopfile.js
42 lines (41 loc) · 1.1 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
export default plop => {
plop.setHelper('spaceSeparatedCase', helper => helper.split('-').join(' '));
plop.setGenerator('helper', {
description: 'new github helper',
prompts: [
{
type: 'input',
name: 'helper',
message: 'New helper name (e.g. my-new-helper):'
},
{
type: 'input',
name: 'description',
message: 'Enter a detailed description of what the helper does and how it can be used:'
}
],
actions: [
{
type: 'add',
path: 'src/helpers/{{ helper }}.ts',
templateFile: 'templates/helper.hbs'
},
{
type: 'add',
path: 'test/helpers/{{ helper }}.test.ts',
templateFile: 'templates/test.hbs'
},
{
type: 'add',
path: '.github/workflows/{{ helper }}.yml',
templateFile: 'templates/workflow.hbs'
},
{
type: 'modify',
path: 'README.md',
pattern: /Each of the following helpers are defined in a file of the same name in `src\/helpers`:/g,
templateFile: 'templates/docs.hbs'
}
]
});
};