berry icon indicating copy to clipboard operation
berry copied to clipboard

fix(plugin-npm): add resolver for converting locators with __archiveUrl

Open spanishpear opened this issue 4 months ago • 4 comments

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 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.

spanishpear avatar Sep 07 '25 13:09 spanishpear

Thanks for adding tests to the PR! I'll close my previous PR as this PR solves the issues.

BasixKOR avatar Sep 08 '25 03:09 BasixKOR

@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

spanishpear avatar Sep 10 '25 03:09 spanishpear

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.

spanishpear avatar Sep 28 '25 06:09 spanishpear

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! ❤️

spanishpear avatar Sep 28 '25 07:09 spanishpear