fix: 디자인 토큰 미해결 참조 필터링 및 js 플랫폼 제거#50
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이번 PR은 디자인 토큰 빌드 과정에서 발생하는 미해결 참조 문제를 해결하고, 사용하지 않는 JS 플랫폼 설정을 제거하여 빌드 결과물을 최적화하는 데 목적이 있습니다. 또한, 빌드 시 참조 오류를 더 명확하게 파악할 수 있도록 로깅 설정을 보강하였습니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. 토큰 속에 숨은 참조, 필터로 걸러내어 정리하니, 깔끔해진 빌드 결과물, 코드의 길도 밝아지네. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the design tokens package by adding a comprehensive set of CSS variables and refining the Style Dictionary build configuration. Key changes include the removal of the JS platform and the package's main entry point, alongside the introduction of a filter to exclude tokens with unresolved references. Review feedback suggests improving the isResolved logic to handle complex token objects using JSON.stringify, increasing the severity of broken reference logs from warning to error for better data integrity, and verifying the impact of removing the main export as it constitutes a breaking change for consumers.
| const isResolved = (token) => { | ||
| const val = String(token.value ?? ''); | ||
| return !val.includes('{') && !val.includes('}'); | ||
| }; |
There was a problem hiding this comment.
isResolved 함수에서 token.value가 객체인 경우(예: typography, shadow 등 복합 토큰) String() 변환 시 "[object Object]"가 되어 내부의 미해결 참조를 감지하지 못합니다. JSON.stringify()를 사용하여 값의 전체 구조를 문자열로 확인하는 것이 더 안전합니다.
const isResolved = (token) => {
const val = JSON.stringify(token.value);
return !!val && !val.includes('{') && !val.includes('}');
};| preprocessors: ['tokens-studio'], | ||
| log: { | ||
| verbosity: 'verbose', | ||
| errors: { brokenReferences: 'warn' }, |
| "version": "1.0.0", | ||
| "type": "module", | ||
| "exports": { | ||
| ".": "./dist/js/tokens.js", |
Pull Request
관련 이슈
작업 내용
참고 사항
체크리스트