-
Notifications
You must be signed in to change notification settings - Fork 0
fix: 디자인 토큰 미해결 참조 필터링 및 js 플랫폼 제거 #50
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
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 |
|---|---|---|
|
|
@@ -20,6 +20,12 @@ StyleDictionary.registerTransformGroup({ | |
| ], | ||
| }); | ||
|
|
||
| // 미해결 참조({...}) 토큰 제외 | ||
| const isResolved = (token) => { | ||
| const val = String(token.value ?? ''); | ||
| return !val.includes('{') && !val.includes('}'); | ||
| }; | ||
|
Comment on lines
+24
to
+27
Contributor
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.
const isResolved = (token) => {
const val = JSON.stringify(token.value);
return !!val && !val.includes('{') && !val.includes('}');
}; |
||
|
|
||
| function setDeep(obj, path, value) { | ||
| let cur = obj; | ||
| for (let i = 0; i < path.length - 1; i++) { | ||
|
|
@@ -65,6 +71,10 @@ StyleDictionary.registerFormat({ | |
| const sd = new StyleDictionary({ | ||
| source: ['tokens/tokens.json'], | ||
| preprocessors: ['tokens-studio'], | ||
| log: { | ||
| verbosity: 'verbose', | ||
| errors: { brokenReferences: 'warn' }, | ||
|
Contributor
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. |
||
| }, | ||
| platforms: { | ||
| css: { | ||
| transformGroup: 'tokens-studio/css', | ||
|
|
@@ -73,6 +83,7 @@ const sd = new StyleDictionary({ | |
| { | ||
| destination: 'variables.css', | ||
| format: 'css/variables', | ||
| filter: isResolved, | ||
| options: { selector: ':root', outputReferences: false }, | ||
| }, | ||
| ], | ||
|
|
@@ -84,20 +95,7 @@ const sd = new StyleDictionary({ | |
| { | ||
| destination: 'preset.cjs', | ||
| format: 'javascript/tailwind-preset', | ||
| }, | ||
| ], | ||
| }, | ||
| js: { | ||
| transformGroup: 'tokens-studio', | ||
| buildPath: 'dist/js/', | ||
| files: [ | ||
| { | ||
| destination: 'tokens.js', | ||
| format: 'javascript/es6', | ||
| }, | ||
| { | ||
| destination: 'tokens.d.ts', | ||
| format: 'typescript/es6-declarations', | ||
| filter: isResolved, | ||
| }, | ||
| ], | ||
| }, | ||
|
|
||
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.
js플랫폼 제거와 함께 패키지의 메인 엔트리포인트인.export가 삭제되었습니다. 이는 이 패키지를 직접 임포트하여 사용하던 기존 프로젝트들에 영향을 주는 Breaking Change입니다. 의도된 변경인지 확인이 필요하며, 필요한 경우 소비자들에게/css또는/tailwind경로를 명시적으로 사용하도록 안내가 필요합니다.