-
Notifications
You must be signed in to change notification settings - Fork 84
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
[WNMGDS-2746][WNMGDS-2776] Update token build scripts to use JSON source #2952
[WNMGDS-2746][WNMGDS-2776] Update token build scripts to use JSON source #2952
Commits on Feb 21, 2024
-
This script can just be about exporting CSS/Sass now
After the Figma changes, we have a different way of storing tokens, and they're all in one folder. We haven't needed the multiple input directories for a while, and we don't really have a big reason to run the command multiple times for different outputs either. This command has become specific to outputting what our other packages will consume, while we have a separate set of scripts for syncing with Figma.
Configuration menu - View commit details
-
Copy full SHA for 0408b24 - Browse repository at this point
Copy the full SHA 0408b24View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e51206 - Browse repository at this point
Copy the full SHA 6e51206View commit details -
Move the new token types and token-reading utils because they are mor…
…e broadly useful We will now need them in the CSS/Sass exporters
Configuration menu - View commit details
-
Copy full SHA for 00a84de - Browse repository at this point
Copy the full SHA 00a84deView commit details -
Configuration menu - View commit details
-
Copy full SHA for a42f391 - Browse repository at this point
Copy the full SHA a42f391View commit details -
In the flattened token files, keep the notation internally consistent
Let the Figma scripts do the conversion from `.` to `/`, but let our other exporters expect the alias notation to match the flattened keys
Configuration menu - View commit details
-
Copy full SHA for 6380a68 - Browse repository at this point
Copy the full SHA 6380a68View commit details
Commits on Feb 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b590cb5 - Browse repository at this point
Copy the full SHA b590cb5View commit details -
by breaking it into functions that are easier to test and by only converting the files it finds rather than requiring all theme files to be present
Configuration menu - View commit details
-
Copy full SHA for 4051b57 - Browse repository at this point
Copy the full SHA 4051b57View commit details -
Now have the basic structure of the new exporter
Still need to resolve values more intelligently and generate variable names in a way that matches the old ones and conveys the correct hierarchy
Configuration menu - View commit details
-
Copy full SHA for 80e67af - Browse repository at this point
Copy the full SHA 80e67afView commit details -
Configuration menu - View commit details
-
Copy full SHA for d246d21 - Browse repository at this point
Copy the full SHA d246d21View commit details -
Configuration menu - View commit details
-
Copy full SHA for 11082a9 - Browse repository at this point
Copy the full SHA 11082a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e84d9c - Browse repository at this point
Copy the full SHA 3e84d9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 85fe607 - Browse repository at this point
Copy the full SHA 85fe607View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ffc868 - Browse repository at this point
Copy the full SHA 6ffc868View commit details
Commits on Feb 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7400f46 - Browse repository at this point
Copy the full SHA 7400f46View commit details -
More snapshot tests, but now I see that layout is empty
The test data needs some layout tokens, but it gets complicated, because spacers are currently defined as plain numbers in Figma, whereas we'll probably want the JSON `$type` to be `dimension`. We need to intelligently convert the values between our JSON storage and Figma
Configuration menu - View commit details
-
Copy full SHA for 89579e5 - Browse repository at this point
Copy the full SHA 89579e5View commit details -
Add fiddly logic for converting from and to Figma's generic number type
Once we do our first down-sync from Figma, we could possibly start storing this translation information as meta-data inside the JSON tokens. It wouldn't get uploaded to Figma, but it could be manually maintained in our repository. Being able to store information that doesn't go to Figma, however, would require that we merge incoming data with our local JSON files instead of the current overwriting method. Actually, if we're not storing that info in Figma, it's already in our tokens...why would I have to tell a dimension token that it's a dimension? If we don't need to be able to save the JSON based on only the information stored in Figma, then this isn't a problem at all. Maybe after the first down-sync we just need to update the down-sync operation to be a merge, and we look at the local (repository) token's `$type` and `$value` properties before converting from our Figma `NUMBER` variable. If `$type` is `dimension` then look at the unit of `$value` to determine how to translate from Figma.
Configuration menu - View commit details
-
Copy full SHA for 2114689 - Browse repository at this point
Copy the full SHA 2114689View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e6b947 - Browse repository at this point
Copy the full SHA 3e6b947View commit details -
Get rid of extra quotes in CSS output and add support for percentages
This is so fiddly. I hate it.
Configuration menu - View commit details
-
Copy full SHA for 8f26132 - Browse repository at this point
Copy the full SHA 8f26132View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f9ee7c - Browse repository at this point
Copy the full SHA 1f9ee7cView commit details
Commits on Feb 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f1eeb7e - Browse repository at this point
Copy the full SHA f1eeb7eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a66a31 - Browse repository at this point
Copy the full SHA 8a66a31View commit details -
Configuration menu - View commit details
-
Copy full SHA for 43d42e7 - Browse repository at this point
Copy the full SHA 43d42e7View commit details
Commits on May 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 022c35c - Browse repository at this point
Copy the full SHA 022c35cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 199165a - Browse repository at this point
Copy the full SHA 199165aView commit details
Commits on May 23, 2024
-
Replace our old tokens with some test ones synced from Figma
We don't have the full set of tokens in Figma yet because we're in the process of trying to transfer the library file from one account to another, but we've got all the `System` variables, and I manually created a few variables in the `Theme` collection.
Configuration menu - View commit details
-
Copy full SHA for 0c34171 - Browse repository at this point
Copy the full SHA 0c34171View commit details -
Configuration menu - View commit details
-
Copy full SHA for f72a516 - Browse repository at this point
Copy the full SHA f72a516View commit details -
Fix
"{spacer.4}px"
as a$value
in the JSONIf a variable is an alias, we don't need to send it through our logic for converting pixel values to other units
Configuration menu - View commit details
-
Copy full SHA for 18cd414 - Browse repository at this point
Copy the full SHA 18cd414View commit details -
Add checks in the unit tests for that functionality and fix it again
My previous solution wasn't perfect because it didn't account for inheriting the token type from the aliased variable
Configuration menu - View commit details
-
Copy full SHA for 9f7f9da - Browse repository at this point
Copy the full SHA 9f7f9daView commit details -
Configuration menu - View commit details
-
Copy full SHA for 51dbd90 - Browse repository at this point
Copy the full SHA 51dbd90View commit details -
Configuration menu - View commit details
-
Copy full SHA for 256ebda - Browse repository at this point
Copy the full SHA 256ebdaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1097525 - Browse repository at this point
Copy the full SHA 1097525View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6edf182 - Browse repository at this point
Copy the full SHA 6edf182View commit details
Commits on May 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 368558d - Browse repository at this point
Copy the full SHA 368558dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c3014c - Browse repository at this point
Copy the full SHA 0c3014cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0565cd0 - Browse repository at this point
Copy the full SHA 0565cd0View commit details -
WIP: Add guessing back in. It works!
I now that I think about it again, I don't really think it's necessary to store the number type information in the `$extensions` when we can later infer from the `$type` and the converted `$value` string that it wrote, which should contain the unit. The only weird one would be `0` values that are also `dimensions`, but I say we always pretend those are pixel values.
Configuration menu - View commit details
-
Copy full SHA for e3c12b3 - Browse repository at this point
Copy the full SHA e3c12b3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 905bc5c - Browse repository at this point
Copy the full SHA 905bc5cView commit details -
Update unit tests and make sure we can get types for Figma from aliases
Now that we don't duplicate the type information on alias tokens, we have to resolve the aliases until we get to a real token with a type in order to send that information to Figma.
Configuration menu - View commit details
-
Copy full SHA for 60d8ce5 - Browse repository at this point
Copy the full SHA 60d8ce5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 70e6c0c - Browse repository at this point
Copy the full SHA 70e6c0cView commit details
Commits on May 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b8f1ad8 - Browse repository at this point
Copy the full SHA b8f1ad8View commit details
Commits on May 28, 2024
-
Temporarily revert var printing and add some snapshot tests that will…
… fail They will fail because I've manually created the snapshots by copying the old CSS files so we can see the changes from this branch
Configuration menu - View commit details
-
Copy full SHA for fd7dd9c - Browse repository at this point
Copy the full SHA fd7dd9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0885284 - Browse repository at this point
Copy the full SHA 0885284View commit details -
Configuration menu - View commit details
-
Copy full SHA for b8b3597 - Browse repository at this point
Copy the full SHA b8b3597View commit details -
Configuration menu - View commit details
-
Copy full SHA for a063114 - Browse repository at this point
Copy the full SHA a063114View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5dcfdf8 - Browse repository at this point
Copy the full SHA 5dcfdf8View commit details
Commits on May 29, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2ab241a - Browse repository at this point
Copy the full SHA 2ab241aView commit details -
Use new official Figma API types package
Following the example of figma/variables-github-action-example#19
Configuration menu - View commit details
-
Copy full SHA for f9be14f - Browse repository at this point
Copy the full SHA f9be14fView commit details -
Configuration menu - View commit details
-
Copy full SHA for c84f8b4 - Browse repository at this point
Copy the full SHA c84f8b4View commit details
Commits on May 30, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 349b57e - Browse repository at this point
Copy the full SHA 349b57eView commit details