-
Notifications
You must be signed in to change notification settings - Fork 1
Setting(design-system): storybook 설정 및 chromatic 배포 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
436e5a3
87adaf4
7a16e17
0b38e39
8953242
ff5875a
56316bd
7e0b3c4
70ae8ee
e3b0a5d
d7d7cd9
033c6d4
00d232b
3e508f5
b716d2e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,72 @@ | ||||||||||||||||||||||
| name: 'Chromatic Publish' | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| on: | ||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||
| branches: | ||||||||||||||||||||||
| - develop | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| permissions: write-all | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||
| storybook: | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - name: Checkout Repository | ||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Setup Node.js | ||||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| node-version: 20 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Install PNPM | ||||||||||||||||||||||
| run: npm i -g pnpm | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
Comment on lines
+20
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion PNPM 설치 방식 개선 및 캐시 연계 npm -g 설치 대신 공식 액션을 사용하고 Node 세팅에 PNPM 캐시를 연동하세요. - name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
+ cache: pnpm
+
- - name: Install PNPM
- run: npm i -g pnpm
+ - name: Setup PNPM
+ uses: pnpm/action-setup@v4
+ with:
+ version: 9
+ run_install: false
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| - name: Cache node modules | ||||||||||||||||||||||
| id: cache-node | ||||||||||||||||||||||
| uses: actions/cache@v3 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| path: | | ||||||||||||||||||||||
| **/node_modules | ||||||||||||||||||||||
| key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} | ||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||
| ${{ runner.os }}-node- | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
Comment on lines
+28
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actions/cache@v3 런타임 호환성 이슈 및 캐시 전략 재고(PNPM 스토어 캐시 권장) actionlint 경고대로 v3는 최신 러너와 호환되지 않습니다. 또한 PNPM은 node_modules 캐시보다 스토어 캐시(~/.pnpm-store)를 쓰는 것이 안전/효율적입니다.
- uses: actions/cache@v3
+ uses: actions/cache@v4
- - name: Cache node modules
- id: cache-node
- uses: actions/cache@v3
- with:
- path: |
- **/node_modules
- key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
- restore-keys: |
- ${{ runner.os }}-node-
+ # PNPM 스토어 캐시는 actions/setup-node@v4의 `cache: pnpm`가 관리선택지 중 하나로 정리해 주세요(권장: 후자). 📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.7)30-30: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||||||||||||||||||
| - name: Install Dependencies | ||||||||||||||||||||||
| if: steps.cache-node.outputs.cache-hit != 'true' | ||||||||||||||||||||||
| run: pnpm install --frozen-lockfile | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Build Storybook for design system(pds) | ||||||||||||||||||||||
| run: pnpm --filter @pinback/design-system run build:storybook | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Publish to Chromatic | ||||||||||||||||||||||
| id: chromatic | ||||||||||||||||||||||
| uses: chromaui/action@latest | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||||||||||||||||||||||
| workingDir: packages/design-system | ||||||||||||||||||||||
| buildScriptName: build:storybook | ||||||||||||||||||||||
| onlyChanged: true | ||||||||||||||||||||||
| autoAcceptChanges: true | ||||||||||||||||||||||
| exitOnceUploaded: true | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Comment PR on Success | ||||||||||||||||||||||
| if: success() && github.event_name == 'pull_request' | ||||||||||||||||||||||
| uses: thollander/actions-comment-pull-request@v2 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| comment_tag: ${{ github.event.number }}-storybook | ||||||||||||||||||||||
| message: | | ||||||||||||||||||||||
| ✅ Storybook chromatic 배포 확인: | ||||||||||||||||||||||
| 🐿️ [storybook](${{ steps.chromatic.outputs.storybookUrl }}) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Comment PR on Failure | ||||||||||||||||||||||
| if: failure() && github.event_name == 'pull_request' | ||||||||||||||||||||||
| uses: thollander/actions-comment-pull-request@v2 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| comment_tag: ${{ github.event.number }}-storybook | ||||||||||||||||||||||
| message: | | ||||||||||||||||||||||
| 🚨 Storybook 배포 실패 | ||||||||||||||||||||||
| : Github Actions 로그를 확인해주세요. | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,3 +40,6 @@ yarn-error.log* | |
| # typescript | ||
| # 증분 빌드 정보 파일 | ||
| *.tsbuildinfo | ||
|
|
||
| *storybook.log | ||
| storybook-static | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,5 +17,6 @@ | |
| "tailwindCSS.suggestions": true, | ||
| "editor.quickSuggestions": { | ||
| "strings": true | ||
| } | ||
| }, | ||
| "tailwindCSS.experimental.configFile": "./packages/design-system/styles.css" | ||
|
Comment on lines
+20
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainTailwind VS Code 설정: configFile이 CSS를 가리키고 있어 인텔리센스가 비활성화될 수 있음
적용 제안(diff): "editor.quickSuggestions": {
"strings": true
},
- "tailwindCSS.experimental.configFile": "./packages/design-system/styles.css"
+ "tailwindCSS.experimental.configFile": "./packages/design-system/tailwind.config.ts"
}여러 패키지에 Tailwind 설정이 추가될 가능성이 있다면(모노레포), 배열 형태로 다중 설정을 지원하도록 확장하는 것도 고려해 주세요: - "tailwindCSS.experimental.configFile": "./packages/design-system/tailwind.config.ts"
+ "tailwindCSS.experimental.configFile": [
+ "./packages/design-system/tailwind.config.ts"
+ ]설정 파일 경로 자동 확인 스크립트: 문서화 제안: 이전 PR 학습에 따르면 컨벤션 문서는 🏁 Script executed: #!/bin/bash
# 리포지토리 내 tailwind 설정 파일 위치 확인
fd -t f -E node_modules -E dist -E build -E .turbo -g "**/tailwind.config.*" -a | sed 's/^/.\/&/'Length of output: 154 .vscode/settings.json: Tailwind CSS 설정 파일 경로 수정 필요 실제 리포지토리 내에 Tailwind 설정 파일은 • 파일:
• (추가) 모노레포에서 다수의 Tailwind 설정 파일을 관리해야 할 경우 배열 형태로 지정할 수 있습니다. "tailwindCSS.experimental.configFile": [
"./apps/extension/tailwind.config.ts"
// 향후 design-system 패키지에 config 파일이 생기면 여기에 추가
]• 설정 파일 경로 자동 확인 스크립트 예시 # 워크스페이스 내 tailwind.config.* 파일을 상대경로(./…) 형태로 출력
fd -t f \
-E node_modules -E dist -E build -E .turbo \
-g "tailwind.config.*" \
--strip-cwd-prefix | sed 's|^|./|'문서화: 위 변경사항(.vscode 설정 의도, 다중 config 관리 이유 등)은 🤖 Prompt for AI Agents |
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||||||||||||||||||||||
| import type { StorybookConfig } from '@storybook/react-vite'; | ||||||||||||||||||||||||||||||||||
| import { dirname, join } from 'path'; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||
| * This function is used to resolve the absolute path of a package. | ||||||||||||||||||||||||||||||||||
| * It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
| function getAbsolutePath(value: string): string { | ||||||||||||||||||||||||||||||||||
| return dirname(require.resolve(join(value, 'package.json'))); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+8
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ESM 환경에서 require 미정의 오류 — createRequire 사용으로 교체 필요 design-system 패키지는 ESM("type": "module")입니다. ESM 컨텍스트에서 아래와 같이 수정 제안드립니다: import type { StorybookConfig } from '@storybook/react-vite';
import { dirname, join } from 'path';
+import { createRequire } from 'node:module';
+
+const require = createRequire(import.meta.url);
/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value: string): string {
return dirname(require.resolve(join(value, 'package.json')));
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| const config: StorybookConfig = { | ||||||||||||||||||||||||||||||||||
| stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||||||||||||||||||||||||||||||||||
| addons: [ | ||||||||||||||||||||||||||||||||||
| getAbsolutePath('@chromatic-com/storybook'), | ||||||||||||||||||||||||||||||||||
| getAbsolutePath('@storybook/addon-docs'), | ||||||||||||||||||||||||||||||||||
| getAbsolutePath('@storybook/addon-onboarding'), | ||||||||||||||||||||||||||||||||||
| getAbsolutePath('@storybook/addon-a11y'), | ||||||||||||||||||||||||||||||||||
| getAbsolutePath('@storybook/addon-vitest'), | ||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||
| framework: { | ||||||||||||||||||||||||||||||||||
| name: getAbsolutePath('@storybook/react-vite'), | ||||||||||||||||||||||||||||||||||
| options: {}, | ||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||
| docs: { | ||||||||||||||||||||||||||||||||||
| defaultName: 'Documentation', | ||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||
| typescript: { | ||||||||||||||||||||||||||||||||||
| check: true, | ||||||||||||||||||||||||||||||||||
| reactDocgen: 'react-docgen-typescript', | ||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||
| export default config; | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import type { Preview } from '@storybook/react-vite'; | ||
| import '../styles.css'; | ||
|
|
||
| const preview: Preview = { | ||
| parameters: { | ||
| actions: { argTypesRegex: '^on[A-Z].*' }, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 주로 저희는 액션 on~으로 컨벤션 맞추면 될까용??
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. story 부분 설정하면서 생각이 나서! on prefix 설정을 통일하는 것도 괜찮을 것 같아요.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저희 서비스가 어차피 구분할 비슷한 기능들이 많은 것도 아니구 개발 사이즈도 큰 건 아니라, on 범위 정도로도 충분히 다 액션 정의해도 될 것 같아요! handle 키워드를 만약 쓰게 된다해도, |
||
|
|
||
| controls: { | ||
| matchers: { | ||
| color: /(background|color)$/i, | ||
| date: /Date$/i, | ||
| text: /(title|label|name|placeholder|text)$/i, | ||
| }, | ||
| }, | ||
| }, | ||
|
|
||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default preview; | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,7 @@ | ||||||
| import * as a11yAddonAnnotations from '@storybook/addon-a11y/preview'; | ||||||
| import { setProjectAnnotations } from '@storybook/react-vite'; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. setProjectAnnotations import 경로 수정 필요 문서 링크(Portable Stories + Vitest) 기준, 수정 제안: -import { setProjectAnnotations } from '@storybook/react-vite';
+import { setProjectAnnotations } from '@storybook/portable-stories';📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| import * as projectAnnotations from './preview'; | ||||||
|
|
||||||
| // This is an important step to apply the right configuration when testing your stories. | ||||||
| // More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations | ||||||
| setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]); | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,23 @@ | ||||||||||
| // For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format | ||||||||||
| import storybook from 'eslint-plugin-storybook'; | ||||||||||
|
|
||||||||||
| import config from '@pinback/eslint-config/react-internal'; | ||||||||||
|
|
||||||||||
| /** @type {import("eslint").Linter.Config} */ | ||||||||||
| export default config; | ||||||||||
| export default [ | ||||||||||
| ...storybook.configs['flat/recommended'], | ||||||||||
| ...config, | ||||||||||
| { | ||||||||||
| files: ['**/*.js', '**/*.ts'], | ||||||||||
| ignores: [ | ||||||||||
|
Comment on lines
+11
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 파일 글롭 범위 확장 필요(jsx/tsx/mdx 포함) 현재 js/ts만 대상으로 하여 TSX/JSX/MDX 파일에 규칙 오버라이드가 적용되지 않습니다. React/Storybook 환경에서는 TSX/MDX가 핵심이므로 포함이 필요합니다. 특히 이 블록에서 no-undef 등을 끄는 의도가 TSX에도 반영되어야 합니다. - files: ['**/*.js', '**/*.ts'],
+ files: ['**/*.{js,jsx,ts,tsx,mdx}'],📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| 'node_modules', | ||||||||||
| 'dist', | ||||||||||
| 'build', | ||||||||||
| 'public', | ||||||||||
| 'public/**', | ||||||||||
| 'public/**/*', | ||||||||||
| 'storybook-static', | ||||||||||
| 'icons/**/*', | ||||||||||
| ], | ||||||||||
| }, | ||||||||||
| ]; | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,25 +11,41 @@ | |
| }, | ||
| "scripts": { | ||
| "lint": "eslint .", | ||
| "build": "vite build", | ||
| "check-types": "tsc --noEmit", | ||
| "build": "vite build", | ||
| "build:storybook": "storybook build", | ||
| "dev:storybook": "storybook dev -p 6006", | ||
| "generate:component": "turbo gen react-component" | ||
| }, | ||
|
Comment on lines
12
to
19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CI 실패 원인: pnpm-lock.yaml 스펙 불일치 — 루트에서 재생성 필요 파이프라인 에러 메시지처럼 lockfile이 package.json과 맞지 않습니다. 워크스페이스 루트에서 재생성하세요. 권장 절차:
pnpm -w install
pnpm -w dedupe
git add pnpm-lock.yaml필요 시 제가 워크스페이스 범위 점검 스크립트 제공 가능합니다. Also applies to: 21-22, 39-40 🤖 Prompt for AI Agents |
||
| "devDependencies": { | ||
| "@chromatic-com/storybook": "4.1.1", | ||
| "@pinback/eslint-config": "workspace:*", | ||
| "@pinback/tailwind-config": "workspace:*", | ||
| "@pinback/typescript-config": "workspace:*", | ||
| "@storybook/addon-a11y": "9.1.3", | ||
| "@storybook/addon-docs": "9.1.3", | ||
| "@storybook/addon-onboarding": "^9.1.3", | ||
| "@storybook/addon-vitest": "9.1.3", | ||
| "@storybook/blocks": "^8.6.14", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 얘만 다른 의존성과 버전이 다른 이유가 있을까요??
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 따로 설정한 부분 없이 패키지 매니저로 add만했는데 저렇게 설정된 것 같아요! |
||
| "@storybook/react-vite": "9.1.3", | ||
| "@tailwindcss/vite": "^4.1.12", | ||
| "@vitejs/plugin-react": "^4.5.2", | ||
| "@turbo/gen": "^2.5.0", | ||
| "@types/node": "^22.15.3", | ||
| "@types/react": "19.1.0", | ||
| "@types/react-dom": "19.1.1", | ||
| "@vitejs/plugin-react": "^4.5.2", | ||
| "@vitest/browser": "^3.2.4", | ||
| "@vitest/coverage-v8": "^3.2.4", | ||
| "chromatic": "^13.1.3", | ||
| "eslint": "^9.33.0", | ||
| "eslint-plugin-storybook": "9.1.3", | ||
| "playwright": "^1.55.0", | ||
| "storybook": "9.1.3", | ||
| "tailwindcss": "^4.1.12", | ||
| "typescript": "5.9.2", | ||
| "typescript-eslint": "^8.39.1", | ||
| "vite": "^7.1.2" | ||
| "vite": "^7.1.2", | ||
| "vitest": "^3.2.4" | ||
|
Comment on lines
+36
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVite 7과 @vitejs/plugin-react 호환성 확인 필요 현재 Vite ^7.1.2와 plugin-react ^4.5.2 조합입니다. 메이저 호환성에 이슈가 없는지 최신 문서로 확인 부탁드립니다. 검증 스크립트(루트에서 실행): 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Vite: $(jq -r '.devDependencies.vite' packages/design-system/package.json)"
echo "Plugin-react: $(jq -r '.devDependencies[\"@vitejs/plugin-react\"]' packages/design-system/package.json)"
echo "참고: 공식 호환성 테이블 확인 권장."Length of output: 490 다음 스크립트를 실행하여 🏁 Script executed: #!/bin/bash
set -euo pipefail
# package.json에서 Vite 버전 조회
VITE_VERSION=$(jq -r '.devDependencies.vite // .dependencies.vite' packages/design-system/package.json)
# package.json에서 @vitejs/plugin-react 버전 조회
PLUGIN_RAW=$(jq -r '.devDependencies["@vitejs/plugin-react"] // .dependencies["@vitejs/plugin-react"]' packages/design-system/package.json)
echo "Vite version: $VITE_VERSION"
echo "Plugin React version: $PLUGIN_RAW"
# ^ 또는 ~ 제거
PLUGIN_VERSION=${PLUGIN_RAW#^}
PLUGIN_VERSION=${PLUGIN_VERSION#~}
echo "Fetching peerDependencies for @vitejs/plugin-react@$PLUGIN_VERSION"
curl -s https://registry.npmjs.org/@vitejs/plugin-react/$PLUGIN_VERSION | jq '.peerDependencies'Length of output: 719 Vite 7.1.2와 @vitejs/plugin-react@4.5.2 호환성 문제 확인 • 대상 파일
• 조치 방안 (필수)
위 중 하나를 선택해 의존성 충돌을 해소해 주세요. 🤖 Prompt for AI Agents |
||
| }, | ||
| "dependencies": { | ||
| "@radix-ui/react-slot": "^1.2.3", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { Meta } from '@storybook/blocks'; | ||
|
|
||
| <Meta title="Introduction" /> | ||
|
|
||
| # PinBack Design System (pds) | ||
|
|
||
| #### pds는 PinBack 서비스를 위한 통합된 디자인 언어입니다. | ||
|
|
||
| <br /> | ||
| <br /> | ||
| <br /> | ||
|
|
||
| ## pds 사용하기 | ||
|
|
||
| #### pds는 총 3개의 서비스에 걸쳐 제공됩니다. [(Github)](https://github.com/Pinback-Team/pinback-client)<br />이 사이트는 모든 PinBack 서비스의 기반이 되어 디자인에 필요한 가이드라인 및 스펙을 제공합니다. | ||
|
|
||
| - client | ||
| - extension | ||
| - landing | ||
|
|
||
| <br /> | ||
|
|
||
| ## 가이드라인 | ||
|
|
||
| - Components | ||
| - Colors | ||
| - Fonts | ||
| - Icons |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react-vite'; | ||
| import Button from './Button'; | ||
|
|
||
| // Storybook에 컴포넌트를 어떻게 표시할지 정의합니다. | ||
| const meta: Meta<typeof Button> = { | ||
| title: 'UI/Button', | ||
| component: Button, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof Button>; | ||
|
|
||
| export const Primary: Story = { | ||
| args: { | ||
| children: 'Primary Button', | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,13 @@ | ||||||||||||||||||
| const Button = () => { | ||||||||||||||||||
| return <div>Button</div>; | ||||||||||||||||||
| interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { | ||||||||||||||||||
| children: React.ReactNode; | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 타입 네임스페이스 직접 참조 지양: React 타입은 명시적으로 import 현재 파일에서 React 심볼을 타입 위치에서 사용하지만 import가 없습니다. TS 설정에 따라 -interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
- children: React.ReactNode;
-}
+import type { ButtonHTMLAttributes, ReactNode } from 'react';
+
+interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
+ children: ReactNode;
+}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| const Button = ({ children, ...props }: ButtonProps) => { | ||||||||||||||||||
| return ( | ||||||||||||||||||
| <button type="button" {...props}> | ||||||||||||||||||
| {children} | ||||||||||||||||||
| </button> | ||||||||||||||||||
| ); | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| export default Button; | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||||||||
| { | ||||||||||||||
| "$schema": "../../node_modules/turbo/schema.json", | ||||||||||||||
| "extends": ["//"], | ||||||||||||||
| "tasks": { | ||||||||||||||
| "build": { | ||||||||||||||
| "with": ["build:storybook"] | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 찾아보니, 스토리북 CLI는 디렉토리 기준으로 main.tz, tsconfig 등을 읽어야 하는데 이게 디자인시스템 내로 들어가있어서 루트딴에서 실행이 안되는군여 이렇게 설정하면 확실히 경로이동 덜 번거로워질 것 같네요! 감사합니다 |
||||||||||||||
| }, | ||||||||||||||
|
Comment on lines
+5
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "with"는 Turbo 설정 키가 아닙니다 — "dependsOn"으로 교체하세요 Turbo 설정에서 task 간 의존성을 선언하려면 "dependsOn"를 사용해야 합니다. 현재 "with"는 인식되지 않아 build 시 storybook 빌드가 실행되지 않습니다. 아래처럼 수정하면 루트의 기본 빌드 의존성("^build")도 유지하면서 이 패키지의 build가 build:storybook을 선행 실행하도록 보장할 수 있습니다. - "build": {
- "with": ["build:storybook"]
- },
+ "build": {
+ "dependsOn": ["^build", "build:storybook"]
+ },📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with도 정식 옵션이 맞지마 두개 차이점이 좀 있는거같아요. with는 동시실행이 목적이고 dependsOn은 빌드 순서 보장이 필요할 때 사용하는것같아요. 확인해보고 우리 프로젝트에 필요한거 적용하면 좋을것같네요-!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query: 💡 Result: Short answer — purpose and difference
Key details / how to choose
Examples (from the official docs)
Notes about schema and naming
I pulled these details from the official Turborepo docs today (I checked the docs on August 21, 2025). If you want:
tell me which and I’ll fetch or generate it. Citations:
@jjangminii 맞습니다! 제가 잘못된 정보를 제공했네요. 죄송합니다. "with"와 "dependsOn" 모두 정식 Turbo 옵션입니다:
현재 상황에서는 Storybook 빌드가 완료된 후 메인 빌드가 실행되어야 한다면 "build": {
"dependsOn": ["^build", "build:storybook"]
}하지만 만약 병렬 실행이 목적이라면 현재 정확한 정보 수정해 주셔서 감사합니다. 🙏 ✏️ Learnings added
|
||||||||||||||
| "build:storybook": { | ||||||||||||||
| "outputs": ["storybook-static/**"] | ||||||||||||||
| }, | ||||||||||||||
| "dev:storybook": { | ||||||||||||||
| "cache": false, | ||||||||||||||
| "persistent": true | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /// <reference types="@vitest/browser/providers/playwright" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
권한 축소(least-privilege) 권장: write-all 제거하고 필요한 권한만 명시
PR 코멘트 작성과 체크아웃/Chromatic 상태 보고에 필요한 최소 권한만 부여하세요.
아래처럼 축소를 제안합니다(Chromatic 체크런 생성이 필요하면 checks: write 추가).
🤖 Prompt for AI Agents