@xylabs/threads 3.1.12 → 3.2.0

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.
@@ -8,29 +8,6 @@
8
8
  /* eslint-disable unicorn/text-encoding-identifier-case */
9
9
  /* eslint-disable unicorn/no-process-exit */
10
10
  /// <reference lib="dom" />
11
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- var desc = Object.getOwnPropertyDescriptor(m, k);
14
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
- desc = { enumerable: true, get: function() { return m[k]; } };
16
- }
17
- Object.defineProperty(o, k2, desc);
18
- }) : (function(o, m, k, k2) {
19
- if (k2 === undefined) k2 = k;
20
- o[k2] = m[k];
21
- }));
22
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
- Object.defineProperty(o, "default", { enumerable: true, value: v });
24
- }) : function(o, v) {
25
- o["default"] = v;
26
- });
27
- var __importStar = (this && this.__importStar) || function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
35
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
13
  };
@@ -38,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
38
15
  exports.isWorkerRuntime = exports.getWorkerImplementation = exports.defaultPoolSize = void 0;
39
16
  const node_events_1 = require("node:events");
40
17
  const node_os_1 = require("node:os");
41
- const path = __importStar(require("node:path"));
18
+ const node_path_1 = __importDefault(require("node:path"));
42
19
  const node_url_1 = require("node:url");
43
20
  const callsites_1 = __importDefault(require("callsites"));
44
21
  let tsNodeAvailable;
@@ -83,13 +60,13 @@ function rebaseScriptPath(scriptPath, ignoreRegex) {
83
60
  if (callerPath && callerPath.startsWith('file:')) {
84
61
  callerPath = (0, node_url_1.fileURLToPath)(callerPath);
85
62
  }
86
- const rebasedScriptPath = callerPath ? path.join(path.dirname(callerPath), scriptPath) : scriptPath;
63
+ const rebasedScriptPath = callerPath ? node_path_1.default.join(node_path_1.default.dirname(callerPath), scriptPath) : scriptPath;
87
64
  return rebasedScriptPath;
88
65
  }
89
66
  function resolveScriptPath(scriptPath, baseURL) {
90
67
  const makeRelative = (filePath) => {
91
68
  // eval() hack is also webpack-related
92
- return path.isAbsolute(filePath) ? filePath : path.join(baseURL || eval('__dirname'), filePath);
69
+ return node_path_1.default.isAbsolute(filePath) ? filePath : node_path_1.default.join(baseURL || eval('__dirname'), filePath);
93
70
  };
94
71
  const workerFilePath = typeof __non_webpack_require__ === 'function' ?
95
72
  __non_webpack_require__.resolve(makeRelative(scriptPath))
@@ -9,7 +9,7 @@
9
9
  /// <reference lib="dom" />
10
10
  import { EventEmitter } from 'node:events';
11
11
  import { cpus } from 'node:os';
12
- import * as path from 'node:path';
12
+ import path from 'node:path';
13
13
  import { fileURLToPath } from 'node:url';
14
14
  import getCallsites from 'callsites';
15
15
  let tsNodeAvailable;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/threads",
3
- "version": "3.1.12",
3
+ "version": "3.2.0",
4
4
  "description": "Web workers & worker threads as simple as a function call",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -75,10 +75,10 @@
75
75
  "devDependencies": {
76
76
  "@rollup/plugin-commonjs": "^16.0.0",
77
77
  "@rollup/plugin-node-resolve": "^10.0.0",
78
- "@types/chai": "^4.3.14",
78
+ "@types/chai": "^4.3.15",
79
79
  "@types/debug": "^4.1.12",
80
80
  "@types/execa": "^2.0.0",
81
- "@types/node": "^20.12.7",
81
+ "@types/node": "^20.12.8",
82
82
  "@types/webpack": "^4.41.38",
83
83
  "ava": "^3.15.0",
84
84
  "chai": "^4.4.1",
@@ -10,7 +10,7 @@
10
10
 
11
11
  import { EventEmitter } from 'node:events'
12
12
  import { cpus } from 'node:os'
13
- import * as path from 'node:path'
13
+ import path from 'node:path'
14
14
  import { fileURLToPath } from 'node:url'
15
15
 
16
16
  import getCallsites, { CallSite } from 'callsites'
@@ -1,4 +1,4 @@
1
- import * as path from 'node:path'
1
+ import path from 'node:path'
2
2
 
3
3
  import test from 'ava'
4
4
  import execa from 'execa'
@@ -55,4 +55,6 @@ function test4() {
55
55
  }
56
56
  }
57
57
 
58
- export default () => Promise.all([test(), test2(), test3(), test4()])
58
+ const testAll = () => Promise.all([test(), test2(), test3(), test4()])
59
+
60
+ export default testAll
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable require-await */
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
3
  /* eslint-disable @typescript-eslint/no-var-requires */
4
- import * as path from 'node:path'
4
+ import path from 'node:path'
5
5
 
6
6
  import test from 'ava'
7
7
  import Webpack from 'webpack'