Skip to content

Commit

Permalink
feat(gatsby): release plugin option validation (gatsbyjs#27437)
Browse files Browse the repository at this point in the history
* chore(gatsby): add @gatsbyVersion pragma to pluginOptionsSchema Node API

This will make Gatsby prompt users on old versions of gatsby that don't support the API to upgrade to the new version.

* 2.25.0!

* Remove GATSBY_EXPERIMENTAL_PLUGIN_OPTION_VALIDATION feature flag

* Fix incorrect option in gatsby-admin;

* Fix tests

* Remove obsolete snapshots

* Trigger Build

* Remove flag from remark-autolink-headers

* Fix gatsby-plugin-mdx default
  • Loading branch information
mxstbr committed Nov 2, 2020
1 parent fd0bff8 commit ddbc9fd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/gatsby-node.js
Expand Up @@ -153,14 +153,12 @@ const createFSMachine = (
return interpret(fsMachine).start()
}

if (process.env.GATSBY_EXPERIMENTAL_PLUGIN_OPTION_VALIDATION) {
exports.pluginOptionsSchema = ({ Joi }) =>
Joi.object({
name: Joi.string(),
path: Joi.string(),
ignore: Joi.array().items(Joi.string()),
})
}
exports.pluginOptionsSchema = ({ Joi }) =>
Joi.object({
name: Joi.string(),
path: Joi.string(),
ignore: Joi.array().items(Joi.string()),
})

exports.sourceNodes = (api, pluginOptions) => {
// Validate that the path exists.
Expand Down

0 comments on commit ddbc9fd

Please sign in to comment.