Skip to content

Commit 39cb580

Browse files
committed
Fix Storybook configuration
1 parent 27428bb commit 39cb580

File tree

5 files changed

+4361
-1919
lines changed

5 files changed

+4361
-1919
lines changed

.flowconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[ignore]
2+
<PROJECT_ROOT>/node_modules/@storybook/.*
23

34
[untyped]
45

.storybook/main.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
module.exports = {
2-
addons: ['@storybook/preset-create-react-app'],
3-
stories: ['../src/*.stories.js'],
4-
};
2+
"stories": [
3+
"../src/**/*.stories.mdx",
4+
"../src/**/*.stories.@(js|jsx|ts|tsx)"
5+
],
6+
"addons": [
7+
"@storybook/addon-links",
8+
"@storybook/addon-essentials",
9+
"@storybook/addon-interactions",
10+
"@storybook/preset-create-react-app"
11+
],
12+
"framework": "@storybook/react"
13+
}

.storybook/preview.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const parameters = {
2+
actions: { argTypesRegex: "^on[A-Z].*" },
3+
controls: {
4+
matchers: {
5+
color: /(background|color)$/i,
6+
date: /Date$/,
7+
},
8+
},
9+
}

package.json

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,23 @@
4848
"lint": "node_modules/.bin/prettier --check src/**/*.{js,json} && eslint --ext .js,.yml . && npmPkgJsonLint -q . && pkg-ok && markdownlint *.md",
4949
"postinstall": "husky install",
5050
"report-deploy": "bash ./scripts/report-deploy.sh",
51-
"snapshot": "build-storybook",
5251
"start": "react-scripts start",
5352
"storybook": "start-storybook -p 9009 -s public",
5453
"test": "react-scripts test",
5554
"vercel-build": "REACT_APP_GIT_SHA=`([ -n \"$VERCEL_GIT_COMMIT_SHA\" ] && echo \"$VERCEL_GIT_COMMIT_SHA\") || git rev-parse HEAD` react-scripts build && build-storybook -o build/storybook/ && esdoc && mv docs/ build/ && yarn report-deploy"
5655
},
5756
"eslintConfig": {
58-
"extends": "react-app"
57+
"extends": "react-app",
58+
"overrides": [
59+
{
60+
"files": [
61+
"**/*.stories.*"
62+
],
63+
"rules": {
64+
"import/no-anonymous-default-export": "off"
65+
}
66+
}
67+
]
5968
},
6069
"browserslist": [
6170
">0.2%",
@@ -70,13 +79,20 @@
7079
"@sebastianwessel/esdoc-jsx-plugin": "^2.1.0",
7180
"@sebastianwessel/esdoc-react-plugin": "^2.1.0",
7281
"@sebastianwessel/esdoc-standard-plugin": "^2.1.0",
73-
"@storybook/preset-create-react-app": "^4.1.0",
74-
"@storybook/react": "^6.1.21",
82+
"@storybook/addon-actions": "^6.5.10",
83+
"@storybook/addon-essentials": "^6.5.10",
84+
"@storybook/addon-interactions": "^6.5.10",
85+
"@storybook/addon-links": "^6.5.10",
86+
"@storybook/builder-webpack4": "^6.5.10",
87+
"@storybook/manager-webpack4": "^6.5.10",
88+
"@storybook/node-logger": "^6.5.10",
89+
"@storybook/preset-create-react-app": "^3.2.0",
90+
"@storybook/react": "^6.5.10",
91+
"@storybook/testing-library": "^0.0.13",
7592
"@testing-library/react": "^12.1.5",
7693
"@welldone-software/why-did-you-render": "^7.0.1",
7794
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
7895
"bundlewatch": "^0.3.3",
79-
"chromatic": "^6.7.3",
8096
"coveralls": "^3.1.1",
8197
"enzyme": "^3.11.0",
8298
"eslint-plugin-yaml": "^0.5.0",
@@ -120,6 +136,6 @@
120136
"path": "build/static/js/runtime-main.*.js",
121137
"maxSize": "1 kB"
122138
}
123-
]
139+
]
124140
}
125141
}

0 commit comments

Comments
 (0)