@nocobase/server 0.14.0-alpha.2 → 0.14.0-alpha.3
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/locale/locale.js
CHANGED
|
@@ -23,7 +23,6 @@ __export(locale_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(locale_exports);
|
|
24
24
|
var import_cache = require("@nocobase/cache");
|
|
25
25
|
var import_utils = require("@nocobase/utils");
|
|
26
|
-
var import_plugin_manager = require("../plugin-manager");
|
|
27
26
|
var import_resource = require("./resource");
|
|
28
27
|
const _Locale = class _Locale {
|
|
29
28
|
app;
|
|
@@ -75,11 +74,19 @@ const _Locale = class _Locale {
|
|
|
75
74
|
return await this.wrapCache(`locale:resources:${lang}`, () => this.getResources(lang));
|
|
76
75
|
}
|
|
77
76
|
getResources(lang) {
|
|
77
|
+
var _a;
|
|
78
78
|
const resources = {};
|
|
79
79
|
const names = this.app.pm.getAliases();
|
|
80
80
|
for (const name of names) {
|
|
81
81
|
try {
|
|
82
|
-
const
|
|
82
|
+
const p = this.app.pm.get(name);
|
|
83
|
+
if (!p) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const packageName = (_a = p.options) == null ? void 0 : _a.packageName;
|
|
87
|
+
if (!packageName) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
83
90
|
const res = (0, import_resource.getResource)(packageName, lang);
|
|
84
91
|
if (res) {
|
|
85
92
|
resources[name] = { ...res };
|
|
@@ -34,7 +34,6 @@ var import_utils = require("@nocobase/utils");
|
|
|
34
34
|
var import_fs = __toESM(require("fs"));
|
|
35
35
|
var import_path = __toESM(require("path"));
|
|
36
36
|
var import_clientStaticUtils = require("../clientStaticUtils");
|
|
37
|
-
var import_plugin_manager = __toESM(require("../plugin-manager"));
|
|
38
37
|
var resource_default = {
|
|
39
38
|
name: "pm",
|
|
40
39
|
actions: {
|
|
@@ -154,11 +153,9 @@ var resource_default = {
|
|
|
154
153
|
});
|
|
155
154
|
ctx.body = items.map((item) => {
|
|
156
155
|
try {
|
|
157
|
-
const packageName = import_plugin_manager.default.getPackageName(item.name);
|
|
158
156
|
return {
|
|
159
157
|
...item.toJSON(),
|
|
160
|
-
packageName,
|
|
161
|
-
url: (0, import_clientStaticUtils.getExposeUrl)(packageName, PLUGIN_CLIENT_ENTRY_FILE)
|
|
158
|
+
url: (0, import_clientStaticUtils.getExposeUrl)(item.packageName, PLUGIN_CLIENT_ENTRY_FILE)
|
|
162
159
|
};
|
|
163
160
|
} catch {
|
|
164
161
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/server",
|
|
3
|
-
"version": "0.14.0-alpha.
|
|
3
|
+
"version": "0.14.0-alpha.3",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"@koa/cors": "^3.1.0",
|
|
11
11
|
"@koa/multer": "^3.0.2",
|
|
12
12
|
"@koa/router": "^9.4.0",
|
|
13
|
-
"@nocobase/acl": "0.14.0-alpha.
|
|
14
|
-
"@nocobase/actions": "0.14.0-alpha.
|
|
15
|
-
"@nocobase/auth": "0.14.0-alpha.
|
|
16
|
-
"@nocobase/cache": "0.14.0-alpha.
|
|
17
|
-
"@nocobase/database": "0.14.0-alpha.
|
|
18
|
-
"@nocobase/evaluators": "0.14.0-alpha.
|
|
19
|
-
"@nocobase/logger": "0.14.0-alpha.
|
|
20
|
-
"@nocobase/resourcer": "0.14.0-alpha.
|
|
21
|
-
"@nocobase/sdk": "0.14.0-alpha.
|
|
22
|
-
"@nocobase/utils": "0.14.0-alpha.
|
|
13
|
+
"@nocobase/acl": "0.14.0-alpha.3",
|
|
14
|
+
"@nocobase/actions": "0.14.0-alpha.3",
|
|
15
|
+
"@nocobase/auth": "0.14.0-alpha.3",
|
|
16
|
+
"@nocobase/cache": "0.14.0-alpha.3",
|
|
17
|
+
"@nocobase/database": "0.14.0-alpha.3",
|
|
18
|
+
"@nocobase/evaluators": "0.14.0-alpha.3",
|
|
19
|
+
"@nocobase/logger": "0.14.0-alpha.3",
|
|
20
|
+
"@nocobase/resourcer": "0.14.0-alpha.3",
|
|
21
|
+
"@nocobase/sdk": "0.14.0-alpha.3",
|
|
22
|
+
"@nocobase/utils": "0.14.0-alpha.3",
|
|
23
23
|
"@types/decompress": "4.2.4",
|
|
24
24
|
"@types/ini": "^1.3.31",
|
|
25
25
|
"@types/koa-send": "^4.1.3",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"@types/serve-handler": "^6.1.1",
|
|
52
52
|
"@types/ws": "^8.5.5"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "535a8c83d37e488a52bd1ad3c75726101081177c"
|
|
55
55
|
}
|