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

docs: document pluginOptionsSchema #27337

Merged
merged 4 commits into from
Oct 16, 2020
Merged

docs: document pluginOptionsSchema #27337

merged 4 commits into from
Oct 16, 2020

Conversation

mxstbr
Copy link
Contributor

@mxstbr mxstbr commented Oct 8, 2020

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]

@mxstbr mxstbr added the status: needs docs review Pull request related to documentation waiting for review label Oct 8, 2020
@mxstbr mxstbr requested a review from a team October 8, 2020 11:50
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 8, 2020
@LekoArts LekoArts added type: documentation An issue or pull request for improving or updating Gatsby's documentation and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Oct 8, 2020
Copy link
Contributor

@meganesu meganesu left a 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.
Copy link
Contributor

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?

Copy link
Contributor Author

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 👍

docs/docs/configuring-usage-with-plugin-options.md Outdated Show resolved Hide resolved
docs/docs/configuring-usage-with-plugin-options.md Outdated Show resolved Hide resolved
docs/docs/configuring-usage-with-plugin-options.md Outdated Show resolved Hide resolved
@mxstbr
Copy link
Contributor Author

mxstbr commented Oct 15, 2020

Updated based on the excellent suggestions @meganesu! How does this sound to you?

meganesu
meganesu previously approved these changes Oct 15, 2020
Copy link
Contributor

@meganesu meganesu left a 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 ✨

docs/docs/configuring-usage-with-plugin-options.md Outdated Show resolved Hide resolved
Co-authored-by: Megan Sullivan <megan@gatsbyjs.com>
@mxstbr mxstbr added bot: merge on green Gatsbot will merge these PRs automatically when all tests passes and removed status: needs docs review Pull request related to documentation waiting for review labels Oct 15, 2020
@mxstbr mxstbr merged commit 26667be into master Oct 16, 2020
@delete-merged-branch delete-merged-branch bot deleted the docs/plugin-options-schema branch October 16, 2020 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants