Skip to content

Commit 9e530fd

Browse files
committed
re-add Storybook
1 parent 5d0d808 commit 9e530fd

53 files changed

Lines changed: 4091 additions & 123 deletions

File tree

Some content is hidden

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

.github/workflows/chromatic.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Chromatic
2+
3+
on: push
4+
5+
jobs:
6+
visual_regression_check:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v5
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Install pnpm
16+
uses: pnpm/action-setup@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v5
20+
with:
21+
node-version-file: ".nvmrc"
22+
cache: "pnpm"
23+
24+
- name: Install dependencies
25+
run: pnpm install --frozen-lockfile
26+
27+
- name: Publish to Chromatic
28+
uses: chromaui/action@latest
29+
with:
30+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
31+
autoAcceptChanges: main
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
buildScriptName: storybook:build

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,8 @@ tsconfig.tsbuildinfo
9595

9696
# MCP config (local tool settings)
9797
.mcp.json
98+
# Storybook
99+
storybook-static
100+
98101
# next-agents-md
99102
.next-docs/

eslint.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import eslintPluginLodash from 'eslint-plugin-lodash';
1414
import eslintPluginPlaywright from 'eslint-plugin-playwright';
1515
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
1616
import reactYouMightNotNeedAnEffect from 'eslint-plugin-react-you-might-not-need-an-effect';
17+
import eslintPluginStorybook from 'eslint-plugin-storybook';
1718

1819

1920
const compat = new FlatCompat({
@@ -43,6 +44,7 @@ export default defineConfig(
4344
'playwright-report/**',
4445
'test-results/**',
4546
'public/**',
47+
'src/.storybook/**',
4648
'*.svg',
4749
'prettier.config.js',
4850
]),
@@ -412,6 +414,9 @@ export default defineConfig(
412414
},
413415
},
414416

417+
// ── Storybook stories ──
418+
...eslintPluginStorybook.configs['flat/recommended'],
419+
415420
// ── Prettier (must be last) ──
416421
eslintPluginPrettierRecommended,
417422
);

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"build": "next build",
77
"build:analyze": "cross-env ANALYZE=true next build",
8+
"chromatic": "chromatic --exit-zero-on-changes",
89
"dev": "next -p 3000",
910
"format": "prettier --write \"**/*\"",
1011
"format:md": "prettier --write \"**/*.md\"",
@@ -14,6 +15,8 @@
1415
"postbuild": "next-sitemap --config next-sitemap.config.ts",
1516
"prepare": "husky",
1617
"start": "next start -p 3000",
18+
"storybook": "storybook dev -p 6006 -c src/.storybook",
19+
"storybook:build": "storybook build -c src/.storybook",
1720
"test:e2e": "export LOCAL_PLAYWRIGHT=true && playwright test --headed",
1821
"test:e2e:debug": "pnpm test:e2e --debug",
1922
"test:e2e:dev": "export LOCAL_PLAYWRIGHT=true && playwright test --ui",
@@ -72,6 +75,8 @@
7275
"@faker-js/faker": "^10.4.0",
7376
"@next/eslint-plugin-next": "^16.2.3",
7477
"@playwright/test": "^1.59.1",
78+
"@storybook/addon-docs": "^10.3.5",
79+
"@storybook/nextjs": "^10.3.5",
7580
"@svgr/webpack": "^8.1.0",
7681
"@tailwindcss/postcss": "^4.2.2",
7782
"@testing-library/jest-dom": "^6.9.1",
@@ -90,6 +95,7 @@
9095
"@vitest/ui": "^4.1.4",
9196
"axios-mock-adapter": "^2.1.0",
9297
"babel-plugin-react-compiler": "^1.0.0",
98+
"chromatic": "^16.2.0",
9399
"cross-env": "^10.1.0",
94100
"dotenv": "^17.4.1",
95101
"eslint": "^10.2.0",
@@ -103,6 +109,7 @@
103109
"eslint-plugin-prettier": "^5.5.5",
104110
"eslint-plugin-react-hooks": "^7.0.1",
105111
"eslint-plugin-react-you-might-not-need-an-effect": "^0.9.3",
112+
"eslint-plugin-storybook": "^10.3.5",
106113
"eslint-plugin-unicorn": "^64.0.0",
107114
"husky": "^9.1.7",
108115
"jsdom": "^29.0.2",
@@ -111,6 +118,7 @@
111118
"prettier": "^3.8.2",
112119
"prettier-plugin-tailwindcss": "^0.7.2",
113120
"shadcn": "^4.2.0",
121+
"storybook": "^10.3.5",
114122
"tailwindcss": "^4.2.2",
115123
"typescript": "^6.0.2",
116124
"typescript-eslint": "^8.58.1",

0 commit comments

Comments
 (0)