Skip to content

Commit

Permalink
wip: 默认导出 url、createChildProcess 等文件
Browse files Browse the repository at this point in the history
  • Loading branch information
renxia committed Jan 21, 2024
1 parent 98942d9 commit 2bc6e73
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export * from './helper';
export * from './is';
export * from './objects';
export * from './semver';
export * from './url';
export * from './uuid';
1 change: 1 addition & 0 deletions src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 3 additions & 3 deletions src/node/worker-threads.ts → src/node/lib/worker-threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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...
}

0 comments on commit 2bc6e73

Please sign in to comment.