fix(plugin-npm): add resolver for converting locators with __archiveUrl
What's the problem this PR addresses?
This PR extends the tarball resolver started in #6525 and adds the tests requested!
Fixes #5156 #5890 (?)
How did you fix it?
1. New NpmTarballResolver
Added packages/plugin-npm/sources/NpmTarballResolver.ts - a resolver that specifically handles npm packages with __archiveUrl parameters. Extended @BasixKOR's work from #6525 with tests
e.g. to handle
"unconventional-tarball": "npm:1.0.0::__archiveUrl=https://registry.example.org/unconventional-tarball/tralala/unconventional-tarball-1.0.0.tgz"
Checklist
- [x] I have read the Contributing Guide.
- [x] I have set the packages that need to be released for my changes to be effective.
- [x] I will check that all automated PR checks pass before the PR gets reviewed.
Thanks for adding tests to the PR! I'll close my previous PR as this PR solves the issues.
@BasixKOR No worries! I think I tried to solve too much with this PR by also fixing patch-commit to generate valid selectors as well... big can of worms. I might try remove that second "fix" and just keep your original PR with the tests for now :D
I've updated the PR to just add the tests, rather than try to fix the patch-package generation issue, as that's more complex.
I can't request reviewers, so just an FYI ping for @arcanis - as you had asked for tests in the previous PR https://github.com/yarnpkg/berry/pull/6525
Thanks! ❤️