Skip to content

Commit

Permalink
fix: fix storybook build
Browse files Browse the repository at this point in the history
  • Loading branch information
PupoSDC committed Nov 25, 2023
1 parent 2c640e0 commit 151a69a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
19 changes: 9 additions & 10 deletions apps/docs/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import type { StorybookConfig } from "@storybook/nextjs";

const config: StorybookConfig = {
framework: "@storybook/nextjs",
framework: {
name: "@storybook/nextjs",
options: {
builder: {
useSWC: true,
},
},
},
stories: [
"../**/*.stories.tsx",
"../**/*.mdx",
Expand All @@ -16,19 +23,11 @@ const config: StorybookConfig = {
staticDirs: ["../public"],
typescript: {
reactDocgen: "react-docgen-typescript",
skipBabel: false,
check: false,
skipBabel: true,
},
features: {},
webpackFinal: async (config) => ({
...config,
resolve: {
...config.resolve,
fallback: {
...config.resolve?.fallback,
crypto: false,
},
},
ignoreWarnings: [/Failed to parse source map/],
}),
};
Expand Down
5 changes: 4 additions & 1 deletion apps/docs/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Suspense, useEffect } from "react";
import React, { Suspense, useEffect } from "react";
import { default as CssBaseline } from "@mui/joy/CssBaseline";
import { default as Typography } from "@mui/joy/Typography";
import { CssVarsProvider, extendTheme, useColorScheme } from "@mui/joy/styles";
Expand All @@ -12,6 +12,9 @@ import { trpc } from "@chair-flight/trpc/client";
import type { TypographyProps } from "@mui/joy";
import "@fontsource/public-sans";

// TODO this is a complete hack. Open ticket with SB
window.React = React;

initialize({
onUnhandledRequest: ({ method, url }) => {
if (url.pathname.includes("/trpc")) {
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@
"zustand": "^4.4.6"
},
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/preset-react": "^7.23.3",
"@next/bundle-analyzer": "^14.0.3",
"@nx/cypress": "^17.1.3",
"@nx/eslint-plugin": "^17.1.3",
Expand Down
6 changes: 0 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 151a69a

Please sign in to comment.