From ddbc9fd70a0344273d444f8f47661ba3d0c368d3 Mon Sep 17 00:00:00 2001 From: Max Stoiber Date: Mon, 2 Nov 2020 14:26:44 +0100 Subject: [PATCH] feat(gatsby): release plugin option validation (#27437) * 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 --- src/gatsby-node.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gatsby-node.js b/src/gatsby-node.js index cb00044756f96..642180713ab45 100644 --- a/src/gatsby-node.js +++ b/src/gatsby-node.js @@ -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.