@nocobase/server 2.1.0-beta.34 → 2.1.0-beta.35
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/lib/gateway/index.js
CHANGED
|
@@ -294,6 +294,7 @@ const _Gateway = class _Gateway extends import_events.EventEmitter {
|
|
|
294
294
|
__nocobase_api_client_share_token__: import_node_process.default.env.API_CLIENT_SHARE_TOKEN === "true",
|
|
295
295
|
__nocobase_ws_url__: import_node_process.default.env.WEBSOCKET_URL || "",
|
|
296
296
|
__nocobase_ws_path__: import_node_process.default.env.WS_PATH,
|
|
297
|
+
__nocobase_app_dev__: import_node_process.default.env.NOCOBASE_APP_DEV === "true",
|
|
297
298
|
__esm_cdn_base_url__: import_node_process.default.env.ESM_CDN_BASE_URL || "https://esm.sh",
|
|
298
299
|
__esm_cdn_suffix__: import_node_process.default.env.ESM_CDN_SUFFIX || ""
|
|
299
300
|
};
|
|
@@ -12,6 +12,7 @@ export declare class PackageUrls {
|
|
|
12
12
|
static clear(): void;
|
|
13
13
|
static getCacheKey(packageName: string, lane: PluginClientLane): string;
|
|
14
14
|
static get(packageName: string, lane?: PluginClientLane): Promise<string>;
|
|
15
|
+
static getAppDevUrl(packageName: string, lane: PluginClientLane): string;
|
|
15
16
|
static hasClientEntry(packageName: string, lane: PluginClientLane): Promise<boolean>;
|
|
16
17
|
static fetch(packageName: string, lane?: PluginClientLane): Promise<string>;
|
|
17
18
|
}
|
|
@@ -48,6 +48,7 @@ var import_crypto = __toESM(require("crypto"));
|
|
|
48
48
|
var import_fs = __toESM(require("fs"));
|
|
49
49
|
var import_fs_extra = __toESM(require("fs-extra"));
|
|
50
50
|
var import_path = __toESM(require("path"));
|
|
51
|
+
var import_plugin_manager = __toESM(require("../plugin-manager"));
|
|
51
52
|
var import_utils2 = require("../utils");
|
|
52
53
|
var import_package = __toESM(require("../../../package.json"));
|
|
53
54
|
const PLUGIN_CLIENT_ENTRY_FILES = {
|
|
@@ -58,6 +59,32 @@ const PLUGIN_CLIENT_MARKER_FILES = {
|
|
|
58
59
|
client: "client.js",
|
|
59
60
|
"client-v2": "client-v2.js"
|
|
60
61
|
};
|
|
62
|
+
function getAppDevPluginUrls() {
|
|
63
|
+
if (process.env.NOCOBASE_APP_DEV !== "true" || !process.env.NOCOBASE_APP_DEV_PLUGIN_URLS) {
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
return JSON.parse(process.env.NOCOBASE_APP_DEV_PLUGIN_URLS);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
return {};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
__name(getAppDevPluginUrls, "getAppDevPluginUrls");
|
|
73
|
+
function getAppDevPluginDependencies(packageJson2, lane) {
|
|
74
|
+
const appDevPluginUrls = getAppDevPluginUrls();
|
|
75
|
+
const deps = {
|
|
76
|
+
...packageJson2.dependencies,
|
|
77
|
+
...packageJson2.peerDependencies,
|
|
78
|
+
...packageJson2.devDependencies
|
|
79
|
+
};
|
|
80
|
+
return Object.keys(deps).filter(
|
|
81
|
+
(packageName) => {
|
|
82
|
+
var _a;
|
|
83
|
+
return ((_a = appDevPluginUrls[packageName]) == null ? void 0 : _a[lane]) || packageName.startsWith("@nocobase/plugin-") || packageName.startsWith("@nocobase/preset-");
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
__name(getAppDevPluginDependencies, "getAppDevPluginDependencies");
|
|
61
88
|
const _PackageUrls = class _PackageUrls {
|
|
62
89
|
static clear() {
|
|
63
90
|
this.items = {};
|
|
@@ -66,6 +93,10 @@ const _PackageUrls = class _PackageUrls {
|
|
|
66
93
|
return `${lane}:${packageName}`;
|
|
67
94
|
}
|
|
68
95
|
static async get(packageName, lane = "client") {
|
|
96
|
+
const appDevUrl = this.getAppDevUrl(packageName, lane);
|
|
97
|
+
if (appDevUrl) {
|
|
98
|
+
return appDevUrl;
|
|
99
|
+
}
|
|
69
100
|
const cacheKey = this.getCacheKey(packageName, lane);
|
|
70
101
|
const cached = this.items[cacheKey];
|
|
71
102
|
if (cached) {
|
|
@@ -79,7 +110,14 @@ const _PackageUrls = class _PackageUrls {
|
|
|
79
110
|
}
|
|
80
111
|
return nextUrl;
|
|
81
112
|
}
|
|
113
|
+
static getAppDevUrl(packageName, lane) {
|
|
114
|
+
var _a;
|
|
115
|
+
return (_a = getAppDevPluginUrls()[packageName]) == null ? void 0 : _a[lane];
|
|
116
|
+
}
|
|
82
117
|
static async hasClientEntry(packageName, lane) {
|
|
118
|
+
if (this.getAppDevUrl(packageName, lane)) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
83
121
|
const pkgPath = import_path.default.resolve(process.env.NODE_MODULES_PATH, packageName);
|
|
84
122
|
if (!await import_fs_extra.default.exists(pkgPath)) {
|
|
85
123
|
return false;
|
|
@@ -141,6 +179,11 @@ async function listEnabledPlugins(ctx, lane = "client") {
|
|
|
141
179
|
options,
|
|
142
180
|
url
|
|
143
181
|
};
|
|
182
|
+
if (PackageUrls.getAppDevUrl(packageName, lane)) {
|
|
183
|
+
const packageJson2 = await import_plugin_manager.default.getPackageJson(packageName);
|
|
184
|
+
entry.devMode = "esm";
|
|
185
|
+
entry.appDevDependencies = getAppDevPluginDependencies(packageJson2, lane);
|
|
186
|
+
}
|
|
144
187
|
if (lane === "client" && await PackageUrls.hasClientEntry(packageName, "client-v2")) {
|
|
145
188
|
const clientV2Url = await PackageUrls.get(packageName, "client-v2");
|
|
146
189
|
if (clientV2Url) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/server",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.35",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
"@koa/cors": "^5.0.0",
|
|
11
11
|
"@koa/multer": "^3.1.0",
|
|
12
12
|
"@koa/router": "^13.1.0",
|
|
13
|
-
"@nocobase/acl": "2.1.0-beta.
|
|
14
|
-
"@nocobase/actions": "2.1.0-beta.
|
|
15
|
-
"@nocobase/ai": "2.1.0-beta.
|
|
16
|
-
"@nocobase/auth": "2.1.0-beta.
|
|
17
|
-
"@nocobase/cache": "2.1.0-beta.
|
|
18
|
-
"@nocobase/data-source-manager": "2.1.0-beta.
|
|
19
|
-
"@nocobase/database": "2.1.0-beta.
|
|
20
|
-
"@nocobase/evaluators": "2.1.0-beta.
|
|
21
|
-
"@nocobase/lock-manager": "2.1.0-beta.
|
|
22
|
-
"@nocobase/logger": "2.1.0-beta.
|
|
23
|
-
"@nocobase/resourcer": "2.1.0-beta.
|
|
24
|
-
"@nocobase/sdk": "2.1.0-beta.
|
|
25
|
-
"@nocobase/snowflake-id": "2.1.0-beta.
|
|
26
|
-
"@nocobase/telemetry": "2.1.0-beta.
|
|
27
|
-
"@nocobase/utils": "2.1.0-beta.
|
|
13
|
+
"@nocobase/acl": "2.1.0-beta.35",
|
|
14
|
+
"@nocobase/actions": "2.1.0-beta.35",
|
|
15
|
+
"@nocobase/ai": "2.1.0-beta.35",
|
|
16
|
+
"@nocobase/auth": "2.1.0-beta.35",
|
|
17
|
+
"@nocobase/cache": "2.1.0-beta.35",
|
|
18
|
+
"@nocobase/data-source-manager": "2.1.0-beta.35",
|
|
19
|
+
"@nocobase/database": "2.1.0-beta.35",
|
|
20
|
+
"@nocobase/evaluators": "2.1.0-beta.35",
|
|
21
|
+
"@nocobase/lock-manager": "2.1.0-beta.35",
|
|
22
|
+
"@nocobase/logger": "2.1.0-beta.35",
|
|
23
|
+
"@nocobase/resourcer": "2.1.0-beta.35",
|
|
24
|
+
"@nocobase/sdk": "2.1.0-beta.35",
|
|
25
|
+
"@nocobase/snowflake-id": "2.1.0-beta.35",
|
|
26
|
+
"@nocobase/telemetry": "2.1.0-beta.35",
|
|
27
|
+
"@nocobase/utils": "2.1.0-beta.35",
|
|
28
28
|
"@types/decompress": "4.2.7",
|
|
29
29
|
"@types/ini": "^1.3.31",
|
|
30
30
|
"@types/koa-send": "^4.1.3",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"@types/serve-handler": "^6.1.1",
|
|
62
62
|
"@types/ws": "^8.5.5"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "74310d8b9e9581fcde14b5a93d12b41ddb5bb325"
|
|
65
65
|
}
|