-
Notifications
You must be signed in to change notification settings - Fork 511
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
feat!: rewrite external copy with multi version hoisting support #782
Conversation
Codecov Report
@@ Coverage Diff @@
## main #782 +/- ##
==========================================
- Coverage 70.63% 67.17% -3.46%
==========================================
Files 57 58 +1
Lines 5299 5716 +417
Branches 607 605 -2
==========================================
+ Hits 3743 3840 +97
- Misses 1549 1869 +320
Partials 7 7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@pi0 I added the options as a workaround if they were some edge cases that weren't covered (such as a package that doesn't follow semver), but IMO the new approach seems reliable enough to skip that. |
Any updates for this @pi0 ? |
37c872c
to
76278e7
Compare
Updated implementation with parent-level hosting for nested support, windows support using junctions (not portable), and alias support. Although new implementation should be much better for handling hoisting situations and allow better enhancements using new clearer data-structures, it can be buggy without testing on real-world installs. So let's get it a spin. Also there is new |
Resolves #572
Based on amazing work from @mahdiboomeri (#758) this PR introduces a full rewrite of the external copy mechanism.
Previously if multiple versions of an external library were being used by traced externals, we used this strategy:
This causes unresolvable issues especially when sub-dependencies are conflicting.
With this refactor, we respect hoisted structure of package manager and map it into
.output/server/node_modules
:node_modules/{name}@{version}
and symlink tonode_modules/{parent}/node_modules/{name}
for each parent. If no parent modules are detected, hoist it to top level as default (user's version)In case of having issues with new implementation in nitropack v2, you can opt to use legacy externals: