From cf76b42fed76123836b5e89143180d8947639ba1 Mon Sep 17 00:00:00 2001 From: ludrob Date: Tue, 2 Oct 2018 13:37:03 +0100 Subject: [PATCH] fixed x-docs issue with o-grid --- tools/x-docs/gatsby-config.js | 6 ++++-- tools/x-docs/src/lib/create-npm-package-pages.js | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/x-docs/gatsby-config.js b/tools/x-docs/gatsby-config.js index cb35d20d3..a03712a09 100644 --- a/tools/x-docs/gatsby-config.js +++ b/tools/x-docs/gatsby-config.js @@ -19,14 +19,16 @@ module.exports = { resolve: 'gatsby-source-filesystem', options: { name: 'docs', - path: '../../docs' + path: '../../docs', + ignore: ['**/bower_components'] }, }, { resolve: 'gatsby-source-filesystem', options: { name: 'components', - path: '../../components' + path: '../../components', + ignore: ['**/bower_components'] }, }, { diff --git a/tools/x-docs/src/lib/create-npm-package-pages.js b/tools/x-docs/src/lib/create-npm-package-pages.js index a8e5cba60..fa58eae12 100644 --- a/tools/x-docs/src/lib/create-npm-package-pages.js +++ b/tools/x-docs/src/lib/create-npm-package-pages.js @@ -26,6 +26,9 @@ module.exports = async (actions, graphql) => { // Package manifest slug will be /package so remove it const pagePath = path.dirname(node.fields.slug); + if (!node.name) { + throw new Error('invalidPackage:'+JSON.stringify(node)); + } actions.createPage({ component: path.resolve('src/templates/npm-package.jsx'), // Remove the file name from the slug