From f467a4126e7a549f1eb4fad6ce2268f7e2670597 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 23 Feb 2026 11:38:23 +0100 Subject: [PATCH] Return object from runWorkerQueueThreads Signed-off-by: Patrik Oldsberg Co-authored-by: Cursor --- packages/cli-node/report.api.md | 4 +++- .../cli-node/src/concurrency/runWorkerQueueThreads.test.ts | 2 +- packages/cli-node/src/concurrency/runWorkerQueueThreads.ts | 4 ++-- packages/cli/src/modules/lint/commands/repo/lint.ts | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/cli-node/report.api.md b/packages/cli-node/report.api.md index 902eff2b91..b3d8fe5641 100644 --- a/packages/cli-node/report.api.md +++ b/packages/cli-node/report.api.md @@ -216,7 +216,9 @@ export function runConcurrentTasks( // @public export function runWorkerQueueThreads( options: WorkerQueueThreadsOptions, -): Promise; +): Promise<{ + results: TResult[]; +}>; // @public export type WorkerQueueThreadsOptions = { diff --git a/packages/cli-node/src/concurrency/runWorkerQueueThreads.test.ts b/packages/cli-node/src/concurrency/runWorkerQueueThreads.test.ts index 20e71531ab..5dd2cda438 100644 --- a/packages/cli-node/src/concurrency/runWorkerQueueThreads.test.ts +++ b/packages/cli-node/src/concurrency/runWorkerQueueThreads.test.ts @@ -21,7 +21,7 @@ describe('runWorkerQueueThreads', () => { const sharedData = new SharedArrayBuffer(10); const sharedView = new Uint8Array(sharedData); - const results = await runWorkerQueueThreads({ + const { results } = await runWorkerQueueThreads({ context: sharedData, items: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], workerFactory: (data: SharedArrayBuffer) => { diff --git a/packages/cli-node/src/concurrency/runWorkerQueueThreads.ts b/packages/cli-node/src/concurrency/runWorkerQueueThreads.ts index d1974dba90..2d2a3b37e4 100644 --- a/packages/cli-node/src/concurrency/runWorkerQueueThreads.ts +++ b/packages/cli-node/src/concurrency/runWorkerQueueThreads.ts @@ -78,7 +78,7 @@ export type WorkerQueueThreadsOptions = { */ export async function runWorkerQueueThreads( options: WorkerQueueThreadsOptions, -): Promise { +): Promise<{ results: TResult[] }> { const items = Array.from(options.items); const workerFactory = options.workerFactory; const workerData = options.context; @@ -134,7 +134,7 @@ export async function runWorkerQueueThreads( }), ); - return results; + return { results }; } /* istanbul ignore next */ diff --git a/packages/cli/src/modules/lint/commands/repo/lint.ts b/packages/cli/src/modules/lint/commands/repo/lint.ts index 07e4eac3ff..98a100fe3e 100644 --- a/packages/cli/src/modules/lint/commands/repo/lint.ts +++ b/packages/cli/src/modules/lint/commands/repo/lint.ts @@ -105,7 +105,7 @@ export async function command(opts: OptionValues, cmd: Command): Promise { }), ); - const resultsList = await runWorkerQueueThreads({ + const { results: resultsList } = await runWorkerQueueThreads({ items: items.filter(item => item.lintOptions), // Filter out packages without lint script context: { fix: Boolean(opts.fix),