Skip to content

Commit 12dd1b7

Browse files
authored
Merge pull request #31 from FE9-2/feature/new-structure
refactor: 라이브러리 재설정, 폴더 구조 변경 및 관련 파일 수정
2 parents e3cc631 + af97fa8 commit 12dd1b7

Some content is hidden

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

43 files changed

+12292
-7667
lines changed

.github/workflows/chromatic.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Preview # 워크플로우 이름
2+
3+
on:
4+
pull_request: # 특정 이벤트 발생 시 실행
5+
branches: ["main", "dev"] # main과 dev 브랜치에서 PR 생성 시 실행
6+
7+
permissions: # GitHub Actions의 권한 설정
8+
contents: write # 콘텐츠를 읽고 쓰는 권한
9+
pages: write # GitHub Pages 배포 권한
10+
deployments: write # 배포 권한
11+
id-token: write # OIDC 토큰 생성 권한
12+
issues: write # 이슈 생성 및 편집 권한
13+
pull-requests: write # PR 생성 및 편집 권한
14+
15+
jobs:
16+
storybook-preview:
17+
runs-on: ubuntu-20.04 # 워크플로우 실행 환경 (Ubuntu 20.04)
18+
env:
19+
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
20+
steps:
21+
- name: 저장소 체크아웃
22+
uses: actions/checkout@v3 # GitHub Actions의 공식 체크아웃 액션
23+
with:
24+
fetch-depth: 0 # 전체 Git 기록을 가져옴 (CI 최적화를 위해 기본값은 1)
25+
26+
- name: 캐시 종속성
27+
id: cache
28+
uses: actions/cache@v3 # 캐시를 사용하여 빌드 속도 개선
29+
with:
30+
path: "**/node_modules" # 캐시 대상 경로
31+
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}-storybook # 캐시 키 설정
32+
33+
- name: 종속성 설치
34+
if: steps.cache.outputs.cache-hit != 'true' # 캐시가 없을 때만 실행
35+
run: yarn install # Yarn으로 프로젝트 의존성 설치
36+
37+
- name: Chromatic에 게시
38+
id: chromatic
39+
uses: chromaui/action@v1 # Chromatic의 GitHub Action
40+
with:
41+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} # 환경 변수 참조
42+
token: ${{ secrets.GITHUB_TOKEN }} # GitHub 인증 토큰
43+
onlyChanged: true # 변경된 스토리만 업로드
44+
autoAcceptChanges: true # Chromatic에서 변경 사항 자동 승인
45+
46+
- name: 현재 시간 가져오기
47+
uses: josStorer/get-current-time@v2 # 현재 시간 가져오는 액션
48+
id: current-time
49+
with:
50+
format: "YYYY년 MM월 DD일 HH시 mm분 ss초" # 시간 형식
51+
utcOffset: "+09:00" # 한국 시간대로 설정 (UTC+9)
52+
53+
outputs: # 다음 Job에서 사용할 출력값 설정
54+
storybook_url: ${{ steps.chromatic.outputs.storybookUrl }} # Chromatic URL
55+
currnent_time: ${{ steps.current-time.outputs.formattedTime }} # 포맷된 현재 시간
56+
57+
github-bot-storybook:
58+
runs-on: ubuntu-latest # 최신 Ubuntu 환경
59+
needs: [storybook-preview] # `storybook-preview` Job이 완료된 후 실행
60+
61+
steps:
62+
- name: PR 코멘트 남기기
63+
uses: thollander/actions-comment-pull-request@v2 # PR에 댓글 남기는 액션
64+
with:
65+
comment_tag: ${{github.event.number}}-storybook # 댓글 태그로 중복 방지
66+
message: |
67+
💄 Storybook: ${{ needs.storybook-preview.outputs.storybook_url }} # Chromatic에서 생성된 Storybook URL
68+
🕖 Update: ${{ needs.storybook-preview.outputs.currnent_time }} # 현재 시간

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ next-env.d.ts
4141
# vscode
4242
.vscode/
4343
.vscode/*
44+
45+
# storybook
46+
storybook-static/
47+
storybook-static/*
48+
build-storybook.log

.husky/commit-msg

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

.husky/pre-commit

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

.prettierrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@
1010
"arrowParens": "always",
1111
"proseWrap": "preserve",
1212
"endOfLine": "lf",
13-
"plugins": ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],
14-
"importOrder": ["^@/lib/(.*)$", "^@/app/(.*)$", "^@/components/(.*)$", "^[./]"],
15-
"importOrderSeparation": true,
16-
"importOrderSortSpecifiers": true
13+
"plugins": ["prettier-plugin-tailwindcss"]
1714
}

.storybook/main.ts

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

.storybook/preview.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { Preview } from "@storybook/react";
2+
3+
const preview: Preview = {
4+
parameters: {
5+
controls: {
6+
matchers: {
7+
color: /(background|color)$/i,
8+
date: /Date$/i,
9+
},
10+
},
11+
},
12+
};
13+
14+
export default preview;

commitlint.config.js

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

0 commit comments

Comments
 (0)