What happened?
findModuleFile: When combining searchDir and modulePath, don't let the result "escape" the confines of searchDir. If that happens, return undefined indicating a module resolution failure.
findPackageDependencyDir (local to resolve.ts): Add a stopDir parameter to limit the scope of the search to the current repository. Don't let the search go all the way to the root of the file system. Other resolvers don't do this because it violates the algorithm, but it's reasonable for us since we know node_modules will only legitimately be in the repo based on the way npm, yarn, pnpm, and other major package managers work (even if node_modules is a bunch of symlinks).
Affected Package
@rnx-kit/typescript-react-native-resolver
Version
Which platforms are you seeing this issue on?
System Information
Steps to Reproduce
N/A
Code of Conduct
What happened?
findModuleFile: When combiningsearchDirandmodulePath, don't let the result "escape" the confines ofsearchDir. If that happens, returnundefinedindicating a module resolution failure.findPackageDependencyDir(local to resolve.ts): Add astopDirparameter to limit the scope of the search to the current repository. Don't let the search go all the way to the root of the file system. Other resolvers don't do this because it violates the algorithm, but it's reasonable for us since we knownode_moduleswill only legitimately be in the repo based on the way npm, yarn, pnpm, and other major package managers work (even if node_modules is a bunch of symlinks).Affected Package
@rnx-kit/typescript-react-native-resolver
Version
Which platforms are you seeing this issue on?
System Information
Steps to Reproduce
N/A
Code of Conduct