@nocobase/server 2.1.0-beta.35 → 2.1.0-beta.37
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.
|
@@ -42,7 +42,7 @@ __export(static_file_security_exports, {
|
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(static_file_security_exports);
|
|
44
44
|
var import_node_path = __toESM(require("node:path"));
|
|
45
|
-
const ACTIVE_CONTENT_EXTENSIONS = /* @__PURE__ */ new Set([".htm", ".html", ".svg", ".svgz", ".xhtml"]);
|
|
45
|
+
const ACTIVE_CONTENT_EXTENSIONS = /* @__PURE__ */ new Set([".htm", ".html", ".pdf", ".svg", ".svgz", ".xhtml"]);
|
|
46
46
|
function stripQueryAndHash(pathname = "") {
|
|
47
47
|
return pathname.split("?")[0].split("#")[0];
|
|
48
48
|
}
|
|
@@ -155,7 +155,11 @@ const _PluginManager = class _PluginManager {
|
|
|
155
155
|
*/
|
|
156
156
|
static async getPackageJson(nameOrPkg) {
|
|
157
157
|
const { packageName } = await this.parseName(nameOrPkg);
|
|
158
|
-
const
|
|
158
|
+
const nodeModulesPath = String(process.env.NODE_MODULES_PATH ?? "").trim();
|
|
159
|
+
if (!nodeModulesPath) {
|
|
160
|
+
throw new Error("NODE_MODULES_PATH is not configured");
|
|
161
|
+
}
|
|
162
|
+
const packageFile = (0, import_path.resolve)(nodeModulesPath, packageName, "package.json");
|
|
159
163
|
if (!await import_fs_extra.default.exists(packageFile)) {
|
|
160
164
|
throw new Error(`Cannot find plugin '${nameOrPkg}'`);
|
|
161
165
|
}
|
|
@@ -297,8 +301,8 @@ const _PluginManager = class _PluginManager {
|
|
|
297
301
|
}
|
|
298
302
|
/* istanbul ignore next -- @preserve */
|
|
299
303
|
async create(pluginName, options) {
|
|
300
|
-
const createPlugin = /* @__PURE__ */ __name(async (
|
|
301
|
-
const pluginDir = (0, import_path.resolve)(process.cwd(), "packages/plugins",
|
|
304
|
+
const createPlugin = /* @__PURE__ */ __name(async (name) => {
|
|
305
|
+
const pluginDir = (0, import_path.resolve)(process.cwd(), "packages/plugins", name);
|
|
302
306
|
if (options == null ? void 0 : options.forceRecreate) {
|
|
303
307
|
await import_fs_extra.default.rm(pluginDir, { recursive: true, force: true });
|
|
304
308
|
}
|
|
@@ -307,21 +311,13 @@ const _PluginManager = class _PluginManager {
|
|
|
307
311
|
cwd: process.cwd(),
|
|
308
312
|
args: {},
|
|
309
313
|
context: {
|
|
310
|
-
name
|
|
314
|
+
name
|
|
311
315
|
}
|
|
312
316
|
});
|
|
313
317
|
await generator.run();
|
|
314
318
|
}, "createPlugin");
|
|
315
319
|
await createPlugin(pluginName);
|
|
316
320
|
this.app.log.info("attempt to add the plugin to the app");
|
|
317
|
-
const { name, packageName } = await _PluginManager.parseName(pluginName);
|
|
318
|
-
const json = await _PluginManager.getPackageJson(packageName);
|
|
319
|
-
this.app.log.info(`add plugin [${packageName}]`, {
|
|
320
|
-
name,
|
|
321
|
-
packageName,
|
|
322
|
-
version: json.version
|
|
323
|
-
});
|
|
324
|
-
await (0, import_helper.tsxRerunning)();
|
|
325
321
|
}
|
|
326
322
|
async addOrThrow(plugin, options = {}, insert = false, isUpgrade = false) {
|
|
327
323
|
if (!isUpgrade && this.has(plugin)) {
|
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.37",
|
|
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.37",
|
|
14
|
+
"@nocobase/actions": "2.1.0-beta.37",
|
|
15
|
+
"@nocobase/ai": "2.1.0-beta.37",
|
|
16
|
+
"@nocobase/auth": "2.1.0-beta.37",
|
|
17
|
+
"@nocobase/cache": "2.1.0-beta.37",
|
|
18
|
+
"@nocobase/data-source-manager": "2.1.0-beta.37",
|
|
19
|
+
"@nocobase/database": "2.1.0-beta.37",
|
|
20
|
+
"@nocobase/evaluators": "2.1.0-beta.37",
|
|
21
|
+
"@nocobase/lock-manager": "2.1.0-beta.37",
|
|
22
|
+
"@nocobase/logger": "2.1.0-beta.37",
|
|
23
|
+
"@nocobase/resourcer": "2.1.0-beta.37",
|
|
24
|
+
"@nocobase/sdk": "2.1.0-beta.37",
|
|
25
|
+
"@nocobase/snowflake-id": "2.1.0-beta.37",
|
|
26
|
+
"@nocobase/telemetry": "2.1.0-beta.37",
|
|
27
|
+
"@nocobase/utils": "2.1.0-beta.37",
|
|
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": "7132e5b83ecc0e42b54715eaf1429c72bcef34ae"
|
|
65
65
|
}
|