@xylabs/threads 3.6.6 → 3.6.8
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/dist/esm/master/implementation.browser.js +3 -3
- package/dist/esm/master/implementation.node.js +11 -9
- package/dist/esm/master/pool.js +9 -9
- package/dist/esm/master/spawn.js +4 -4
- package/dist/esm/observable-promise.js +2 -2
- package/dist/esm/observable.js +1 -1
- package/dist/esm/worker/index.js +2 -2
- package/dist/master/implementation.browser.js +3 -3
- package/dist/master/implementation.node.js +11 -9
- package/dist/master/pool.js +9 -9
- package/dist/master/spawn.js +4 -4
- package/dist/observable-promise.js +2 -2
- package/dist/observable.js +1 -1
- package/dist/worker/index.js +2 -2
- package/observable.d.ts +1 -0
- package/package.json +6 -6
- package/register.d.ts +1 -0
- package/rollup.config.js +0 -1
- package/src/index.ts +1 -0
- package/src/master/implementation.browser.ts +4 -3
- package/src/master/implementation.node.ts +20 -17
- package/src/master/index.ts +1 -0
- package/src/master/invocation-proxy.ts +1 -1
- package/src/master/pool-types.ts +28 -28
- package/src/master/pool.ts +10 -10
- package/src/master/spawn.ts +10 -9
- package/src/master/thread.ts +1 -0
- package/src/observable-promise.ts +11 -11
- package/src/observable.ts +1 -2
- package/src/ponyfills.ts +6 -6
- package/src/serializers.ts +1 -0
- package/src/transferable.ts +0 -1
- package/src/types/master.ts +4 -3
- package/src/worker/implementation.browser.ts +1 -0
- package/src/worker/implementation.tiny-worker.ts +1 -1
- package/src/worker/implementation.ts +1 -0
- package/src/worker/implementation.worker_threads.ts +1 -0
- package/src/worker/index.ts +3 -2
- package/test/lib/serialization.ts +2 -2
- package/test/observable-promise.test.ts +9 -9
- package/test/observable.test.ts +7 -6
- package/test/pool.test.ts +7 -7
- package/test/serialization.test.ts +1 -0
- package/test/spawn.chromium.mocha.ts +1 -0
- package/test/spawn.test.ts +4 -2
- package/test/streaming.test.ts +1 -1
- package/test/transferables.test.ts +3 -2
- package/test/workers/minmax.ts +1 -0
- package/test/workers/serialization.ts +1 -0
- package/test-tooling/webpack/app.ts +4 -5
- package/test-tooling/webpack/webpack.chromium.mocha.ts +1 -1
- package/test-tooling/webpack/webpack.node.config.js +0 -1
- package/test-tooling/webpack/webpack.test.ts +13 -7
- package/test-tooling/webpack/webpack.web.config.js +0 -1
- package/worker.d.ts +1 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
1
3
|
/* eslint-disable require-await */
|
|
2
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
|
|
5
|
+
|
|
4
6
|
import path from 'node:path'
|
|
5
7
|
|
|
6
8
|
import test from 'ava'
|
|
@@ -10,16 +12,20 @@ const browserConfig = require('./webpack.web.config')
|
|
|
10
12
|
const serverConfig = require('./webpack.node.config')
|
|
11
13
|
|
|
12
14
|
const stringifyWebpackError = (error: any) =>
|
|
13
|
-
error
|
|
14
|
-
typeof error.stack === 'string'
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
error
|
|
16
|
+
? typeof error.stack === 'string'
|
|
17
|
+
? error.stack
|
|
18
|
+
: typeof error.message === 'string'
|
|
19
|
+
? error.message
|
|
20
|
+
: error
|
|
21
|
+
: ''
|
|
18
22
|
|
|
19
23
|
async function runWebpack(config: any) {
|
|
20
24
|
return new Promise<Webpack.Stats>((resolve, reject) => {
|
|
21
25
|
Webpack(config).run((error, stats) => {
|
|
22
|
-
|
|
26
|
+
if (stats) {
|
|
27
|
+
error ? reject(error) : resolve(stats)
|
|
28
|
+
}
|
|
23
29
|
})
|
|
24
30
|
})
|
|
25
31
|
}
|
package/worker.d.ts
CHANGED