@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.
Files changed (55) hide show
  1. package/dist/esm/master/implementation.browser.js +3 -3
  2. package/dist/esm/master/implementation.node.js +11 -9
  3. package/dist/esm/master/pool.js +9 -9
  4. package/dist/esm/master/spawn.js +4 -4
  5. package/dist/esm/observable-promise.js +2 -2
  6. package/dist/esm/observable.js +1 -1
  7. package/dist/esm/worker/index.js +2 -2
  8. package/dist/master/implementation.browser.js +3 -3
  9. package/dist/master/implementation.node.js +11 -9
  10. package/dist/master/pool.js +9 -9
  11. package/dist/master/spawn.js +4 -4
  12. package/dist/observable-promise.js +2 -2
  13. package/dist/observable.js +1 -1
  14. package/dist/worker/index.js +2 -2
  15. package/observable.d.ts +1 -0
  16. package/package.json +6 -6
  17. package/register.d.ts +1 -0
  18. package/rollup.config.js +0 -1
  19. package/src/index.ts +1 -0
  20. package/src/master/implementation.browser.ts +4 -3
  21. package/src/master/implementation.node.ts +20 -17
  22. package/src/master/index.ts +1 -0
  23. package/src/master/invocation-proxy.ts +1 -1
  24. package/src/master/pool-types.ts +28 -28
  25. package/src/master/pool.ts +10 -10
  26. package/src/master/spawn.ts +10 -9
  27. package/src/master/thread.ts +1 -0
  28. package/src/observable-promise.ts +11 -11
  29. package/src/observable.ts +1 -2
  30. package/src/ponyfills.ts +6 -6
  31. package/src/serializers.ts +1 -0
  32. package/src/transferable.ts +0 -1
  33. package/src/types/master.ts +4 -3
  34. package/src/worker/implementation.browser.ts +1 -0
  35. package/src/worker/implementation.tiny-worker.ts +1 -1
  36. package/src/worker/implementation.ts +1 -0
  37. package/src/worker/implementation.worker_threads.ts +1 -0
  38. package/src/worker/index.ts +3 -2
  39. package/test/lib/serialization.ts +2 -2
  40. package/test/observable-promise.test.ts +9 -9
  41. package/test/observable.test.ts +7 -6
  42. package/test/pool.test.ts +7 -7
  43. package/test/serialization.test.ts +1 -0
  44. package/test/spawn.chromium.mocha.ts +1 -0
  45. package/test/spawn.test.ts +4 -2
  46. package/test/streaming.test.ts +1 -1
  47. package/test/transferables.test.ts +3 -2
  48. package/test/workers/minmax.ts +1 -0
  49. package/test/workers/serialization.ts +1 -0
  50. package/test-tooling/webpack/app.ts +4 -5
  51. package/test-tooling/webpack/webpack.chromium.mocha.ts +1 -1
  52. package/test-tooling/webpack/webpack.node.config.js +0 -1
  53. package/test-tooling/webpack/webpack.test.ts +13 -7
  54. package/test-tooling/webpack/webpack.web.config.js +0 -1
  55. 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
- /* eslint-disable @typescript-eslint/no-var-requires */
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' ? error.stack
15
- : typeof error.message === 'string' ? error.message
16
- : error
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
- error ? reject(error) : resolve(stats)
26
+ if (stats) {
27
+ error ? reject(error) : resolve(stats)
28
+ }
23
29
  })
24
30
  })
25
31
  }
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
1
  const path = require('node:path')
3
2
  const ThreadsPlugin = require('threads-plugin')
4
3
 
package/worker.d.ts CHANGED
@@ -1 +1,2 @@
1
+ /* eslint-disable import/no-internal-modules */
1
2
  export * from './dist/worker/index'