Skip to content

Commit 778fdef

Browse files
authored
docs(Storybook): upgrade to Storybook V8 (#639)
1 parent 2fa495f commit 778fdef

File tree

83 files changed

+9267
-3588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+9267
-3588
lines changed

.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"files": ["*.stories.tsx", "packages/*/demo/**/*"],
3737
"rules": {
3838
"react/button-has-type": "off",
39-
"react/no-array-index-key": "off"
39+
"react/no-array-index-key": "off",
40+
"func-name-matching": "off"
4041
}
4142
}
4243
]

.storybook/main.js

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { dirname, join } from 'path';
12
/**
23
* Copyright Zendesk, Inc.
34
*
@@ -16,6 +17,10 @@ const PACKAGE_NAMES = readdirSync(path.resolve(__dirname, '../packages')).filter
1617
name => name !== '.template'
1718
);
1819

20+
function getAbsolutePath(value) {
21+
return dirname(require.resolve(join(value, 'package.json')));
22+
}
23+
1924
const options = {
2025
backgrounds: false,
2126
measure: false,
@@ -24,7 +29,8 @@ const options = {
2429
};
2530

2631
module.exports = {
27-
stories: ['../packages/*/demo/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
32+
stories: ['../packages/*/demo/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
33+
2834
addons: [
2935
{ name: '@storybook/addon-essentials', options },
3036
{
@@ -38,12 +44,16 @@ module.exports = {
3844
}
3945
}
4046
},
41-
'@storybook/addon-a11y'
47+
getAbsolutePath('@storybook/addon-a11y'),
48+
getAbsolutePath('@storybook/addon-mdx-gfm'),
49+
'@storybook/addon-webpack5-compiler-babel'
4250
],
51+
4352
framework: {
44-
name: '@storybook/react-webpack5',
53+
name: getAbsolutePath('@storybook/react-webpack5'),
4554
options: {}
4655
},
56+
4757
webpackFinal: config => {
4858
config.plugins.push(
4959
new DefinePlugin({
@@ -64,5 +74,9 @@ module.exports = {
6474
);
6575

6676
return config;
77+
},
78+
79+
docs: {
80+
autodocs: true
6781
}
6882
};

.storybook/manager.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* found at http://www.apache.org/licenses/LICENSE-2.0.
66
*/
77

8-
import { addons } from '@storybook/addons';
8+
import { addons } from '@storybook/manager-api';
99
import { create } from '@storybook/theming';
1010
import { DEFAULT_THEME } from '@zendeskgarden/react-theming';
1111

0 commit comments

Comments
 (0)