adminforth 1.1.83 → 1.1.85

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.
@@ -62,7 +62,7 @@ class CodeInjector {
62
62
  return __awaiter(this, arguments, void 0, function* ({ command, verbose = false, cwd }) {
63
63
  const nodeBinary = process.execPath; // Path to the Node.js binary running this script
64
64
  const npmPath = path.join(path.dirname(nodeBinary), 'npm'); // Path to the npm executable
65
- const env = Object.assign({ VUE_APP_ADMINFORTH_PUBLIC_PATH: this.adminforth.config.baseUrl, FORCE_COLOR: '1' }, process.env);
65
+ const env = Object.assign({ VITE_ADMINFORTH_PUBLIC_PATH: this.adminforth.config.baseUrl, FORCE_COLOR: '1' }, process.env);
66
66
  console.log(`⚙️ Running npm ${command}...`);
67
67
  console.time(`npm ${command} done in`);
68
68
  const { stdout: out, stderr: err } = yield execAsync(`${nodeBinary} ${npmPath} ${command}`, {
@@ -525,7 +525,7 @@ class CodeInjector {
525
525
  console.log(`⚙️ Running npm ${command}...`);
526
526
  const nodeBinary = process.execPath;
527
527
  const npmPath = path.join(path.dirname(nodeBinary), 'npm');
528
- const env = Object.assign({ VUE_APP_ADMINFORTH_PUBLIC_PATH: this.adminforth.config.baseUrl, FORCE_COLOR: '1' }, process.env);
528
+ const env = Object.assign({ VITE_ADMINFORTH_PUBLIC_PATH: this.adminforth.config.baseUrl, FORCE_COLOR: '1' }, process.env);
529
529
  const devServer = spawn(`${nodeBinary}`, [`${npmPath}`, ...command.split(' ')], {
530
530
  cwd,
531
531
  env,
@@ -6,7 +6,10 @@ import { useRouter } from 'vue-router';
6
6
  import { useCoreStore } from './stores/core';
7
7
  import { useUserStore } from './stores/user';
8
8
 
9
- export async function callApi({path, method, body=undefined} ) {
9
+ export async function callApi({path, method, body=undefined}: {
10
+ path: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'
11
+ body?: any
12
+ }): Promise<any> {
10
13
  const options = {
11
14
  method,
12
15
  headers: {
@@ -38,7 +38,7 @@ const customLogger = {
38
38
 
39
39
  // https://vitejs.dev/config/
40
40
  export default defineConfig({
41
- base: process.env.VUE_APP_ADMINFORTH_PUBLIC_PATH || '/',
41
+ base: process.env.VITE_ADMINFORTH_PUBLIC_PATH || '/',
42
42
  server: {
43
43
  port: 5173,
44
44
  strictPort: true, // better predictability
@@ -75,7 +75,7 @@ class CodeInjector implements CodeInjectorType {
75
75
  const npmPath = path.join(path.dirname(nodeBinary), 'npm'); // Path to the npm executable
76
76
 
77
77
  const env = {
78
- VUE_APP_ADMINFORTH_PUBLIC_PATH: this.adminforth.config.baseUrl,
78
+ VITE_ADMINFORTH_PUBLIC_PATH: this.adminforth.config.baseUrl,
79
79
  FORCE_COLOR: '1',
80
80
  ...process.env,
81
81
  };
@@ -607,7 +607,7 @@ async watchForReprepare({ verbose }) {
607
607
  const nodeBinary = process.execPath;
608
608
  const npmPath = path.join(path.dirname(nodeBinary), 'npm');
609
609
  const env = {
610
- VUE_APP_ADMINFORTH_PUBLIC_PATH: this.adminforth.config.baseUrl,
610
+ VITE_ADMINFORTH_PUBLIC_PATH: this.adminforth.config.baseUrl,
611
611
  FORCE_COLOR: '1',
612
612
  ...process.env,
613
613
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.1.83",
3
+ "version": "1.1.85",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/spa/src/utils.ts CHANGED
@@ -6,7 +6,10 @@ import { useRouter } from 'vue-router';
6
6
  import { useCoreStore } from './stores/core';
7
7
  import { useUserStore } from './stores/user';
8
8
 
9
- export async function callApi({path, method, body=undefined} ) {
9
+ export async function callApi({path, method, body=undefined}: {
10
+ path: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'
11
+ body?: any
12
+ }): Promise<any> {
10
13
  const options = {
11
14
  method,
12
15
  headers: {
@@ -38,7 +38,7 @@ const customLogger = {
38
38
 
39
39
  // https://vitejs.dev/config/
40
40
  export default defineConfig({
41
- base: process.env.VUE_APP_ADMINFORTH_PUBLIC_PATH || '/',
41
+ base: process.env.VITE_ADMINFORTH_PUBLIC_PATH || '/',
42
42
  server: {
43
43
  port: 5173,
44
44
  strictPort: true, // better predictability