-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplopfile.js
46 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
44
45
46
module.exports = plop => {
plop.setGenerator('structure', {
description: 'Create a component with folder structure',
prompts: [
{
type: 'input',
name: 'name',
message: 'What is your component name?'
},
],
actions: [
{
// Create main component file
type: 'add',
path: 'src/modules/{{name}}/{{name}}.module.ts',
templateFile: 'templates/module.ts'
},
{
// Create flow folder with a placeholder file
type: 'add',
path: 'src/modules/{{name}}/flow/index.ts',
},
{
// Create controller folder with a placeholder file
type: 'add',
path: 'src/modules/{{name}}/controller/{{name}}.controller.ts',
templateFile: 'templates/controller.ts'
},
{
// Create service folder with a placeholder file
type: 'add',
path: 'src/modules/{{name}}/service/{{name}}.service.ts',
templateFile: 'templates/service.ts'
},
{
// Create service folder with a placeholder file
type: 'add',
path: 'src/modules/{{name}}/model/{{name}}.data.ts',
},
],
});
};