Skip to content

Commit

Permalink
docs(Storybook): upgrade to Storybook V8 (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
ze-flo committed May 7, 2024
1 parent 2fa495f commit 778fdef
Show file tree
Hide file tree
Showing 83 changed files with 9,267 additions and 3,588 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"files": ["*.stories.tsx", "packages/*/demo/**/*"],
"rules": {
"react/button-has-type": "off",
"react/no-array-index-key": "off"
"react/no-array-index-key": "off",
"func-name-matching": "off"
}
}
]
Expand Down
20 changes: 17 additions & 3 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { dirname, join } from 'path';
/**
* Copyright Zendesk, Inc.
*
Expand All @@ -16,6 +17,10 @@ const PACKAGE_NAMES = readdirSync(path.resolve(__dirname, '../packages')).filter
name => name !== '.template'
);

function getAbsolutePath(value) {
return dirname(require.resolve(join(value, 'package.json')));
}

const options = {
backgrounds: false,
measure: false,
Expand All @@ -24,7 +29,8 @@ const options = {
};

module.exports = {
stories: ['../packages/*/demo/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
stories: ['../packages/*/demo/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],

addons: [
{ name: '@storybook/addon-essentials', options },
{
Expand All @@ -38,12 +44,16 @@ module.exports = {
}
}
},
'@storybook/addon-a11y'
getAbsolutePath('@storybook/addon-a11y'),
getAbsolutePath('@storybook/addon-mdx-gfm'),
'@storybook/addon-webpack5-compiler-babel'
],

framework: {
name: '@storybook/react-webpack5',
name: getAbsolutePath('@storybook/react-webpack5'),
options: {}
},

webpackFinal: config => {
config.plugins.push(
new DefinePlugin({
Expand All @@ -64,5 +74,9 @@ module.exports = {
);

return config;
},

docs: {
autodocs: true
}
};
2 changes: 1 addition & 1 deletion .storybook/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* found at http://www.apache.org/licenses/LICENSE-2.0.
*/

import { addons } from '@storybook/addons';
import { addons } from '@storybook/manager-api';
import { create } from '@storybook/theming';
import { DEFAULT_THEME } from '@zendeskgarden/react-theming';

Expand Down
Loading

0 comments on commit 778fdef

Please sign in to comment.