berry icon indicating copy to clipboard operation
berry copied to clipboard

[Feature] Allow plugins to define its own `MessageName`

Open BasixKOR opened this issue 4 months ago • 0 comments

  • [ ] 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.

BasixKOR avatar Feb 22 '24 06:02 BasixKOR