Open MBDesu opened 1 year ago
Perfect, thanks for adding the information and examples, I understand the use case. I'll start looking into it in a couple of days. I can have a new version probably by the end of the week.
For faster communication please join the discord group listed on the README, we can test and ask questions faster there: https://discord.gg/fNEEthRGJu
Also any other feedback to improve the library is always welcome
Perfect, thanks for adding the information and examples, I understand the use case. I'll start looking into it in a couple of days. I can have a new version probably by the end of the week.
Of course! Thanks for your prompt response.
For faster communication please join the discord group listed on the README, we can test and ask questions faster there: https://discord.gg/fNEEthRGJu
Sure, I can do that in the next day or two.
Also any other feedback to improve the library is always welcome
Well, since you're asking...
For what it's worth, I would prefer the latter of my two proposed solutions. There are even a whole host of other ways you could do this, like allowing an external configuration script that does what this would do essentially, but I think npm
's overrides work fantastically if you're able to use them, and matching functionality as equally as possible within reason is something to strive for.
See the NPM documentation for more details.
Sure, I red the documentation of how NPM currently does it, I agree with you, it would be good to have the same functionality. I'll move in that direction 👍
Hi, my team's project is struggling with the same exact scenario listed above, specifically with loader-utils 1.2.3, and trying to bump 1.2.3 to a higher version but not impact other major versions that are valid. Has there been any progress? I'll look to hop on discord as well.
Currently I haven't had the opportunity to make some progress, my current work has been leaving me with not so much time.
If you guys have the opportunity to make a pull request it would be really helpful, so I can review it and then submit the new version
If there is no opportunity to make the the PR I can try adding that feature later this week, maybe on Friday
is there any update to this? i have a similar scenario where i would need different versions of the same package, as indirect dependencies.
Essentially the same request as rogeriochaves/npm-force-resolutions#32, it would be very useful in projects with multiple versions of the same transient dependency to be able to independently define which version these should be updated to.
As mentioned in the thread for the aforementioned
npm-force-resolutions
issue, GHSA-3rfm-jhwj-7488 and GHSA-76p3-8jx3-jpfq are good use cases for such a feature.Consider the following
package.json
:This application is using Angular 13, which, to my knowledge, relies on versions of
nx
which requiresnpm
8.1.2, making usingnpm
's native overrides out of the question (as overrides were introduced in 8.3).Additionally, for the sake of this example, it is using an internal, closed-source package called
@internal/library
.Looking at the dependency tree, you can see several versions of
loader-utils
are transitively required:In this case,
loader-utils
1.2.3 (a vulnerable version) is a transitive dependency of@internal/library
.For the sake of remediating GHSA-3rfm-jhwj-7488 and/or GHSA-76p3-8jx3-jpfq in this scenario, it would be useful to be able to only update
loader-utils
1.2.3 to 1.4.2. Updating all instances ofloader-utils
to 1.4.2, 2.0.4, or 3.2.0 (versions without vulnerabilities) may introduce breaking changes across major versions, and this tree contains 3 distinct major versions ofloader-utils
.The mechanism by which this is controlled could vary, but even simply being able to specify which version is troublesome in
resolutions
would be helpful, e.g.:Another possibility would be to take the approach
npm
did and allow specifying the dependency structure you'd like to override. In this case, ideally only theloader-utils
whose direct parent is@nrwl/webpack
would be forced to useloader-utils
1.4.2:Thanks for your consideration.