From 08458640a4fe27acf18cb98b18c372ff4dc11d4e Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sun, 13 Oct 2019 17:08:43 +0800 Subject: [PATCH] CLI: MDX configuration fixes --- lib/cli/generators/ANGULAR/template-mdx/.storybook/config.js | 2 +- lib/cli/generators/HTML/template-mdx/.storybook/config.js | 2 +- lib/cli/generators/REACT/template-mdx/.storybook/config.js | 2 +- lib/cli/generators/SFC_VUE/template-mdx/.storybook/config.js | 2 +- lib/cli/generators/VUE/template-mdx/.storybook/config.js | 2 +- lib/cli/generators/VUE/template-mdx/.storybook/presets.js | 1 + .../generators/WEBPACK_REACT/template-mdx/.storybook/config.js | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 lib/cli/generators/VUE/template-mdx/.storybook/presets.js diff --git a/lib/cli/generators/ANGULAR/template-mdx/.storybook/config.js b/lib/cli/generators/ANGULAR/template-mdx/.storybook/config.js index b9f8d0322eb..f1689d243bd 100644 --- a/lib/cli/generators/ANGULAR/template-mdx/.storybook/config.js +++ b/lib/cli/generators/ANGULAR/template-mdx/.storybook/config.js @@ -1,4 +1,4 @@ import { configure } from '@storybook/angular'; // automatically import all files ending in *.stories.ts -configure(require.context('../src/stories', true, /\.stories\.ts$/), module); +configure(require.context('../src/stories', true, /\.stories\.(ts|mdx)$/), module); diff --git a/lib/cli/generators/HTML/template-mdx/.storybook/config.js b/lib/cli/generators/HTML/template-mdx/.storybook/config.js index 055d4e30181..0c2a58cfec2 100644 --- a/lib/cli/generators/HTML/template-mdx/.storybook/config.js +++ b/lib/cli/generators/HTML/template-mdx/.storybook/config.js @@ -1,4 +1,4 @@ import { configure } from '@storybook/html'; // automatically import all files ending in *.stories.js -configure(require.context('../stories', true, /\.stories\.js$/), module); +configure(require.context('../stories', true, /\.stories\.(js|mdx)$/), module); diff --git a/lib/cli/generators/REACT/template-mdx/.storybook/config.js b/lib/cli/generators/REACT/template-mdx/.storybook/config.js index 0603ed51131..e178df98fe4 100644 --- a/lib/cli/generators/REACT/template-mdx/.storybook/config.js +++ b/lib/cli/generators/REACT/template-mdx/.storybook/config.js @@ -1,4 +1,4 @@ import { configure } from '@storybook/react'; // automatically import all files ending in *.stories.js -configure(require.context('../stories', true, /\.stories\.js$/), module); +configure(require.context('../stories', true, /\.stories\.(js|mdx)$/), module); diff --git a/lib/cli/generators/SFC_VUE/template-mdx/.storybook/config.js b/lib/cli/generators/SFC_VUE/template-mdx/.storybook/config.js index 145eb83c09a..08a361c9a9b 100644 --- a/lib/cli/generators/SFC_VUE/template-mdx/.storybook/config.js +++ b/lib/cli/generators/SFC_VUE/template-mdx/.storybook/config.js @@ -1,4 +1,4 @@ import { configure } from '@storybook/vue'; // automatically import all files ending in *.stories.js -configure(require.context('../src/stories', true, /\.stories\.js$/), module); +configure(require.context('../src/stories', true, /\.stories\.(js|mdx)$/), module); diff --git a/lib/cli/generators/VUE/template-mdx/.storybook/config.js b/lib/cli/generators/VUE/template-mdx/.storybook/config.js index 1516685de79..f770a9332fd 100644 --- a/lib/cli/generators/VUE/template-mdx/.storybook/config.js +++ b/lib/cli/generators/VUE/template-mdx/.storybook/config.js @@ -1,4 +1,4 @@ import { configure } from '@storybook/vue'; // automatically import all files ending in *.stories.js -configure(require.context('../stories', true, /\.stories\.js$/), module); +configure(require.context('../stories', true, /\.stories\.(js|mdx)$/), module); diff --git a/lib/cli/generators/VUE/template-mdx/.storybook/presets.js b/lib/cli/generators/VUE/template-mdx/.storybook/presets.js new file mode 100644 index 00000000000..a4707c74c5c --- /dev/null +++ b/lib/cli/generators/VUE/template-mdx/.storybook/presets.js @@ -0,0 +1 @@ +module.exports = ['@storybook/addon-docs/vue/preset']; diff --git a/lib/cli/generators/WEBPACK_REACT/template-mdx/.storybook/config.js b/lib/cli/generators/WEBPACK_REACT/template-mdx/.storybook/config.js index 0603ed51131..e178df98fe4 100644 --- a/lib/cli/generators/WEBPACK_REACT/template-mdx/.storybook/config.js +++ b/lib/cli/generators/WEBPACK_REACT/template-mdx/.storybook/config.js @@ -1,4 +1,4 @@ import { configure } from '@storybook/react'; // automatically import all files ending in *.stories.js -configure(require.context('../stories', true, /\.stories\.js$/), module); +configure(require.context('../stories', true, /\.stories\.(js|mdx)$/), module);