Skip to content

Commit

Permalink
chore(packages/ui): Add storybook-build npm-script for CI to run, als…
Browse files Browse the repository at this point in the history
…o include new config and mappings.
  • Loading branch information
brunomenezes committed Jan 14, 2025
1 parent 45e8194 commit 6bceea4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/ui/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ module.exports = {
'../src/stories/**/*.stories.mdx',
'../src/stories/**/*.stories.@(js|jsx|ts|tsx)',
],
typescript: {
reactDocgen: 'react-docgen-typescript-plugin',
},
addons: [
'storybook-addon-performance/register',
'@storybook/addon-links',
'@storybook/addon-essentials',
'storybook-addon-next-router',
],
webpackFinal: async (config) => {
config.module.rules = config.module.rules.map((r) =>
Expand All @@ -41,7 +45,15 @@ module.exports = {
!/@chakra-ui/.test(filename) &&
!/@zag-js/.test(filename) &&
!/ethers/.test(filename) &&
!/@walletconnect/.test(filename)
!/@walletconnect/.test(filename) &&
!/@web3modal/.test(filename) &&
!/valtio\/vanilla/.test(filename) &&
!/@safe-global/.test(filename) &&
!/viem/.test(filename) &&
!/@web3-onboard/.test(filename) &&
!/abitype/.test(filename) &&
!/unstorage/.test(filename) &&
!/ox/.test(filename)
);
},
}
Expand All @@ -57,6 +69,8 @@ module.exports = {
},
];

config.node = { fs: 'empty' };

return {
...config,
resolve: {
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ChakraProvider, useColorMode } from '@chakra-ui/react';
import { Fonts, theme } from '@explorer/ui';
import '@fontsource/rubik';
import { MINIMAL_VIEWPORTS } from '@storybook/addon-viewport';
import { RouterContext } from 'next/dist/shared/lib/router-context.shared-runtime';
import { useEffect } from 'react';
import { withPerformance } from 'storybook-addon-performance';

Expand All @@ -24,6 +25,9 @@ export const parameters = {
date: /Date$/,
},
},
nextRouter: {
Provider: RouterContext.Provider,
},
viewport: {
viewports: MINIMAL_VIEWPORTS,
},
Expand Down

0 comments on commit 6bceea4

Please sign in to comment.