forked from ExpediaGroup/github-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plopfile.js
43 lines (42 loc) · 1.17 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
// eslint-disable-next-line functional/immutable-data,import/no-commonjs
module.exports = 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'
}
]
});
};