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 17, 2021
1 parent 6c35488 commit 5d33f5e
Show file tree
Hide file tree
Showing 6 changed files with 846 additions and 157 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);
4 changes: 1 addition & 3 deletions 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 All @@ -47,8 +46,7 @@
"react-dom": "16.8.6",
"react-app-polyfill": "~1.0.1",
"react": "16.8.6",
"screener-runner": "^0.10.43",
"screener-storybook": "^0.18.6",
"screener-storybook": "0.21.0",
"style-loader": "^2.0.0",
"tslib": "^1.10.0"
}
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"@types/jest-axe": "3.2.2",
"@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 Expand Up @@ -107,7 +106,6 @@
"packages/fluentui/*"
],
"nohoist": [
"packages/web-components/@storybook",
"packages/web-components/@storybook/**",
"packages/web-components/typescript",
"packages/web-components/typescript/**",
Expand Down
Loading

0 comments on commit 5d33f5e

Please sign in to comment.