You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds a stopDir option to findPackageDependencyDir so 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-level node_modules is still found.
A regression test covers both cases: a dependency above stopDir is ignored, while a dependency at stopDir/node_modules is still resolved.
Test plan
PATH="$HOME/.nvm/versions/node/v22.22.0/bin:$PATH" yarn workspace @rnx-kit/tools-node test
Note: 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.
Updated in 5918878. I reverted the incidental startDir defaulting change and left the stopAt pass-through/regression coverage intact.
Test note: I ran corepack yarn install --immutable, then attempted corepack yarn workspace @rnx-kit/tools-node test; the local run is blocked because this machine has Node v20.15.0 and the repo test command calls fs.globSync, which is unavailable there.
Thanks! It looks like CI is failing on formatting. Can you run yarn format and push the changes?
Test note: I ran corepack yarn install --immutable, then attempted corepack yarn workspace @rnx-kit/tools-node test; the local run is blocked because this machine has Node v20.15.0 and the repo test command calls fs.globSync, which is unavailable there.
Is there a particular reason for why you can't use Node v22 or greater?
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
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.