[rush] Add support for package aliases ("@npm:" in version specifier) - #1280
Conversation
146a688 to
c866ff1
Compare
|
Interesting. I've never seen this feature before. This is a feature of Yarn? Do you have a repro repo that we can test this against? |
Hello, thanks for chiming in. Yes, this is a feature of Yarn. I've created a test repository here: https://github.com/KevinGrandon/bug-rush-yarn-npm-resolution You can clone it and run See Yarn aliasing for more info: https://yarnpkg.com/en/docs/cli/add#toc-yarn-add-alias |
…m: prefix Hello, would love some help here. No idea if this is working or not TBH and would love some help/guidance, or if you want to take this over and land it I'd be happy with that, but I'm very happy to continue contributing to this. I currently don't know if this works as I haven't been able to figure out how to link this locally, or get the tests working. This is an attempt to add support for finding packages when their semver range starts with `npm:`, which is a useful mechanism for aliasing or forking packages. See microsoft#1279 for more details. Refs microsoft#1279
0aa473b to
4582508
Compare
|
Latest changes to |
|
Tried with the following ranges and this seems to work ok: |
|
In #1279 (comment) Zoltan said:
I wonder if we should implement this for PNPM as well (but maybe in a separate PR?). |
|
This PR is awaiting the design discussion in #1279 I'm starting to believe it's an important feature, so if I get some time I may pitch in with the implementation. |
|
Kevin Grandon (@KevinGrandon) Do you have the information needed to proceed with this WIP, or is the design still unclear? (Or do you want someone else to take over this PR?) Thanks. |
|
Josh Wedekind (@halfnibble) I believe we arrived at a design. Since all the package managers support this feature, it seems useful for Rush to support it as well. If Kevin doesn't have time, perhaps someone else could help out. The main design changes that I had requested were:
|
Thanks for the updates here, I am short on time and not sure I am the right person to implement the parser. Please feel free to steal the code diff here or close this PR. Apologies I wasn't able to push this over the finish line. |
…-prefix-yarn-support
…at encapsulates the npm-package-arg spec parsing (This is a pure refactoring change that should not alter any behavior.)
…r instead of a string (This is a pure refactoring change that should not alter any behavior.)
…ndencyKey() (This is a pure refactoring change that should not alter any behavior.)
… support for NPM package aliases
|
This PR is now code complete and seems to work with both PNPM and Yarn. The code review may be a bit tricky since I had to do a fair amount of refactoring. Overall I believe this change should also improve some edge cases where |
|
Ian Clanton-Thuon (@iclanton) let's try to get this merged. |
…-prefix-yarn-support # Conflicts: # common/config/rush/pnpm-lock.yaml
Hello, would love some guidance, or if you want to take this over and land it I'd be happy with that, but I'm very happy to continue contributing to this. This PR is currently working with my test case , but I have been unable to figure out how to write a properly functioning test case for this.
This is an attempt to add support for finding packages when their semver range starts with
npm:, which is a useful mechanism for aliasing or forking packages. See #1279 for more details.Refs #1279