adminforth 1.1.9 → 1.1.10
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/dist/index.js +3 -9
- package/index.ts +6 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -313,20 +313,14 @@ class AdminForth {
|
|
|
313
313
|
for (const resource of this.config.resources) {
|
|
314
314
|
for (const column of resource.columns) {
|
|
315
315
|
if (column.components) {
|
|
316
|
-
Object.entries(column.components).forEach(([key, comp]) => {
|
|
317
|
-
column.components[key] = this.validateComponent(comp, errors);
|
|
318
|
-
});
|
|
319
316
|
console.log('🔧🔧🔧 Validating components for resource', column.components);
|
|
320
|
-
for (const
|
|
321
|
-
if (this.codeInjector.allComponentNames[file]) {
|
|
317
|
+
for (const comp of Object.values(column.components)) {
|
|
318
|
+
if (this.codeInjector.allComponentNames[comp.file]) {
|
|
322
319
|
// not obvious, but if we are in this if, it means that this is plugin component
|
|
323
320
|
// and there is no sense to check if it exists in users folder
|
|
324
321
|
continue;
|
|
325
322
|
}
|
|
326
|
-
|
|
327
|
-
if (!fs.existsSync(path)) {
|
|
328
|
-
throw new Error(`Component file ${path} does not exist`);
|
|
329
|
-
}
|
|
323
|
+
this.validateComponent(comp, errors);
|
|
330
324
|
}
|
|
331
325
|
}
|
|
332
326
|
}
|
package/index.ts
CHANGED
|
@@ -371,21 +371,15 @@ class AdminForth implements AdminForthClass {
|
|
|
371
371
|
for (const resource of this.config.resources) {
|
|
372
372
|
for (const column of resource.columns) {
|
|
373
373
|
if (column.components) {
|
|
374
|
-
Object.entries(column.components).forEach(([key, comp]) => {
|
|
375
|
-
column.components[key] = this.validateComponent(comp, errors);
|
|
376
|
-
});
|
|
377
374
|
console.log('🔧🔧🔧 Validating components for resource', column.components);
|
|
378
375
|
|
|
379
|
-
for (const
|
|
380
|
-
if (this.codeInjector.allComponentNames[file]) {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
const path = file.replace('@@', this.config.customization.customComponentsDir);
|
|
386
|
-
if (!fs.existsSync(path)) {
|
|
387
|
-
throw new Error(`Component file ${path} does not exist`);
|
|
376
|
+
for (const comp of Object.values(column.components) as Array<AdminForthComponentDeclarationFull>) {
|
|
377
|
+
if (this.codeInjector.allComponentNames[comp.file]) {
|
|
378
|
+
// not obvious, but if we are in this if, it means that this is plugin component
|
|
379
|
+
// and there is no sense to check if it exists in users folder
|
|
380
|
+
continue;
|
|
388
381
|
}
|
|
382
|
+
this.validateComponent(comp, errors);
|
|
389
383
|
}
|
|
390
384
|
}
|
|
391
385
|
}
|