From c2ac88b4e2212208bb8290aa99f74edaf659355d Mon Sep 17 00:00:00 2001 From: taysea Date: Thu, 31 Oct 2024 15:14:03 -0700 Subject: [PATCH] Fix paddingY:update script for element tokens --- design-tokens/src/scripts/update-paddingY.ts | 7 +++++++ design-tokens/src/scripts/verify-paddingY.ts | 4 +++- design-tokens/tokens/component/component.default.json | 4 ++-- design-tokens/tokens/component/element.default.json | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/design-tokens/src/scripts/update-paddingY.ts b/design-tokens/src/scripts/update-paddingY.ts index 2e85143bc..62415597c 100644 --- a/design-tokens/src/scripts/update-paddingY.ts +++ b/design-tokens/src/scripts/update-paddingY.ts @@ -120,6 +120,13 @@ nonComponentTokens.forEach(category => { delete updated[category]; }); +writeFileSync( + './tokens/component/element.default.json', + JSON.stringify({ element: updated.element }, null, 2), +); + +delete updated.element; + writeFileSync( './tokens/component/component.default.json', JSON.stringify(updated, null, 2), diff --git a/design-tokens/src/scripts/verify-paddingY.ts b/design-tokens/src/scripts/verify-paddingY.ts index 55269d5a7..9c7bdb237 100644 --- a/design-tokens/src/scripts/verify-paddingY.ts +++ b/design-tokens/src/scripts/verify-paddingY.ts @@ -63,7 +63,9 @@ export const descend = ( const paddingY = (minHeight - lineHeight - 2 * borderWidth) / 2; if (paddingY !== value.paddingY.$value) console.error( - `🛑 ${keyPath.join('.')}: ${paddingY} does not match ${ + `🛑 ${keyPath.join( + '.', + )}: Expected value ${paddingY} does not match existing value ${ value.paddingY.$value }. Run paddingY:update if this change is expected.`, ); diff --git a/design-tokens/tokens/component/component.default.json b/design-tokens/tokens/component/component.default.json index 55240ae04..25f6c130c 100644 --- a/design-tokens/tokens/component/component.default.json +++ b/design-tokens/tokens/component/component.default.json @@ -3995,7 +3995,7 @@ }, "paddingY": { "$type": "number", - "$value": 7, + "$value": 8, "$description": "", "$extensions": { "com.figma": { @@ -4226,7 +4226,7 @@ }, "paddingY": { "$type": "number", - "$value": 8, + "$value": 9, "$description": "", "$extensions": { "com.figma": { diff --git a/design-tokens/tokens/component/element.default.json b/design-tokens/tokens/component/element.default.json index 9b912ab89..27c2686d1 100644 --- a/design-tokens/tokens/component/element.default.json +++ b/design-tokens/tokens/component/element.default.json @@ -585,7 +585,7 @@ }, "paddingY": { "$type": "number", - "$value": 8, + "$value": 9, "$description": "", "$extensions": { "com.figma": {