(packed: ReadonlyArray<PackedPackage>)
| 361 | const PUBLISH_CONCURRENCY = 4; |
| 362 | |
| 363 | const publishAll = async (packed: ReadonlyArray<PackedPackage>) => { |
| 364 | const queue = [...packed]; |
| 365 | const failures: string[] = []; |
| 366 | |
| 367 | const workers = Array.from({ length: Math.min(PUBLISH_CONCURRENCY, queue.length) }, async () => { |
| 368 | for (let next = queue.shift(); next !== undefined; next = queue.shift()) { |
| 369 | try { |
| 370 | await publishPacked(next); |
| 371 | } catch (error) { |
| 372 | failures.push(error instanceof Error ? error.message : String(error)); |
| 373 | } |
| 374 | } |
| 375 | }); |
| 376 | await Promise.all(workers); |
| 377 | |
| 378 | if (failures.length > 0) { |
| 379 | throw new Error(`${failures.length} package(s) failed to publish:\n${failures.join("\n")}`); |
| 380 | } |
| 381 | }; |
| 382 | |
| 383 | /** |
| 384 | * Rewrite-in-place mode for the pkg.pr.new preview workflow. pkg-pr-new runs |
no test coverage detected