diff --git a/src/common/index.ts b/src/common/index.ts index 624296a..ad18073 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -6,4 +6,5 @@ export * from './helper'; export * from './is'; export * from './objects'; export * from './semver'; +export * from './url'; export * from './uuid'; diff --git a/src/node/index.ts b/src/node/index.ts index 8ab353d..5f6c724 100644 --- a/src/node/index.ts +++ b/src/node/index.ts @@ -2,6 +2,7 @@ export * from './lib'; export * from './clearRequireCache'; export * from './clipboard'; export * from './common'; +export * from './createChildProcess'; export * from './createFilePathFilter'; export * from './crypto'; export * from './exec'; diff --git a/src/node/worker-threads.ts b/src/node/lib/worker-threads.ts similarity index 91% rename from src/node/worker-threads.ts rename to src/node/lib/worker-threads.ts index 8b59ef3..cf4ed8e 100644 --- a/src/node/worker-threads.ts +++ b/src/node/lib/worker-threads.ts @@ -10,7 +10,7 @@ */ import { Worker, isMainThread, workerData } from 'node:worker_threads'; // parentPort -import { getLogger } from './get-logger'; +import { getLogger } from '../get-logger'; interface CreateThreadOptions { debug?: boolean; type: string; @@ -61,8 +61,8 @@ if (!isMainThread) { // }; // const resetConfig = { checkOnInit: false, exitOnError: false, mode: 'current' }; - // eslint-disable-next-line @typescript-eslint/no-var-requires - require(config.workerFile)(config); + // eslint-disable-next-line unicorn/prefer-top-level-await + if (config.workerFile) import(config.workerFile).then(f => (f.default || f)(config)); // heartbeat and more... }