Replace run-parallel-limit with p-limit and use native promises#901
Draft
ecraig12345 with Copilot wants to merge 1 commit into
Draft
Replace run-parallel-limit with p-limit and use native promises#901ecraig12345 with Copilot wants to merge 1 commit into
run-parallel-limit with p-limit and use native promises#901ecraig12345 with Copilot wants to merge 1 commit into
Conversation
Copilot created this pull request from a session on behalf of
ecraig12345
July 25, 2026 09:43
View session
There was a problem hiding this comment.
Pull request overview
This PR updates just-scripts to remove the run-parallel-limit callback-based concurrency helper, replacing it with p-limit and converting the affected tasks to promise-first async implementations (including using stream/promises for copy streaming). This aligns the task implementations with modern Node.js behavior while preserving concurrency limits and existing task semantics.
Changes:
- Replaced
run-parallel-limit/@types/run-parallel-limitwithp-limit(ESM-only, loaded via dynamic import) injust-scripts. - Converted
cleanTask,copyTask, andsassTasktoasynctasks using native promises andPromise.all+ concurrency limiting. - Updated tests to accommodate promise-based behavior and ESM-only import constraints under
mock-fs.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Removes run-parallel-limit and adds p-limit (+ transitive yocto-queue) to the lockfile. |
| packages/just-scripts/package.json | Swaps the runtime dependency to p-limit and drops @types/run-parallel-limit. |
| packages/just-scripts/src/tasks/cleanTask.ts | Converts to async + p-limit-throttled fse.remove promises. |
| packages/just-scripts/src/tasks/copyTask.ts | Converts to async + p-limit, and switches to pipeline from stream/promises. |
| packages/just-scripts/src/tasks/sassTask.ts | Converts to async + p-limit; awaits compile/postcss steps inline and promisifies legacy render(). |
| packages/just-scripts/src/tasks/tests/cleanTask.spec.ts | Updates the fs-extra.remove mock to be promise-based. |
| packages/just-scripts/src/tasks/tests/copyTask.spec.ts | Preloads p-limit in beforeAll to avoid ESM load issues under mock-fs. |
| change/change-21b37dad-e52f-40ef-937e-eb775c98f1e9.json | Adds a Beachball change file documenting the dependency/task updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fixes #823
Replaces the
run-parallel-limitdependency withp-limitinjust-scripts, and converts the affected tasks to use native promises inline rather than wrapping the old callback pattern.cleanTask: now anasynctask that awaitsPromise.allof limitedfse.remove(path)promises (no callback wrapper).copyTask: collects src/dest pairs, then awaits limited copies usingpipelinefromstream/promisesinstead of the callback form ofpipeline.sassTask:asynctask awaiting limited per-file work;compile()andpostcss(...).process()are awaited inline. Only the legacynode-sassrender()callback API is promisified, since it has no promise-based equivalent.p-limit(^7.3.1), removedrun-parallel-limitand@types/run-parallel-limit.p-limitv7 is ESM-only, so it is dynamically imported from CJS the same waynano-spawnalready is elsewhere in the package.A Beachball change file is included.
Test Notes
cleanTask.spec.ts: thefs-extra.removemock is now promise-based instead of callback-based.copyTask.spec.ts: preloads the ESM-onlyp-limitinbeforeAll, since it cannot be loaded from disk whilemock-fsis active.yarn build,yarn test,yarn lint,yarn format:check,yarn api:update(no API report changes).