-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
docs: document pluginOptionsSchema #27337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating these docs! 😊 This is a great start. I added some questions that will hopefully help clarify things even further. Let me know what you think!
} | ||
``` | ||
|
||
This ensures users pass a boolean to `optionA` and `optionB`, and a string to `message`. It also defaults the `message` option to "default message" in case users do not pass their own. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when the validation fails? Is that something a user has to fix or the plugin author?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user has to adapt their configuration of the plugin! For example, if the error is "optionA is required", then the user would have to add optionA: true/false
to it 👍
Updated based on the excellent suggestions @meganesu! How does this sound to you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Left one tiny suggestion, but other than that I think this is ready to go ✨
Co-authored-by: Megan Sullivan <megan@gatsbyjs.com>
This improves the documentation for the new
pluginOptionsSchema
Node API (introduced in #27166 and #27242) and adds a section about it to the existing "Configuring Plugin Usage with Plugin Options" doc.[ch15947]