berry
berry copied to clipboard
[Feature] Allow plugins to define its own `MessageName`
- [ ] I'd be willing to implement this feature (contributing guide)
- I'd love to help implement this, but it would require a nice API design first
- [x] This feature is important to have in this repository; a contrib plugin wouldn't do
Describe the user story
As a Yarn plugin developer (for team's internal tools), I often want to show the error codes that describes the situation exactly, but the provided MessageName
are too general to accurate convey the action the user is expected to do.
Describe the solution you'd like
Design an API for define a set of error codes for own (perhaps by creating a field on Plugin
interface to declare its own), and change the Reporter
API to accept it.
Describe the drawbacks of your solution
I'm unsure how this can be achieved without creating breaking changes to the current API.
Describe alternatives you've considered
For now, we're just changing the error message for users with MessageName
vaguely matching the error.