fix(tools-node): limit package dependency search scope#4154
Conversation
db43dbf to
98283fc
Compare
|
Updated in 5918878. I reverted the incidental Test note: I ran |
|
Thanks! It looks like CI is failing on formatting. Can you run
Is there a particular reason for why you can't use Node v22 or greater? |
|
Thanks. I ran I also reran the package test with Node 22.22.0 on PATH:
That passed: 36 tests, 3 suites. The earlier local failure was because my default shell was still on Node 20.15.0, where the repo's test runner hits |
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.