tokens-studio / figma-plugin

Official repository of the plugin 'Tokens Studio for Figma' (Figma Tokens)
https://www.figma.com/community/plugin/843461159747178978
MIT License
1.35k stars 194 forks source link

2.0: Fix order of keys when pushed to remote #2914

Closed six7 closed 3 months ago

six7 commented 3 months ago

Closes #2907

With 2.0 we seem to have introduced a regression when it comes to the order of token keys. We made it so that type always comes first, then value, and so on. This is bad because we need to respect users key ordering.

With this PR we're now respecting the order and keeping it the same by not destructuring the object.

Before

CleanShot 2024-06-24 at 08 39 54@2x

As you can see in this screenshot we reordered keys, even though the user didnt specify that.

After

CleanShot 2024-06-24 at 08 40 55@2x

Here's me after the change just adding a modifier - note how it preserves the order of value first.

changeset-bot[bot] commented 3 months ago

⚠️ No Changeset found

Latest commit: 92732eff8c016a59ce17a89d14eb085e3abcc1c8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR