Skip to content

Commit 418933d

Browse files
committed
feat: setup chromatic
1 parent a4cfd34 commit 418933d

File tree

11 files changed

+366
-1315
lines changed

11 files changed

+366
-1315
lines changed

.github/workflows/chromatic.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Chromatic
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
chromatic:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- name: pnpm 설치
15+
uses: pnpm/action-setup@v4
16+
with:
17+
run_install: false
18+
- name: Node.js 환경 설정
19+
uses: actions/setup-node@v4
20+
with:
21+
cache: pnpm
22+
node-version-file: .nvmrc
23+
- name: 의존성 설치
24+
run: pnpm install
25+
- name: Run Chromatic
26+
uses: chromaui/action@latest
27+
with:
28+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,6 @@ dist
174174
# Finder (MacOS) folder config
175175
.DS_Store
176176

177-
*storybook.log
177+
# Storybook
178+
*storybook.log
179+
storybook-static

.storybook/main.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { StorybookConfig } from '@storybook/react-vite';
2+
3+
export default {
4+
stories: [
5+
'../packages/**/*.mdx',
6+
'../packages/**/*.stories.@(js|jsx|mjs|ts|tsx)',
7+
],
8+
addons: [
9+
'@storybook/addon-essentials',
10+
'@storybook/addon-interactions',
11+
'@storybook/addon-links',
12+
],
13+
framework: {
14+
name: '@storybook/react-vite',
15+
options: {},
16+
},
17+
} satisfies StorybookConfig;

.storybook/preview.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import 'sanitize.css';
2+
import 'sanitize.css/typography.css';
3+
import type { Preview } from '@storybook/react';
4+
5+
export default {
6+
tags: ['autodocs'],
7+
} satisfies Preview;

chromatic.config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://www.chromatic.com/config-file.schema.json",
3+
"buildScriptName": "build:storybook"
4+
}

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,26 @@
22
"name": "sipe-design-system",
33
"private": true,
44
"type": "module",
5+
"scripts": {
6+
"build:storybook": "storybook build",
7+
"dev:storybook": "storybook dev -p 6006"
8+
},
59
"devDependencies": {
610
"@biomejs/biome": "catalog:",
711
"@changesets/cli": "^2.27.9",
12+
"@storybook/addon-essentials": "catalog:",
13+
"@storybook/addon-interactions": "catalog:",
14+
"@storybook/addon-links": "catalog:",
15+
"@storybook/blocks": "catalog:",
16+
"@storybook/react": "catalog:",
17+
"@storybook/react-vite": "catalog:",
18+
"@storybook/test": "catalog:",
819
"@tsconfig/strictest": "^2.0.5",
920
"@types/node": "^22.8.1",
21+
"chromatic": "^11.19.0",
1022
"knip": "catalog:",
23+
"sanitize.css": "^13.0.0",
24+
"storybook": "catalog:",
1125
"typescript": "catalog:"
1226
},
1327
"packageManager": "[email protected]"

packages/Input/src/Input.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useRef, useState } from 'react';
33
import { Action, Input } from './Input';
44

55
const meta = {
6+
title: 'Input',
67
component: Input,
78
parameters: {
89
layout: 'centered',

packages/skeleton/src/Skeleton.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Meta, StoryObj } from '@storybook/react';
44
import { Skeleton } from './Skeleton';
55

66
const meta = {
7+
title: 'Skeleton',
78
component: Skeleton,
89
parameters: {
910
layout: 'centered',

packages/typography/src/Typography.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
22
import { Typography } from './Typography';
33

44
const meta = {
5+
title: 'Typography',
56
component: Typography,
67
parameters: {
78
layout: 'centered',

0 commit comments

Comments
 (0)