threadsx 2.0.0 → 2.0.2
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.
|
@@ -86,6 +86,12 @@ function createTsRuntimeModule(scriptPath, runtime) {
|
|
|
86
86
|
return content;
|
|
87
87
|
}
|
|
88
88
|
function rebaseScriptPath(scriptPath, ignoreRegex) {
|
|
89
|
+
// An already-absolute path (e.g. from `new Worker(new URL("./w", import.meta.url))`,
|
|
90
|
+
// which threadsx normalizes to a filesystem path) must not be rebased onto the
|
|
91
|
+
// caller's directory — doing so would prepend it and corrupt the path.
|
|
92
|
+
if (path.isAbsolute(scriptPath)) {
|
|
93
|
+
return scriptPath;
|
|
94
|
+
}
|
|
89
95
|
const parentCallSite = (0, callsites_1.default)().find((callsite) => {
|
|
90
96
|
const filename = callsite.getFileName();
|
|
91
97
|
return Boolean(filename &&
|
|
@@ -45,6 +45,12 @@ function createTsRuntimeModule(scriptPath, runtime) {
|
|
|
45
45
|
return content;
|
|
46
46
|
}
|
|
47
47
|
function rebaseScriptPath(scriptPath, ignoreRegex) {
|
|
48
|
+
// An already-absolute path (e.g. from `new Worker(new URL("./w", import.meta.url))`,
|
|
49
|
+
// which threadsx normalizes to a filesystem path) must not be rebased onto the
|
|
50
|
+
// caller's directory — doing so would prepend it and corrupt the path.
|
|
51
|
+
if (path.isAbsolute(scriptPath)) {
|
|
52
|
+
return scriptPath;
|
|
53
|
+
}
|
|
48
54
|
const parentCallSite = getCallsites().find((callsite) => {
|
|
49
55
|
const filename = callsite.getFileName();
|
|
50
56
|
return Boolean(filename &&
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "threadsx",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "Make web workers & worker threads as simple as a function call. Maintained, modernized fork of threads.js — Node.js 20+, ESM & CommonJS, TypeScript, observables and thread pools.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist-esm/index.js",
|
|
@@ -63,14 +63,25 @@
|
|
|
63
63
|
},
|
|
64
64
|
"homepage": "https://threadsx.jmaleonard.com",
|
|
65
65
|
"keywords": [
|
|
66
|
+
"threadsx",
|
|
67
|
+
"threads",
|
|
66
68
|
"thread",
|
|
67
69
|
"worker",
|
|
70
|
+
"web-worker",
|
|
71
|
+
"worker-threads",
|
|
72
|
+
"worker_threads",
|
|
73
|
+
"thread-pool",
|
|
68
74
|
"pool",
|
|
69
75
|
"spawn",
|
|
70
|
-
"isomorphic",
|
|
71
76
|
"parallel",
|
|
77
|
+
"multithreading",
|
|
78
|
+
"concurrency",
|
|
72
79
|
"observable",
|
|
73
|
-
"
|
|
80
|
+
"typescript",
|
|
81
|
+
"esm",
|
|
82
|
+
"isomorphic",
|
|
83
|
+
"nodejs",
|
|
84
|
+
"browser"
|
|
74
85
|
],
|
|
75
86
|
"dependencies": {
|
|
76
87
|
"callsites": "^3.1.0",
|