@tachybase/module-worker-thread 1.2.11 → 1.2.13

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.
@@ -1,12 +1,12 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.2.11",
4
- "@tachybase/schema": "1.2.11",
3
+ "@tachybase/client": "1.2.13",
4
+ "@tachybase/schema": "1.2.13",
5
5
  "antd": "5.22.5",
6
- "@tachybase/server": "1.2.11",
7
- "@tachybase/logger": "1.2.11",
8
- "@tachybase/module-collection": "1.2.11",
9
- "@tachybase/module-user": "1.2.11",
10
- "@tachybase/utils": "1.2.11",
11
- "@tachybase/actions": "1.2.11"
6
+ "@tachybase/server": "1.2.13",
7
+ "@tachybase/logger": "1.2.13",
8
+ "@tachybase/module-collection": "1.2.13",
9
+ "@tachybase/module-user": "1.2.13",
10
+ "@tachybase/utils": "1.2.13",
11
+ "@tachybase/actions": "1.2.13"
12
12
  };
@@ -1 +1,4 @@
1
+ declare module 'node:module' {
2
+ function _load(request: string, parent: NodeModule | null, isMain: boolean): any;
3
+ }
1
4
  export {};
@@ -1,55 +1,11 @@
1
1
  var import_node_module = require("node:module");
2
- var import_node_path = require("node:path");
3
2
  var import_node_worker_threads = require("node:worker_threads");
4
- const whitelists = /* @__PURE__ */ new Set([
5
- "@koa/cors",
6
- "@koa/multer",
7
- "@tachybase/acl",
8
- "@tachybase/actions",
9
- "@tachybase/auth",
10
- "@tachybase/cache",
11
- "@tachybase/data-source",
12
- "@tachybase/database",
13
- "@tachybase/evaluators",
14
- "@tachybase/logger",
15
- "@tachybase/resourcer",
16
- "@tachybase/schema",
17
- "@tachybase/server",
18
- "@tachybase/utils",
19
- "async-mutex",
20
- "axios",
21
- "cache-manager",
22
- "dayjs",
23
- "dotenv",
24
- "i18next",
25
- "jsonwebtoken",
26
- "koa",
27
- "koa-bodyparser",
28
- "lodash",
29
- "mathjs",
30
- "multer",
31
- "mysql2",
32
- "pg",
33
- "react",
34
- "react-dom",
35
- "sequelize",
36
- "sqlite3",
37
- "umzug",
38
- "winston",
39
- "winston-daily-rotate-file"
40
- ]);
41
3
  if (!import_node_worker_threads.isMainThread && process.env.RUN_MODE === "engine") {
42
- let isBareModule = function(name) {
43
- return !name.startsWith(".") && !name.startsWith("/") && !(0, import_node_path.isAbsolute)(name);
44
- };
45
4
  const lookingPaths = process.env.TACHYBASE_WORKER_PATHS.split(",");
5
+ const whitelists = new Set(process.env.TACHYBASE_WORKER_MODULES.split(","));
46
6
  const originalLoad = import_node_module.Module._load;
47
- process.env.TACHYBASE_WORKER_PATHS = lookingPaths.join(",");
48
7
  import_node_module.Module._load = function(request, parent, isMain) {
49
- if ((0, import_node_module.isBuiltin)(request)) {
50
- return originalLoad(request, parent, isMain);
51
- }
52
- if (isBareModule(request) && (whitelists.has(request) || request.startsWith("@tachybase/"))) {
8
+ if (whitelists.has(request) || request.startsWith("@tachybase/")) {
53
9
  try {
54
10
  const resolvedFromApp = require.resolve(request, { paths: lookingPaths });
55
11
  return originalLoad(resolvedFromApp, parent, isMain);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/module-worker-thread",
3
3
  "displayName": "Worker thread",
4
- "version": "1.2.11",
4
+ "version": "1.2.13",
5
5
  "description": "Worker thread for executing time-consuming tasks",
6
6
  "keywords": [
7
7
  "Workflow"
@@ -13,15 +13,15 @@
13
13
  "tsx": "^4.19.2"
14
14
  },
15
15
  "peerDependencies": {
16
- "@tachybase/actions": "1.2.11",
17
- "@tachybase/client": "1.2.11",
18
- "@tachybase/logger": "1.2.11",
19
- "@tachybase/module-collection": "1.2.11",
20
- "@tachybase/module-user": "1.2.11",
21
- "@tachybase/schema": "1.2.11",
22
- "@tachybase/test": "1.2.11",
23
- "@tachybase/server": "1.2.11",
24
- "@tachybase/utils": "1.2.11"
16
+ "@tachybase/actions": "1.2.13",
17
+ "@tachybase/logger": "1.2.13",
18
+ "@tachybase/client": "1.2.13",
19
+ "@tachybase/module-collection": "1.2.13",
20
+ "@tachybase/schema": "1.2.13",
21
+ "@tachybase/server": "1.2.13",
22
+ "@tachybase/test": "1.2.13",
23
+ "@tachybase/utils": "1.2.13",
24
+ "@tachybase/module-user": "1.2.13"
25
25
  },
26
26
  "description.zh-CN": "工作线程,用于执行耗时任务",
27
27
  "displayName.zh-CN": "工作线程",