@tachybase/module-worker-thread 1.3.5 → 1.3.7

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,13 +1,14 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.3.5",
4
- "@tachybase/schema": "1.3.5",
3
+ "@tachybase/client": "1.3.7",
4
+ "@tachybase/schema": "1.3.7",
5
5
  "antd": "5.22.5",
6
- "@tachybase/globals": "1.3.5",
7
- "@tachybase/server": "1.3.5",
8
- "@tachybase/logger": "1.3.5",
9
- "@tachybase/module-collection": "1.3.5",
10
- "@tachybase/module-user": "1.3.5",
11
- "@tachybase/utils": "1.3.5",
12
- "@tachybase/actions": "1.3.5"
6
+ "@tachybase/globals": "1.3.7",
7
+ "@tachybase/loader": "1.3.7",
8
+ "@tachybase/server": "1.3.7",
9
+ "@tachybase/logger": "1.3.7",
10
+ "@tachybase/module-collection": "1.3.7",
11
+ "@tachybase/module-user": "1.3.7",
12
+ "@tachybase/utils": "1.3.7",
13
+ "@tachybase/actions": "1.3.7"
13
14
  };
@@ -23,23 +23,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  var import_node_module = require("node:module");
24
24
  var import_node_worker_threads = require("node:worker_threads");
25
25
  var import_globals = __toESM(require("@tachybase/globals"));
26
+ var import_loader = require("@tachybase/loader");
26
27
  const paths = process.env.NODE_MODULES_PATH.split(",");
27
28
  import_globals.default.getInstance().set("PLUGIN_PATHS", paths);
28
29
  if (!import_node_worker_threads.isMainThread && process.env.RUN_MODE === "engine") {
29
30
  const lookingPaths = process.env.TACHYBASE_WORKER_PATHS.split(",");
30
31
  const whitelists = new Set(process.env.TACHYBASE_WORKER_MODULES.split(","));
31
32
  const originalLoad = import_node_module.Module._load;
32
- import_node_module.Module._load = function(request, parent, isMain) {
33
- if (whitelists.has(request) || request.startsWith("@tachybase/")) {
34
- try {
35
- const resolvedFromApp = require.resolve(request, { paths: lookingPaths });
36
- return originalLoad(resolvedFromApp, parent, isMain);
37
- } catch (err) {
38
- if (err.code === "MODULE_NOT_FOUND") {
39
- return originalLoad(request, parent, isMain);
40
- }
41
- }
42
- }
43
- return originalLoad(request, parent, isMain);
44
- };
33
+ import_node_module.Module._load = (0, import_loader.defineLoader)(whitelists, originalLoad, lookingPaths);
45
34
  }
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.3.5",
4
+ "version": "1.3.7",
5
5
  "description": "Worker thread for executing time-consuming tasks",
6
6
  "keywords": [
7
7
  "Workflow"
@@ -13,16 +13,17 @@
13
13
  "tsx": "^4.19.2"
14
14
  },
15
15
  "peerDependencies": {
16
- "@tachybase/client": "1.3.5",
17
- "@tachybase/actions": "1.3.5",
18
- "@tachybase/logger": "1.3.5",
19
- "@tachybase/module-collection": "1.3.5",
20
- "@tachybase/module-user": "1.3.5",
21
- "@tachybase/globals": "1.3.5",
22
- "@tachybase/schema": "1.3.5",
23
- "@tachybase/test": "1.3.5",
24
- "@tachybase/utils": "1.3.5",
25
- "@tachybase/server": "1.3.5"
16
+ "@tachybase/actions": "1.3.7",
17
+ "@tachybase/globals": "1.3.7",
18
+ "@tachybase/logger": "1.3.7",
19
+ "@tachybase/client": "1.3.7",
20
+ "@tachybase/loader": "1.3.7",
21
+ "@tachybase/module-user": "1.3.7",
22
+ "@tachybase/module-collection": "1.3.7",
23
+ "@tachybase/schema": "1.3.7",
24
+ "@tachybase/server": "1.3.7",
25
+ "@tachybase/utils": "1.3.7",
26
+ "@tachybase/test": "1.3.7"
26
27
  },
27
28
  "description.zh-CN": "工作线程,用于执行耗时任务",
28
29
  "displayName.zh-CN": "工作线程",