Skip to content

Commit 011941d

Browse files
authored
feat: add material ui and tsup (#422)
1 parent 83b2804 commit 011941d

File tree

23 files changed

+694
-88
lines changed

23 files changed

+694
-88
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ This repo uses the following open source packages:
4040
- [Next.js](https://nextjs.org)
4141
- [Prettier](https://www.npmjs.com/package/prettier)
4242
- [Storybook](https://storybook.js.org/)
43+
- [tsup](https://github.com/egoist/tsup)
4344
- [Turborepo](https://turbo.build/)
4445

46+
4547
## How to contribute
4648

4749
1. Fork the Project

apps/docs/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Image, { type ImageProps } from "next/image";
2-
import { Button } from "@repo/ui/button";
2+
import { Button } from "@repo/ui";
33
import styles from "./page.module.css";
44

55
type Props = Omit<ImageProps, "src"> & {

apps/storybook/.storybook/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const config: StorybookConfig = {
1414
addons: [
1515
getAbsolutePath("@storybook/addon-onboarding"),
1616
getAbsolutePath("@storybook/addon-essentials"),
17-
getAbsolutePath("@chromatic-com/storybook"),
1817
getAbsolutePath("@storybook/addon-interactions"),
1918
],
2019
framework: {

apps/storybook/.storybook/preview.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
import type { Preview } from "@storybook/react";
2+
import '@fontsource/roboto/300.css';
3+
import '@fontsource/roboto/400.css';
4+
import '@fontsource/roboto/500.css';
5+
import '@fontsource/roboto/700.css';
6+
import '@fontsource/material-icons';
7+
8+
import { CssBaseline, ThemeProvider } from '@mui/material';
9+
import { withThemeFromJSXProvider } from '@storybook/addon-themes';
10+
import theme from '@repo/ui/theme';
211

312
const preview: Preview = {
413
parameters: {
@@ -11,4 +20,16 @@ const preview: Preview = {
1120
},
1221
};
1322

23+
export const decorators = [
24+
withThemeFromJSXProvider({
25+
themes: {
26+
default: theme,
27+
},
28+
defaultTheme: 'default',
29+
Provider: ThemeProvider,
30+
GlobalStyles: CssBaseline,
31+
}),
32+
];
33+
34+
1435
export default preview;

apps/storybook/package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "storybook",
2+
"name": "@repo/storybook",
33
"version": "0.1.0",
44
"private": true,
55
"type": "module",
@@ -12,15 +12,19 @@
1212
"build:storybook": "storybook build"
1313
},
1414
"dependencies": {
15+
"@emotion/react": "^11.0.0-rc.0",
16+
"@emotion/styled": "^11.14.0",
17+
"@fontsource/material-icons": "^5.1.0",
18+
"@fontsource/roboto": "^5.1.0",
1519
"@repo/ui": "*",
20+
"@storybook/addon-themes": "^8.4.7",
1621
"next": "^15.1.0",
1722
"react": "^19.0.0",
1823
"react-dom": "^19.0.0"
1924
},
2025
"devDependencies": {
2126
"@repo/eslint-config": "*",
2227
"@repo/typescript-config": "*",
23-
"@chromatic-com/storybook": "^3.2.3",
2428
"@storybook/addon-essentials": "^8.4.7",
2529
"@storybook/addon-interactions": "^8.4.7",
2630
"@storybook/addon-onboarding": "^8.4.7",
@@ -29,11 +33,12 @@
2933
"@storybook/react": "^8.4.7",
3034
"@storybook/test": "^8.4.7",
3135
"@types/node": "^20",
32-
"@types/react": "^18",
33-
"@types/react-dom": "^18",
36+
"@types/react": "18.3.1",
37+
"@types/react-dom": "18.3.1",
3438
"postcss": "^8",
3539
"storybook": "^8.4.7",
3640
"tailwindcss": "^3.4.1",
37-
"typescript": "^5"
41+
"typescript": "^5.5.4",
42+
"webpack": "^5"
3843
}
39-
}
44+
}

apps/web/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@
1111
"check-types": "tsc --noEmit"
1212
},
1313
"dependencies": {
14+
"@emotion/cache": "^11.14.0",
15+
"@emotion/react": "^11.14.0",
16+
"@mui/material-nextjs": "^6.3.0",
1417
"@repo/ui": "*",
1518
"next": "^15.1.0",
1619
"react": "^19.0.0",
17-
"react-dom": "^19.0.0"
20+
"react-dom": "^19.0.0",
21+
"@mui/material": "^6.3.0"
1822
},
1923
"devDependencies": {
2024
"@repo/eslint-config": "*",
2125
"@repo/typescript-config": "*",
2226
"@types/node": "^20",
2327
"@types/react": "18.3.1",
24-
"@types/react-dom": "18.3.0",
28+
"@types/react-dom": "18.3.1",
2529
"typescript": "5.5.4"
2630
}
27-
}
31+
}

apps/web/src/app/layout.tsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import type { Metadata } from "next";
2-
import localFont from "next/font/local";
32
import "./globals.css";
3+
import { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';
44

5-
const geistSans = localFont({
6-
src: "./fonts/GeistVF.woff",
7-
variable: "--font-geist-sans",
8-
});
9-
const geistMono = localFont({
10-
src: "./fonts/GeistMonoVF.woff",
11-
variable: "--font-geist-mono",
5+
import { Roboto } from 'next/font/google';
6+
import { ThemeProvider } from '@mui/material/styles';
7+
import theme from '@repo/ui/theme';
8+
9+
const roboto = Roboto({
10+
weight: ['300', '400', '500', '700'],
11+
subsets: ['latin'],
12+
display: 'swap',
13+
variable: '--font-roboto',
1214
});
1315

1416
export const metadata: Metadata = {
@@ -23,8 +25,12 @@ export default function RootLayout({
2325
}>) {
2426
return (
2527
<html lang="en">
26-
<body className={`${geistSans.variable} ${geistMono.variable}`}>
27-
{children}
28+
<body className={roboto.variable}>
29+
<AppRouterCacheProvider>
30+
<ThemeProvider theme={theme}>
31+
{children}
32+
</ThemeProvider>
33+
</AppRouterCacheProvider>
2834
</body>
2935
</html>
3036
);

apps/web/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Image, { type ImageProps } from "next/image";
2-
import { Button } from "@repo/ui/button";
2+
import { Button } from "@repo/ui";
33
import styles from "./page.module.css";
44

55
type Props = Omit<ImageProps, "src"> & {

packages/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"eslint-plugin-turbo": "^2.3.0",
2222
"eslint-plugin-storybook": "^0.11.1",
2323
"globals": "^15.12.0",
24-
"typescript": "^5.3.3",
24+
"typescript": "^5.5.4",
2525
"typescript-eslint": "^8.15.0"
2626
}
2727
}

packages/ui/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# build
2+
.dist

0 commit comments

Comments
 (0)