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

add expandComposition #1110

Merged

Conversation

swordEdge
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Aug 3, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
figma-tokens ✅ Ready (Inspect) Visit Preview Aug 9, 2022 at 0:56AM (UTC)
ft-storybook ✅ Ready (Inspect) Visit Preview Aug 9, 2022 at 0:56AM (UTC)

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Commit SHA:16adee487c073993fb207916c1388017ead5dc36

Test coverage results 🧪

Code coverage diff between base branch:next and head branch: 1000-add-support-for-expandcompositiontokens-to-token-transformer 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 64.03 (0.05) 55.74 (0.26) 59.39 (0) 64.23 (0.04)
🟢 src/utils/convertTokens.tsx 80.56 (0.56) 73.91 (9) 80 (0) 80.56 (0.56)
🟢 src/utils/convertTokensToGroupedObject.ts 95 (10) 81.82 (6.82) 100 (0) 95 (10)
🟢 src/utils/is/isSingleCompositionToken.ts 100 (33.33) 100 (50) 100 (0) 100 (0)

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

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

Copy link
Collaborator

@six7 six7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a few composition tokens in the https://github.com/six7/figma-tokens/tree/main/token-transformer/tokens files and make sure that we test that from a token-transformer level?

The "tests" there are basically running token-transformer with a few inputs that should then produce certain outputs: https://github.com/six7/figma-tokens/blob/main/token-transformer/package.json

Other than that this looks great!

Copy link
Collaborator

@six7 six7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for this in token-transformer/transform.test.js? You'll need to add a output/composition.json so the test know what is the expected result, you can look at the other tests to see how that was done.

Also, package.json needs a change in the test script (line 18):
Change "test": "npm run build-typography-test && npm run build-light-test && npm run build-dark-test && npm run build-folder-test && npm run build-resolve-false-test && jest"

to "test": "npm run build-typography-test && npm run build-light-test && npm run build-dark-test && npm run build-folder-test && npm run build-resolve-false-test && npm run build-composition-test && jest"

@@ -10,6 +10,7 @@
"main": "index.js",
"scripts": {
"build-typography-test": "node index.js tokens.json temp/typography.json base/options,base/sizing,core/typography base/options,base/sizing",
"build-composition-test": "node index.js tokens.json temp/composition.json base/options,base/sizing,core/composition base/options,base/sizing",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"build-composition-test": "node index.js tokens.json temp/composition.json base/options,base/sizing,core/composition base/options,base/sizing",
"build-composition-test": "node index.js tokens.json temp/composition.json base/options,base/sizing,core/composition base/options,base/sizing --expandComposition=true",

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be enabled to be run

@six7 six7 merged commit 99f4998 into next Aug 11, 2022
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.

Add support for --expandCompositionTokens to token-transformer
4 participants