From d3f21e966f5e3d9c10fada21ae588441ca3a4a2d Mon Sep 17 00:00:00 2001 From: atanasster Date: Sat, 27 Jun 2020 08:21:07 -0400 Subject: [PATCH] fix: sb6 beta has now fixed handling of glob --- core/config/src/index.ts | 3 ++- .../custom-pages-storybook-6/.storybook/main.js | 2 +- examples/gatsby/.config/buildtime.js | 16 ++++++++-------- examples/storybook-6-no-docs/.storybook/main.js | 16 ++++++++-------- examples/storybook-6/.storybook/main.js | 16 ++++++++-------- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/core/config/src/index.ts b/core/config/src/index.ts index 8af88a797..d2f398d62 100644 --- a/core/config/src/index.ts +++ b/core/config/src/index.ts @@ -82,7 +82,8 @@ export const extractStories = ({ const stories = config && config.stories ? config.stories.reduce((acc: string[], storyRg: string) => { - const regex = storyRg.replace(/\((.*?)\)/g, '+($1)'); + //fix for sb5 issue handling glob + const regex = storyRg.replace('.(', '.@('); return [...acc, ...globSync(path.resolve(configPath, regex))]; }, []) : undefined; diff --git a/examples/custom-pages-storybook-6/.storybook/main.js b/examples/custom-pages-storybook-6/.storybook/main.js index 6452a24c8..ce1dc7673 100644 --- a/examples/custom-pages-storybook-6/.storybook/main.js +++ b/examples/custom-pages-storybook-6/.storybook/main.js @@ -1,6 +1,6 @@ module.exports = { stories: [ - '../src/stories/**/*.stories.(js|mdx)', + '../src/stories/**/*.stories.@(js|mdx)', ], addons: [ '@storybook/addon-docs', diff --git a/examples/gatsby/.config/buildtime.js b/examples/gatsby/.config/buildtime.js index 70053b103..10ef38e1f 100644 --- a/examples/gatsby/.config/buildtime.js +++ b/examples/gatsby/.config/buildtime.js @@ -7,14 +7,14 @@ module.exports = { '../../stories/src/tutorial/getting-started/*.mdx', '../../stories/src/tutorial/write-documentation/*.mdx', '../../stories/src/tutorial/parts/*.mdx', - '../../stories/src/stories/*.stories.(js|jsx|tsx|mdx)', - '../src/stories/*.stories.(js|jsx|tsx|mdx)', - '../../../ui/app/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../ui/components/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../ui/blocks/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../core/core/src/stories/**/*.stories.(js|jsx|tsx|mdx)', - '../../../ui/editors/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../plugins/axe-plugin/src/stories/**/*.stories.(js|jsx|tsx|mdx)', + '../../stories/src/stories/*.stories.@(js|jsx|tsx|mdx)', + '../src/stories/*.stories.@(js|jsx|tsx|mdx)', + '../../../ui/app/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../ui/components/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../ui/blocks/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../core/core/src/stories/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../ui/editors/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../plugins/axe-plugin/src/stories/**/*.stories.@(js|jsx|tsx|mdx)', ], pages: { story: { diff --git a/examples/storybook-6-no-docs/.storybook/main.js b/examples/storybook-6-no-docs/.storybook/main.js index 2666d6eff..94fd1371d 100644 --- a/examples/storybook-6-no-docs/.storybook/main.js +++ b/examples/storybook-6-no-docs/.storybook/main.js @@ -26,14 +26,14 @@ module.exports = { } }], stories: [ - '../../../ui/editors/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../ui/components/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../ui/app/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../ui/blocks/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../core/core/src/stories/**/*.stories.(js|jsx|tsx|mdx)', - '../../../plugins/axe-plugin/src/stories/**/*.stories.(js|jsx|tsx|mdx)', - '../../stories/src/**/*.stories.(js|jsx|tsx|mdx)', - '../stories/**/*.stories.(js|jsx|tsx|mdx)', + '../../../ui/editors/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../ui/components/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../ui/app/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../ui/blocks/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../core/core/src/stories/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../plugins/axe-plugin/src/stories/**/*.stories.@(js|jsx|tsx|mdx)', + '../../stories/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../stories/**/*.stories.@(js|jsx|tsx|mdx)', // '../../stories/src/blogs/*.mdx', ], webpackFinal: (config = {}, options = {}) => { diff --git a/examples/storybook-6/.storybook/main.js b/examples/storybook-6/.storybook/main.js index 62f3aa07a..96790f4dd 100644 --- a/examples/storybook-6/.storybook/main.js +++ b/examples/storybook-6/.storybook/main.js @@ -3,14 +3,14 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl module.exports = { stories: [ - '../../../ui/editors/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../ui/components/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../ui/app/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../ui/blocks/src/**/*.stories.(js|jsx|tsx|mdx)', - '../../../core/core/src/stories/**/*.stories.(js|jsx|tsx|mdx)', - '../../../plugins/axe-plugin/src/stories/**/*.stories.(js|jsx|tsx|mdx)', - '../../stories/src/**/*.stories.(js|jsx|tsx|mdx)', - '../stories/**/*.stories.(js|jsx|tsx|mdx)', + '../../../ui/editors/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../ui/components/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../ui/app/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../ui/blocks/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../core/core/src/stories/**/*.stories.@(js|jsx|tsx|mdx)', + '../../../plugins/axe-plugin/src/stories/**/*.stories.@(js|jsx|tsx|mdx)', + '../../stories/src/**/*.stories.@(js|jsx|tsx|mdx)', + '../stories/**/*.stories.@(js|jsx|tsx|mdx)', ], addons: [ {