-
Notifications
You must be signed in to change notification settings - Fork 4.6k
🪟 🔧 Upgrade to Storybook 7 #22056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🪟 🔧 Upgrade to Storybook 7 #22056
Changes from all commits
674c8e8
bada25d
6ab502b
64dcc08
a757988
48a460f
f7cd992
7836952
6915ffa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { StorybookConfig } from "@storybook/react-vite"; | ||
|
||
const config: StorybookConfig = { | ||
framework: "@storybook/react-vite", | ||
stories: ["../src/**/*.stories.@(ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
], | ||
}; | ||
|
||
export default config; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import { addDecorator } from "@storybook/react"; | ||
|
||
import { withProviders } from "./withProvider"; | ||
|
||
import "!style-loader!css-loader!sass-loader!../public/index.css"; | ||
import "../public/index.css"; | ||
import "../src/scss/global.scss"; | ||
import "../src/globals"; | ||
|
||
addDecorator(withProviders); | ||
import "../src/dayjs-setup"; | ||
|
||
export const parameters = {}; | ||
export const decorators = [withProviders]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,11 @@ import { QueryClientProvider, QueryClient } from "react-query"; | |
import { theme } from "../src/theme"; | ||
import messages from "../src/locales/en.json"; | ||
import { FeatureService } from "../src/hooks/services/Feature"; | ||
import { ConfigServiceProvider, defaultConfig } from "../src/config"; | ||
import { ConfigServiceProvider, config } from "../src/config"; | ||
import { DocumentationPanelProvider } from "../src/views/Connector/ConnectorDocumentationLayout/DocumentationPanelContext"; | ||
import { ServicesProvider } from "../src/core/servicesProvider"; | ||
import { analyticsServiceContext } from "../src/hooks/services/Analytics"; | ||
import { AppMonitoringServiceProvider } from "../src/hooks/services/AppMonitoringService"; | ||
import type { AnalyticsService } from "../src/core/analytics"; | ||
|
||
const analyticsContextMock: AnalyticsService = { | ||
|
@@ -38,11 +39,13 @@ export const withProviders = (getStory) => ( | |
<MemoryRouter> | ||
<IntlProvider messages={messages} locale={"en"}> | ||
<ThemeProvider theme={theme}> | ||
<ConfigServiceProvider defaultConfig={defaultConfig} providers={[]}> | ||
<ConfigServiceProvider config={config}> | ||
<DocumentationPanelProvider> | ||
<FeatureService features={[]}> | ||
{getStory()} | ||
</FeatureService> | ||
<AppMonitoringServiceProvider> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ️ This broke the |
||
<FeatureService features={[]}> | ||
{getStory()} | ||
</FeatureService> | ||
</AppMonitoringServiceProvider> | ||
</DocumentationPanelProvider> | ||
</ConfigServiceProvider> | ||
</ThemeProvider> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,10 @@ task buildStorybook(type: NpmTask) { | |
inputs.dir 'src' | ||
|
||
outputs.dir 'build/storybook' | ||
|
||
environment = [ | ||
'NODE_OPTIONS': '--max_old_space_size=4096' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ️ It seems storybooks compile process with Vite requires more memory. I saw CI failing with an heap out of memory error on this, so giving it more space here. |
||
] | ||
} | ||
|
||
task copyBuildOutput(type: Copy) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ This is kinda "funny" that this worked beforehand. So it seems that Storybook never did typecheck those files, until Storybook 7 (or use using a
main.ts
instead ofmain.js
).