Skip to content

Commit 1dc9f0d

Browse files
Remove storybook and setup lightweight ladle alternative (#7666)
1 parent 6c6f5ab commit 1dc9f0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+691
-3047
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module.exports = {
4646
'rules',
4747
'out',
4848
'.hive',
49+
'packages/web/app/.ladle/**',
4950
'public',
5051
'packages/web/app/src/graphql/index.ts',
5152
'packages/libraries/cli/src/sdk.ts',

.github/workflows/main.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ jobs:
7979
uses: ./.github/workflows/website.yaml
8080
secrets: inherit
8181

82-
# Deploy Storybook to CloudFlare Pages
83-
storybook:
84-
uses: ./.github/workflows/storybook.yaml
85-
secrets: inherit
86-
8782
# GraphQL Schema Publish
8883
graphql-schema:
8984
uses: ./.github/workflows/graphql-schema-publish.yaml

.github/workflows/pr.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ jobs:
8989
if: ${{ !github.event.pull_request.head.repo.fork }}
9090
secrets: inherit
9191

92-
# Deploy Storybook preview to CloudFlare Pages
93-
storybook-preview:
94-
uses: ./.github/workflows/storybook.yaml
95-
if: ${{ !github.event.pull_request.head.repo.fork }}
96-
secrets: inherit
97-
9892
# Release alpha version on NPM for Hive libraries
9993
alpha:
10094
uses: ./.github/workflows/release-alpha.yaml

.github/workflows/storybook.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ __snapshots__/
1313
/packages/web/app/src/graphql/index.ts
1414
/packages/web/app/next.config.mjs
1515
/packages/migrations/test/utils/testkit.ts
16-
/packages/web/app/storybook-static
1716
/packages/web/docs/out/
1817
/packages/web/docs/public/privacy-policy.html
1918

packages/web/app/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
# production
1616
/build
1717

18-
# storybook
19-
/storybook-static
20-
2118
# misc
2219
.DS_Store
2320
*.pem
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import '../src/index.css';
2+
import { useEffect } from 'react';
3+
import type { GlobalProvider } from '@ladle/react';
4+
import { ThemeProvider, useTheme } from '../src/components/theme/theme-provider';
5+
6+
function ThemeSynchronizer({ theme }: { theme: string }) {
7+
const { setTheme } = useTheme();
8+
useEffect(() => {
9+
if (theme === 'dark' || theme === 'light') {
10+
setTheme(theme);
11+
} else {
12+
setTheme('system');
13+
}
14+
}, [theme, setTheme]);
15+
return null;
16+
}
17+
18+
export const Provider: GlobalProvider = ({ children, globalState }) => (
19+
<ThemeProvider>
20+
<ThemeSynchronizer theme={globalState.theme} />
21+
{children}
22+
</ThemeProvider>
23+
);

packages/web/app/.ladle/config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import('@ladle/react').UserConfig} */
2+
export default {
3+
stories: 'src/**/*.stories.{js,jsx,ts,tsx}',
4+
viteConfig: '.ladle/vite.config.ts',
5+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vite';
2+
import tsconfigPaths from 'vite-tsconfig-paths';
3+
import tailwindcss from '@tailwindcss/vite';
4+
5+
export default defineConfig({
6+
plugins: [tsconfigPaths(), tailwindcss()],
7+
});

packages/web/app/.storybook/main.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)