Skip to content

Commit d371f60

Browse files
committed
Merge branch 'develop' into init/#28/router
2 parents fa95b8c + 9c5a986 commit d371f60

39 files changed

+5562
-848
lines changed

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: '20'
25+
node-version: '22'
2626
cache: 'pnpm'
2727
cache-dependency-path: 'pnpm-lock.yaml'
2828

.github/workflows/chromatic.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Workflow name
2+
name: 'Chromatic Deployment'
3+
run-name: ${{ github.actor }}의 스토리북 배포
4+
5+
# Event for the workflow
6+
on:
7+
pull_request:
8+
branches: ['develop']
9+
push:
10+
branches: ['develop', 'main']
11+
12+
# Permission settings
13+
permissions:
14+
contents: read
15+
pull-requests: write
16+
17+
# List of jobs
18+
jobs:
19+
chromatic:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
status: ${{ job.status }}
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v2
31+
with:
32+
version: 8
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '20'
38+
cache: 'pnpm'
39+
40+
- name: Install dependencies
41+
run: pnpm install --no-frozen-lockfile
42+
43+
- name: Publish to Chromatic
44+
id: chromatic
45+
uses: chromaui/action@v1
46+
with:
47+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
48+
token: ${{ secrets.GITHUB_TOKEN }}
49+
onlyChanged: true
50+
51+
- name: Comment PR
52+
if: github.event_name == 'pull_request'
53+
uses: thollander/actions-comment-pull-request@v2
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
message: |
58+
### 🎨 스토리북 배포 완료!
59+
60+
👉 [스토리북 미리보기](${{ steps.chromatic.outputs.storybookUrl }})
61+
62+
변경된 컴포넌트의 디자인을 확인해주세요.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ jobs:
2828
- name: Set up Node.js
2929
uses: actions/setup-node@v4
3030
with:
31-
node-version: '20'
31+
node-version: '22'
3232
cache: 'pnpm'
3333
cache-dependency-path: 'pnpm-lock.yaml'
34-
34+
3535
- name: Install dependencies
3636
run: pnpm install --frozen-lockfile
37-
37+
3838
- name: Run Lint
3939
run: pnpm lint
4040

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ dist-ssr
2424
*.sw?
2525

2626
.env
27+
28+
*storybook.log
29+
storybook-static

.storybook/main.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { StorybookConfig } from '@storybook/react-vite';
2+
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
3+
4+
const config: StorybookConfig = {
5+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
6+
addons: [
7+
'@chromatic-com/storybook',
8+
'@storybook/addon-docs',
9+
'@storybook/addon-a11y',
10+
'@storybook/addon-vitest',
11+
],
12+
framework: {
13+
name: '@storybook/react-vite',
14+
options: {},
15+
},
16+
viteFinal: (config) => {
17+
config.plugins = config.plugins || [];
18+
config.plugins.push(vanillaExtractPlugin());
19+
return config;
20+
},
21+
};
22+
export default config;

.storybook/preview.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import type { Preview } from '@storybook/react';
2+
import '../src/style/reset.css';
3+
import '../src/style/global.css';
4+
5+
const preview: Preview = {
6+
parameters: {
7+
actions: { argTypesRegex: '^on[A-Z].*' },
8+
controls: {
9+
matchers: {
10+
color: /(background|color)$/i,
11+
date: /Date$/i,
12+
},
13+
},
14+
15+
a11y: {
16+
// 'todo' - show a11y violations in the test UI only
17+
// 'error' - fail CI on a11y violations
18+
// 'off' - skip a11y checks entirely
19+
test: 'todo',
20+
},
21+
},
22+
};
23+
24+
export default preview;

.storybook/vitest.setup.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import '@storybook/addon-a11y/preview';
2+
3+
import { setProjectAnnotations } from '@storybook/react-vite';
4+
import * as globalStorybookConfig from './preview';
5+
6+
// This is an important step to apply the right configuration when testing your stories.
7+
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
8+
setProjectAnnotations(globalStorybookConfig);

eslint.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2+
import storybook from "eslint-plugin-storybook";
3+
14
import js from '@eslint/js';
25
import globals from 'globals';
36
import react from 'eslint-plugin-react';
@@ -56,4 +59,4 @@ export default tseslint.config({
5659
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
5760
'prettier/prettier': 'error',
5861
},
59-
});
62+
}, storybook.configs["flat/recommended"]);

package.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,38 @@
88
"build": "tsc -b && vite build",
99
"lint": "eslint .",
1010
"preview": "vite preview",
11-
"svgr": "npx @svgr/cli -d src/assets/svg --ignore-existing --typescript --no-dimensions public/svg"
11+
"svgr": "npx @svgr/cli -d src/assets/svg --ignore-existing --typescript --no-dimensions public/svg",
12+
"storybook": "storybook dev -p 6006",
13+
"build-storybook": "storybook build",
14+
"chromatic": "chromatic --exit-zero-on-changes"
1215
},
1316
"dependencies": {
17+
"@reduxjs/toolkit": "^2.8.2",
1418
"axios": "^1.10.0",
1519
"react": "^19.1.0",
1620
"react-dom": "^19.1.0",
21+
"react-redux": "^9.2.0"
22+
"react-dom": "^19.1.0",
1723
"react-router-dom": "^7.6.3"
1824
},
1925
"devDependencies": {
26+
"@chromatic-com/storybook": "^4.0.1",
2027
"@eslint/js": "^9.29.0",
28+
"@storybook/addon-a11y": "^9.0.15",
29+
"@storybook/addon-docs": "^9.0.15",
30+
"@storybook/addon-essentials": "^8.6.14",
31+
"@storybook/addon-vitest": "^9.0.15",
32+
"@storybook/blocks": "^8.6.14",
33+
"@storybook/react": "^9.0.15",
34+
"@storybook/react-vite": "^9.0.15",
2135
"@types/react": "^19.1.2",
2236
"@types/react-dom": "^19.1.2",
2337
"@vanilla-extract/css": "^1.17.4",
2438
"@vanilla-extract/vite-plugin": "^5.0.7",
2539
"@vitejs/plugin-react-swc": "^3.9.0",
40+
"@vitest/browser": "^3.2.4",
41+
"@vitest/coverage-v8": "^3.2.4",
42+
"chromatic": "^13.1.2",
2643
"eslint": "^9.29.0",
2744
"eslint-config-prettier": "^10.1.5",
2845
"eslint-plugin-import": "^2.32.0",
@@ -31,12 +48,16 @@
3148
"eslint-plugin-react": "^7.37.5",
3249
"eslint-plugin-react-hooks": "^5.2.0",
3350
"eslint-plugin-react-refresh": "^0.4.20",
51+
"eslint-plugin-storybook": "^9.0.15",
3452
"globals": "^16.2.0",
53+
"playwright": "^1.53.2",
3554
"prettier": "^3.6.0",
55+
"storybook": "^9.0.15",
3656
"typescript": "~5.8.3",
3757
"typescript-eslint": "^8.34.1",
3858
"vite": "^6.3.5",
39-
"vite-plugin-svgr": "^4.3.0"
59+
"vite-plugin-svgr": "^4.3.0",
60+
"vitest": "^3.2.4"
4061
},
4162
"packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184"
4263
}

0 commit comments

Comments
 (0)