Skip to content

Commit

Permalink
build: upgrade storybook (carbon-design-system#3883)
Browse files Browse the repository at this point in the history
* build: upgrade storybook

* chore: lint fix
  • Loading branch information
matthewgallo authored Dec 1, 2023
1 parent 97d8e11 commit 366f662
Show file tree
Hide file tree
Showing 21 changed files with 1,545 additions and 759 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
29 changes: 18 additions & 11 deletions packages/core/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
/**
* Copyright IBM Corp. 2020, 2022
* Copyright IBM Corp. 2020, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

const { resolve } = require('path');
const { merge } = require('webpack-merge');
const path = require('path');
const { dirname, join, resolve } = require('path');

module.exports = {
addons: [
'@storybook/addon-actions',
'@storybook/addon-docs',
'@storybook/addon-controls',
'@storybook/addon-links',
getAbsolutePath('@storybook/addon-actions'),
getAbsolutePath('@storybook/addon-docs'),
getAbsolutePath('@storybook/addon-controls'),
getAbsolutePath('@storybook/addon-links'),
{
name: '@storybook/addon-storysource',
options: {
Expand All @@ -23,26 +22,30 @@ module.exports = {
},
},
},
'@storybook/addon-viewport',
'@storybook/addon-mdx-gfm',
getAbsolutePath('@storybook/addon-viewport'),
getAbsolutePath('@storybook/addon-mdx-gfm'),
'@carbon/storybook-addon-theme/preset.js',
],

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

features: {
// setting storyStoryV7 to false allows the storybook to build
storyStoreV7: false, // 👈 Opt out of on-demand story loading - problems https://github.com/storybookjs/storybook/issues/21696
},

stories: [
'../../ibm-products/+(docs|src)/**/*+(-story|.stories).*',
'../+(docs|src)/**/*+(-story|.stories).*',
'../../../examples/**/*+(-story|.stories).*',
],

// v11 will only show stories for C4P components (or at least until CDAI/Security move from v10 to v11)
webpackFinal: async (configuration, { configType }) =>
merge(configuration, {
Expand Down Expand Up @@ -87,7 +90,7 @@ module.exports = {
},
resolve: {
alias: {
ALIAS_STORY_STYLE_CONFIG$: path.resolve(
ALIAS_STORY_STYLE_CONFIG$: resolve(
configType === 'DEVELOPMENT'
? '../ibm-products-styles/src/config-dev.scss'
: '../ibm-products-styles/src/config.scss'
Expand All @@ -96,3 +99,7 @@ module.exports = {
},
}),
};

function getAbsolutePath(value) {
return dirname(require.resolve(join(value, 'package.json')));
}
33 changes: 17 additions & 16 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,22 @@
"@carbon/storybook-addon-theme": "^2.0.5",
"@carbon/themes": "^11.28.0",
"@carbon/type": "^11.25.1",
"@storybook/addon-actions": "^7.2.3",
"@storybook/addon-controls": "^7.2.3",
"@storybook/addon-docs": "^7.2.3",
"@storybook/addon-links": "^7.2.3",
"@storybook/addon-mdx-gfm": "^7.2.3",
"@storybook/addon-storysource": "^7.2.3",
"@storybook/addon-viewport": "^7.2.3",
"@storybook/addons": "^7.2.3",
"@storybook/api": "^7.2.3",
"@storybook/components": "^7.2.3",
"@storybook/core-events": "^7.2.3",
"@storybook/csf": "^0.1.1",
"@storybook/react": "^7.2.3",
"@storybook/react-webpack5": "^7.2.3",
"@storybook/theming": "^7.2.3",
"@storybook/addon-actions": "^7.6.2",
"@storybook/addon-controls": "^7.6.2",
"@storybook/addon-docs": "^7.6.2",
"@storybook/addon-links": "^7.6.2",
"@storybook/addon-mdx-gfm": "^7.6.2",
"@storybook/addon-storysource": "^7.6.2",
"@storybook/addon-viewport": "^7.6.2",
"@storybook/addons": "^7.6.2",
"@storybook/api": "^7.6.2",
"@storybook/components": "^7.6.2",
"@storybook/core-events": "^7.6.2",
"@storybook/csf": "^0.1.2",
"@storybook/react": "^7.6.2",
"@storybook/react-webpack5": "^7.6.2",
"@storybook/source-loader": "^7.6.2",
"@storybook/theming": "^7.6.2",
"babel-loader": "^9.1.3",
"babel-preset-ibm-cloud-cognitive": "^0.14.39",
"css-loader": "^6.8.1",
Expand All @@ -65,7 +66,7 @@
"rimraf": "^5.0.1",
"sass": "^1.64.2",
"sass-loader": "^13.3.2",
"storybook": "^7.2.3",
"storybook": "^7.6.2",
"style-loader": "^3.3.3",
"typescript": "^5.1.6",
"webpack": "^5.88.2",
Expand Down
Loading

0 comments on commit 366f662

Please sign in to comment.