Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Request: document how to implement YNX plugin error codes #6361

Open
1 of 2 tasks
giles-v opened this issue Jun 27, 2024 · 0 comments
Open
1 of 2 tasks

[Feature] Request: document how to implement YNX plugin error codes #6361

giles-v opened this issue Jun 27, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@giles-v
Copy link

giles-v commented Jun 27, 2024

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

In https://yarnpkg.com/advanced/error-codes, there is a top-of-page infobox:

Are you a plugin author and want to declare your own error codes that don't match the semantic of the ones provided here? Please relinquish one character and use the YNX prefix (ex YNX001) instead of YN0!

However, given that reportWarning only accepts a MessageName as the first parameter (which is defined as a fixed type), and stringifyMessageName automatically prepends only YN, it's not clear how plugin authors should do this. An example of how this is intended would be great, and if that needs some changes to provide entry points, adding those.

Describe the solution you'd like

  • If there's a specific intended implementation route for YNX errors, document it with a short example.
  • If there is no current way for plugin authors to reportWarning or similar with YNX code, then either make it possible or clarify the infobox to reflect what's possible today.
@giles-v giles-v added the enhancement New feature or request label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant