feat(tokens): add Style Dictionary v5 pipeline with W3C DTCG primitive tokens#261
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
70f5f04 to
40af8de
Compare
Yeom-JinHo
left a comment
There was a problem hiding this comment.
방향 좋고 깔끔한거 같습니다!
Figma에서 export할떄 어떤 플러그인을 쓰는건가요? W3C DTCG 포맷으로 잘 떨어지나요?
| "build:tokens": "node config.js", | ||
| "dev:storybook": "storybook dev -p 6006", |
There was a problem hiding this comment.
| "types": "./dist/ts/index.d.ts", | ||
| "default": "./dist/ts/index.js" | ||
| } | ||
| } |
There was a problem hiding this comment.
/dist/css/index.css는 아직 미완성이여서 export list에 없는걸까요?
There was a problem hiding this comment.
넵 semantic 토큰이 아직 미완이라(리뷰중) 보류했습니다.
Token Studio 연동하고 semantic 토큰 완성되면 ./styles.css 형태로 export 추가할 예정입니다!
| "import": { | ||
| "types": "./dist/ts/index.d.ts", | ||
| "default": "./dist/ts/index.js" | ||
| } |
There was a problem hiding this comment.
- cjs export 도 안하신게 의도인지 궁금합니다
There was a problem hiding this comment.
아앗 의도 아니여요 감사합니다!
요기서 추가했습니당 > chore: cjs export
| "build": "tsup", | ||
| "build:tokens": "node config.js", |
There was a problem hiding this comment.
| "build": "tsup", | |
| "build:tokens": "node config.js", | |
| "build": "pnpm build:tokens && tsup", | |
| "build:tokens": "node config.js", |
어떠신지용
There was a problem hiding this comment.
오토머지 걸어놨더니 리뷰 반영하던 중에 머지가 되버렸네요.. build 스크립트는 다음 PR에서 같이 반영해보겠습니다!
제안주신 것처럼 하면 dist 생성하자마자 tsup이 dist를 제거해버리는 상황이 우려되어서
build:tokens 제거하고 아래처럼 수정해보려고 합니다!
"build": "tsup && node config.js",
진호님 리뷰 감사합니다! |
Summary
config.js)$value/$type)으로 primitive 토큰 JSON 정의 — color, spacing,typography, radius
./token-namessubpath export 추가 —ColorToken,DesignToken,cssVar()자동 생성
Changes
Primitive 토큰
color.jsonspacing.jsontypography.jsonradius.json빌드 결과물
dist/css/primitive.css— CSS 커스텀 프로퍼티 (--color-gray-500등)dist/css/index.css— primitive + semantic 통합본dist/ts/primitive.js+dist/ts/primitive.d.ts—cssVar()구현 및 타입 선언설계 결정
tokens/semantic/light/에 JSON 추가 시 빌드에 자동 포함되는 구조prepack순서를tsup → build:tokens로 고정 — tsupclean: true이후dist/ts/생성 보장publishConfig.exports에./token-names추가 — 배포 후 subpath 접근 가능Test plan
node packages/tokens/config.js실행 후dist/css/primitive.css,dist/ts/primitive.d.ts,dist/ts/primitive.js생성 확인@sipe-team/tokens/token-names에서cssVar()import 및 타입 추론 확인