From 2be8bf0b0b30c2ea314a4a0e5149b113ef995241 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 26 Feb 2020 09:34:59 -0400 Subject: [PATCH] Rename Storybook modules (#8112) The names for Storybook modules have changed in v5.3.0. `config.js` was renamed to `preview.js`, and addon registration has been moved to `main.js`. See here for details: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-52x-to-53x --- .storybook/addons.js | 2 -- .storybook/config.js | 11 ----------- .storybook/main.js | 7 +++++++ .storybook/{decorators.js => preview.js} | 0 4 files changed, 7 insertions(+), 13 deletions(-) delete mode 100644 .storybook/addons.js delete mode 100644 .storybook/config.js create mode 100644 .storybook/main.js rename .storybook/{decorators.js => preview.js} (100%) diff --git a/.storybook/addons.js b/.storybook/addons.js deleted file mode 100644 index 4e162fa27..000000000 --- a/.storybook/addons.js +++ /dev/null @@ -1,2 +0,0 @@ -import '@storybook/addon-knobs/register' -import '@storybook/addon-actions/register' diff --git a/.storybook/config.js b/.storybook/config.js deleted file mode 100644 index 48e3997eb..000000000 --- a/.storybook/config.js +++ /dev/null @@ -1,11 +0,0 @@ -import { configure } from '@storybook/react' -import '../ui/app/css/index.scss' - -const req = require.context('../ui/app/components', true, /\.stories\.js$/) - -function loadStories () { - require('./decorators') - req.keys().forEach((filename) => req(filename)) -} - -configure(loadStories, module) diff --git a/.storybook/main.js b/.storybook/main.js new file mode 100644 index 000000000..6743d33e4 --- /dev/null +++ b/.storybook/main.js @@ -0,0 +1,7 @@ +module.exports = { + stories: ['../ui/app/components/**/*.stories.js'], + addons: [ + '@storybook/addon-knobs', + '@storybook/addon-actions', + ], +} diff --git a/.storybook/decorators.js b/.storybook/preview.js similarity index 100% rename from .storybook/decorators.js rename to .storybook/preview.js