adminforth 1.0.34 → 1.0.36

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.
@@ -13,11 +13,12 @@ export function guessLabelFromName(name) {
13
13
  return name.split(/(?=[A-Z])/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(' ');
14
14
  }
15
15
  }
16
- let package_json;
17
16
  const __filename = fileURLToPath(import.meta.url);
18
- const __dirname = path.join(path.dirname(__filename), '..');
19
- console.log('📦 __filename', __dirname);
20
- console.log('📦 __dirname', __dirname);
17
+ let __dirname = path.join(path.dirname(__filename), '..');
18
+ if (__dirname.endsWith('dist')) {
19
+ // in prod build we are in dist also
20
+ __dirname = path.join(__dirname, '..');
21
+ }
21
22
  export const ADMIN_FORTH_ABSOLUTE_PATH = __dirname;
22
- package_json = JSON.parse(fs.readFileSync(path.join(ADMIN_FORTH_ABSOLUTE_PATH, 'package.json'), 'utf8'));
23
+ const package_json = JSON.parse(fs.readFileSync(path.join(ADMIN_FORTH_ABSOLUTE_PATH, 'package.json'), 'utf8'));
23
24
  export const ADMINFORTH_VERSION = package_json.version;
package/modules/utils.ts CHANGED
@@ -15,14 +15,15 @@ export function guessLabelFromName(name) {
15
15
  }
16
16
 
17
17
 
18
- let package_json;
19
18
  const __filename = fileURLToPath(import.meta.url);
20
- const __dirname = path.join(path.dirname(__filename), '..');
21
- console.log('📦 __filename', __dirname);
22
- console.log('📦 __dirname', __dirname);
19
+ let __dirname = path.join(path.dirname(__filename), '..');
20
+ if (__dirname.endsWith('dist')) {
21
+ // in prod build we are in dist also
22
+ __dirname = path.join(__dirname, '..');
23
+ }
23
24
 
24
25
  export const ADMIN_FORTH_ABSOLUTE_PATH = __dirname;
25
26
 
26
- package_json = JSON.parse(fs.readFileSync(path.join(ADMIN_FORTH_ABSOLUTE_PATH, 'package.json'), 'utf8'));
27
+ const package_json = JSON.parse(fs.readFileSync(path.join(ADMIN_FORTH_ABSOLUTE_PATH, 'package.json'), 'utf8'));
27
28
 
28
29
  export const ADMINFORTH_VERSION = package_json.version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",