-
Notifications
You must be signed in to change notification settings - Fork 607
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
[rush] Add support for Yarn resolutions when using Yarn #831
Comments
This one would be immensely useful for us. Any pointers on where to start looking in case a third-party contribution would be useful? |
Just ran into this. Would love to know if there's a way to accomplish this or help. |
After thinking about it a little, I suspect that this feature may be fairly easy to implement. Some background: The common package contains references to tarballs (called the "temp packages"), one for each project project in your repo. (See this code.) If your real project is called my-lib, then the corresponding temp package name will be @rush-temp/my-lib, and the common package will contain something like this: common/temp/package.json {
"name": "rush-common",
"version": "0.0.0"
"description": "Temporary file generated by the Rush tool",
"private": true,
"dependencies": {
. . .
"@rush-temp/my-lib": "file:./projects/my-lib.tgz",
. . .
}
} If you extract the temp package tarball, it contains a single fake package.json file that describes the dependencies that Rush will install for the corresponding project. (You don't actually need to extract it, because its extracted contents are already present in common/temp/projects/my-lib/package.json. The reason for using a tarball is to make it easier for the package manager's cache to determine whether the fake package has changed or not.) Thus, in theory in order to implement this feature, all we need to do is copy the In practice, the question will be whether Yarn correctly respects it during installation. (All three package managers tend to be fairly buggy when handling If you can get it working, please create a PR! :-P |
I would expect A global solution would be nice and though #1360 addresses this on package level, I think should be a first level option within rush itself for the whole mono-repo, in order to have consistent versions. |
The Yarn package manager has a feature called "resolutions" that is similar in function to pnpmfile.js. It allows a package to specify fixup rules for indirect dependencies, for example:
The full docs are here:
https://yarnpkg.com/lang/en/docs/selective-version-resolutions/
We should figure out how to support this in a Rush repo when using the Yarn package manager.
The text was updated successfully, but these errors were encountered: