synckit 0.4.1 → 0.6.1

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/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
17
17
  [![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
18
18
 
19
- Perform async work synchronously in Node.js using `worker_threads`, or `child_process` as fallback, with first-class TypeScript support.
19
+ Perform async work synchronously in Node.js using `worker_threads` with first-class TypeScript support.
20
20
 
21
21
  ## TOC <!-- omit in toc -->
22
22
 
@@ -43,8 +43,6 @@ npm i synckit
43
43
 
44
44
  ### API
45
45
 
46
- `worker_threads` is used by default for performance, if you have any problem with it, you can set env `SYNCKIT_WORKER_THREADS=0` to disable it and fallback to previously `child_process` solution, and please raise an issue here so that we can improve it.
47
-
48
46
  ```js
49
47
  // runner.js
50
48
  import { createSyncFn } from 'synckit'
@@ -66,16 +64,13 @@ runAsWorker(async (...args) => {
66
64
  })
67
65
  ```
68
66
 
69
- You must make sure:
70
-
71
- 1. if `worker_threads` is enabled (by default), the `result` is serialized by [`Structured Clone Algorithm`](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm)
72
- 2. if `child_process` is used, the `result` is serialized by `JSON.stringify`
67
+ You must make sure, the `result` is serialized by [`Structured Clone Algorithm`](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm)
73
68
 
74
69
  ### Envs
75
70
 
76
- 1. `SYNCKIT_WORKER_THREADS`: whether or not enable `worker_threads`, it's enabled by default, set as `0` to disable
77
- 2. `SYNCKIT_BUFFER_SIZE`: `bufferSize` to create `SharedArrayBuffer` for `worker_threads` (default as `1024`), or `maxBuffer` for `child_process` (no default)
78
- 3. `SYNCKIT_TIMEOUT`: `timeout` for performing the async job (no default)
71
+ 1. `SYNCKIT_BUFFER_SIZE`: `bufferSize` to create `SharedArrayBuffer` for `worker_threads` (default as `1024`)
72
+ 2. `SYNCKIT_TIMEOUT`: `timeout` for performing the async job (no default)
73
+ 3. `SYNCKIT_EXEC_ARGV`: List of node CLI options passed to the worker, split with comma `,`. (default as `[]`), see also [`node` docs](https://nodejs.org/api/worker_threads.html)
79
74
 
80
75
  ### TypeScript
81
76
 
package/lib/index.cjs CHANGED
@@ -2,37 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var child_process = require('child_process');
6
- var os = require('os');
7
5
  var path = require('path');
8
- var fs = require('fs');
9
- var module$1 = require('module');
10
- var uuid = require('uuid');
6
+ var worker_threads = require('worker_threads');
11
7
 
12
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
9
 
14
10
  var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
15
- var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
16
11
 
17
- var __defProp = Object.defineProperty;
18
- var __defProps = Object.defineProperties;
19
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
20
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
21
- var __hasOwnProp = Object.prototype.hasOwnProperty;
22
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
23
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
24
- var __spreadValues = (a, b) => {
25
- for (var prop in b || (b = {}))
26
- if (__hasOwnProp.call(b, prop))
27
- __defNormalProp(a, prop, b[prop]);
28
- if (__getOwnPropSymbols)
29
- for (var prop of __getOwnPropSymbols(b)) {
30
- if (__propIsEnum.call(b, prop))
31
- __defNormalProp(a, prop, b[prop]);
32
- }
33
- return a;
34
- };
35
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
36
12
  var __async = (__this, __arguments, generator) => {
37
13
  return new Promise((resolve, reject) => {
38
14
  var fulfilled = (value) => {
@@ -53,78 +29,64 @@ var __async = (__this, __arguments, generator) => {
53
29
  step((generator = generator.apply(__this, __arguments)).next());
54
30
  });
55
31
  };
56
- const import_meta = {};
57
- const tmpdir = fs__default['default'].realpathSync(os.tmpdir());
58
- let workerThreads;
59
- const cjsRequire = typeof require === "undefined" ? module$1.createRequire(import_meta.url) : require;
60
- try {
61
- workerThreads = cjsRequire("worker_threads");
62
- if (typeof workerThreads.receiveMessageOnPort !== "function") {
63
- workerThreads = void 0;
64
- }
65
- } catch (e) {
66
- }
67
- if (!workerThreads) {
68
- console.warn("[synckit]: `worker_threads` or `receiveMessageOnPort` is not available in current environment, `Node >= 12` is required");
69
- }
32
+ var _a;
70
33
  const {
71
- SYNCKIT_WORKER_THREADS,
72
34
  SYNCKIT_BUFFER_SIZE,
73
35
  SYNCKIT_TIMEOUT,
74
- SYNCKIT_TS_ESM
36
+ SYNCKIT_TS_ESM,
37
+ SYNCKIT_EXEC_ARV
75
38
  } = process.env;
76
- const useWorkerThreads = !!workerThreads && (!SYNCKIT_WORKER_THREADS || !["0", "false"].includes(SYNCKIT_WORKER_THREADS));
77
39
  const TS_USE_ESM = !!SYNCKIT_TS_ESM && ["1", "true"].includes(SYNCKIT_TS_ESM);
78
40
  const DEFAULT_BUFFER_SIZE = SYNCKIT_BUFFER_SIZE ? +SYNCKIT_BUFFER_SIZE : void 0;
79
41
  const DEFAULT_TIMEOUT = SYNCKIT_TIMEOUT ? +SYNCKIT_TIMEOUT : void 0;
80
42
  const DEFAULT_WORKER_BUFFER_SIZE = DEFAULT_BUFFER_SIZE || 1024;
81
- const syncFnCache = new Map();
82
- function createSyncFn(workerPath, bufferSize, timeout = DEFAULT_TIMEOUT) {
83
- if (!path__default['default'].isAbsolute(workerPath)) {
43
+ const DEFAULT_EXEC_ARGV = (_a = SYNCKIT_EXEC_ARV == null ? void 0 : SYNCKIT_EXEC_ARV.split(",")) != null ? _a : [];
44
+ const syncFnCache = /* @__PURE__ */ new Map();
45
+ const extractProperties = (object) => {
46
+ const properties = {};
47
+ if (object && typeof object === "object") {
48
+ for (const key in object) {
49
+ properties[key] = object[key];
50
+ }
51
+ }
52
+ return properties;
53
+ };
54
+ const applyProperties = (object, properties) => {
55
+ if (!properties) {
56
+ return object;
57
+ }
58
+ for (const key in properties) {
59
+ object[key] = properties[key];
60
+ }
61
+ return object;
62
+ };
63
+ function createSyncFn(workerPath, bufferSizeOrOptions, timeout) {
64
+ if (!path__default["default"].isAbsolute(workerPath)) {
84
65
  throw new Error("`workerPath` must be absolute");
85
66
  }
86
67
  const cachedSyncFn = syncFnCache.get(workerPath);
87
68
  if (cachedSyncFn) {
88
69
  return cachedSyncFn;
89
70
  }
90
- const syncFn = (useWorkerThreads ? startWorkerThread : startChildProcess)(workerPath, bufferSize, timeout);
71
+ const syncFn = startWorkerThread(workerPath, typeof bufferSizeOrOptions === "number" ? { bufferSize: bufferSizeOrOptions, timeout } : bufferSizeOrOptions);
91
72
  syncFnCache.set(workerPath, syncFn);
92
73
  return syncFn;
93
74
  }
94
- function startChildProcess(workerPath, bufferSize = DEFAULT_BUFFER_SIZE, timeout) {
95
- const executor = workerPath.endsWith(".ts") ? TS_USE_ESM ? "node --loader ts-node/esm" : "ts-node" : "node";
96
- return (...args) => {
97
- const filename = path__default['default'].resolve(tmpdir, `synckit-${uuid.v4()}.json`);
98
- fs__default['default'].writeFileSync(filename, JSON.stringify(args));
99
- const command = `${executor} ${workerPath} ${filename}`;
100
- try {
101
- child_process.execSync(command, {
102
- stdio: "inherit",
103
- maxBuffer: bufferSize,
104
- timeout
105
- });
106
- const { result, error } = JSON.parse(fs__default['default'].readFileSync(filename, "utf8"));
107
- if (error) {
108
- throw typeof error === "object" && "message" in error ? Object.assign(new Error(), error) : error;
109
- }
110
- return result;
111
- } finally {
112
- fs__default['default'].unlinkSync(filename);
113
- }
114
- };
115
- }
116
75
  const throwError = (msg) => {
117
76
  throw new Error(msg);
118
77
  };
119
- function startWorkerThread(workerPath, bufferSize = DEFAULT_WORKER_BUFFER_SIZE, timeout) {
120
- const { MessageChannel, Worker } = workerThreads;
121
- const { port1: mainPort, port2: workerPort } = new MessageChannel();
78
+ function startWorkerThread(workerPath, {
79
+ bufferSize = DEFAULT_WORKER_BUFFER_SIZE,
80
+ timeout = DEFAULT_TIMEOUT,
81
+ execArgv = DEFAULT_EXEC_ARGV
82
+ } = {}) {
83
+ const { port1: mainPort, port2: workerPort } = new worker_threads.MessageChannel();
122
84
  const isTs = workerPath.endsWith(".ts");
123
- const worker = new Worker(isTs ? TS_USE_ESM ? throwError("Native esm in `.ts` file is not supported yet, please use `.cjs` instead") : `require('ts-node/register');require('${workerPath}')` : workerPath, {
85
+ const worker = new worker_threads.Worker(isTs ? TS_USE_ESM ? throwError("Native esm in `.ts` file is not supported yet, please use `.cjs` instead") : `require('ts-node/register');require('${workerPath}')` : workerPath, {
124
86
  eval: isTs,
125
87
  workerData: { workerPort },
126
88
  transferList: [workerPort],
127
- execArgv: []
89
+ execArgv
128
90
  });
129
91
  let nextID = 0;
130
92
  const syncFn = (...args) => {
@@ -140,13 +102,14 @@ function startWorkerThread(workerPath, bufferSize = DEFAULT_WORKER_BUFFER_SIZE,
140
102
  const {
141
103
  id: id2,
142
104
  result,
143
- error
144
- } = workerThreads.receiveMessageOnPort(mainPort).message;
105
+ error,
106
+ properties
107
+ } = worker_threads.receiveMessageOnPort(mainPort).message;
145
108
  if (id !== id2) {
146
109
  throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
147
110
  }
148
111
  if (error) {
149
- throw error;
112
+ throw applyProperties(error, properties);
150
113
  }
151
114
  return result;
152
115
  };
@@ -154,47 +117,33 @@ function startWorkerThread(workerPath, bufferSize = DEFAULT_WORKER_BUFFER_SIZE,
154
117
  return syncFn;
155
118
  }
156
119
  function runAsWorker(fn) {
157
- return __async(this, null, function* () {
158
- if (!(workerThreads == null ? void 0 : workerThreads.workerData)) {
159
- const filename = process.argv[2];
160
- const content = fs__default['default'].readFileSync(filename, "utf8");
161
- const args = JSON.parse(content);
120
+ if (!worker_threads.workerData) {
121
+ return;
122
+ }
123
+ const { workerPort } = worker_threads.workerData;
124
+ worker_threads.parentPort.on("message", ({ sharedBuffer, id, args }) => {
125
+ (() => __async(this, null, function* () {
126
+ const sharedBufferView = new Int32Array(sharedBuffer);
162
127
  let msg;
163
128
  try {
164
- msg = { result: yield fn(...args) };
165
- } catch (err) {
129
+ msg = { id, result: yield fn(...args) };
130
+ } catch (error) {
166
131
  msg = {
167
- error: err instanceof Error ? __spreadProps(__spreadValues({}, err), { name: err.name, message: err.message, stack: err.stack }) : err
132
+ id,
133
+ error,
134
+ properties: extractProperties(error)
168
135
  };
169
136
  }
170
- fs__default['default'].writeFileSync(filename, JSON.stringify(msg));
171
- return;
172
- }
173
- const { workerPort } = workerThreads.workerData;
174
- workerThreads.parentPort.on("message", ({ sharedBuffer, id, args }) => {
175
- (() => __async(this, null, function* () {
176
- const sharedBufferView = new Int32Array(sharedBuffer);
177
- let msg;
178
- try {
179
- msg = { id, result: yield fn(...args) };
180
- } catch (error) {
181
- msg = {
182
- id,
183
- error
184
- };
185
- }
186
- workerPort.postMessage(msg);
187
- Atomics.add(sharedBufferView, 0, 1);
188
- Atomics.notify(sharedBufferView, 0);
189
- }))();
190
- });
137
+ workerPort.postMessage(msg);
138
+ Atomics.add(sharedBufferView, 0, 1);
139
+ Atomics.notify(sharedBufferView, 0);
140
+ }))();
191
141
  });
192
142
  }
193
143
 
194
144
  exports.DEFAULT_BUFFER_SIZE = DEFAULT_BUFFER_SIZE;
145
+ exports.DEFAULT_EXEC_ARGV = DEFAULT_EXEC_ARGV;
195
146
  exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
196
147
  exports.DEFAULT_WORKER_BUFFER_SIZE = DEFAULT_WORKER_BUFFER_SIZE;
197
148
  exports.createSyncFn = createSyncFn;
198
149
  exports.runAsWorker = runAsWorker;
199
- exports.tmpdir = tmpdir;
200
- exports.useWorkerThreads = useWorkerThreads;
package/lib/index.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  import { AnyAsyncFn, Syncify } from './types.js';
2
2
  export * from './types.js';
3
- /**
4
- * @link https://github.com/sindresorhus/temp-dir/blob/main/index.js#L9
5
- */
6
- export declare const tmpdir: string;
7
- export declare const useWorkerThreads: boolean;
8
3
  export declare const DEFAULT_BUFFER_SIZE: number | undefined;
9
4
  export declare const DEFAULT_TIMEOUT: number | undefined;
10
5
  export declare const DEFAULT_WORKER_BUFFER_SIZE: number;
6
+ export declare const DEFAULT_EXEC_ARGV: string[];
7
+ export interface SynckitOptions {
8
+ bufferSize?: number;
9
+ timeout?: number;
10
+ execArgv?: string[];
11
+ }
11
12
  export declare function createSyncFn<T extends AnyAsyncFn>(workerPath: string, bufferSize?: number, timeout?: number): Syncify<T>;
12
- export declare function runAsWorker<T extends AnyAsyncFn>(fn: T): Promise<void>;
13
+ export declare function createSyncFn<T extends AnyAsyncFn>(workerPath: string, options?: SynckitOptions): Syncify<T>;
14
+ export declare function runAsWorker<R = unknown, T extends AnyAsyncFn<R> = AnyAsyncFn<R>>(fn: T): void;
package/lib/index.js CHANGED
@@ -1,42 +1,44 @@
1
+ var _a;
1
2
  import { __awaiter } from "tslib";
2
- import { execSync } from 'child_process';
3
- import { tmpdir as _tmpdir } from 'os';
4
3
  import path from 'path';
5
- import fs from 'fs';
6
- import { createRequire } from 'module';
7
- import { v4 as uuid } from 'uuid';
4
+ import { MessageChannel, Worker, receiveMessageOnPort, workerData, parentPort, } from 'worker_threads';
8
5
  export * from './types.js';
9
- /**
10
- * @link https://github.com/sindresorhus/temp-dir/blob/main/index.js#L9
11
- */
12
- export const tmpdir = fs.realpathSync(_tmpdir());
13
- let workerThreads;
14
- const cjsRequire =
15
- /* istanbul ignore next */
16
- typeof require === 'undefined' ? createRequire(import.meta.url) : require;
17
- try {
18
- workerThreads = cjsRequire('worker_threads');
19
- /* istanbul ignore if */
20
- if (typeof workerThreads.receiveMessageOnPort !== 'function') {
21
- workerThreads = undefined;
22
- }
23
- }
24
- catch (_a) { }
25
- /* istanbul ignore if */
26
- if (!workerThreads) {
27
- console.warn('[synckit]: `worker_threads` or `receiveMessageOnPort` is not available in current environment, `Node >= 12` is required');
28
- }
29
- const { SYNCKIT_WORKER_THREADS, SYNCKIT_BUFFER_SIZE, SYNCKIT_TIMEOUT, SYNCKIT_TS_ESM, } = process.env;
30
- export const useWorkerThreads = !!workerThreads &&
31
- (!SYNCKIT_WORKER_THREADS || !['0', 'false'].includes(SYNCKIT_WORKER_THREADS));
6
+ const { SYNCKIT_BUFFER_SIZE, SYNCKIT_TIMEOUT, SYNCKIT_TS_ESM, SYNCKIT_EXEC_ARV, } = process.env;
32
7
  const TS_USE_ESM = !!SYNCKIT_TS_ESM && ['1', 'true'].includes(SYNCKIT_TS_ESM);
33
8
  export const DEFAULT_BUFFER_SIZE = SYNCKIT_BUFFER_SIZE
34
9
  ? +SYNCKIT_BUFFER_SIZE
35
10
  : undefined;
36
11
  export const DEFAULT_TIMEOUT = SYNCKIT_TIMEOUT ? +SYNCKIT_TIMEOUT : undefined;
37
12
  export const DEFAULT_WORKER_BUFFER_SIZE = DEFAULT_BUFFER_SIZE || 1024;
13
+ export const DEFAULT_EXEC_ARGV = (_a = SYNCKIT_EXEC_ARV === null || SYNCKIT_EXEC_ARV === void 0 ? void 0 : SYNCKIT_EXEC_ARV.split(',')) !== null && _a !== void 0 ? _a : [];
38
14
  const syncFnCache = new Map();
39
- export function createSyncFn(workerPath, bufferSize, timeout = DEFAULT_TIMEOUT) {
15
+ // MessagePort doesn't copy the properties of Error objects. We still want
16
+ // error objects to have extra properties such as "warnings" so implement the
17
+ // property copying manually.
18
+ const extractProperties = (object) => {
19
+ const properties = {};
20
+ if (object && typeof object === 'object') {
21
+ for (const key in object) {
22
+ properties[key] = object[key];
23
+ }
24
+ }
25
+ return properties;
26
+ };
27
+ // MessagePort doesn't copy the properties of Error objects. We still want
28
+ // error objects to have extra properties such as "warnings" so implement the
29
+ // property copying manually.
30
+ const applyProperties = (object, properties) => {
31
+ if (!properties) {
32
+ return object;
33
+ }
34
+ // eslint-disable-next-line sonar/for-in
35
+ for (const key in properties) {
36
+ ;
37
+ object[key] = properties[key];
38
+ }
39
+ return object;
40
+ };
41
+ export function createSyncFn(workerPath, bufferSizeOrOptions, timeout) {
40
42
  if (!path.isAbsolute(workerPath)) {
41
43
  throw new Error('`workerPath` must be absolute');
42
44
  }
@@ -44,45 +46,16 @@ export function createSyncFn(workerPath, bufferSize, timeout = DEFAULT_TIMEOUT)
44
46
  if (cachedSyncFn) {
45
47
  return cachedSyncFn;
46
48
  }
47
- const syncFn = (useWorkerThreads ? startWorkerThread : startChildProcess)(workerPath, bufferSize, timeout);
49
+ const syncFn = startWorkerThread(workerPath, typeof bufferSizeOrOptions === 'number'
50
+ ? { bufferSize: bufferSizeOrOptions, timeout }
51
+ : bufferSizeOrOptions);
48
52
  syncFnCache.set(workerPath, syncFn);
49
53
  return syncFn;
50
54
  }
51
- function startChildProcess(workerPath, bufferSize = DEFAULT_BUFFER_SIZE, timeout) {
52
- const executor = workerPath.endsWith('.ts')
53
- ? TS_USE_ESM
54
- ? 'node --loader ts-node/esm'
55
- : 'ts-node'
56
- : 'node';
57
- return (...args) => {
58
- const filename = path.resolve(tmpdir, `synckit-${uuid()}.json`);
59
- fs.writeFileSync(filename, JSON.stringify(args));
60
- const command = `${executor} ${workerPath} ${filename}`;
61
- try {
62
- execSync(command, {
63
- stdio: 'inherit',
64
- maxBuffer: bufferSize,
65
- timeout,
66
- });
67
- const { result, error } = JSON.parse(fs.readFileSync(filename, 'utf8'));
68
- if (error) {
69
- throw typeof error === 'object' && 'message' in error
70
- ? // eslint-disable-next-line unicorn/error-message
71
- Object.assign(new Error(), error)
72
- : error;
73
- }
74
- return result;
75
- }
76
- finally {
77
- fs.unlinkSync(filename);
78
- }
79
- };
80
- }
81
55
  const throwError = (msg) => {
82
56
  throw new Error(msg);
83
57
  };
84
- function startWorkerThread(workerPath, bufferSize = DEFAULT_WORKER_BUFFER_SIZE, timeout) {
85
- const { MessageChannel, Worker } = workerThreads;
58
+ function startWorkerThread(workerPath, { bufferSize = DEFAULT_WORKER_BUFFER_SIZE, timeout = DEFAULT_TIMEOUT, execArgv = DEFAULT_EXEC_ARGV, } = {}) {
86
59
  const { port1: mainPort, port2: workerPort } = new MessageChannel();
87
60
  const isTs = workerPath.endsWith('.ts');
88
61
  const worker = new Worker(isTs
@@ -93,7 +66,7 @@ function startWorkerThread(workerPath, bufferSize = DEFAULT_WORKER_BUFFER_SIZE,
93
66
  eval: isTs,
94
67
  workerData: { workerPort },
95
68
  transferList: [workerPort],
96
- execArgv: [],
69
+ execArgv,
97
70
  });
98
71
  let nextID = 0;
99
72
  const syncFn = (...args) => {
@@ -107,62 +80,45 @@ function startWorkerThread(workerPath, bufferSize = DEFAULT_WORKER_BUFFER_SIZE,
107
80
  if (!['ok', 'not-equal'].includes(status)) {
108
81
  throw new Error('Internal error: Atomics.wait() failed: ' + status);
109
82
  }
110
- const { id: id2, result, error, } = workerThreads.receiveMessageOnPort(mainPort)
111
- .message;
83
+ const { id: id2, result, error, properties, } = receiveMessageOnPort(mainPort).message;
112
84
  /* istanbul ignore if */
113
85
  if (id !== id2) {
114
86
  throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
115
87
  }
116
88
  if (error) {
117
- throw error;
89
+ throw applyProperties(error, properties);
118
90
  }
119
91
  return result;
120
92
  };
121
93
  worker.unref();
122
94
  return syncFn;
123
95
  }
96
+ /* istanbul ignore next */
124
97
  export function runAsWorker(fn) {
125
- return __awaiter(this, void 0, void 0, function* () {
126
- if (!(workerThreads === null || workerThreads === void 0 ? void 0 : workerThreads.workerData)) {
127
- const filename = process.argv[2];
128
- const content = fs.readFileSync(filename, 'utf8');
129
- const args = JSON.parse(content);
98
+ if (!workerData) {
99
+ return;
100
+ }
101
+ const { workerPort } = workerData;
102
+ parentPort.on('message', ({ sharedBuffer, id, args }) => {
103
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
104
+ ;
105
+ (() => __awaiter(this, void 0, void 0, function* () {
106
+ const sharedBufferView = new Int32Array(sharedBuffer);
130
107
  let msg;
131
108
  try {
132
- msg = { result: yield fn(...args) };
109
+ msg = { id, result: yield fn(...args) };
133
110
  }
134
- catch (err) {
111
+ catch (error) {
135
112
  msg = {
136
- error: err instanceof Error
137
- ? Object.assign(Object.assign({}, err), { name: err.name, message: err.message, stack: err.stack }) : err,
113
+ id,
114
+ error,
115
+ properties: extractProperties(error),
138
116
  };
139
117
  }
140
- fs.writeFileSync(filename, JSON.stringify(msg));
141
- return;
142
- }
143
- /* istanbul ignore next */
144
- const { workerPort } = workerThreads.workerData;
145
- /* istanbul ignore next */
146
- workerThreads.parentPort.on('message', ({ sharedBuffer, id, args }) => {
147
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
148
- ;
149
- (() => __awaiter(this, void 0, void 0, function* () {
150
- const sharedBufferView = new Int32Array(sharedBuffer);
151
- let msg;
152
- try {
153
- msg = { id, result: yield fn(...args) };
154
- }
155
- catch (error) {
156
- msg = {
157
- id,
158
- error,
159
- };
160
- }
161
- workerPort.postMessage(msg);
162
- Atomics.add(sharedBufferView, 0, 1);
163
- Atomics.notify(sharedBufferView, 0);
164
- }))();
165
- });
118
+ workerPort.postMessage(msg);
119
+ Atomics.add(sharedBufferView, 0, 1);
120
+ Atomics.notify(sharedBufferView, 0);
121
+ }))();
166
122
  });
167
123
  }
168
124
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,IAAI,CAAA;AACtC,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,aAAa,EAA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,GAAG,GAAG;oBACJ,EAAE;oBACF,KAAK;oBACL,UAAU,EAAE,iBAAiB,CAAC,KAAK,CAAC;iBACrC,CAAA;aACF;YACD,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YAC3B,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;YACnC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAA;QACrC,CAAC,CAAA,CAAC,EAAE,CAAA;IACN,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.esnext.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/tslib/tslib.d.ts","../src/types.ts","../src/index.ts","../node_modules/@types/estree/index.d.ts","../node_modules/@types/acorn/index.d.ts","../node_modules/@babel/types/lib/index.d.ts","../node_modules/@types/babel__generator/index.d.ts","../node_modules/@babel/parser/typings/babel-parser.d.ts","../node_modules/@types/babel__template/index.d.ts","../node_modules/@types/babel__traverse/index.d.ts","../node_modules/@types/babel__core/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/concat-stream/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/estree-jsx/index.d.ts","../node_modules/@types/fs-extra/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/glob/index.d.ts","../node_modules/@types/graceful-fs/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/hast/index.d.ts","../node_modules/ci-info/index.d.ts","../node_modules/@types/is-ci/index.d.ts","../node_modules/@types/is-empty/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/istanbul-lib-report/index.d.ts","../node_modules/@types/istanbul-reports/index.d.ts","../node_modules/chalk/index.d.ts","../node_modules/jest-diff/build/cleanupSemantic.d.ts","../node_modules/pretty-format/build/types.d.ts","../node_modules/pretty-format/build/index.d.ts","../node_modules/jest-diff/build/types.d.ts","../node_modules/jest-diff/build/diffLines.d.ts","../node_modules/jest-diff/build/printDiffs.d.ts","../node_modules/jest-diff/build/index.d.ts","../node_modules/jest-matcher-utils/build/index.d.ts","../node_modules/@types/jest/index.d.ts","../node_modules/@types/js-yaml/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/prettier/index.d.ts","../node_modules/@types/resolve/index.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/stack-utils/index.d.ts","../node_modules/@types/supports-color/index.d.ts","../node_modules/@types/uuid/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"3ac1b83264055b28c0165688fda6dfcc39001e9e7828f649299101c23ad0a0c3","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","2f93dda35dafec68ec217c9ce67f0f4fbbbb030c055ac312641565ad60dd7e26","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"5075b36ab861c8c0c45377cb8c96270d7c65f0eeaf105d53fac6850da61f1027","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"e8c9f4e445a489991ca1a4232667de3ac36b07ba75ea335971fbeacf2d26fe67","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"6ea9ab679ea030cf46c16a711a316078e9e02619ebaf07a7fcd16964aba88f2d","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"12f4cfe2fe60b810c3174537bc2ddb20c1067b7768643d12cb1266fd183afb75","4c077e030a1ce2d6e84ca6e4847e7c8c12f5440b98241e437c6a9ecf11738e57","e6087c7f3f7dd3eb44c4a89cf8e550604699450642235a8afff28fe8a3286c57","7d7c8ef7d48a035142c07dae60545ecc0e4af4c337742760cb09726f2f8e31db","3777eb752cef9aa8dd35bb997145413310008aa54ec44766de81a7ad891526cd","2ff9995137f3e5d68971388ec58af0c79721626323884513f9f5e2e996ac1fdd","cc957354aa3c94c9961ebf46282cfde1e81d107fc5785a61f62c67f1dd3ac2eb","1a7cc144992d79b062c22ac0309c6624dbb0d49bbddff7ea3b9daa0c17bcac0a","93de1c6dab503f053efe8d304cb522bb3a89feab8c98f307a674a4fae04773e9","3b043cf9a81854a72963fdb57d1884fc4da1cf5be69b5e0a4c5b751e58cb6d88","5426e62886b7be7806312d31a00e8f7dccd6fe63ba9bbefe99ee2eab29cc48a3","0cba3a5d7b81356222594442753cf90dd2892e5ccfe1d262aaca6896ba6c1380","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"c2ab70bbc7a24c42a790890739dd8a0ba9d2e15038b40dff8163a97a5d148c00","affectsGlobalScope":true},"422dbb183fdced59425ca072c8bd09efaa77ce4e2ab928ec0d8a1ce062d2a45a",{"version":"712ba0d43b44d144dfd01593f61af6e2e21cfae83e834d297643e7973e55ed61","affectsGlobalScope":true},"1dab5ab6bcf11de47ab9db295df8c4f1d92ffa750e8f095e88c71ce4c3299628","f71f46ccd5a90566f0a37b25b23bc4684381ab2180bdf6733f4e6624474e1894",{"version":"54e65985a3ee3cec182e6a555e20974ea936fc8b8d1738c14e8ed8a42bd921d4","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","98a3ebfa494b46265634a73459050befba5da8fdc6ca0ef9b7269421780f4ff3","34e5de87d983bc6aefef8b17658556e3157003e8d9555d3cb098c6bef0b5fbc8","cc0b61316c4f37393f1f9595e93b673f4184e9d07f4c127165a490ec4a928668","f27371653aded82b2b160f7a7033fb4a5b1534b6f6081ef7be1468f0f15327d3","c762cd6754b13a461c54b59d0ae0ab7aeef3c292c6cf889873f786ee4d8e75c9","f4ea7d5df644785bd9fbf419930cbaec118f0d8b4160037d2339b8e23c059e79",{"version":"bfea28e6162ed21a0aeed181b623dcf250aa79abf49e24a6b7e012655af36d81","affectsGlobalScope":true},"b8aca9d0c81abb02bec9b7621983ae65bde71da6727580070602bd2500a9ce2a","ae97e20f2e10dbeec193d6a2f9cd9a367a1e293e7d6b33b68bacea166afd7792","10d4796a130577d57003a77b95d8723530bbec84718e364aa2129fa8ffba0378","ad41bb744149e92adb06eb953da195115620a3f2ad48e7d3ae04d10762dae197","bf73c576885408d4a176f44a9035d798827cc5020d58284cb18d7573430d9022","7ae078ca42a670445ae0c6a97c029cb83d143d62abd1730efb33f68f0b2c0e82",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"5d0a9ea09d990b5788f867f1c79d4878f86f7384cb7dab38eecbf22f9efd063d","12eea70b5e11e924bb0543aea5eadc16ced318aa26001b453b0d561c2fd0bd1e","08777cd9318d294646b121838574e1dd7acbb22c21a03df84e1f2c87b1ad47f2","08a90bcdc717df3d50a2ce178d966a8c353fd23e5c392fd3594a6e39d9bb6304",{"version":"4cd4cff679c9b3d9239fd7bf70293ca4594583767526916af8e5d5a47d0219c7","affectsGlobalScope":true},"2a12d2da5ac4c4979401a3f6eaafa874747a37c365e4bc18aa2b171ae134d21b","002b837927b53f3714308ecd96f72ee8a053b8aeb28213d8ec6de23ed1608b66","1dc9c847473bb47279e398b22c740c83ea37a5c88bf66629666e3cf4c5b9f99c","a9e4a5a24bf2c44de4c98274975a1a705a0abbaad04df3557c2d3cd8b1727949","00fa7ce8bc8acc560dc341bbfdf37840a8c59e6a67c9bfa3fa5f36254df35db2","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","5f0ed51db151c2cdc4fa3bb0f44ce6066912ad001b607a34e65a96c52eb76248",{"version":"3345c276cab0e76dda86c0fb79104ff915a4580ba0f3e440870e183b1baec476","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","103d70bfbeb3cd3a3f26d1705bf986322d8738c2c143f38ebb743b1e228d7444","f52fbf64c7e480271a9096763c4882d356b05cab05bf56a64e68a95313cd2ce2","59bdb65f28d7ce52ccfc906e9aaf422f8b8534b2d21c32a27d7819be5ad81df7",{"version":"3a2da34079a2567161c1359316a32e712404b56566c45332ac9dcee015ecce9f","affectsGlobalScope":true},"28a2e7383fd898c386ffdcacedf0ec0845e5d1a86b5a43f25b86bc315f556b79","3aff9c8c36192e46a84afe7b926136d520487155154ab9ba982a8b544ea8fc95","a880cf8d85af2e4189c709b0fea613741649c0e40fffb4360ec70762563d5de0","85bbf436a15bbeda4db888be3062d47f99c66fd05d7c50f0f6473a9151b6a070","9f9c49c95ecd25e0cb2587751925976cf64fd184714cb11e213749c80cf0f927","f0c75c08a71f9212c93a719a25fb0320d53f2e50ca89a812640e08f8ad8c408c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"9cafe917bf667f1027b2bb62e2de454ecd2119c80873ad76fc41d941089753b8","310a0cc92822ada13db096f9970a576de760b2f82a3782a24af62cb5a07e0aff","6a9c5127096b35264eb7cd21b2417bfc1d42cceca9ba4ce2bb0c3410b7816042","78828b06c0d3b586954015e9ebde5480b009e166c71244763bda328ec0920f41","f54243828d27a24d59ebf25740dfe6e7dff3931723f8ce7b658cdbe766f89da9","6de408de17cb0e3fa3a5e3d0f79bd104848d98dbfa72e92fddfa1a4aa3d8393c","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fd326577c62145816fe1acc306c734c2396487f76719d3785d4e825b34540b33","3ebae8c00411116a66fca65b08228ea0cf0b72724701f9b854442100aab55aba","cddf5c26907c0b8378bc05543161c11637b830da9fadf59e02a11e675d11e180","3d2cd8f3047fff04a71e7037a6a4cb9f4accb28dbd8c0d83164d414811025af0","913754f9281683f22d98d0ba7796896cee30c302baefa3dda69f61af8de244d8","a3e5b8b86e7bd38d9afdc294875c4445c535319e288d3a13c1e2e41f9af934f2","d45d40831ccbd547e3f4ae8f326420b9e454dd27fa970f417c8e94a23e93db29","8b06ac3faeacb8484d84ddb44571d8f410697f98d7bfa86c0fda60373a9f5215","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190","7f82ef88bdb67d9a850dd1c7cd2d690f33e0f0acd208e3c9eba086f3670d4f73",{"version":"3fe15a491a792852283caeece8142bc7427a29c183d9fec8691d95a49c8932a1","affectsGlobalScope":true},"686e548ae30250d62532c8cacb43fccc922b693408371bd3503563c4a0f28eed","f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","2a2e2c6463bcf3c59f31bc9ab4b6ef963bbf7dffb049cd017e2c1834e3adca63","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","6209c901f30cc321f4b86800d11fad3d67e73a3308f19946b1bc642af0280298","8a19491eba2108d5c333c249699f40aff05ad312c04a17504573b27d91f0aede","87352bb579421f6938177a53bb66e8514067b4872ccaa5fe08ddbca56364570c","b0d10e46cfe3f6c476b69af02eaa38e4ccc7430221ce3109ae84bb9fb8282298","105fa3d1b286795f9ac1b82f5a737db303dfe65ebc9830c1938a2bbe538a861f","fab58e600970e66547644a44bc9918e3223aa2cbd9e8763cec004b2cfb48827e","70e9a18da08294f75bf23e46c7d69e67634c0765d355887b9b41f0d959e1426e","6ba73232c9d3267ca36ddb83e335d474d2c0e167481e3dec416c782894e11438"],"options":{"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"jsx":1,"module":99,"noImplicitOverride":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":2},"fileIdsList":[[55,104],[104],[53,104],[55,56,57,58,59,104],[55,57,104],[93,104,111],[104,113],[77,104,111],[76,77,104,111,117],[104,120],[104,122],[104,125],[104,126],[104,131,136],[61,104],[64,104],[65,70,104],[66,76,77,84,93,103,104],[66,67,76,84,104],[68,104],[69,70,77,85,104],[70,93,100,104],[71,73,76,84,104],[72,104],[73,74,104],[75,76,104],[76,104],[76,77,78,93,103,104],[76,77,78,93,104],[79,84,93,103,104],[76,77,79,80,84,93,100,103,104],[79,81,93,100,103,104],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110],[76,82,104],[83,103,104],[73,76,84,93,104],[85,104],[86,104],[64,87,104],[88,102,104,108],[89,104],[90,104],[76,91,104],[91,92,104,106],[76,93,94,95,104],[93,95,104],[93,94,104],[96,104],[97,104],[76,98,99,104],[98,99,104],[70,84,93,100,104],[101,104],[84,102,104],[65,79,90,103,104],[70,104],[93,104,105],[104,106],[104,107],[65,70,76,78,87,93,103,104,106,108],[93,104,109],[104,111],[104,151],[104,129,132],[104,129,132,133,134],[104,131],[104,128,135],[104,130],[50,51,86,104,108],[50,104,108]],"referencedMap":[[57,1],[55,2],[54,3],[60,4],[56,1],[58,5],[59,1],[112,6],[114,7],[115,3],[53,2],[116,8],[118,9],[119,8],[121,10],[123,11],[124,2],[125,2],[126,12],[127,13],[137,14],[138,2],[139,2],[140,2],[141,10],[117,2],[142,2],[113,2],[61,15],[62,15],[64,16],[65,17],[66,18],[67,19],[68,20],[69,21],[70,22],[71,23],[72,24],[73,25],[74,25],[75,26],[76,27],[77,28],[78,29],[63,2],[110,2],[79,30],[80,31],[81,32],[111,33],[82,34],[83,35],[84,36],[85,37],[86,38],[87,39],[88,40],[89,41],[90,42],[91,43],[92,44],[93,45],[95,46],[94,47],[96,48],[97,49],[98,50],[99,51],[100,52],[101,53],[102,54],[103,55],[104,56],[105,57],[106,58],[107,59],[108,60],[109,61],[143,2],[144,2],[145,2],[146,62],[147,2],[148,2],[149,2],[120,2],[150,2],[151,2],[152,63],[128,2],[122,2],[129,2],[133,64],[135,65],[134,64],[132,66],[136,67],[131,68],[130,2],[50,2],[12,2],[11,2],[2,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[3,2],[4,2],[24,2],[21,2],[22,2],[23,2],[25,2],[26,2],[27,2],[5,2],[28,2],[29,2],[30,2],[31,2],[6,2],[32,2],[33,2],[34,2],[35,2],[7,2],[40,2],[36,2],[37,2],[38,2],[39,2],[8,2],[44,2],[41,2],[42,2],[43,2],[45,2],[9,2],[46,2],[47,2],[48,2],[1,2],[10,2],[49,2],[52,69],[51,70]],"exportedModulesMap":[[57,1],[55,2],[54,3],[60,4],[56,1],[58,5],[59,1],[112,6],[114,7],[115,3],[53,2],[116,8],[118,9],[119,8],[121,10],[123,11],[124,2],[125,2],[126,12],[127,13],[137,14],[138,2],[139,2],[140,2],[141,10],[117,2],[142,2],[113,2],[61,15],[62,15],[64,16],[65,17],[66,18],[67,19],[68,20],[69,21],[70,22],[71,23],[72,24],[73,25],[74,25],[75,26],[76,27],[77,28],[78,29],[63,2],[110,2],[79,30],[80,31],[81,32],[111,33],[82,34],[83,35],[84,36],[85,37],[86,38],[87,39],[88,40],[89,41],[90,42],[91,43],[92,44],[93,45],[95,46],[94,47],[96,48],[97,49],[98,50],[99,51],[100,52],[101,53],[102,54],[103,55],[104,56],[105,57],[106,58],[107,59],[108,60],[109,61],[143,2],[144,2],[145,2],[146,62],[147,2],[148,2],[149,2],[120,2],[150,2],[151,2],[152,63],[128,2],[122,2],[129,2],[133,64],[135,65],[134,64],[132,66],[136,67],[131,68],[130,2],[50,2],[12,2],[11,2],[2,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[3,2],[4,2],[24,2],[21,2],[22,2],[23,2],[25,2],[26,2],[27,2],[5,2],[28,2],[29,2],[30,2],[31,2],[6,2],[32,2],[33,2],[34,2],[35,2],[7,2],[40,2],[36,2],[37,2],[38,2],[39,2],[8,2],[44,2],[41,2],[42,2],[43,2],[45,2],[9,2],[46,2],[47,2],[48,2],[1,2],[10,2],[49,2],[52,69],[51,70]],"semanticDiagnosticsPerFile":[57,55,54,60,56,58,59,112,114,115,53,116,118,119,121,123,124,125,126,127,137,138,139,140,141,117,142,113,61,62,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,63,110,79,80,81,111,82,83,84,85,86,87,88,89,90,91,92,93,95,94,96,97,98,99,100,101,102,103,104,105,106,107,108,109,143,144,145,146,147,148,149,120,150,151,152,128,122,129,133,135,134,132,136,131,130,50,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,44,41,42,43,45,9,46,47,48,1,10,49,52,51]},"version":"4.6.3"}
package/lib/types.d.ts CHANGED
@@ -16,6 +16,7 @@ export interface WorkerData {
16
16
  export interface DataMessage<T> {
17
17
  result?: T;
18
18
  error?: unknown;
19
+ properties?: Record<string, unknown>;
19
20
  }
20
21
  export interface WorkerToMainMessage<T = unknown> extends DataMessage<T> {
21
22
  id: number;
package/package.json CHANGED
@@ -1,27 +1,29 @@
1
1
  {
2
2
  "name": "synckit",
3
- "version": "0.4.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "description": "Perform async work synchronously in Node.js using `worker_threads`, or `child_process` as fallback, with first-class TypeScript support.",
6
6
  "repository": "git+https://github.com/rx-ts/synckit.git",
7
7
  "author": "JounQin <admin@1stg.me>",
8
8
  "license": "MIT",
9
9
  "engines": {
10
- "node": ">=12"
10
+ "node": ">=12.20"
11
11
  },
12
12
  "main": "./lib/index.cjs",
13
13
  "module": "./lib/index.js",
14
14
  "exports": {
15
15
  "import": "./lib/index.js",
16
- "require": "./lib/index.cjs"
16
+ "require": "./lib/index.cjs",
17
+ "types": "./lib/index.d.ts"
17
18
  },
18
- "types": "lib",
19
+ "types": "./lib/index.d.ts",
19
20
  "files": [
20
21
  "lib",
21
22
  "!*.tsbuildinfo"
22
23
  ],
23
24
  "keywords": [
24
25
  "deasync",
26
+ "make-synchronous",
25
27
  "sync",
26
28
  "sync-exec",
27
29
  "sync-rpc",
@@ -29,90 +31,7 @@
29
31
  "synchronize",
30
32
  "synckit"
31
33
  ],
32
- "scripts": {
33
- "benchmark": "run-s benchmark:*",
34
- "benchmark-export": "run-s benchmark-export:*",
35
- "benchmark-export:cjs": "yarn benchmark:cjs > benchmarks/benchmark.cjs.txt",
36
- "benchmark-export:esm": "yarn benchmark:esm> benchmarks/benchmark.esm.txt",
37
- "benchmark:cjs": "node benchmarks/benchmark.cjs",
38
- "benchmark:esm": "node benchmarks/benchmark.js",
39
- "build": "run-p build:*",
40
- "build:r": "r -f cjs",
41
- "build:ts": "tsc -p src",
42
- "jest": "node --experimental-vm-modules node_modules/.bin/jest --setupFiles dotenv/config",
43
- "lint": "run-p lint:*",
44
- "lint:es": "eslint . --cache -f friendly --max-warnings 10",
45
- "lint:tsc": "tsc --noEmit",
46
- "prepare": "simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
47
- "prerelease": "npm run build",
48
- "pretest": "yarn build:ts",
49
- "release": "clean-publish && changeset publish",
50
- "test": "yarn jest",
51
- "typecov": "type-coverage"
52
- },
53
34
  "dependencies": {
54
- "tslib": "^2.3.1",
55
- "uuid": "^8.3.2"
56
- },
57
- "devDependencies": {
58
- "@1stg/lib-config": "^4.0.0",
59
- "@changesets/changelog-github": "^0.4.0",
60
- "@changesets/cli": "^2.16.0",
61
- "@types/jest": "^27.0.1",
62
- "@types/node": "^16.7.5",
63
- "@types/uuid": "^8.3.1",
64
- "clean-publish": "^2.1.1",
65
- "deasync": "^0.1.23",
66
- "enhanced-resolve": "^5.8.2",
67
- "postcss": "^8.3.6",
68
- "sync-threads": "^1.0.1",
69
- "ts-expect": "^1.3.0",
70
- "ts-jest": "^27.0.5",
71
- "ts-node": "^10.2.1",
72
- "type-coverage": "^2.18.1",
73
- "typescript": "^4.4.2"
74
- },
75
- "resolutions": {
76
- "prettier": "^2.3.2",
77
35
  "tslib": "^2.3.1"
78
- },
79
- "commitlint": {
80
- "extends": "@1stg"
81
- },
82
- "jest": {
83
- "preset": "ts-jest",
84
- "testEnvironment": "node",
85
- "collectCoverage": true,
86
- "extensionsToTreatAsEsm": [
87
- ".ts"
88
- ],
89
- "moduleNameMapper": {
90
- "^(\\.{1,2}/.*)\\.js$": "$1",
91
- "^synckit$": "<rootDir>/src"
92
- },
93
- "globals": {
94
- "ts-jest": {
95
- "useESM": true,
96
- "tsconfig": {
97
- "importHelpers": false
98
- }
99
- }
100
- }
101
- },
102
- "prettier": "@1stg/prettier-config",
103
- "renovate": {
104
- "extends": [
105
- "@1stg"
106
- ]
107
- },
108
- "typeCoverage": {
109
- "atLeast": 99.2,
110
- "cache": true,
111
- "detail": true,
112
- "ignoreAsAssertion": true,
113
- "ignoreNonNullAssertion": true,
114
- "showRelativePath": true,
115
- "strict": true,
116
- "update": true
117
36
  }
118
37
  }
package/CHANGELOG.md DELETED
@@ -1,81 +0,0 @@
1
- # synckit
2
-
3
- ## 0.4.1
4
-
5
- ### Patch Changes
6
-
7
- - [`c357bb3`](https://github.com/rx-ts/synckit/commit/c357bb3bb61d3854da0b41f3587cc77063514179) Thanks [@JounQin](https://github.com/JounQin)! - fix: add legacy fields as fallback
8
-
9
- ## 0.4.0
10
-
11
- ### Minor Changes
12
-
13
- - [#45](https://github.com/rx-ts/synckit/pull/45) [`f38de5f`](https://github.com/rx-ts/synckit/commit/f38de5fe5dfc8e4a8871d3d55e7a4d9bdc3a5d05) Thanks [@JounQin](https://github.com/JounQin)! - feat: use native esm
14
-
15
- ## 0.3.4
16
-
17
- ### Patch Changes
18
-
19
- - [#39](https://github.com/rx-ts/synckit/pull/39) [`0698572`](https://github.com/rx-ts/synckit/commit/0698572d048e38d9c1e5de233c07e89a7ca01eca) Thanks [@JounQin](https://github.com/JounQin)! - fix: test whether `receiveMessageOnPort` available for `--experimental-worker`
20
-
21
- ## 0.3.3
22
-
23
- ### Patch Changes
24
-
25
- - [#37](https://github.com/rx-ts/synckit/pull/37) [`4ae675a`](https://github.com/rx-ts/synckit/commit/4ae675ad4b0bc02ac459e9d49319154048ee40dd) Thanks [@JounQin](https://github.com/JounQin)! - fix: `worker_threads` API changes a lot
26
-
27
- ## 0.3.2
28
-
29
- ### Patch Changes
30
-
31
- - [#35](https://github.com/rx-ts/synckit/pull/35) [`578db5b`](https://github.com/rx-ts/synckit/commit/578db5bd33fdd137ca09b450a211e46d3f7299cf) Thanks [@JounQin](https://github.com/JounQin)! - fix: improve compatibility with node >=8.10 <12.11
32
-
33
- ## 0.3.1
34
-
35
- ### Patch Changes
36
-
37
- - [#34](https://github.com/rx-ts/synckit/pull/34) [`255736c`](https://github.com/rx-ts/synckit/commit/255736ca98731cf52aa1391d855737f45edb457f) Thanks [@JounQin](https://github.com/JounQin)! - fix: `worker_threads` is only available on Node 12
38
-
39
- - [#32](https://github.com/rx-ts/synckit/pull/32) [`d84e48e`](https://github.com/rx-ts/synckit/commit/d84e48e643124c3d5801bec3147ec158ccf6db49) Thanks [@JounQin](https://github.com/JounQin)! - fix(types): stricter but internal types
40
-
41
- ## 0.3.0
42
-
43
- ### Minor Changes
44
-
45
- - [#27](https://github.com/rx-ts/synckit/pull/27) [`2809da0`](https://github.com/rx-ts/synckit/commit/2809da0d25b9e4c617b3699c78cf80fbae895c6f) Thanks [@JounQin](https://github.com/JounQin)! - feat: add more env variables support
46
-
47
- ## 0.2.0
48
-
49
- ### Minor Changes
50
-
51
- - [#23](https://github.com/rx-ts/synckit/pull/23) [`6577e86`](https://github.com/rx-ts/synckit/commit/6577e86bff97a6a4d803394571e9406a86dd82dc) Thanks [@JounQin](https://github.com/JounQin)! - feat: use worker_threads by default for performance
52
-
53
- ## 0.1.6
54
-
55
- ### Patch Changes
56
-
57
- - [`b3e9760`](https://github.com/rx-ts/synckit/commit/b3e976062f1c568d495ad0a578c55b83506208c9) Thanks [@JounQin](https://github.com/JounQin)! - feat: support custom TSCONFIG_PATH env
58
-
59
- ## 0.1.4
60
-
61
- ### Patch Changes
62
-
63
- - [#9](https://github.com/rx-ts/synckit/pull/9) [`cad2e05`](https://github.com/rx-ts/synckit/commit/cad2e059bba51779115f63121077532b97d8aa6e) Thanks [@JounQin](https://github.com/JounQin)! - fix: try to fix clean-publish + changeset publish again
64
-
65
- ## 0.1.2
66
-
67
- ### Patch Changes
68
-
69
- - [#7](https://github.com/rx-ts/synckit/pull/7) [`0336c22`](https://github.com/rx-ts/synckit/commit/0336c22a5f159fa6d35b9a6b8f93f0a56a35b3dd) Thanks [@JounQin](https://github.com/JounQin)! - fix: try to fix clean-publish + changeset publish
70
-
71
- ## 0.1.1
72
-
73
- ### Patch Changes
74
-
75
- - [#5](https://github.com/rx-ts/synckit/pull/5) [`e451004`](https://github.com/rx-ts/synckit/commit/e4510040211b139a423d64eaf6607804c00a9915) Thanks [@JounQin](https://github.com/JounQin)! - fix: improve type definitions, mark tslib as dep
76
-
77
- ## 0.1.0
78
-
79
- ### Minor Changes
80
-
81
- - [`e7446f9`](https://github.com/rx-ts/synckit/commit/e7446f91421df5ee59e05adc002b3daa52dff96f) Thanks [@JounQin](https://github.com/JounQin)! - feat: first blood, should just work