MIGRATE rax-example

This commit is contained in:
Norbert de Langen 2019-11-25 15:05:18 +01:00
parent 54f51db541
commit 8f84c3a5a3
6 changed files with 56 additions and 47 deletions

View File

@ -1,10 +0,0 @@
import '@storybook/addon-storysource/register';
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-events/register';
import '@storybook/addon-notes/register';
import '@storybook/addon-options/register';
import '@storybook/addon-knobs/register';
import '@storybook/addon-backgrounds/register';
import '@storybook/addon-a11y/register';
import '@storybook/addon-jest/register';

View File

@ -1,16 +0,0 @@
import { configure, addParameters } from '@storybook/rax';
addParameters({
options: {
name: 'Stroybook for Rax',
url: 'https://github.com/storybookjs/storybook/tree/master/examples/rax-kitchen-sink',
goFullScreen: false,
showAddonsPanel: true,
showSearchBox: false,
showRoots: true,
enableShortcuts: true,
panelPosition: 'bottom',
},
});
configure(require.context('../src/stories', true, /\.stories\.js$/), module);

View File

@ -0,0 +1,36 @@
const path = require('path');
module.exports = {
stories: ['../src/stories/**/*.stories.js'],
addons: [
'@storybook/addon-storysource/register',
'@storybook/addon-actions/register',
'@storybook/addon-links/register',
'@storybook/addon-events/register',
'@storybook/addon-notes/register',
'@storybook/addon-options/register',
'@storybook/addon-knobs/register',
'@storybook/addon-backgrounds/register',
'@storybook/addon-a11y/register',
'@storybook/addon-jest/register',
],
webpack: async config => ({
...config,
module: {
...config.module,
rules: [
...config.module.rules,
{
test: [/\.stories\.js$/, /index\.js$/],
loaders: [require.resolve('@storybook/source-loader')],
include: [path.resolve(__dirname, '../src')],
enforce: 'pre',
},
{
test: /\.stylesheet$/,
use: [require.resolve('stylesheet-loader')],
},
],
},
}),
};

View File

@ -0,0 +1,19 @@
import { addons } from '@storybook/addons';
import { create } from '@storybook/theming/create';
const theme = create({
base: 'light',
brandTitle: 'Storybook for Rax',
brandUrl: 'https://github.com/storybookjs/storybook/tree/master/examples/rax-kitchen-sink',
});
addons.setConfig({
goFullScreen: false,
showAddonsPanel: true,
showSearchBox: false,
showRoots: true,
enableShortcuts: true,
panelPosition: 'bottom',
theme,
});

View File

@ -1,21 +0,0 @@
const path = require('path');
module.exports = async ({ config, mode }) => ({
...config,
module: {
...config.module,
rules: [
...config.module.rules,
{
test: [/\.stories\.js$/, /index\.js$/],
loaders: [require.resolve('@storybook/source-loader')],
include: [path.resolve(__dirname, '../src')],
enforce: 'pre',
},
{
test: /\.stylesheet$/,
use: [require.resolve('stylesheet-loader')],
},
],
},
});

View File

@ -38,6 +38,7 @@
"@storybook/addons": "5.3.0-beta.6",
"@storybook/rax": "5.3.0-beta.6",
"@storybook/source-loader": "5.3.0-beta.6",
"@storybook/theming": "5.3.0-beta.6",
"babel-eslint": "^10.0.3",
"babel-preset-rax": "^1.0.0-beta.0",
"rax-scripts": "^2.0.0",