refactor: reduce production dependency surface - #1632
Merged
Conversation
commit: |
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Contributor
Interactive terminal E2ETerminal Control verified the built CLI at
|
aidenybai
marked this pull request as ready for review
August 12, 2026 07:36
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.
Why
Before, the published CLI depended on
@babel/code-frameandfiguresfor a small subset of their behavior, while the private eval runner depended onp-limitfor a basic FIFO concurrency cap. After, focused TypeScript implementations preserve those contracts with a smaller production dependency graph.Development dependencies are intentionally unchanged.
@astrojs/compilerremains because React Doctor uses its official Astro-to-TSX conversion and source maps before linting.astrofiles.What changed
p-limitusage with a tested FIFO concurrency limiter@babel/code-frame,figures, andp-limitfrom production dependency declarationsEval results
Not run: this changes dependency implementations only and does not change rule detection behavior.
Test plan
nr test— 15/15 tasks passed; React Doctor 2,454 tests passedFORCE_COLOR=1 nr test tests/build-code-frame.test.ts— 6/6 passednr test:deslop— 525 deslop-js and 17 deslop-cli tests passednr lint— passed with existing fuzz-corpus warnings onlynr typecheck— 16/16 tasks passednr format:check— passednr check:published-deps— all five published packages passednr smoke:json-report— passednr smoke:packed-cli-install— passed with zero forbidden packagesNote
Low Risk
Dependency-trimming refactor with local replacements and coverage for code frames and concurrency. Main residual risk is subtle CLI rendering or eval scheduling differences versus the removed libraries.
Overview
Shrinks the production dependency surface by replacing three narrow helpers with local TypeScript implementations.
Published CLI (
react-doctor): drops@babel/code-frameandfigures. Diagnostic frames now go through localrenderCodeFrame/highlightCodeLine, and Ink menus use a smallterminalSymbolsmap with the same Unicode fallbacks.Evals: drops
p-limitin favor of a tested FIFOcreateConcurrencyLimit, wired through sandbox cleanup, attempt runners, and paired NDJSON writes.Adds a patch changeset for the CLI change.
Reviewed by Cursor Bugbot for commit 4d3298a. Bugbot is set up for automated code reviews on this repo. Configure here.