Forráskód Böngészése

chore: remove useless storybook v5 config

pointhalo 3 éve
szülő
commit
6f44d7e0d2

+ 0 - 71
.storybook/v5config/base/config.js

@@ -1,71 +0,0 @@
-import { configure, addDecorator, addParameters } from '@storybook/react';
-import 'reset-css';
-import 'normalize.css';
-
-const config = loadStories => {
-    // Option defaults:
-    addParameters({
-        options: {
-            /**
-             * show story component as full screen
-             * @type {Boolean}
-             */
-            isFullscreen: false,
-            /**
-             * display panel that shows a list of stories
-             * @type {Boolean}
-             */
-            showNav: true,
-            /**
-             * display panel that shows addon configurations
-             * @type {Boolean}
-             */
-            showPanel: true,
-            /**
-             * where to show the addon panel
-             * @type {('bottom'|'right')}
-             */
-            panelPosition: 'bottom',
-            /**
-             * regex for finding the hierarchy separator
-             * @example:
-             *   null - turn off hierarchy
-             *   /\// - split by `/`
-             *   /\./ - split by `.`
-             *   /\/|\./ - split by `/` or `.`
-             * @type {Regex}
-             */
-            hierarchySeparator: /\/|\./,
-            /**
-             * regex for finding the hierarchy root separator
-             * @example:
-             *   null - turn off multiple hierarchy roots
-             *   /\|/ - split by `|`
-             * @type {Regex}
-             */
-            hierarchyRootSeparator: /\|/,
-            /**
-             * sidebar tree animations
-             * @type {Boolean}
-             */
-            sidebarAnimations: true,
-            /**
-             * enable/disable shortcuts
-             * @type {Boolean}
-             */
-            enableShortcuts: true,
-            /**
-             * show/hide tool bar
-             * @type {Boolean}
-             */
-            isToolshown: true,
-            /**
-             * theme storybook, see link below
-             */
-            theme: undefined,
-        },
-    });
-    configure(loadStories, module);
-};
-
-export default config;

+ 0 - 82
.storybook/v5config/base/webpack.config.js

@@ -1,82 +0,0 @@
-// you can use this file to add your custom webpack plugins, loaders and anything you like.
-// This is just the basic way to add additional webpack configurations.
-// For more information refer the docs: https://storybook.js.org/configurations/custom-webpack-config
-
-// IMPORTANT
-// When you add this file, we won't add the default configurations which is similar
-// to "React Create App". This only has babel loader to load JavaScript.
-const path = require('path');
-const _ = require('lodash');
-const SemiWebpackPlugin = require('../../packages/semi-ui-plugin-core');
-
-function resolve(...dirs) {
-    return path.join(__dirname, '../..', ...dirs);
-}
-
-module.exports = ({ config }) => {
-    const rules =
-        (config.module.rules &&
-            config.module.rules.filter(rule => {
-                const test = _.toString(rule && rule.test);
-                if (/\.css/i.test(test) || /\.s(c|a)ss/i.test(test)) {
-                    return false;
-                }
-                return true;
-            })) ||
-        [];
-    rules.push(
-        {
-            test: /\.css$/,
-            loaders: ['style-loader', 'css-loader'],
-        },
-        {
-            test: /\.tsx?$/,
-            use: [
-                {
-                    loader: require.resolve('awesome-typescript-loader'),
-                },
-            ],
-        },
-        {
-            test: /\.svg?$/,
-            use: ['@svgr/webpack']
-        }
-    );
-    config.module.rules = rules;
-    config.resolve.extensions.push('.js', '.jsx', '.ts', '.tsx');
-    config.resolve.symlinks = false;
-    config.resolve.alias = {
-        '@douyinfe/semi-foundation': resolve('packages/semi-foundation'),
-        '@douyinfe/semi-ui': resolve('packages/semi-ui'),
-        '@douyinfe/semi-icons': resolve('packages/semi-icons/src'),
-        '@douyinfe/semi-theme-default': resolve('packages/semi-theme-default'),
-        '@douyinfe/semi-illustrations': resolve('packages/semi-illustrations/src'),
-    };
-    config.devtool = 'source-map';
-    // config.devtool = 'cheap-source-map';
-    config.plugins.push(
-        new SemiWebpackPlugin({
-            theme: '@douyinfe/semi-theme-default',
-            esbuild: true,
-            paths: [
-                function check(path) {
-                    return (
-                        (/packages\/semi-foundation/i.test(path) ||
-                            /packages\/semi-ui/i.test(path) ||
-                            /packages\/semi-icons/i.test(path)) &&
-                        !(
-                            /packages\/semi-foundation\/node_modules/i.test(path) ||
-                            /packages\/semi-ui\/node_modules/i.test(path)
-                        )
-                    );
-                },
-            ],
-            scssPaths: [
-                resolve('packages/semi-foundation'),
-                resolve('packages/semi-ui'),
-                resolve('packages/semi-theme-default'),
-            ],
-        })
-    );
-    return config;
-};

+ 0 - 1
.storybook/v5config/js/addons.js

@@ -1 +0,0 @@
-import '../base/addons';

+ 0 - 8
.storybook/v5config/js/config.js

@@ -1,8 +0,0 @@
-import config from '../base/config';
-
-// automatically import all files ending in *.stories.js
-const req = require.context('../../packages/semi-ui', true, /.stories.js$/);
-function loadStories() {
-    req.keys().forEach(filename => req(filename));
-}
-config(loadStories);

+ 0 - 8
.storybook/v5config/js/webpack.config.js

@@ -1,8 +0,0 @@
-// you can use this file to add your custom webpack plugins, loaders and anything you like.
-// This is just the basic way to add additional webpack configurations.
-// For more information refer the docs: https://storybook.js.org/configurations/custom-webpack-config
-
-// IMPORTANT
-// When you add this file, we won't add the default configurations which is similar
-// to "React Create App". This only has babel loader to load JavaScript.
-module.exports = require('../base/webpack.config');

+ 0 - 1
.storybook/v5config/ts/addons.js

@@ -1 +0,0 @@
-import '../base/addons';

+ 0 - 8
.storybook/v5config/ts/config.js

@@ -1,8 +0,0 @@
-import config from '../base/config';
-
-// automatically import all files ending in *.stories.tsx
-const req = require.context('../../packages/semi-ui', true, /.stories.tsx$/);
-function loadStories() {
-    req.keys().forEach(filename => req(filename));
-}
-config(loadStories);

+ 0 - 8
.storybook/v5config/ts/webpack.config.js

@@ -1,8 +0,0 @@
-// you can use this file to add your custom webpack plugins, loaders and anything you like.
-// This is just the basic way to add additional webpack configurations.
-// For more information refer the docs: https://storybook.js.org/configurations/custom-webpack-config
-
-// IMPORTANT
-// When you add this file, we won't add the default configurations which is similar
-// to "React Create App". This only has babel loader to load JavaScript.
-module.exports = require('../base/webpack.config');