-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix: Prevent node_modules contamination after running test-packages (Fixes #12874) #13988
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
Open
Divyanshu-Mishra9620
wants to merge
3
commits into
meteor:devel
Choose a base branch
from
Divyanshu-Mishra9620:fix/node-modules-contamination-12874
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix: Prevent node_modules contamination after running test-packages (Fixes #12874) #13988
Divyanshu-Mishra9620
wants to merge
3
commits into
meteor:devel
from
Divyanshu-Mishra9620:fix/node-modules-contamination-12874
Conversation
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
✅ Deploy Preview for v3-meteor-api-docs canceled.
|
✅ Deploy Preview for v3-migration-docs canceled.
|
@italojs Hey can you please review this PR |
did you push all files? i cant see the |
Should we maintain the test-smoke-app in the fix? it's looks like a test-app only |
…teor#12874); remove test-smoke-app as requested
Hi @italojs,
|
The file has MANY linter changes, I can't see where the actual fix is. Could you please remove all those linter changes? |
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:
This PR resolves issue #12874, where running meteor test-packages could overwrite or contaminate the app’s node_modules directory, causing errors when starting the app.
Summary of changes:
Added a guard in tools/isobuild/meteor-npm.js to prevent rebuilt package directories from being renamed outside the test-runner’s working directory.
Ensured rebuilt npm package directories are saved with a .rebuild-saved-* suffix if outside the test-runner cwd, avoiding overwriting app dependencies.
Verified the fix with a minimal test app and package (test-smoke-app/packages/my-package), confirming that running test-packages no longer breaks the app’s npm dependencies.
Testing:
Added a minimal test package (my-package) with an npm dependency.
Ran meteor test-packages ./packages/my-package and then started the app with meteor run.
Confirmed the app starts without npm errors and that node_modules is not contaminated.