mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 07:21:16 +08:00
MIGRATE rax-example
This commit is contained in:
parent
54f51db541
commit
8f84c3a5a3
@ -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';
|
@ -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);
|
36
examples/rax-kitchen-sink/.storybook/main.js
Normal file
36
examples/rax-kitchen-sink/.storybook/main.js
Normal 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')],
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
};
|
19
examples/rax-kitchen-sink/.storybook/manager.js
Normal file
19
examples/rax-kitchen-sink/.storybook/manager.js
Normal 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,
|
||||
});
|
@ -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')],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user