-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplopfile.ts
123 lines (123 loc) · 3.8 KB
/
plopfile.ts
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module.exports = function (
/** @type {import('plop').NodePlopAPI} */
plop,
) {
plop.setGenerator('component', {
description: 'Create a component',
prompts: [
{
type: 'input',
name: 'name',
message: 'What is your component name?',
},
{
type: 'input',
name: 'path',
message:
'At which path would you like to add this component? (Basic/Layouts/Modals/Specific)?',
},
],
actions: [
{
type: 'add',
path:
'src/components/{{pascalCase path}}/{{pascalCase name}}/index.tsx',
templateFile: 'src/plopTemplates/Component/index.tsx.hbs',
},
{
type: 'add',
path:
'src/components/{{pascalCase path}}/{{pascalCase name}}/{{pascalCase name}}.react.tsx',
templateFile: 'src/plopTemplates/Component/Component.react.tsx.hbs',
},
{
type: 'add',
path:
'src/components/{{pascalCase path}}/{{pascalCase name}}/{{pascalCase name}}View.react.tsx',
templateFile: 'src/plopTemplates/Component/ComponentView.react.tsx.hbs',
},
{
type: 'add',
path:
'src/components/{{pascalCase path}}/{{pascalCase name}}/{{pascalCase name}}Reducer.tsx',
templateFile: 'src/plopTemplates/Component/ComponentReducer.tsx.hbs',
},
{
type: 'add',
path:
'src/components/{{pascalCase path}}/{{pascalCase name}}/{{pascalCase name}}Util.tsx',
templateFile: 'src/plopTemplates/Component/ComponentUtil.tsx.hbs',
},
{
type: 'add',
path:
'src/components/{{pascalCase path}}/{{pascalCase name}}/{{pascalCase name}}.module.scss',
templateFile: 'src/plopTemplates/Component/Component.module.scss.hbs',
},
{
type: 'add',
path:
'src/components/{{pascalCase path}}/{{pascalCase name}}/{{pascalCase name}}.media.scss',
templateFile: 'src/plopTemplates/Component/Component.media.scss.hbs',
},
],
});
plop.setGenerator('route', {
description: 'Create a Route',
prompts: [
{
type: 'input',
name: 'name',
message: 'What is your route name?',
},
{
type: 'input',
name: 'path',
message: 'At which path would you like to add this route?',
},
],
actions: [
{
type: 'add',
path: 'src/routes/{{lowerCase path}}/{{lowerCase name}}/index.tsx',
templateFile: 'src/plopTemplates/Route/index.tsx.hbs',
},
{
type: 'add',
path:
'src/routes/{{lowerCase path}}/{{lowerCase name}}/{{pascalCase name}}.react.tsx',
templateFile: 'src/plopTemplates/Route/Route.react.tsx.hbs',
},
{
type: 'add',
path:
'src/routes/{{lowerCase path}}/{{lowerCase name}}/{{pascalCase name}}View.react.tsx',
templateFile: 'src/plopTemplates/Route/RouteView.react.tsx.hbs',
},
{
type: 'add',
path:
'src/routes/{{lowerCase path}}/{{lowerCase name}}/{{pascalCase name}}Reducer.tsx',
templateFile: 'src/plopTemplates/Route/RouteReducer.tsx.hbs',
},
{
type: 'add',
path:
'src/routes/{{lowerCase path}}/{{lowerCase name}}/{{pascalCase name}}Util.tsx',
templateFile: 'src/plopTemplates/Route/RouteUtil.tsx.hbs',
},
{
type: 'add',
path:
'src/routes/{{lowerCase path}}/{{lowerCase name}}/{{pascalCase name}}.module.scss',
templateFile: 'src/plopTemplates/Route/Route.module.scss.hbs',
},
{
type: 'add',
path:
'src/routes/{{lowerCase path}}/{{lowerCase name}}/{{pascalCase name}}.media.scss',
templateFile: 'src/plopTemplates/Route/Route.media.scss.hbs',
},
],
});
};