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
 
@@ -159,7 +159,6 @@ async function syncResourceColumns(filePath, content, discoveredColumns) {
159
159
  tabWidth: 2,
160
160
  useTabs: false,
161
161
  trailingComma: true,
162
- wrapColumn: 1,
163
162
  }).code;
164
163
 
165
164
  await fs.writeFile(filePath, newContent, "utf-8");
@@ -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 importLine = `import ${resourceId}Resource from "./resources/${table}";`;
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 === `./resources/${table}`
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(`./resources/${table}`)
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`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.58.3",
3
+ "version": "2.58.4",
4
4
  "description": "OpenSource Agent-Native forth-generation admin panel",
5
5
  "keywords": [
6
6
  "adminforth",