-
Notifications
You must be signed in to change notification settings - Fork 567
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
Reference global property from theme property (alias) #524
Comments
Thank you so much for the kind words! I just set up a new project based on the multi-brand-multi-platform example and added global and theme files in your example to reproduce the issue. Thank you for such a detailed bug report, it made debugging much easier. I believe the issue is the colon in the "value" string in the _properties/global/somefile.json file. You have This issue does illuminate something Style Dictionary could be doing better though because with the colon present the build just hangs forever and doesn't show an error. So thank you for finding this so we can have better error messaging! |
I was just about to return with the very same finding. But, you beat me to it. That was the actual root issue. As such, I'll close this issue. A little embarrassing on my part - hah. But, as you pointed out I'm likely not the only one struggling with misspellings and similar. I've been theoretically exploring different ways of validating the properties - possibly using JSON schemas. But, haven't had time to dig into it just yet. Totally agree with your perspective. |
Thank you for bringing this issue to our attention, I have a fix for the infinite hanging you experienced. It turns out there was a pretty serious bug. We have error checks in place to grab all reference errors and notify the user, but that wasn't happening after a change we made in 3.0. |
Intro
Let me start off by saying thanks to all the contributors of this repository. The StyleDictionary tool is wonderful and I look forward to what will follow for the Design Token community. How Style Dictionary may come to be packaged and extended to enable new innovations; with GUIs and more. From a personal perspective, I consider it almost as beneficial to the dev community as Git.
The issue
With one of the more advanced setups for Multi Brand & Multi Platform, I'm having trouble referencing the global (general) properties from my theme restricted properties.
Project structure
The setup follows the structure proposed in the official documentation for multi-theme Style Dictionary.
The project structure follows the documentation guidelines.
How to re-create
Run Style Dictionary on the following definition.
properties/themename/themename.json
_properties/global/somefile.json
Note: the actual content of the value field is exceptionally long (up to hundreds of characters). Here it's been replaced by the hex code #fff. May have impact. Example: url(data:image/svg+xml;base64,adsadsdsadsadsadasdsadsadsadsadsadadsadsadsadsadsadsadsasadsadsajdhj21h3uh213h1371237ahsdhsadjhsadjsahdjsahdkjh1321h3j21h3j21h31jjsagdhgsadgsadagdhgsadhsagdhsahdg1312g3hgahsgdhasgdhgsajdgashdgsadhsagdhagdhsag131232132131sadsadasdadd4444466661337loremipsumdummydata);"
Build script
Note: surrounding code and properties have been omitted for the sake of simplicity.
Environment
Script runner: Node
Operating system: Windows
Package management: NPM
Style Dictionary version: 2.9.0
Once the alias was replaced by content, the build went through successfully.
The text was updated successfully, but these errors were encountered: