@acorex/platform-generator 19.2.12 → 19.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generators.json +10 -0
- package/package.json +4 -1
- package/src/bin/interactive-entity-creator.js +448 -0
- package/src/bin/test-entity-creator.js +48 -0
- package/src/generators/app-module/files/src/app/app.module.ts.template +0 -3
- package/src/generators/app-module/files/src/app/modules/root/sample/sample.service.ts.template +1 -1
- package/src/generators/app-module/files/src/app/modules/root/sample/sample.types.ts.template +1 -1
- package/src/generators/create-app-module/files/__fileName__/src/index.ts__tmpl__ +9 -0
- package/src/generators/create-app-module/files/__fileName__/src/lib/__fileName__.module.ts__tmpl__ +44 -0
- package/src/generators/create-app-module/files/__fileName__/src/lib/const.ts__tmpl__ +19 -0
- package/src/generators/create-app-module/files/__fileName__/src/lib/entity.provider.ts__tmpl__ +33 -0
- package/src/generators/create-app-module/files/__fileName__/src/lib/menu.provider.ts__tmpl__ +29 -0
- package/src/generators/create-app-module/files/__fileName__/src/lib/permission.provider.ts__tmpl__ +13 -0
- package/src/generators/create-app-module/files/__fileName__/src/lib/search-command.provider.ts__tmpl__ +17 -0
- package/src/generators/create-app-module/files/__fileName__/src/lib/setting.provider.ts__tmpl__ +29 -0
- package/src/generators/create-module-entity/files/__entityFileName__.entity.ts__tmpl__ +150 -0
- package/src/generators/create-module-entity/files/__entityFileName__.service.ts__tmpl__ +16 -0
- package/src/generators/create-module-entity/files/__entityFileName__.types.ts__tmpl__ +6 -0
- package/src/generators/create-module-entity/files/index.ts__tmpl__ +3 -0
- package/src/generators/create-module-entity/generator.d.ts +11 -0
- package/src/generators/create-module-entity/generator.js +338 -20
- package/src/generators/create-module-entity/generator.js.map +1 -1
- package/src/generators/create-module-entity/schema.json +85 -2
- package/src/generators/create-tag-entity/files/index.ts__tmpl__ +3 -0
- package/src/generators/create-tag-entity/files/tag-__entityFileName__.entity.ts__tmpl__ +240 -0
- package/src/generators/create-tag-entity/files/tag-__entityFileName__.service.ts__tmpl__ +16 -0
- package/src/generators/create-tag-entity/files/tag-__entityFileName__.types.ts__tmpl__ +6 -0
- package/src/generators/create-tag-entity/generator.d.ts +7 -0
- package/src/generators/create-tag-entity/generator.js +111 -0
- package/src/generators/create-tag-entity/generator.js.map +1 -0
- package/src/generators/create-tag-entity/schema.json +16 -0
- package/src/generators/create-widget/files/__fileName__-widget-column.component.ts__tmpl__ +11 -0
- package/src/generators/create-widget/files/__fileName__-widget-edit.component.ts__tmpl__ +35 -0
- package/src/generators/create-widget/files/__fileName__-widget-filter.component.ts__tmpl__ +12 -0
- package/src/generators/create-widget/files/__fileName__-widget-print.component.ts__tmpl__ +11 -0
- package/src/generators/create-widget/files/__fileName__-widget-view.component.ts__tmpl__ +14 -0
- package/src/generators/create-widget/files/__fileName__-widget.config.ts__tmpl__ +44 -0
- package/src/generators/create-widget/files/index.ts__tmpl__ +6 -0
- package/src/generators/create-widget/generator.d.ts +8 -0
- package/src/generators/create-widget/generator.js +99 -0
- package/src/generators/create-widget/generator.js.map +1 -0
- package/src/generators/create-widget/schema.d.ts +6 -0
- package/src/generators/create-widget/schema.json +66 -0
- package/src/generators/index.d.ts +0 -0
- package/src/generators/index.js +1 -0
- package/src/generators/index.js.map +1 -0
|
@@ -6,6 +6,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const path = require("path");
|
|
7
7
|
function default_1(tree, schema) {
|
|
8
8
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
schema.entity = schema.entity !== undefined ? schema.entity : true;
|
|
9
10
|
const normalizedNames = generateNameVariants(schema.name, 'entity');
|
|
10
11
|
const normalizedModuleNames = generateNameVariants(schema.moduleName, 'module');
|
|
11
12
|
const targetDir = (0, devkit_1.joinPathFragments)('libs', 'modules', // Ensure 'modules' is part of the path
|
|
@@ -15,11 +16,30 @@ function default_1(tree, schema) {
|
|
|
15
16
|
{
|
|
16
17
|
text: \`\${scope}.${normalizedNames.entityPropertyName}\`,
|
|
17
18
|
path: '',
|
|
18
|
-
icon: ''
|
|
19
|
+
icon: '${schema.icon || 'fa-light fa-default'}'
|
|
19
20
|
},
|
|
20
21
|
`;
|
|
22
|
+
// Process custom properties
|
|
23
|
+
const propertyDefinitions = processProperties(schema);
|
|
24
|
+
// Generate actual property code for the entity file
|
|
25
|
+
const entityPropertiesCode = generateEntityProperties(propertyDefinitions);
|
|
26
|
+
const entityColumnsCode = generateEntityColumns(propertyDefinitions);
|
|
27
|
+
const layoutPropertiesCode = generateLayoutProperties(propertyDefinitions);
|
|
28
|
+
const modelPropertiesCode = generateModelProperties(propertyDefinitions);
|
|
29
|
+
const firstPropertyName = propertyDefinitions.length > 0 ? propertyDefinitions[0].name : 'name';
|
|
21
30
|
const targetDirModule = (0, devkit_1.joinPathFragments)('libs', 'modules', normalizedModuleNames.moduleFileName);
|
|
22
|
-
(0, devkit_1.
|
|
31
|
+
const entityFilePath = (0, devkit_1.joinPathFragments)(targetDir, `${normalizedNames.entityFileName}.entity.ts`);
|
|
32
|
+
if (schema.entity !== false) {
|
|
33
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), targetDir, Object.assign(Object.assign(Object.assign(Object.assign({}, schema), normalizedModuleNames), normalizedNames), { entityPropertiesCode,
|
|
34
|
+
entityColumnsCode,
|
|
35
|
+
layoutPropertiesCode,
|
|
36
|
+
modelPropertiesCode,
|
|
37
|
+
firstPropertyName, tmpl: '' }));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Remove the entity file from the generated files
|
|
41
|
+
tree.delete(entityFilePath);
|
|
42
|
+
}
|
|
23
43
|
function generateNameVariants(baseName, prefix) {
|
|
24
44
|
const formattedNames = (0, devkit_1.names)(baseName);
|
|
25
45
|
//const capitalizedPrefix = prefix.charAt(0).toUpperCase() + prefix.slice(1);
|
|
@@ -35,35 +55,333 @@ function default_1(tree, schema) {
|
|
|
35
55
|
function toSpacedString(str) {
|
|
36
56
|
return str.replace(/([a-z0-9])([A-Z])/g, '$1 $2').toLowerCase();
|
|
37
57
|
}
|
|
58
|
+
function processProperties(schema) {
|
|
59
|
+
// Handle both array and string inputs for backward compatibility
|
|
60
|
+
let propNames = [];
|
|
61
|
+
let dataTypes = [];
|
|
62
|
+
let requiredProps = [];
|
|
63
|
+
let colSpans = [];
|
|
64
|
+
let orders = [];
|
|
65
|
+
let enableSorts = [];
|
|
66
|
+
let enableFilters = [];
|
|
67
|
+
let enableInlineFilters = [];
|
|
68
|
+
let inColumns = [];
|
|
69
|
+
// Process properties
|
|
70
|
+
if (Array.isArray(schema.properties)) {
|
|
71
|
+
propNames = schema.properties;
|
|
72
|
+
}
|
|
73
|
+
else if (schema.properties === '_interactive_') {
|
|
74
|
+
// This will be handled by the interactive prompt in NX
|
|
75
|
+
// For now, use defaults
|
|
76
|
+
propNames = ['name', 'title'];
|
|
77
|
+
}
|
|
78
|
+
else if (schema.properties) {
|
|
79
|
+
propNames = schema.properties.split(',').map((p) => p.trim());
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
propNames = ['name', 'title'];
|
|
83
|
+
}
|
|
84
|
+
// Process data types
|
|
85
|
+
if (Array.isArray(schema.dataTypes)) {
|
|
86
|
+
dataTypes = schema.dataTypes;
|
|
87
|
+
}
|
|
88
|
+
else if (schema.dataTypes === '_interactive_') {
|
|
89
|
+
// This will be handled by the interactive prompt in NX
|
|
90
|
+
// For now, use string for all properties
|
|
91
|
+
dataTypes = Array(propNames.length).fill('string');
|
|
92
|
+
}
|
|
93
|
+
else if (schema.dataTypes) {
|
|
94
|
+
dataTypes = schema.dataTypes.split(',').map((t) => t.trim());
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
dataTypes = Array(propNames.length).fill('string');
|
|
98
|
+
}
|
|
99
|
+
// Ensure dataTypes has the same length as propNames
|
|
100
|
+
while (dataTypes.length < propNames.length) {
|
|
101
|
+
dataTypes.push('string');
|
|
102
|
+
}
|
|
103
|
+
// Process required properties
|
|
104
|
+
if (Array.isArray(schema.required)) {
|
|
105
|
+
requiredProps = schema.required;
|
|
106
|
+
}
|
|
107
|
+
else if (schema.required === '_all_') {
|
|
108
|
+
requiredProps = [...propNames];
|
|
109
|
+
}
|
|
110
|
+
else if (schema.required === '_none_') {
|
|
111
|
+
requiredProps = [];
|
|
112
|
+
}
|
|
113
|
+
else if (schema.required === '_interactive_') {
|
|
114
|
+
// This will be handled by the interactive prompt in NX
|
|
115
|
+
// For now, use first two properties as required
|
|
116
|
+
requiredProps = propNames.slice(0, 2);
|
|
117
|
+
}
|
|
118
|
+
else if (schema.required) {
|
|
119
|
+
requiredProps = schema.required.split(',').map((r) => r.trim());
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
requiredProps = propNames.slice(0, 2); // First two properties are required by default
|
|
123
|
+
}
|
|
124
|
+
// Process column spans
|
|
125
|
+
if (Array.isArray(schema.colSpans)) {
|
|
126
|
+
colSpans = schema.colSpans;
|
|
127
|
+
}
|
|
128
|
+
else if (schema.colSpans) {
|
|
129
|
+
colSpans = schema.colSpans.split(',').map((c) => c.trim());
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
colSpans = Array(propNames.length).fill('6'); // Default column span is 6 (half of 12-column grid)
|
|
133
|
+
}
|
|
134
|
+
// Ensure colSpans has the same length as propNames
|
|
135
|
+
while (colSpans.length < propNames.length) {
|
|
136
|
+
colSpans.push('6');
|
|
137
|
+
}
|
|
138
|
+
// Process orders
|
|
139
|
+
if (Array.isArray(schema.orders)) {
|
|
140
|
+
orders = schema.orders;
|
|
141
|
+
}
|
|
142
|
+
else if (schema.orders) {
|
|
143
|
+
orders = schema.orders.split(',').map((o) => o.trim());
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
// Default order is sequential starting from 1
|
|
147
|
+
orders = propNames.map((_, index) => (index + 1).toString());
|
|
148
|
+
}
|
|
149
|
+
// Ensure orders has the same length as propNames
|
|
150
|
+
while (orders.length < propNames.length) {
|
|
151
|
+
orders.push((orders.length + 1).toString());
|
|
152
|
+
}
|
|
153
|
+
// Process enableSorts
|
|
154
|
+
if (Array.isArray(schema.enableSorts)) {
|
|
155
|
+
enableSorts = schema.enableSorts;
|
|
156
|
+
}
|
|
157
|
+
else if (schema.enableSorts) {
|
|
158
|
+
enableSorts = schema.enableSorts.split(',').map((s) => s.trim());
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
enableSorts = Array(propNames.length).fill('true'); // Default is true
|
|
162
|
+
}
|
|
163
|
+
// Ensure enableSorts has the same length as propNames
|
|
164
|
+
while (enableSorts.length < propNames.length) {
|
|
165
|
+
enableSorts.push('true');
|
|
166
|
+
}
|
|
167
|
+
// Process enableFilters
|
|
168
|
+
if (Array.isArray(schema.enableFilters)) {
|
|
169
|
+
enableFilters = schema.enableFilters;
|
|
170
|
+
}
|
|
171
|
+
else if (schema.enableFilters) {
|
|
172
|
+
enableFilters = schema.enableFilters.split(',').map((f) => f.trim());
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
enableFilters = Array(propNames.length).fill('true'); // Default is true
|
|
176
|
+
}
|
|
177
|
+
// Ensure enableFilters has the same length as propNames
|
|
178
|
+
while (enableFilters.length < propNames.length) {
|
|
179
|
+
enableFilters.push('true');
|
|
180
|
+
}
|
|
181
|
+
// Process enableInlineFilters
|
|
182
|
+
if (Array.isArray(schema.enableInlineFilters)) {
|
|
183
|
+
enableInlineFilters = schema.enableInlineFilters;
|
|
184
|
+
}
|
|
185
|
+
else if (schema.enableInlineFilters) {
|
|
186
|
+
enableInlineFilters = schema.enableInlineFilters.split(',').map((f) => f.trim());
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
enableInlineFilters = Array(propNames.length).fill('false'); // Default is false
|
|
190
|
+
}
|
|
191
|
+
// Ensure enableInlineFilters has the same length as propNames
|
|
192
|
+
while (enableInlineFilters.length < propNames.length) {
|
|
193
|
+
enableInlineFilters.push('false');
|
|
194
|
+
}
|
|
195
|
+
// Process inColumns
|
|
196
|
+
if (Array.isArray(schema.inColumns)) {
|
|
197
|
+
inColumns = schema.inColumns;
|
|
198
|
+
}
|
|
199
|
+
else if (schema.inColumns) {
|
|
200
|
+
inColumns = schema.inColumns.split(',').map((c) => c.trim());
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
inColumns = propNames.slice(0, 4).map(() => 'true'); // Default: first 4 properties in column
|
|
204
|
+
if (propNames.length > 4) {
|
|
205
|
+
inColumns = [...inColumns, ...Array(propNames.length - 4).fill('false')];
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
// Ensure inColumns has the same length as propNames
|
|
209
|
+
while (inColumns.length < propNames.length) {
|
|
210
|
+
inColumns.push('false');
|
|
211
|
+
}
|
|
212
|
+
return propNames.map((propName, index) => ({
|
|
213
|
+
name: propName,
|
|
214
|
+
dataType: dataTypes[index] || 'string',
|
|
215
|
+
isRequired: requiredProps.includes(propName),
|
|
216
|
+
colSpan: parseInt(colSpans[index] || '6', 10),
|
|
217
|
+
order: parseInt(orders[index] || (index + 1).toString(), 10),
|
|
218
|
+
enableSort: enableSorts[index] === 'true',
|
|
219
|
+
enableFilter: enableFilters[index] === 'true',
|
|
220
|
+
enableInlineFilter: enableInlineFilters[index] === 'true',
|
|
221
|
+
inColumn: inColumns[index] === 'true',
|
|
222
|
+
}));
|
|
223
|
+
}
|
|
224
|
+
function generateModelProperties(props) {
|
|
225
|
+
return props.map((prop) => ` ${prop.name}: ${getTypeScriptType(prop.dataType)};`).join('\n');
|
|
226
|
+
}
|
|
227
|
+
function getTypeScriptType(dataType) {
|
|
228
|
+
switch (dataType.toLowerCase()) {
|
|
229
|
+
case 'number':
|
|
230
|
+
case 'int':
|
|
231
|
+
case 'integer':
|
|
232
|
+
return 'number';
|
|
233
|
+
case 'boolean':
|
|
234
|
+
case 'bool':
|
|
235
|
+
return 'boolean';
|
|
236
|
+
case 'date':
|
|
237
|
+
case 'datetime':
|
|
238
|
+
return 'Date';
|
|
239
|
+
case 'object':
|
|
240
|
+
return 'any';
|
|
241
|
+
case 'array':
|
|
242
|
+
return 'any[]';
|
|
243
|
+
default:
|
|
244
|
+
return 'string';
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function generateEntityProperties(props) {
|
|
248
|
+
return props
|
|
249
|
+
.map((prop) => {
|
|
250
|
+
// Use a different approach for the scope value
|
|
251
|
+
const scopeValue = prop.name === 'name' || prop.name === 'title' ? 'common' : '${i18n}'; // Escape the $ character
|
|
252
|
+
return `
|
|
253
|
+
{
|
|
254
|
+
name: '${prop.name}',
|
|
255
|
+
title: \`t("${prop.name}", { scope: "${scopeValue}" })\`,
|
|
256
|
+
groupId: 'section',
|
|
257
|
+
options: {
|
|
258
|
+
sort: {
|
|
259
|
+
enabled: ${prop.enableSort},
|
|
260
|
+
},
|
|
261
|
+
filter: {
|
|
262
|
+
advance: {
|
|
263
|
+
enabled: ${prop.enableFilter},
|
|
264
|
+
},
|
|
265
|
+
inline: {
|
|
266
|
+
enabled: ${prop.enableInlineFilter},
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
schema: {
|
|
271
|
+
dataType: '${prop.dataType}',
|
|
272
|
+
interface: {
|
|
273
|
+
type: ${getWidgetType(prop.dataType)},
|
|
274
|
+
},
|
|
275
|
+
},${prop.isRequired
|
|
276
|
+
? `
|
|
277
|
+
validations: [
|
|
278
|
+
{
|
|
279
|
+
rule: 'required',
|
|
280
|
+
},
|
|
281
|
+
],`
|
|
282
|
+
: ''}
|
|
283
|
+
},`;
|
|
284
|
+
})
|
|
285
|
+
.join('\n');
|
|
286
|
+
}
|
|
287
|
+
function getWidgetType(dataType) {
|
|
288
|
+
switch (dataType.toLowerCase()) {
|
|
289
|
+
case 'number':
|
|
290
|
+
case 'int':
|
|
291
|
+
case 'integer':
|
|
292
|
+
return 'AXPWidgetsCatalog.number';
|
|
293
|
+
case 'boolean':
|
|
294
|
+
case 'bool':
|
|
295
|
+
return 'AXPWidgetsCatalog.checkbox';
|
|
296
|
+
case 'date':
|
|
297
|
+
return 'AXPWidgetsCatalog.date';
|
|
298
|
+
case 'datetime':
|
|
299
|
+
return 'AXPWidgetsCatalog.dateTime';
|
|
300
|
+
case 'password':
|
|
301
|
+
return 'AXPWidgetsCatalog.password';
|
|
302
|
+
case 'email':
|
|
303
|
+
return 'AXPWidgetsCatalog.email';
|
|
304
|
+
case 'textarea':
|
|
305
|
+
case 'longtext':
|
|
306
|
+
return 'AXPWidgetsCatalog.textarea';
|
|
307
|
+
case 'html':
|
|
308
|
+
return 'AXPWidgetsCatalog.html';
|
|
309
|
+
case 'select':
|
|
310
|
+
case 'dropdown':
|
|
311
|
+
return 'AXPWidgetsCatalog.select';
|
|
312
|
+
default:
|
|
313
|
+
return 'AXPWidgetsCatalog.text';
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
function generateEntityColumns(props) {
|
|
317
|
+
// Use properties marked as inColumn instead of just first 4
|
|
318
|
+
const columnProps = props.filter((prop) => prop.inColumn !== false);
|
|
319
|
+
return columnProps.map((prop) => `{ name: '${prop.name}' }`).join(', ');
|
|
320
|
+
}
|
|
321
|
+
function generateLayoutProperties(props) {
|
|
322
|
+
// Sort properties by order
|
|
323
|
+
const sortedProps = [...props].sort((a, b) => a.order - b.order);
|
|
324
|
+
return sortedProps
|
|
325
|
+
.map((prop) => `
|
|
326
|
+
{
|
|
327
|
+
name: '${prop.name}',
|
|
328
|
+
layout: {
|
|
329
|
+
positions: {
|
|
330
|
+
lg: {
|
|
331
|
+
colSpan: ${prop.colSpan},
|
|
332
|
+
order: ${prop.order},
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
},`)
|
|
337
|
+
.join('\n');
|
|
338
|
+
}
|
|
38
339
|
// Update const.ts with the new entity key
|
|
39
340
|
const constFilePath = (0, devkit_1.joinPathFragments)(targetDirModule, 'src/lib/const.ts');
|
|
40
341
|
if (tree.exists(constFilePath)) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
342
|
+
if (tree.exists(constFilePath)) {
|
|
343
|
+
const originalContent = tree.read(constFilePath, 'utf-8');
|
|
344
|
+
// Construct the new entity object
|
|
345
|
+
const newEntityContent = `
|
|
346
|
+
${normalizedNames.entityPropertyName}: {
|
|
347
|
+
name: '${normalizedNames.entityClassName}',
|
|
348
|
+
title: \`t("${normalizedNames.entityPropertyName}", { scope: "\${config.i18n}" })\`,
|
|
349
|
+
titlePlural: \`t("${normalizedNames.entityPropertyName}Plural", { scope: "\${config.i18n}" })\`,
|
|
350
|
+
icon: '${schema.icon || 'fa-light fa-default'}',
|
|
351
|
+
},`;
|
|
352
|
+
// Check if `entities` object already exists
|
|
353
|
+
if (/entities:\s*\{[^}]*\}/.test(originalContent)) {
|
|
354
|
+
// Append the new entity inside the `entities` object
|
|
355
|
+
const newContent = originalContent.replace(/(entities:\s*\{)/, `$1${newEntityContent}`);
|
|
356
|
+
tree.write(constFilePath, newContent);
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
// If `entities` doesn't exist, add it before closing `RootConfig`
|
|
360
|
+
const newContent = originalContent.replace(/RootConfig\s*=\s*\{([^}]*config,\s*module:[^}]*)\}/, `RootConfig = {$1, entities: {${newEntityContent}}}`);
|
|
361
|
+
tree.write(constFilePath, newContent);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
44
364
|
}
|
|
45
|
-
// Append
|
|
365
|
+
// Append service provider to the existing module.ts file if it exists
|
|
46
366
|
const moduleFilePath = (0, devkit_1.joinPathFragments)(targetDirModule, `src/lib/${normalizedModuleNames.moduleFileName}.module.ts`);
|
|
47
|
-
// Define import and
|
|
48
|
-
const
|
|
49
|
-
const
|
|
367
|
+
// Define import and provider strings for the new entity
|
|
368
|
+
const serviceImport = `import { AXM${normalizedNames.entityClassName}Service, AXM${normalizedNames.entityClassName}ServiceImpl } from './entities';`;
|
|
369
|
+
const serviceProvider = `{
|
|
370
|
+
provide: AXM${normalizedNames.entityClassName}Service,
|
|
371
|
+
useClass: AXM${normalizedNames.entityClassName}ServiceImpl,
|
|
372
|
+
}`;
|
|
50
373
|
if (tree.exists(moduleFilePath)) {
|
|
51
374
|
const originalContent = tree.read(moduleFilePath, 'utf-8');
|
|
52
375
|
// Add the import if not already present
|
|
53
|
-
const updatedImports = originalContent.includes(
|
|
376
|
+
const updatedImports = originalContent.includes(serviceImport)
|
|
54
377
|
? originalContent
|
|
55
|
-
: originalContent.replace(/(@NgModule\(\{)/, `${
|
|
56
|
-
// Add the
|
|
57
|
-
const
|
|
58
|
-
updatedImports.includes(`${entityModule} ,`) ||
|
|
59
|
-
updatedImports.includes(`[${entityModule}`) ||
|
|
60
|
-
updatedImports.includes(`[ ${entityModule}`) ||
|
|
61
|
-
updatedImports.includes(`${entityModule} ]`) ||
|
|
62
|
-
updatedImports.includes(`${entityModule}]`)
|
|
378
|
+
: originalContent.replace(/(@NgModule\(\{)/, `${serviceImport}\n$1`);
|
|
379
|
+
// Add the provider to the providers array if not already present
|
|
380
|
+
const updatedProviders = updatedImports.includes(serviceProvider)
|
|
63
381
|
? updatedImports
|
|
64
|
-
: updatedImports.replace(/
|
|
382
|
+
: updatedImports.replace(/providers:\s*\[/, `providers: [${serviceProvider}, `);
|
|
65
383
|
// Write the updated content back to the module file
|
|
66
|
-
tree.write(moduleFilePath,
|
|
384
|
+
tree.write(moduleFilePath, updatedProviders);
|
|
67
385
|
}
|
|
68
386
|
// Append new menu item to `children` array in `menu.provider.ts`
|
|
69
387
|
const menuProviderFilePath = (0, devkit_1.joinPathFragments)(targetDirModule, 'src/lib/menu.provider.ts');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../generator/src/generators/create-module-entity/generator.ts"],"names":[],"mappings":";;AAQA,4BA4HC;;AApID,uCAA2E;AAC3E,6BAA6B;AAO7B,mBAA+B,IAAU,EAAE,MAAc;;QACvD,MAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,CA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AE,CAAC;YAC/B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;YAC1D,MAAM,cAAc,GAAG,eAAe,CAAC,QAAQ,CAAC,aAAa,CAAC;gBAC5D,CAAC,CAAC,eAAe;gBACjB,CAAC,CAAC,GAAG,eAAe,GAAG,aAAa,EAAE,CAAC;YACzC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,iEAAiE;YACjE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;CAAA"}
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../generator/src/generators/create-module-entity/generator.ts"],"names":[],"mappings":";;AA+BA,4BAocC;;AAneD,uCAA2E;AAC3E,6BAA6B;AA8B7B,mBAA+B,IAAU,EAAE,MAAc;;QACvD,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QACnE,MAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACpE,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAChF,MAAM,SAAS,GAAG,IAAA,0BAAiB,EACjC,MAAM,EACN,SAAS,EAAE,uCAAuC;QAClD,qBAAqB,CAAC,cAAc,EACpC,KAAK,EACL,KAAK,EACL,UAAU,EACV,eAAe,CAAC,cAAc,CAC/B,CAAC;QAEF,kCAAkC;QAClC,MAAM,WAAW,GAAG;;yBAEG,eAAe,CAAC,kBAAkB;;cAE7C,MAAM,CAAC,IAAI,IAAI,qBAAqB;;CAEjD,CAAC;QAEA,4BAA4B;QAC5B,MAAM,mBAAmB,GAAG,iBA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CAAC;YACzC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,iEAAiE;YACjE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;CAAA"}
|
|
@@ -5,11 +5,94 @@
|
|
|
5
5
|
"properties": {
|
|
6
6
|
"moduleName": {
|
|
7
7
|
"type": "string",
|
|
8
|
-
"description": "The name of the module"
|
|
8
|
+
"description": "The name of the module",
|
|
9
|
+
"x-prompt": "What is the name of the module?"
|
|
9
10
|
},
|
|
10
11
|
"name": {
|
|
11
12
|
"type": "string",
|
|
12
|
-
"description": "The name of the entity"
|
|
13
|
+
"description": "The name of the entity",
|
|
14
|
+
"x-prompt": "What is the name of the entity?"
|
|
15
|
+
},
|
|
16
|
+
"properties": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Comma-separated list of property names",
|
|
19
|
+
"default": "name,title",
|
|
20
|
+
"x-prompt": {
|
|
21
|
+
"message": "Enter property names (comma-separated, e.g.: name,title,description)",
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"dataTypes": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Comma-separated list of property data types in same order as properties",
|
|
28
|
+
"default": "string,string",
|
|
29
|
+
"x-prompt": {
|
|
30
|
+
"message": "Enter data types for properties (comma-separated, e.g.: string,string,number)",
|
|
31
|
+
"type": "string"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Comma-separated list of properties that should be required",
|
|
37
|
+
"default": "name,title",
|
|
38
|
+
"x-prompt": {
|
|
39
|
+
"message": "Which properties should be required? (comma-separated, or '_all_' or '_none_')",
|
|
40
|
+
"type": "string"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"colSpans": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Comma-separated list of column spans (1-12) for each property",
|
|
46
|
+
"default": "6,6",
|
|
47
|
+
"x-prompt": {
|
|
48
|
+
"message": "Enter column spans for properties (comma-separated, e.g.: 6,6,12)",
|
|
49
|
+
"type": "string"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"orders": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Comma-separated list of display orders for each property",
|
|
55
|
+
"default": "1,2",
|
|
56
|
+
"x-prompt": {
|
|
57
|
+
"message": "Enter display orders for properties (comma-separated, e.g.: 1,2,3)",
|
|
58
|
+
"type": "string"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"icon": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "FontAwesome icon for the entity (e.g., 'fa-solid fa-box')",
|
|
64
|
+
"default": "fa-light fa-default",
|
|
65
|
+
"x-prompt": {
|
|
66
|
+
"message": "Select an icon for your entity:",
|
|
67
|
+
"type": "list",
|
|
68
|
+
"items": [
|
|
69
|
+
{
|
|
70
|
+
"value": "fa-light fa-default",
|
|
71
|
+
"label": "Default icon"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"value": "fa-solid fa-box",
|
|
75
|
+
"label": "Box"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"value": "fa-solid fa-user",
|
|
79
|
+
"label": "User"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"value": "fa-solid fa-shopping-cart",
|
|
83
|
+
"label": "Shopping cart"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"value": "fa-solid fa-file",
|
|
87
|
+
"label": "File"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"customIcon": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"description": "Custom FontAwesome icon (only used if icon is set to 'custom')",
|
|
95
|
+
"x-prompt": "Enter a custom icon name (if you selected custom icon):"
|
|
13
96
|
}
|
|
14
97
|
},
|
|
15
98
|
"required": ["moduleName", "name"]
|