-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(dev-deps): bump storybook to v8
- Loading branch information
Showing
42 changed files
with
2,130 additions
and
5,806 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
interface ProcessEnv { | ||
DISABLE_HMR?: 'true' | 'false' | undefined; | ||
USE_PRODUCTION_BUILD?: 'true' | 'false' | undefined; | ||
} | ||
|
||
interface Process { | ||
env: ProcessEnv; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import type { Options } from '@swc/core'; | ||
import type { StorybookConfig } from '@storybook/react-webpack5'; | ||
import { resolve } from 'path'; | ||
import { config as dotenvConfig } from 'dotenv'; | ||
|
||
dotenvConfig(); | ||
|
||
const storybookConfig: StorybookConfig = { | ||
typescript: { | ||
check: true, | ||
checkOptions: { | ||
typescript: { | ||
configFile: './stories/tsconfig.json', | ||
}, | ||
}, | ||
}, | ||
addons: [ | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-storysource', | ||
'@storybook/addon-webpack5-compiler-swc', | ||
], | ||
|
||
core: { | ||
disableTelemetry: true, | ||
}, | ||
|
||
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'], | ||
|
||
webpackFinal: async (config) => { | ||
// We need to disable the hot module reloading when we run the lighthouse audit, | ||
// because it wait for the load to finish, but the /__webpack_hmr query never ends. | ||
// https://github.com/storybookjs/storybook/issues/3062#issuecomment-504550789 | ||
if (process.env.DISABLE_HMR === 'true') { | ||
config.entry = (config.entry as string[]).filter( | ||
(singleEntry) => !singleEntry.includes('/webpack-hot-middleware/'), | ||
); | ||
} | ||
|
||
return config; | ||
}, | ||
|
||
framework: { | ||
name: '@storybook/react-webpack5', | ||
|
||
options: { | ||
// FIXME: The way we generate data isn't working properly with StrictMode | ||
strictMode: false, | ||
}, | ||
}, | ||
|
||
docs: { | ||
autodocs: false, | ||
}, | ||
|
||
swc: (config: Options): Options => { | ||
return { | ||
...config, | ||
jsc: { | ||
...(config?.jsc || {}), | ||
baseUrl: resolve(__dirname), | ||
paths: { | ||
'@hello-pangea/dnd': [ | ||
process.env.USE_PRODUCTION_BUILD === 'true' | ||
? resolve(__dirname, '../dist/dnd.esm') | ||
: resolve(__dirname, '../src/index.ts'), | ||
], | ||
}, | ||
}, | ||
}; | ||
}, | ||
}; | ||
|
||
export default storybookConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
import '@atlaskit/css-reset'; | ||
|
||
import { DecoratorFn } from '@storybook/react'; | ||
import { Preview } from '@storybook/react'; | ||
import React from 'react'; | ||
import { resetData } from '../stories/src/data'; | ||
import GlobalStyles from './custom-decorators/global-styles'; | ||
import welcomeMessage from './welcome-message'; | ||
|
||
welcomeMessage(); | ||
|
||
export const decorators: DecoratorFn[] = [ | ||
(story, { id }: { id: string }) => { | ||
resetData(id); | ||
const preview: Preview = { | ||
decorators: [ | ||
(Story, { id }) => { | ||
resetData(id); | ||
|
||
return story({ key: id }); | ||
}, | ||
(story) => <GlobalStyles>{story()}</GlobalStyles>, | ||
]; | ||
|
||
export const parameters = { | ||
layout: 'fullscreen', | ||
return <Story key={id} />; | ||
}, | ||
(Story) => ( | ||
<GlobalStyles> | ||
<Story /> | ||
</GlobalStyles> | ||
), | ||
], | ||
parameters: { | ||
layout: 'fullscreen', | ||
|
||
options: { | ||
storySort: { | ||
order: ['Welcome', 'Examples'], | ||
options: { | ||
storySort: { | ||
order: ['Welcome', 'Examples'], | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.