@acorex/platform-generator 20.3.0-next.2 → 20.3.0-next.20
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/package.json +2 -2
- package/src/bin/interactive-entity-creator.js +84 -90
- package/src/generators/app-module/files/src/app/modules/common/translation-root.module.ts.template +2 -2
- package/src/generators/app-module/files/src/app/modules/layout/layout-root.module.ts.template +2 -2
- package/src/generators/app-module/files/src/app/modules/root/root.module.ts.template +1 -1
- package/src/generators/app-module/files/src/app/modules/root/sample/sample.component.ts.template +2 -2
- package/src/generators/app-module/files/src/app/modules/root/sample/sample.entity.ts.template +1 -1
- package/src/generators/create-module-entity/files/__entityFileName__.entity.ts__tmpl__ +1 -1
- package/src/generators/create-tag-entity/files/tag-__entityFileName__.entity.ts__tmpl__ +1 -1
- package/src/generators/create-widget/files/__fileName__-widget-column.component.ts__tmpl__ +1 -1
- package/src/generators/create-widget/files/__fileName__-widget-edit.component.ts__tmpl__ +1 -1
- package/src/generators/create-widget/files/__fileName__-widget-filter.component.ts__tmpl__ +1 -1
- package/src/generators/create-widget/files/__fileName__-widget-print.component.ts__tmpl__ +1 -1
- package/src/generators/create-widget/files/__fileName__-widget-view.component.ts__tmpl__ +1 -1
- package/src/generators/create-widget/files/__fileName__-widget.config.ts__tmpl__ +2 -2
- package/src/generators/app-module/files/src/assets/i18n/en-US/common.json +0 -404
- package/src/generators/app-module/files/src/assets/i18n/fa-IR/common.json +0 -386
package/package.json
CHANGED
|
@@ -27,18 +27,18 @@ function validateName(name) {
|
|
|
27
27
|
if (!name || name.trim() === '') {
|
|
28
28
|
return 'Name cannot be empty.';
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
// Ensure name is not just a number
|
|
32
32
|
if (/^\d+$/.test(name)) {
|
|
33
33
|
return 'Name cannot be just a number. Please include at least one letter.';
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
// Less restrictive validation that allows non-Latin characters
|
|
37
37
|
// Just check for spaces, special characters, and make sure it starts with a letter or non-Latin character
|
|
38
38
|
if (/^[^a-zA-Z\p{L}]|\s|[^\w\p{L}]/u.test(name)) {
|
|
39
39
|
return 'Name must start with a letter and cannot contain spaces or special characters.';
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
return null; // No error
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -48,15 +48,13 @@ const isDryRun = process.argv.includes('--dryRun');
|
|
|
48
48
|
// Create an interface for readline
|
|
49
49
|
const rl = readline.createInterface({
|
|
50
50
|
input: process.stdin,
|
|
51
|
-
output: process.stdout
|
|
51
|
+
output: process.stdout,
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
// Define widget catalog - copied from widget-catalog.ts
|
|
55
55
|
const widgetCatalog = {
|
|
56
56
|
text: 'text-editor',
|
|
57
|
-
email: 'email-editor',
|
|
58
57
|
password: 'password-editor',
|
|
59
|
-
phone: 'phone-editor',
|
|
60
58
|
largeText: 'large-text-editor',
|
|
61
59
|
richText: 'rich-text-editor',
|
|
62
60
|
number: 'number-editor',
|
|
@@ -66,7 +64,6 @@ const widgetCatalog = {
|
|
|
66
64
|
toggle: 'toggle-editor',
|
|
67
65
|
dateTime: 'date-time-editor',
|
|
68
66
|
color: 'color-editor',
|
|
69
|
-
link: 'link-editor',
|
|
70
67
|
contact: 'contact-editor',
|
|
71
68
|
tagable: 'tagable-editor',
|
|
72
69
|
file: 'file',
|
|
@@ -78,15 +75,13 @@ const widgetCatalog = {
|
|
|
78
75
|
table: 'table-editor',
|
|
79
76
|
qrcode: 'qrcode',
|
|
80
77
|
singleFileBox: 'single-file-box-editor',
|
|
81
|
-
metaData: 'meta-data-editor'
|
|
78
|
+
metaData: 'meta-data-editor',
|
|
82
79
|
};
|
|
83
80
|
|
|
84
81
|
// Define widget to data type mapping
|
|
85
82
|
const widgetToDataType = {
|
|
86
83
|
'text-editor': 'string',
|
|
87
|
-
'email-editor': 'string',
|
|
88
84
|
'password-editor': 'string',
|
|
89
|
-
'phone-editor': 'string',
|
|
90
85
|
'large-text-editor': 'string',
|
|
91
86
|
'rich-text-editor': 'string',
|
|
92
87
|
'number-editor': 'number',
|
|
@@ -96,35 +91,32 @@ const widgetToDataType = {
|
|
|
96
91
|
'toggle-editor': 'boolean',
|
|
97
92
|
'date-time-editor': 'date',
|
|
98
93
|
'color-editor': 'string',
|
|
99
|
-
'link-editor': 'string',
|
|
100
94
|
'contact-editor': 'object',
|
|
101
95
|
'tagable-editor': 'string',
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
file: 'object',
|
|
97
|
+
gallery: 'object',
|
|
98
|
+
signature: 'string',
|
|
99
|
+
map: 'object',
|
|
106
100
|
'lookup-editor': 'object',
|
|
107
101
|
'selection-list-editor': 'array',
|
|
108
102
|
'table-editor': 'array',
|
|
109
|
-
|
|
103
|
+
qrcode: 'string',
|
|
110
104
|
'single-file-box-editor': 'object',
|
|
111
|
-
'meta-data-editor': 'object'
|
|
105
|
+
'meta-data-editor': 'object',
|
|
112
106
|
};
|
|
113
107
|
|
|
114
108
|
// Widget groups for better display
|
|
115
109
|
const widgetGroups = {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
Basic: ['text-editor', 'large-text-editor', 'rich-text-editor', 'number-editor', 'checkbox-editor', 'toggle-editor'],
|
|
111
|
+
Input: ['password-editor', 'date-time-editor', 'color-editor'],
|
|
112
|
+
Complex: ['select-editor', 'lookup-editor', 'selection-list-editor', 'table-editor'],
|
|
113
|
+
Media: ['file', 'gallery', 'signature', 'map', 'qrcode'],
|
|
120
114
|
};
|
|
121
115
|
|
|
122
116
|
// Define default colSpan based on widget type
|
|
123
117
|
const widgetToColSpan = {
|
|
124
118
|
'text-editor': 6,
|
|
125
|
-
'email-editor': 6,
|
|
126
119
|
'password-editor': 6,
|
|
127
|
-
'phone-editor': 6,
|
|
128
120
|
'large-text-editor': 12,
|
|
129
121
|
'rich-text-editor': 12,
|
|
130
122
|
'number-editor': 4,
|
|
@@ -134,19 +126,18 @@ const widgetToColSpan = {
|
|
|
134
126
|
'toggle-editor': 4,
|
|
135
127
|
'date-time-editor': 6,
|
|
136
128
|
'color-editor': 4,
|
|
137
|
-
'link-editor': 6,
|
|
138
129
|
'contact-editor': 8,
|
|
139
130
|
'tagable-editor': 8,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
131
|
+
file: 6,
|
|
132
|
+
gallery: 12,
|
|
133
|
+
signature: 8,
|
|
134
|
+
map: 12,
|
|
144
135
|
'lookup-editor': 6,
|
|
145
136
|
'selection-list-editor': 8,
|
|
146
137
|
'table-editor': 12,
|
|
147
|
-
|
|
138
|
+
qrcode: 6,
|
|
148
139
|
'single-file-box-editor': 6,
|
|
149
|
-
'meta-data-editor': 8
|
|
140
|
+
'meta-data-editor': 8,
|
|
150
141
|
};
|
|
151
142
|
|
|
152
143
|
// Create data object to store all user input
|
|
@@ -163,13 +154,13 @@ const data = {
|
|
|
163
154
|
enableSorts: [],
|
|
164
155
|
enableFilters: [],
|
|
165
156
|
enableInlineFilters: [],
|
|
166
|
-
inColumn: [] // اضافه کردن آرایه جدید برای ذخیره وضعیت نمایش در ستون
|
|
157
|
+
inColumn: [], // اضافه کردن آرایه جدید برای ذخیره وضعیت نمایش در ستون
|
|
167
158
|
};
|
|
168
159
|
|
|
169
160
|
// Run the prompts in sequence
|
|
170
161
|
async function runPrompts() {
|
|
171
162
|
console.log('\n=== AcoreX Platform Interactive Entity Generator ===\n');
|
|
172
|
-
|
|
163
|
+
|
|
173
164
|
// Get module name with validation
|
|
174
165
|
while (true) {
|
|
175
166
|
data.moduleName = await askQuestion('Module name: ');
|
|
@@ -180,7 +171,7 @@ async function runPrompts() {
|
|
|
180
171
|
break;
|
|
181
172
|
}
|
|
182
173
|
}
|
|
183
|
-
|
|
174
|
+
|
|
184
175
|
// Get entity name with validation
|
|
185
176
|
while (true) {
|
|
186
177
|
data.name = await askQuestion('Entity name: ');
|
|
@@ -191,7 +182,7 @@ async function runPrompts() {
|
|
|
191
182
|
break;
|
|
192
183
|
}
|
|
193
184
|
}
|
|
194
|
-
|
|
185
|
+
|
|
195
186
|
// Get properties
|
|
196
187
|
console.log('\nEnter properties (type "done" when finished):');
|
|
197
188
|
let propCount = 1;
|
|
@@ -201,50 +192,53 @@ async function runPrompts() {
|
|
|
201
192
|
break;
|
|
202
193
|
}
|
|
203
194
|
data.properties.push(prop);
|
|
204
|
-
|
|
195
|
+
|
|
205
196
|
// Get widget for this property
|
|
206
197
|
const widget = await selectWidget(`Select widget for "${prop}": `);
|
|
207
198
|
data.widgets.push(widget);
|
|
208
|
-
|
|
199
|
+
|
|
209
200
|
// Automatically determine data type based on widget
|
|
210
201
|
const dataType = widgetToDataType[widget] || 'string';
|
|
211
202
|
data.dataTypes.push(dataType);
|
|
212
|
-
|
|
203
|
+
|
|
213
204
|
// Ask if this property is required
|
|
214
205
|
const isRequired = await askQuestion(`Is "${prop}" required? (y/n): `, 'n');
|
|
215
206
|
if (isRequired.toLowerCase() === 'y') {
|
|
216
207
|
data.required.push(prop);
|
|
217
208
|
}
|
|
218
|
-
|
|
209
|
+
|
|
219
210
|
// Ask if this property should be displayed in columns
|
|
220
211
|
const showInColumn = await askQuestion(`Show "${prop}" in table columns? (y/n): `, 'y');
|
|
221
212
|
data.inColumn.push(showInColumn.toLowerCase() === 'y' ? 'true' : 'false');
|
|
222
|
-
|
|
213
|
+
|
|
223
214
|
// Get colSpan for this property (1-12)
|
|
224
215
|
const defaultColSpan = widgetToColSpan[widget] || 6;
|
|
225
216
|
const colSpan = await askQuestion(`Column span for "${prop}" (1-12): `, defaultColSpan.toString());
|
|
226
217
|
data.colSpans.push(parseInt(colSpan));
|
|
227
|
-
|
|
218
|
+
|
|
228
219
|
// Get order for this property
|
|
229
220
|
const defaultOrder = propCount; // Default order is sequential
|
|
230
|
-
const order = await askQuestion(
|
|
221
|
+
const order = await askQuestion(
|
|
222
|
+
`Display order for "${prop}" (default: ${defaultOrder}): `,
|
|
223
|
+
defaultOrder.toString(),
|
|
224
|
+
);
|
|
231
225
|
data.orders.push(parseInt(order));
|
|
232
|
-
|
|
226
|
+
|
|
233
227
|
// Ask about sort
|
|
234
228
|
const enableSort = await askQuestion(`Enable sorting for "${prop}"? (y/n): `, 'y');
|
|
235
229
|
data.enableSorts.push(enableSort.toLowerCase() === 'y' ? 'true' : 'false');
|
|
236
|
-
|
|
230
|
+
|
|
237
231
|
// Ask about filter
|
|
238
232
|
const enableFilter = await askQuestion(`Enable filtering for "${prop}"? (y/n): `, 'y');
|
|
239
233
|
data.enableFilters.push(enableFilter.toLowerCase() === 'y' ? 'true' : 'false');
|
|
240
|
-
|
|
234
|
+
|
|
241
235
|
// Ask about inline filter
|
|
242
236
|
const enableInlineFilter = await askQuestion(`Enable inline filtering for "${prop}"? (y/n): `, 'n');
|
|
243
237
|
data.enableInlineFilters.push(enableInlineFilter.toLowerCase() === 'y' ? 'true' : 'false');
|
|
244
|
-
|
|
238
|
+
|
|
245
239
|
propCount++;
|
|
246
240
|
}
|
|
247
|
-
|
|
241
|
+
|
|
248
242
|
// Get icon
|
|
249
243
|
console.log('\nSelect an icon:');
|
|
250
244
|
console.log('1. Default icon (fa-light fa-default)');
|
|
@@ -253,28 +247,28 @@ async function runPrompts() {
|
|
|
253
247
|
console.log('4. Shopping cart (fa-solid fa-shopping-cart)');
|
|
254
248
|
console.log('5. File (fa-solid fa-file)');
|
|
255
249
|
console.log('6. Custom icon');
|
|
256
|
-
|
|
250
|
+
|
|
257
251
|
const iconChoice = await askQuestion('Select option (1-6): ', '1');
|
|
258
252
|
const iconOptions = [
|
|
259
253
|
'fa-light fa-default',
|
|
260
254
|
'fa-solid fa-box',
|
|
261
255
|
'fa-solid fa-user',
|
|
262
256
|
'fa-solid fa-shopping-cart',
|
|
263
|
-
'fa-solid fa-file'
|
|
257
|
+
'fa-solid fa-file',
|
|
264
258
|
];
|
|
265
|
-
|
|
259
|
+
|
|
266
260
|
if (iconChoice >= 1 && iconChoice <= 5) {
|
|
267
261
|
data.icon = iconOptions[iconChoice - 1];
|
|
268
262
|
} else if (iconChoice == 6) {
|
|
269
263
|
data.icon = await askQuestion('Enter custom icon (format: fa-solid fa-xyz): ', 'fa-solid fa-star');
|
|
270
264
|
}
|
|
271
|
-
|
|
265
|
+
|
|
272
266
|
// Show summary
|
|
273
267
|
console.log('\n=== Summary ===');
|
|
274
268
|
console.log(`Module: ${data.moduleName}`);
|
|
275
269
|
console.log(`Entity: ${data.name}`);
|
|
276
270
|
console.log('Properties:');
|
|
277
|
-
|
|
271
|
+
|
|
278
272
|
// Sort properties by order for display
|
|
279
273
|
const propSummary = data.properties.map((prop, i) => ({
|
|
280
274
|
name: prop,
|
|
@@ -286,18 +280,20 @@ async function runPrompts() {
|
|
|
286
280
|
enableSort: data.enableSorts[i],
|
|
287
281
|
enableFilter: data.enableFilters[i],
|
|
288
282
|
enableInlineFilter: data.enableInlineFilters[i],
|
|
289
|
-
inColumn: data.inColumn[i]
|
|
283
|
+
inColumn: data.inColumn[i],
|
|
290
284
|
}));
|
|
291
|
-
|
|
285
|
+
|
|
292
286
|
// Sort by order
|
|
293
287
|
propSummary.sort((a, b) => a.order - b.order);
|
|
294
|
-
|
|
295
|
-
propSummary.forEach(prop => {
|
|
296
|
-
console.log(
|
|
288
|
+
|
|
289
|
+
propSummary.forEach((prop) => {
|
|
290
|
+
console.log(
|
|
291
|
+
` - ${prop.name} (Widget: ${prop.widget}, Type: ${prop.dataType}${prop.required ? ', Required' : ''}, ColSpan: ${prop.colSpan}, Order: ${prop.order}, Sort: ${prop.enableSort ? 'Enabled' : 'Disabled'}, Filter: ${prop.enableFilter ? 'Enabled' : 'Disabled'}, Inline Filter: ${prop.enableInlineFilter ? 'Enabled' : 'Disabled'}, In Column: ${prop.inColumn === 'true' ? 'Yes' : 'No'})`,
|
|
292
|
+
);
|
|
297
293
|
});
|
|
298
|
-
|
|
294
|
+
|
|
299
295
|
console.log(`Icon: ${data.icon}`);
|
|
300
|
-
|
|
296
|
+
|
|
301
297
|
const confirm = await askQuestion('\nGenerate entity with these settings? (y/n): ', 'y');
|
|
302
298
|
if (confirm.toLowerCase() === 'y') {
|
|
303
299
|
runNxGenerator();
|
|
@@ -309,9 +305,9 @@ async function runPrompts() {
|
|
|
309
305
|
|
|
310
306
|
// Helper function to ask questions and get answers
|
|
311
307
|
function askQuestion(question, defaultAnswer) {
|
|
312
|
-
return new Promise(resolve => {
|
|
308
|
+
return new Promise((resolve) => {
|
|
313
309
|
const prompt = defaultAnswer ? `${question} [${defaultAnswer}] ` : question;
|
|
314
|
-
|
|
310
|
+
|
|
315
311
|
rl.question(prompt, (answer) => {
|
|
316
312
|
// If answer is empty and there's a default, use the default
|
|
317
313
|
const result = answer.trim() === '' && defaultAnswer ? defaultAnswer : answer.trim();
|
|
@@ -324,7 +320,7 @@ function askQuestion(question, defaultAnswer) {
|
|
|
324
320
|
async function selectWidget(prompt) {
|
|
325
321
|
console.log(`\n${prompt}`);
|
|
326
322
|
console.log('Available widgets (you can type to filter):');
|
|
327
|
-
|
|
323
|
+
|
|
328
324
|
// Display widgets by groups
|
|
329
325
|
for (const [groupName, groupWidgets] of Object.entries(widgetGroups)) {
|
|
330
326
|
console.log(`\n${groupName} widgets:`);
|
|
@@ -333,17 +329,17 @@ async function selectWidget(prompt) {
|
|
|
333
329
|
console.log(` ${(index + 1).toString().padStart(2)}: ${widget} (${widgetKey})`);
|
|
334
330
|
});
|
|
335
331
|
}
|
|
336
|
-
|
|
332
|
+
|
|
337
333
|
// Handling widget selection with filtering
|
|
338
334
|
let selectedWidget = '';
|
|
339
335
|
while (!selectedWidget) {
|
|
340
336
|
const input = await askQuestion('\nEnter widget name or number (or part of name to filter): ');
|
|
341
|
-
|
|
337
|
+
|
|
342
338
|
// Check if input is a number
|
|
343
339
|
if (!isNaN(input) && input > 0 && input <= Object.values(widgetCatalog).length) {
|
|
344
340
|
const allWidgets = Object.values(widgetCatalog);
|
|
345
341
|
selectedWidget = allWidgets[parseInt(input) - 1];
|
|
346
|
-
}
|
|
342
|
+
}
|
|
347
343
|
// Check if input exactly matches a widget name
|
|
348
344
|
else if (Object.values(widgetCatalog).includes(input)) {
|
|
349
345
|
selectedWidget = input;
|
|
@@ -354,55 +350,53 @@ async function selectWidget(prompt) {
|
|
|
354
350
|
}
|
|
355
351
|
// Filter widgets by input
|
|
356
352
|
else {
|
|
357
|
-
const filteredWidgets = Object.entries(widgetCatalog)
|
|
358
|
-
|
|
359
|
-
key.toLowerCase().includes(input.toLowerCase()) ||
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
353
|
+
const filteredWidgets = Object.entries(widgetCatalog).filter(
|
|
354
|
+
([key, value]) =>
|
|
355
|
+
key.toLowerCase().includes(input.toLowerCase()) || value.toLowerCase().includes(input.toLowerCase()),
|
|
356
|
+
);
|
|
357
|
+
|
|
363
358
|
if (filteredWidgets.length === 1) {
|
|
364
359
|
selectedWidget = filteredWidgets[0][1]; // Pick the only match
|
|
365
|
-
}
|
|
366
|
-
else if (filteredWidgets.length > 1) {
|
|
360
|
+
} else if (filteredWidgets.length > 1) {
|
|
367
361
|
console.log('\nFiltered widgets:');
|
|
368
362
|
filteredWidgets.forEach(([key, value], index) => {
|
|
369
363
|
console.log(` ${(index + 1).toString().padStart(2)}: ${value} (${key})`);
|
|
370
364
|
});
|
|
371
|
-
|
|
365
|
+
|
|
372
366
|
const selection = await askQuestion('Select number or continue typing to filter more: ');
|
|
373
367
|
if (!isNaN(selection) && selection > 0 && selection <= filteredWidgets.length) {
|
|
374
368
|
selectedWidget = filteredWidgets[parseInt(selection) - 1][1];
|
|
375
369
|
}
|
|
376
|
-
}
|
|
377
|
-
else {
|
|
370
|
+
} else {
|
|
378
371
|
console.log('No matches found. Try again.');
|
|
379
372
|
}
|
|
380
373
|
}
|
|
381
374
|
}
|
|
382
|
-
|
|
375
|
+
|
|
383
376
|
return selectedWidget;
|
|
384
377
|
}
|
|
385
378
|
|
|
386
379
|
// Run the NX generator with collected data
|
|
387
380
|
function runNxGenerator() {
|
|
388
381
|
// Handle special cases and ensure proper formatting
|
|
389
|
-
|
|
382
|
+
|
|
390
383
|
// For empty required array, use "_none_"
|
|
391
|
-
const requiredValue = data.required.length === 0 ?
|
|
392
|
-
|
|
384
|
+
const requiredValue = data.required.length === 0 ? '_none_' : data.required.join(',');
|
|
385
|
+
|
|
393
386
|
// Ensure single values for colSpans and orders have trailing commas
|
|
394
387
|
let colSpansStr = data.colSpans.join(',');
|
|
395
388
|
if (data.colSpans.length === 1) {
|
|
396
389
|
colSpansStr = colSpansStr + ',';
|
|
397
390
|
}
|
|
398
|
-
|
|
391
|
+
|
|
399
392
|
let ordersStr = data.orders.join(',');
|
|
400
393
|
if (data.orders.length === 1) {
|
|
401
394
|
ordersStr = ordersStr + ',';
|
|
402
395
|
}
|
|
403
|
-
|
|
396
|
+
|
|
404
397
|
// Prepare arguments properly
|
|
405
|
-
const command =
|
|
398
|
+
const command =
|
|
399
|
+
`cd "${projectRoot}" && npx nx g @acorex-platform/generator:create-module-entity` +
|
|
406
400
|
` --moduleName=${data.moduleName}` +
|
|
407
401
|
` --name=${data.name}` +
|
|
408
402
|
` --properties=${data.properties.join(',')}` +
|
|
@@ -416,22 +410,22 @@ function runNxGenerator() {
|
|
|
416
410
|
` --enableInlineFilters=${data.enableInlineFilters.join(',')}` +
|
|
417
411
|
` --inColumn=${data.inColumn.join(',')}` +
|
|
418
412
|
(isDryRun ? ' --dryRun' : '');
|
|
419
|
-
|
|
413
|
+
|
|
420
414
|
console.log(`\nRunning: ${command}`);
|
|
421
|
-
|
|
415
|
+
|
|
422
416
|
try {
|
|
423
417
|
// Execute the command as a shell command to ensure proper environment
|
|
424
418
|
const { execSync } = require('child_process');
|
|
425
|
-
const options = {
|
|
419
|
+
const options = {
|
|
426
420
|
stdio: 'inherit',
|
|
427
|
-
shell: true
|
|
421
|
+
shell: true,
|
|
428
422
|
};
|
|
429
|
-
|
|
423
|
+
|
|
430
424
|
execSync(command, options);
|
|
431
425
|
console.log(`\nGenerator completed successfully`);
|
|
432
426
|
} catch (error) {
|
|
433
427
|
console.error(`\nGenerator failed with error: ${error.message}`);
|
|
434
|
-
|
|
428
|
+
|
|
435
429
|
// Show more detailed error information
|
|
436
430
|
if (error.stderr) {
|
|
437
431
|
console.error(`Error details: ${error.stderr.toString()}`);
|
|
@@ -442,7 +436,7 @@ function runNxGenerator() {
|
|
|
442
436
|
}
|
|
443
437
|
|
|
444
438
|
// Start the prompts
|
|
445
|
-
runPrompts().catch(err => {
|
|
439
|
+
runPrompts().catch((err) => {
|
|
446
440
|
console.error('An error occurred:', err);
|
|
447
441
|
rl.close();
|
|
448
|
-
});
|
|
442
|
+
});
|
package/src/generators/app-module/files/src/app/modules/common/translation-root.module.ts.template
CHANGED
|
@@ -41,11 +41,11 @@ export class MyTranslationLoader implements AXTranslationLoader {
|
|
|
41
41
|
useValue: translationConfig({
|
|
42
42
|
preload: {
|
|
43
43
|
langs: ['en-US'],
|
|
44
|
-
scopes: ['
|
|
44
|
+
scopes: ['acorex', 'general'],
|
|
45
45
|
},
|
|
46
46
|
defaults: {
|
|
47
47
|
lang: 'en-US',
|
|
48
|
-
scope: '
|
|
48
|
+
scope: 'general',
|
|
49
49
|
},
|
|
50
50
|
}),
|
|
51
51
|
},
|
package/src/generators/app-module/files/src/app/modules/layout/layout-root.module.ts.template
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
AXP_MENU_PROVIDER,
|
|
6
6
|
AXP_PLATFORM_CONFIG_TOKEN,
|
|
7
7
|
} from '@acorex/platform/common';
|
|
8
|
-
import {
|
|
8
|
+
import { AXPWidgetCoreModule, AXPWidgetsCatalog, AXP_WIDGETS_EDITOR_CATEGORY } from '@acorex/platform/layout/widget-core';
|
|
9
9
|
import { AXPEntityModule, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
|
|
10
10
|
import { AXPDefaultThemeModule } from '@acorex/platform/themes/default';
|
|
11
11
|
import { AXP_THEME_PALETTE_PROVIDER } from '@acorex/platform/themes/shared';
|
|
@@ -22,7 +22,7 @@ import { AXPRootMenuProvider } from './menu.provider';
|
|
|
22
22
|
AXPDefaultThemeModule,
|
|
23
23
|
AXPCommonModule,
|
|
24
24
|
AXPEntityModule,
|
|
25
|
-
|
|
25
|
+
AXPWidgetCoreModule.forChild({
|
|
26
26
|
widgets: [],
|
|
27
27
|
extendedWidgets: [],
|
|
28
28
|
}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AXPAuthGuard } from '@acorex/platform/auth';
|
|
2
|
-
import { AXPWidgetRegistryService } from '@acorex/platform/layout/
|
|
2
|
+
import { AXPWidgetRegistryService } from '@acorex/platform/layout/widget-core';
|
|
3
3
|
import { AXPRootLayoutComponent } from '@acorex/platform/themes/default';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { inject, NgModule } from '@angular/core';
|
package/src/generators/app-module/files/src/app/modules/root/sample/sample.component.ts.template
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AXButtonModule } from '@acorex/components/button';
|
|
2
2
|
import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
|
|
3
3
|
import { AXGridLayoutBuilderModule } from '@acorex/components/grid-layout-builder';
|
|
4
|
-
import {
|
|
4
|
+
import { AXPWidgetCoreModule } from '@acorex/platform/layout/widget-core';
|
|
5
5
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
6
|
|
|
7
7
|
@Component({
|
|
@@ -15,6 +15,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
|
15
15
|
}`,
|
|
16
16
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
17
17
|
standalone: true,
|
|
18
|
-
imports: [
|
|
18
|
+
imports: [AXPWidgetCoreModule, AXButtonModule, AXGridLayoutBuilderModule, AXDropdownButtonModule],
|
|
19
19
|
})
|
|
20
20
|
export class SampleComponent {}
|
package/src/generators/app-module/files/src/app/modules/root/sample/sample.entity.ts.template
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AXPEntity, AXPEntityCommandScope, AXPEntityQueryType } from '@acorex/platform/common';
|
|
2
|
-
import { AXPWidgetsCatalog } from '@acorex/platform/layout/
|
|
2
|
+
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
|
|
3
3
|
import { Injector } from '@angular/core';
|
|
4
4
|
import { AXMSampleModuleConst } from '../const';
|
|
5
5
|
import { AXMSampleEntityService } from './sample.service';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AXPEntity, AXPEntityCommandScope, AXPEntityQueryType, createAllQueryView } from '@acorex/platform/common';
|
|
2
|
-
import { AXPWidgetsCatalog } from '@acorex/platform/layout/
|
|
2
|
+
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
|
|
3
3
|
import { Injector } from '@angular/core';
|
|
4
4
|
import { RootConfig } from '../../const';
|
|
5
5
|
import { AXM<%= entityClassName %>Service } from './<%= entityFileName %>.service';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AXPEntity, AXPEntityCommandScope, AXPEntityQueryType ,createAllQueryView} from '@acorex/platform/common';
|
|
2
|
-
import { AXPWidgetsCatalog } from '@acorex/platform/layout/
|
|
2
|
+
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
|
|
3
3
|
import { Injector } from '@angular/core';
|
|
4
4
|
import { RootConfig } from '../../const';
|
|
5
5
|
import { AXMTag<%= entityClassName %>Service } from './tag-<%= entityFileName %>.service';
|
|
@@ -4,7 +4,7 @@ import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
|
4
4
|
import { AXFormModule } from '@acorex/components/form';
|
|
5
5
|
import { AXTextBoxModule } from '@acorex/components/text-box';
|
|
6
6
|
import { AXValidationModule } from '@acorex/core/validation';
|
|
7
|
-
import { AXPWidgetComponent } from '@acorex/platform/layout/
|
|
7
|
+
import { AXPWidgetComponent } from '@acorex/platform/layout/widget-core';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
9
|
import { ChangeDetectionStrategy, Component, HostBinding, Signal, computed } from '@angular/core';
|
|
10
10
|
import { FormsModule } from '@angular/forms';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AXPWidgetComponent } from '@acorex/platform/layout/
|
|
1
|
+
import { AXPWidgetComponent } from '@acorex/platform/layout/widget-core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AXPWidgetComponent } from '@acorex/platform/layout/
|
|
1
|
+
import { AXPWidgetComponent } from '@acorex/platform/layout/widget-core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { ChangeDetectionStrategy, Component, computed } from '@angular/core';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AXP_WIDGETS_EDITOR_CATEGORY, AXPWidgetConfig } from '@acorex/platform/layout/
|
|
1
|
+
import { AXP_WIDGETS_EDITOR_CATEGORY, AXPWidgetConfig } from '@acorex/platform/layout/widget-core';
|
|
2
2
|
import { AXP_NAME_PROPERTY } from '../../../properties/general.props';
|
|
3
3
|
import {
|
|
4
4
|
AXP_DATA_PATH_PROPERTY,
|
|
@@ -37,7 +37,7 @@ export const AXP<%= className %>Widget: AXPWidgetConfig = {
|
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
};
|
|
40
|
-
declare module '@acorex/platform/layout/
|
|
40
|
+
declare module '@acorex/platform/layout/widget-core' {
|
|
41
41
|
interface AXPWidgetTypesMap {
|
|
42
42
|
<%= propertyName %>: '<%= fileName %>-editor';
|
|
43
43
|
}
|