Open crubier opened 2 years ago
Hmm interesting !
But if I find issues with packages on my side, I still have to edit https://github.com/yarnpkg/berry/blob/master/packages/plugin-compat/sources/extensions.ts (and create the associated issues) manually, right ?
The idea I had here was about basically filling something like this file, but automatically.
This seems automatable, since solving the YN0002 warning is trivial, since the error message contains all necessary information.
Basically a workflow like:
.yarnrc.yml
automatically (maybe with a CLI flag or something)I guess I would call it @yarn/plugin-auto-compat
, it would use octokit.js to create a PR maybe
I think @missing1984 mentioned yesterday he wrote a tool to catch and autofix such issues locally 🤔
Some problems with completely automated approaches:
not autofix unfortunately.. I built a plugin that automatically load the extension from a global place within our company. it still need people involve to figure out the right overrides.. i've think of automate that but given the nature of the problem it will never be 100% correct especially for the regular and peer dependency thing you mentioned.
Describe the user story
As a developer, I often want to just install packages, but very often (too often), package creators do not fill their peer dependencies correctly. This invariably leads to huge
.yarnrc.yml
where we have to add peer dependencies to packages to avoid yarn YN0002 warnings.Typical
.yarnrc/yml
:Describe the solution you'd like
Maybe there could be a way for yarn to add some telemetry to this part of the code, and have a central source of truth, to let package creators know about their bad peerDeps ?
Opening issues automatically on repos sounds a bit difficult, but just have a central place to report it at least would be helpful ?
Describe the drawbacks of your solution
Need to maintain this solution.
Describe alternatives you've considered
I stopped bothering enough to open issues every time I have issues with peerDeps in packages I use.