Skip to content

Commit 94651d0

Browse files
committed
refactor(#54): Storybook 패키지 변경
1 parent 30bf476 commit 94651d0

File tree

7 files changed

+360
-751
lines changed

7 files changed

+360
-751
lines changed

.storybook/main.ts

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1-
import type { StorybookConfig } from "@storybook/experimental-nextjs-vite";
1+
import type { StorybookConfig } from "@storybook/nextjs-vite";
22
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
33
import svgr from "vite-plugin-svgr";
44
import tsconfigPaths from "vite-tsconfig-paths";
55

66
const config: StorybookConfig = {
77
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
8-
addons: ["@storybook/addon-essentials"],
8+
addons: [
9+
"@chromatic-com/storybook",
10+
"@storybook/addon-docs",
11+
"@storybook/addon-a11y",
12+
"@storybook/addon-vitest",
13+
],
914
framework: {
10-
name: "@storybook/experimental-nextjs-vite",
15+
name: "@storybook/nextjs-vite",
1116
options: {},
1217
},
18+
features: {
19+
experimentalRSC: true,
20+
},
1321
staticDirs: ["../public"],
14-
viteFinal: async config => {
15-
config.plugins = [
16-
...(config.plugins || []),
17-
tsconfigPaths(),
18-
vanillaExtractPlugin(),
19-
svgr(),
20-
];
21-
return config;
22+
async viteFinal(config) {
23+
return {
24+
...config,
25+
plugins: [
26+
...(config.plugins ?? []),
27+
svgr(),
28+
vanillaExtractPlugin(),
29+
tsconfigPaths(),
30+
],
31+
};
2232
},
2333
};
2434
export default config;

.storybook/preview.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import "@/styles/reset.css.ts";
22

3-
import type { Preview } from "@storybook/react";
3+
import type { Preview } from "@storybook/nextjs-vite";
44

55
const preview: Preview = {
66
parameters: {
@@ -10,6 +10,13 @@ const preview: Preview = {
1010
date: /Date$/i,
1111
},
1212
},
13+
14+
a11y: {
15+
// 'todo' - show a11y violations in the test UI only
16+
// 'error' - fail CI on a11y violations
17+
// 'off' - skip a11y checks entirely
18+
test: "todo",
19+
},
1320
},
1421
};
1522

.storybook/vitest.setup.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { beforeAll } from 'vitest';
2-
import { setProjectAnnotations } from '@storybook/experimental-nextjs-vite';
3-
import * as projectAnnotations from './preview';
1+
import { setProjectAnnotations } from "@storybook/nextjs-vite";
2+
import { beforeAll } from "vitest";
3+
4+
import * as projectAnnotations from "./preview";
45

56
// This is an important step to apply the right configuration when testing your stories.
67
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
78
const project = setProjectAnnotations([projectAnnotations]);
89

9-
beforeAll(project.beforeAll);
10+
beforeAll(project.beforeAll);

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@
3030
"vaul": "^1.1.2"
3131
},
3232
"devDependencies": {
33+
"@chromatic-com/storybook": "^4.0.1",
3334
"@commitlint/cli": "^19.8.1",
3435
"@commitlint/config-conventional": "^19.8.1",
3536
"@commitlint/cz-commitlint": "^19.8.1",
3637
"@commitlint/types": "^19.8.1",
3738
"@eslint/eslintrc": "^3",
3839
"@playwright/test": "^1.52.0",
39-
"@storybook/addon-essentials": "^8.6.14",
40-
"@storybook/blocks": "^8.6.14",
41-
"@storybook/experimental-nextjs-vite": "8.6.14",
42-
"@storybook/react": "^8.6.14",
40+
"@storybook/addon-a11y": "^9.0.15",
41+
"@storybook/addon-docs": "^9.0.15",
42+
"@storybook/addon-vitest": "^9.0.15",
43+
"@storybook/nextjs-vite": "^9.0.15",
4344
"@svgr/webpack": "^8.1.0",
4445
"@testing-library/dom": "^10.4.0",
4546
"@testing-library/jest-dom": "^6.6.3",
@@ -62,6 +63,7 @@
6263
"eslint-plugin-jest-dom": "^5.5.0",
6364
"eslint-plugin-playwright": "^2.2.0",
6465
"eslint-plugin-simple-import-sort": "^12.1.1",
66+
"eslint-plugin-storybook": "^9.0.15",
6567
"eslint-plugin-testing-library": "^7.3.0",
6668
"inquirer": "^12.6.3",
6769
"jsdom": "^26.1.0",
@@ -70,8 +72,9 @@
7072
"msw": "^2.8.4",
7173
"playwright": "^1.52.0",
7274
"prettier": "^3.5.3",
73-
"storybook": "^8.6.14",
75+
"storybook": "^9.0.15",
7476
"typescript": "^5",
77+
"vite": "6.2.0",
7578
"vite-plugin-svgr": "^4.3.0",
7679
"vite-tsconfig-paths": "^5.1.4",
7780
"vitest": "^3.1.4"

0 commit comments

Comments
 (0)