Skip to content
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

Check variable value before update #3188

Merged
merged 3 commits into from
Nov 21, 2024
Merged

Conversation

six7
Copy link
Collaborator

@six7 six7 commented Oct 24, 2024

Why does this PR exist?

Closes #3169

Variables weren't checking if they are supposed to update, they just did.

What does this pull request do?

With this change we're making it so that we only update the variable value when the variable value differs from the new value.

Testing this change

Create a few variables, hit Publish in Figma, and then hit export again. In the production version you'd now get another blue dot on the library icon, in this version you don't.

Additional Notes (if any)

CleanShot.2024-10-24.at.09.03.34.mp4

Copy link

changeset-bot bot commented Oct 24, 2024

🦋 Changeset detected

Latest commit: bc70566

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tokens-studio/figma-plugin Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

github-actions bot commented Oct 24, 2024

⤵️ 📦 ✨ The artifact was successfully created! Want to test it? Download it here 👀 🎁

@six7 six7 marked this pull request as draft October 24, 2024 07:14
Copy link
Contributor

Commit SHA:b9b5ff2bd944c16adfe305146b41690456f32fad

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: six7/check-variable-value-before-update 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 68.04 (0.14) 58.8 (0.24) 64.71 (0.1) 68.45 (0.16)
✨ 🆕 packages/tokens-studio-for-figma/src/plugin/setBooleanValuesOnVariable.ts 70 66.66 100 77.77
🟢 packages/tokens-studio-for-figma/src/plugin/setColorValuesOnVariable.ts 100 (25) 100 (0) 100 (0) 100 (25)
🟢 packages/tokens-studio-for-figma/src/plugin/setNumberValuesOnVariable.ts 66.66 (6.66) 66.66 (16.66) 100 (0) 75 (15)
🟢 packages/tokens-studio-for-figma/src/plugin/setStringValuesOnVariable.ts 71.42 (71.42) 75 (-25) 100 (100) 83.33 (83.33)
🟢 packages/tokens-studio-for-figma/src/plugin/setValuesOnVariable.ts 90.24 (14.64) 81.63 (16.33) 100 (0) 90 (15)
🟢 packages/tokens-studio-for-figma/src/utils/convertTokenTypeToVariableType.ts 100 (28.58) 80 (20) 100 (0) 100 (28.58)

Copy link
Contributor

Commit SHA:b9b5ff2bd944c16adfe305146b41690456f32fad
Current PR reduces the test coverage percentage by 1 for some tests

@six7 six7 marked this pull request as ready for review October 24, 2024 07:42
@six7
Copy link
Collaborator Author

six7 commented Nov 10, 2024

@keeganedwin were you able to test this?

@keeganedwin
Copy link
Collaborator

@six7 tested the and seems to be working as showed in the video.

@six7 six7 merged commit 04f3fa6 into main Nov 21, 2024
10 of 11 checks passed
@six7 six7 deleted the six7/check-variable-value-before-update branch November 21, 2024 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Published Changes in Figma Shows all Changes in the File Modified
3 participants