Skip to content

Commit

Permalink
chore(vr-tests): prepare storybook config for SB6
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed Feb 16, 2021
1 parent d7dbaad commit fe7d787
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 29 deletions.
2 changes: 2 additions & 0 deletions apps/vr-tests/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
const custom = require('@fluentui/scripts/storybook/webpack.config');

module.exports = {
stories: ['../src/**/*.stories.tsx'],
webpackFinal: config => custom(config),
addons: ['@storybook/addon-actions'],
};
12 changes: 9 additions & 3 deletions apps/vr-tests/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import '@storybook/addons';
import '@storybook/addon-options/register';
import '@storybook/addon-actions/register';
import { addons } from '@storybook/addons';
import { create } from '@storybook/theming';

addons.setConfig({
theme: create({
base: 'light',
brandTitle: 'Fabric',
}),
});
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import * as storybook from '@storybook/react';
import { setOptions } from '@storybook/addon-options';
import { setAddon } from '@storybook/react';
import { setRTL } from '@fluentui/react/lib/Utilities';

setOptions({
name: 'Fabric',
});

const req = require.context('../src/stories', true, /\.stories\.tsx$/);

function loadStories() {
req.keys().forEach(filename => req(filename));
}

const defaultConfig = {
rtl: false,
};
Expand All @@ -29,7 +18,7 @@ const defaultConfig = {
* In future, this can add a story with additional configurations
* such as theming.
*/
storybook.setAddon({
setAddon({
addStory(storyName, storyFn, config = defaultConfig) {
this.add(storyName, context => {
setRTL(false);
Expand All @@ -46,5 +35,3 @@ storybook.setAddon({
return this;
},
});

storybook.configure(loadStories, module);
1 change: 0 additions & 1 deletion apps/vr-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@fluentui/scripts": "^1.0.0",
"@fluentui/set-version": "^8.0.0-beta.1",
"@fluentui/storybook": "^1.0.0",
"@storybook/addon-options": "5.3.8",
"@storybook/addons": "5.3.8",
"@storybook/channels": "5.3.8",
"@storybook/react": "5.3.8",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"devDependencies": {
"@storybook/addon-a11y": "6.0.0-alpha.1",
"@storybook/addons": "5.3.8",
"@storybook/addon-options": "5.3.8",
"@storybook/addon-actions": "5.3.8",
"@storybook/addon-info": "5.3.8",
"@storybook/addon-knobs": "5.3.8",
Expand Down
9 changes: 0 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2875,15 +2875,6 @@
react-lifecycles-compat "^3.0.4"
react-select "^3.0.8"

"@storybook/[email protected]":
version "5.3.8"
resolved "https://registry.yarnpkg.com/@storybook/addon-options/-/addon-options-5.3.8.tgz#f722943cfcea8e18e257049018f88be21d89f61a"
integrity sha512-J9Bz1whjxQQ9dOdjhLjzuVVvJu46/xmMZrlfYuZ6npUIDir4HX5jmI6gfcG5RZGbbQqGUFT1OCQ46oQHZFFUow==
dependencies:
"@storybook/addons" "5.3.8"
core-js "^3.0.1"
util-deprecate "^1.0.2"

"@storybook/[email protected]", "@storybook/addons@^5.3.8":
version "5.3.8"
resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-5.3.8.tgz#62d62bafd4a73195f617e39f3c61ec7e7837b1ee"
Expand Down

0 comments on commit fe7d787

Please sign in to comment.