@@ -8,18 +8,32 @@ export default class extends BaseGenerator {
8
8
constructor ( params ) {
9
9
super ( params ) ;
10
10
11
+ this . registerTemplates ( "common/" , [
12
+ // utils
13
+ "utils/config.ts" ,
14
+ "utils/date.ts" ,
15
+ ] ) ;
16
+
11
17
this . registerTemplates ( "angular/" , [
12
18
// COMMON COMPONENTS
13
19
"app/components/common/delete/delete.component.html" ,
14
20
"app/components/common/delete/delete.component.ts" ,
21
+ "app/components/common/header/header.component.css" ,
15
22
"app/components/common/header/header.component.html" ,
16
23
"app/components/common/header/header.component.ts" ,
17
24
"app/components/common/layout/layout.component.html" ,
18
25
"app/components/common/layout/layout.component.ts" ,
26
+ "app/components/common/sidebar/sidebar.component.css" ,
19
27
"app/components/common/sidebar/sidebar.component.html" ,
20
28
"app/components/common/sidebar/sidebar.component.ts" ,
21
- "app/components/common/table/table.component.html" ,
22
- "app/components/common/table/table.component.ts" ,
29
+ "app/components/common/svg/list-svg/list-svg.component.svg" ,
30
+ "app/components/common/svg/list-svg/list-svg.component.ts" ,
31
+ "app/components/common/svg/show-svg/show-svg.component.svg" ,
32
+ "app/components/common/svg/show-svg/show-svg.component.ts" ,
33
+ "app/components/common/svg/edit-svg/edit-svg.component.svg" ,
34
+ "app/components/common/svg/edit-svg/edit-svg.component.ts" ,
35
+ "app/components/common/svg/menu/menu.component.svg" ,
36
+ "app/components/common/svg/menu/menu.component.ts" ,
23
37
24
38
// COMPONENTS
25
39
"app/components/foo/create/create.component.html" ,
@@ -32,24 +46,17 @@ export default class extends BaseGenerator {
32
46
"app/components/foo/list/list.component.ts" ,
33
47
"app/components/foo/show/show.component.html" ,
34
48
"app/components/foo/show/show.component.ts" ,
49
+ "app/components/foo/table/table.component.html" ,
50
+ "app/components/foo/table/table.component.ts" ,
35
51
"app/app.component.html" ,
36
52
"app/app.component.ts" ,
37
53
38
- //SVG COMPONENT
39
- "app/components/svg/list-svg/list-svg.component.svg" ,
40
- "app/components/svg/list-svg/list-svg.component.ts" ,
41
- "app/components/svg/show-svg/show-svg.component.svg" ,
42
- "app/components/svg/show-svg/show-svg.component.ts" ,
43
- "app/components/svg/edit-svg/edit-svg.component.svg" ,
44
- "app/components/svg/edit-svg/edit-svg.component.ts" ,
45
- "app/components/svg/menu/menu.component.svg" ,
46
- "app/components/svg/menu/menu.component.ts" ,
47
-
48
54
//INTERFACE
49
55
"app/interface/api.ts" ,
50
56
51
57
// ROUTER
52
58
"app/router/foo.ts" ,
59
+ "app/router/index.ts" ,
53
60
"app/app.routes.ts" ,
54
61
55
62
//SERVICE
@@ -109,53 +116,53 @@ export default class extends BaseGenerator {
109
116
110
117
//CREATE DIRECTORIES - These directories may already exist
111
118
[
112
- `${ dir } /assets` ,
113
- `${ dir } /utils` ,
114
119
`${ dir } /app/components/${ lc } /create` ,
115
120
`${ dir } /app/components/${ lc } /edit` ,
116
121
`${ dir } /app/components/${ lc } /form` ,
117
122
`${ dir } /app/components/${ lc } /list` ,
118
123
`${ dir } /app/components/${ lc } /show` ,
124
+ `${ dir } /app/components/${ lc } /table` ,
119
125
`${ dir } /app/components/common/delete` ,
120
126
`${ dir } /app/components/common/header` ,
121
127
`${ dir } /app/components/common/sidebar` ,
122
- `${ dir } /app/components/common/table` ,
123
- `${ dir } /app/components/svg/list-svg` ,
124
- `${ dir } /app/components/svg/show-svg` ,
125
- `${ dir } /app/components/svg/edit-svg` ,
126
- `${ dir } /app/components/svg/menu` ,
128
+ `${ dir } /app/components/common/svg/list-svg` ,
129
+ `${ dir } /app/components/common/svg/show-svg` ,
130
+ `${ dir } /app/components/common/svg/edit-svg` ,
131
+ `${ dir } /app/components/common/svg/menu` ,
127
132
`${ dir } /app/interface` ,
128
133
`${ dir } /app/router` ,
129
134
`${ dir } /app/service` ,
135
+ `${ dir } /app/utils` ,
130
136
] . forEach ( ( dir ) => this . createDir ( dir , false ) ) ;
131
137
132
138
//CREATE FILE
133
139
[
134
- "app/components/svg/list-svg/list-svg.component.svg" ,
135
- "app/components/svg/list-svg/list-svg.component.ts" ,
136
- "app/components/svg/show-svg/show-svg.component.svg" ,
137
- "app/components/svg/show-svg/show-svg.component.ts" ,
138
- "app/components/svg/edit-svg/edit-svg.component.svg" ,
139
- "app/components/svg/edit-svg/edit-svg.component.ts" ,
140
- "app/components/svg/menu/menu.component.svg" ,
141
- "app/components/svg/menu/menu.component.ts" ,
140
+ "app/components/common/ svg/list-svg/list-svg.component.svg" ,
141
+ "app/components/common/ svg/list-svg/list-svg.component.ts" ,
142
+ "app/components/common/ svg/show-svg/show-svg.component.svg" ,
143
+ "app/components/common/ svg/show-svg/show-svg.component.ts" ,
144
+ "app/components/common/ svg/edit-svg/edit-svg.component.svg" ,
145
+ "app/components/common/ svg/edit-svg/edit-svg.component.ts" ,
146
+ "app/components/common/ svg/menu/menu.component.svg" ,
147
+ "app/components/common/ svg/menu/menu.component.ts" ,
142
148
"app/components/common/delete/delete.component.html" ,
143
149
"app/components/common/delete/delete.component.ts" ,
150
+ "app/components/common/header/header.component.css" ,
144
151
"app/components/common/header/header.component.html" ,
145
152
"app/components/common/header/header.component.ts" ,
146
153
"app/components/common/sidebar/sidebar.component.css" ,
147
154
"app/components/common/sidebar/sidebar.component.html" ,
148
155
"app/components/common/sidebar/sidebar.component.ts" ,
149
- "app/components/common/table/table.component.html" ,
150
- "app/components/common/table/table.component.ts" ,
151
156
"app/interface/api.ts" ,
157
+ "app/service/api.service.ts" ,
152
158
"app/app.component.html" ,
153
159
"app/app.component.ts" ,
154
160
"app/app.routes.ts" ,
155
161
] . forEach ( ( file ) =>
156
162
this . createFile ( file , `${ dir } /${ file } ` , context , false )
157
163
) ;
158
164
165
+ // DYNAMIC FILE
159
166
[
160
167
"app/router/%s.ts" ,
161
168
"app/components/%s/list/list.component.html" ,
@@ -169,9 +176,16 @@ export default class extends BaseGenerator {
169
176
"app/components/%s/show/show.component.html" ,
170
177
"app/components/%s/show/show.component.ts" ,
171
178
"app/components/%s/show/show.component.html" ,
179
+ "app/components/%s/table/table.component.html" ,
180
+ "app/components/%s/table/table.component.ts" ,
172
181
] . forEach ( ( file ) =>
173
182
this . createFileFromPattern ( file , dir , [ lc , formFields ] , context )
174
183
) ;
184
+
185
+ // CONFIG
186
+ this . createConfigFile ( `${ dir } /app/utils/config.ts` , {
187
+ entrypoint : api . entrypoint ,
188
+ } ) ;
175
189
}
176
190
177
191
parseFields ( resource ) {
0 commit comments