fix(tools-node): limit package dependency search scope#4154
Open
vivekjm wants to merge 1 commit into
Open
Conversation
tido64
reviewed
May 18, 2026
db43dbf to
98283fc
Compare
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.
Description
Resolves #801.
This adds a
stopDiroption tofindPackageDependencyDirso callers can keep dependency lookup bounded to a repository root instead of walking all the way up the filesystem. The stop directory itself remains part of the search, so root-levelnode_modulesis still found.A regression test covers both cases: a dependency above
stopDiris ignored, while a dependency atstopDir/node_modulesis still resolved.Test plan
PATH="$HOME/.nvm/versions/node/v22.22.0/bin:$PATH" yarn workspace @rnx-kit/tools-node testPATH="$HOME/.nvm/versions/node/v22.22.0/bin:$PATH" yarn workspace @rnx-kit/tools-node buildPATH="$HOME/.nvm/versions/node/v22.22.0/bin:$PATH" yarn workspace @rnx-kit/tools-node lintPATH="$HOME/.nvm/versions/node/v22.22.0/bin:$PATH" yarn change:checkNote: the default local Node v20.15.0 cannot run the repo test command because it lacks
fs.globSync; the commands above were run with local Node v22.22.0.