Skip to content

feat: Style Dictionary v4 기반 iOS 디자인 토큰 빌드 파이프라인 추가 - #1

Merged
Roy-wonji merged 3 commits into
mainfrom
feat/style-dictionary-ios-pipeline
May 12, 2026
Merged

Roy-wonji merged 3 commits into
mainfrom
feat/style-dictionary-ios-pipeline

Conversation

@Roy-wonji

Copy link
Copy Markdown

요약

Figma Variables(DTCG W3C 표준) → Style Dictionary v4 → iOS Swift/xcassets 파이프라인을 추가합니다. 현재 레포에 Mode 1.tokens.json 한 개만 올라와 있던 상태에서, 동작하는 토큰 시스템(TypeScript + npm run build + GitHub Actions 자동 빌드)으로 확장됩니다.

변경 요약

  • TypeScript 빌드: tsx 런너 + style-dictionary@^4, tsc --noEmit로 타입 검증
  • 레이어 분리 출력: Brand / Semantic / Component / Spacing / Radius 5개 enum + Component 숫자 토큰 enum
  • Asset Catalog: Colors.xcassets/ 안에 Brand/, Semantic/, Component/ namespace 폴더로 정리 (94개 colorset)
  • DTCG 처리: Figma의 \$value: { hex, components, ... } 객체를 hex 문자열로 정규화하는 preprocessor + alias 자동 해석
  • Swift 안전 변환: 예약어(default → \`default\`), 숫자 leaf(Spacing.16 → Spacing.s16)
  • CI: push/PR 시 typecheck + build + build/ios/ artifact 업로드

산출물 예시

```swift
BrandColors.primary500 // Color("Brand/Primary500", bundle: .module)
SemanticColors.textPrimary // Color("Semantic/TextPrimary", bundle: .module)
ComponentColors.buttonPrimaryBackgroundDefault
Spacing.s16 // CGFloat = 16
Radius.`default` // CGFloat = 2
```

테스트

  • `npm install` 통과
  • `npm run typecheck` 통과 (에러 없음)
  • `npm run build` 통과 (94 colorsets + 6 Swift files, collision warning 없음)
  • 머지 후 GitHub Actions workflow 실제 동작 확인

다음 단계 (별도 PR)

  • iOS 레포 자동 동기화 워크플로우 (현재는 artifact upload만)
  • 다크 모드 export (Mode 2.tokens.json) 지원

Roy added 3 commits May 12, 2026 22:22
- Figma Variables DTCG 포맷(Mode 1.tokens.json)을 단일 source로 사용
- TypeScript 기반 빌드(tsx + style-dictionary v4)
- 토큰을 Brand / Semantic / Component / Spacing / Radius 5개 레이어로 분리 출력
- iOS 산출물: Colors.xcassets(namespace 폴더) + 6개 Swift enum 파일
- Figma 색상 객체($value: {hex, components, ...})를 hex 문자열로 정규화하는 preprocessor 포함
- 토큰 reference({Colors.brand.primary.500}) 자동 해석
- Swift 예약어/숫자 leaf(default, Spacing.16) 안전 변환
- GitHub Actions로 push/PR 시 자동 빌드 + iOS 산출물 artifact 업로드
- build.yml 을 2단계 검증 + 자동 PR 흐름으로 재작성
  · 1차: Style Dictionary v4 빌드 (DTCG type/alias 정합성)
  · 2차: Picke-iOS checkout 후 Tools/TokenGenerator.swift 실행
  · 둘 다 통과 시 Picke-iOS 의 develop 으로 자동 PR (peter-evans/create-pull-request)
- PR 브랜치는 chore/design-tokens-sync-<timestamp> 로 매번 신규 생성, 머지 시 자동 삭제
- README 의 전체 흐름도/사전 준비/추가 흐름 문단을 새 구조에 맞춰 갱신
- 동작에 필요한 secret 안내: IOS_REPO_PAT (Contents/PR write 권한)
@Roy-wonji
Roy-wonji merged commit df4ef89 into main May 12, 2026
2 checks passed
@Roy-wonji
Roy-wonji deleted the feat/style-dictionary-ios-pipeline branch May 12, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant