adminforth 2.58.3 → 2.58.4
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.
|
@@ -55,7 +55,7 @@ export const admin = new AdminForth({
|
|
|
55
55
|
},
|
|
56
56
|
],
|
|
57
57
|
resources: [
|
|
58
|
-
usersResource
|
|
58
|
+
usersResource,
|
|
59
59
|
],
|
|
60
60
|
menu: [
|
|
61
61
|
{ type: 'heading', label: 'SYSTEM' },
|
|
@@ -63,7 +63,7 @@ export const admin = new AdminForth({
|
|
|
63
63
|
label: 'Users',
|
|
64
64
|
icon: 'flowbite:user-solid',
|
|
65
65
|
resourceId: 'adminuser'
|
|
66
|
-
}
|
|
66
|
+
},
|
|
67
67
|
],
|
|
68
68
|
});
|
|
69
69
|
|
|
@@ -23,7 +23,7 @@ export async function injectResourceIntoIndex({
|
|
|
23
23
|
let code = await fs.readFile(indexFilePath, "utf-8");
|
|
24
24
|
const ast = recast.parse(code, { parser });
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const resourceImportPath = `./resources/${table}.js`;
|
|
27
27
|
let alreadyImported = false;
|
|
28
28
|
|
|
29
29
|
recast.visit(ast, {
|
|
@@ -31,7 +31,7 @@ export async function injectResourceIntoIndex({
|
|
|
31
31
|
const { node } = path;
|
|
32
32
|
if (
|
|
33
33
|
n.ImportDeclaration.check(node) &&
|
|
34
|
-
node.source.value ===
|
|
34
|
+
node.source.value === resourceImportPath
|
|
35
35
|
) {
|
|
36
36
|
alreadyImported = true;
|
|
37
37
|
return false;
|
|
@@ -49,7 +49,7 @@ export async function injectResourceIntoIndex({
|
|
|
49
49
|
ast.program.body.unshift(
|
|
50
50
|
b.importDeclaration(
|
|
51
51
|
[b.importDefaultSpecifier(b.identifier(`${resourceId}Resource`))],
|
|
52
|
-
b.stringLiteral(
|
|
52
|
+
b.stringLiteral(resourceImportPath)
|
|
53
53
|
)
|
|
54
54
|
);
|
|
55
55
|
|
|
@@ -104,7 +104,6 @@ export async function injectResourceIntoIndex({
|
|
|
104
104
|
tabWidth: 2,
|
|
105
105
|
useTabs: false,
|
|
106
106
|
trailingComma: true,
|
|
107
|
-
wrapColumn: 1
|
|
108
107
|
}).code;
|
|
109
108
|
await fs.writeFile(indexFilePath, newCode, "utf-8");
|
|
110
109
|
console.log(`✅ Injected resource "${resourceId}" into index`);
|