-
Notifications
You must be signed in to change notification settings - Fork 471
Traverse upwards for single context projects #7896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements upward directory traversal for package resolution in single context projects, allowing ReScript to find dependencies in parent node_modules directories when building standalone packages in workspace setups.
Key changes include:
- Added upward traversal logic that searches parent directories for node_modules when dependencies aren't found locally
- Implemented caching mechanism to optimize repeated path existence checks during traversal
- Added comprehensive test coverage for standalone package builds
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
rewatch/src/helpers.rs | Core implementation of upward traversal logic with caching for package resolution |
rewatch/tests/compile.sh | Added test case for standalone package building via rescript command |
rewatch/testrepo/packages/standalone/* | Test fixtures for standalone package with dependency on @testrepo/dep01 |
rewatch/testrepo/package.json | Added standalone package to workspace and updated scripts to use rescript instead of rewatch |
CHANGELOG.md | Documented the new upward traversal feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This resolves the upwards traversal as discussed in #7117 (comment)