@gct-paas/core 0.1.5-dev.3 → 0.1.5-dev.5
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.esm.min.js +1 -1
- package/es/enums/page-designer/widget.d.ts +2 -2
- package/es/global/gct/gct.d.ts +108 -107
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useFile.d.ts +4 -0
- package/es/hooks/useFile.mjs +22 -0
- package/es/index.mjs +3 -1
- package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +23 -0
- package/es/interface/i-pinia-action/i-global-actions.d.ts +3 -0
- package/es/interface/index.d.ts +1 -1
- package/es/locale/index.d.ts +3 -1
- package/es/locale/index.mjs +18 -3
- package/es/modules/platform-config/store.d.ts +106 -106
- package/es/modules/platform-config/useSecuritySetting.d.ts +1 -1
- package/es/modules/user-stores/store/tenant.store.d.ts +6 -8
- package/es/modules/user-stores/store/tenant.store.mjs +12 -14
- package/es/modules/user-stores/store/user.store.d.ts +7 -2
- package/es/modules/user-stores/store/user.store.mjs +15 -4
- package/es/modules/user-stores/types/tenant.d.ts +7 -1
- package/es/router/index.mjs +2 -2
- package/es/setup-app.mjs +4 -2
- package/es/store/global-store.mjs +3 -0
- package/es/store/index.d.ts +1 -0
- package/es/store/index.mjs +1 -0
- package/es/store/session-store.d.ts +7 -0
- package/es/store/session-store.mjs +7 -0
- package/es/store/storage-store.d.ts +2 -0
- package/es/store/storage-store.mjs +3 -2
- package/es/types/index.d.ts +0 -1
- package/es/utils/file/download.d.ts +1 -1
- package/es/utils/file/parser.d.ts +1 -1
- package/es/utils/kit-pkg-util/kit-pkg-util.d.ts +34 -13
- package/es/utils/kit-pkg-util/kit-pkg-util.mjs +51 -40
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +2 -2
- package/es/utils/tools/tools.d.ts +1 -1
- package/package.json +4 -4
- package/es/interface/i-kit-info/i-kit-info.d.ts +0 -20
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PluginModeEnum } from "../../enums/plugin-enum.mjs";
|
|
2
|
+
import "../../enums/index.mjs";
|
|
1
3
|
//#region src/utils/kit-pkg-util/kit-pkg-util.ts
|
|
2
4
|
/**
|
|
3
5
|
* 用于加载套件包的工具类
|
|
@@ -6,8 +8,7 @@
|
|
|
6
8
|
* @class KitPkgUtil
|
|
7
9
|
*/
|
|
8
10
|
var KitPkgUtil = class {
|
|
9
|
-
static KIT_PKG_BASE_PATH = "/
|
|
10
|
-
static cache = /* @__PURE__ */ new Map();
|
|
11
|
+
static KIT_PKG_BASE_PATH = "/plugin-kit";
|
|
11
12
|
static joinPaths(...paths) {
|
|
12
13
|
return paths.filter((p) => p && p.length > 0).map((p, index) => {
|
|
13
14
|
let normalized = p;
|
|
@@ -17,56 +18,66 @@ var KitPkgUtil = class {
|
|
|
17
18
|
}).join("/");
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* 加载套件包,返回套件包入口实例
|
|
21
22
|
*
|
|
22
23
|
* @static
|
|
23
24
|
* @param {string} kit
|
|
24
|
-
* @
|
|
25
|
+
* @param {PluginModeEnum} mode
|
|
26
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
25
27
|
*/
|
|
26
|
-
static async
|
|
27
|
-
|
|
28
|
+
static async loadKit(kit, mode) {
|
|
29
|
+
const loaderUrl = this.joinPaths(this.KIT_PKG_BASE_PATH, kit, mode, "loader.esm.min.js");
|
|
28
30
|
try {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const module = await import(
|
|
32
|
+
/* @vite-ignore */
|
|
33
|
+
loaderUrl
|
|
34
|
+
);
|
|
35
|
+
if (module) return module;
|
|
36
|
+
else console.warn(`Kit ${kit} does not export a default function`);
|
|
35
37
|
} catch (error) {
|
|
36
|
-
console.error(`Error loading kit
|
|
38
|
+
console.error(`Error loading kit ${kit} from ${loaderUrl}:`, error);
|
|
37
39
|
}
|
|
40
|
+
return null;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
|
-
*
|
|
43
|
+
* 加载设计模式套件包
|
|
41
44
|
*
|
|
42
45
|
* @static
|
|
43
|
-
* @param {
|
|
44
|
-
* @
|
|
45
|
-
* @param {PluginModeEnum} mode
|
|
46
|
-
* @return {*} {Promise<void>}
|
|
46
|
+
* @param {string} kit
|
|
47
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
47
48
|
*/
|
|
48
|
-
static
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
49
|
+
static loadDesign(kit) {
|
|
50
|
+
return this.loadKit(kit, PluginModeEnum.DESIGN);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 加载移动端绘制模式套件包
|
|
54
|
+
*
|
|
55
|
+
* @static
|
|
56
|
+
* @param {string} kit
|
|
57
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
58
|
+
*/
|
|
59
|
+
static loadMobile(kit) {
|
|
60
|
+
return this.loadKit(kit, PluginModeEnum.MOBILE);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 加载平板端绘制模式套件包
|
|
64
|
+
*
|
|
65
|
+
* @static
|
|
66
|
+
* @param {string} kit
|
|
67
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
68
|
+
*/
|
|
69
|
+
static loadPad(kit) {
|
|
70
|
+
return this.loadKit(kit, PluginModeEnum.PAD);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 加载网页端绘制模式套件包
|
|
74
|
+
*
|
|
75
|
+
* @static
|
|
76
|
+
* @param {string} kit
|
|
77
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
78
|
+
*/
|
|
79
|
+
static loadWeb(kit) {
|
|
80
|
+
return this.loadKit(kit, PluginModeEnum.WEB);
|
|
70
81
|
}
|
|
71
82
|
};
|
|
72
83
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PluginModeEnum, Platform } from '../../enums';
|
|
2
2
|
import { PluginTenant } from '@gct-paas/api/platform';
|
|
3
|
-
export type IModuleMap = Record<string,
|
|
3
|
+
export type IModuleMap = Record<string, IObject>;
|
|
4
4
|
export type LoadPluginResult = [PluginTenant[], IModuleMap];
|
|
5
5
|
/**
|
|
6
6
|
* 插件包处理工具类
|
|
@@ -28,7 +28,7 @@ export declare class PluginPgkUtil {
|
|
|
28
28
|
*
|
|
29
29
|
* @static
|
|
30
30
|
*/
|
|
31
|
-
static readonly module: Map<string,
|
|
31
|
+
static readonly module: Map<string, IObject>;
|
|
32
32
|
protected static joinPaths(...paths: string[]): string;
|
|
33
33
|
/**
|
|
34
34
|
* 加载插件包配置
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/core",
|
|
3
|
-
"version": "0.1.5-dev.
|
|
3
|
+
"version": "0.1.5-dev.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"loader": "dist/index.esm.min.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"author": "gct",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@fingerprintjs/fingerprintjs": "^5.1.0",
|
|
35
|
-
"@gct-paas/api": "
|
|
35
|
+
"@gct-paas/api": "0.1.4-dev.0",
|
|
36
36
|
"@module-federation/runtime": "^2.2.3",
|
|
37
37
|
"@vueuse/core": "^14.1.0",
|
|
38
38
|
"async-validator": "^4.2.5",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"playwright": "^1.58.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@gct-paas/api": "
|
|
60
|
+
"@gct-paas/api": "0.1.4-dev.0",
|
|
61
61
|
"vue": ">=3",
|
|
62
62
|
"vue-i18n": ">=11",
|
|
63
63
|
"vue-router": ">=4"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"scripts": {
|
|
66
66
|
"dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",
|
|
67
67
|
"es:build": "vite build --config vite.dev.config.ts",
|
|
68
|
-
"build": "npm run lint && vite build --config vite.dev.config.ts && vite build --config vite.config.ts",
|
|
68
|
+
"build": "npm run lint && vue-tsc --noEmit && vite build --config vite.dev.config.ts && vite build --config vite.config.ts",
|
|
69
69
|
"lint": "eslint src/",
|
|
70
70
|
"test": "vitest",
|
|
71
71
|
"test:run": "vitest run",
|