Skip to content

Commit 0d1bbf2

Browse files
committed
build: update storybook, jest
1 parent ff79ead commit 0d1bbf2

File tree

10 files changed

+1274
-676
lines changed

10 files changed

+1274
-676
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
storybook-static
3-
lib
3+
lib
4+
.DS_Store

.storybook/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { withKnobs } from '@storybook/addon-knobs';
66
import { withInfo } from '@storybook/addon-info';
77
import { withOptions } from '@storybook/addon-options';
88
import chaptersAddon from 'react-storybook-addon-chapters';
9-
import { repository, version } from "../package.json"
9+
import { name, repository, version } from "../package.json"
1010
setAddon(chaptersAddon);
1111
addDecorator(withNotes);
1212
addDecorator(withKnobs);
@@ -40,15 +40,15 @@ addParameters({
4040
});
4141

4242
addDecorator(withOptions({
43-
name: `组件库 v${version}`,
43+
name: `${name} v${version}`,
4444
url: repository,
4545
sidebarAnimations: true,
4646
}))
4747
/**
4848
* 动态加载所有stories
4949
*/
5050
function loadStories() {
51-
const req = requireContext('../src/stories', true, /\.stories\.(ts|tsx)$/);
51+
const req = requireContext('../src/stories', true, /\.stories\.(j|t)sx?$/);
5252
const allExport = [require('../src/stories/index.stories')]; // 第一排序
5353
req.keys().forEach(fileName => allExport.push(req(fileName)));
5454
return allExport;

.storybook/webpack.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ module.exports = async ({ config, mode }) => {
66
loader: require.resolve('babel-loader'),
77
options: {
88
presets: [['react-app', { flow: false, typescript: true }]],
9-
plugins: [
10-
['import', { libraryName: "antd", style: true }]
11-
]
129
}
1310
}, {
14-
test: /\.stories\.(ts|tsx)$/,
11+
test: /\.stories\.(j|t)sx?$/,
1512
loaders: [require.resolve('@storybook/addon-storysource/loader')],
1613
enforce: 'pre',
1714
}, {

jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
module.exports = {
32
name: 'storybook-ts-boilerplate',
43
globals: {

0 commit comments

Comments
 (0)