mikaelvesavuori / figmagic

Figmagic is the missing piece between DevOps and design: Generate design tokens, export graphics, and extract design token-driven React components from your Figma documents.
https://docs.figmagic.com
MIT License
813 stars 73 forks source link

Don't crash when not all Design Tokens frames are found #100

Closed tomsoderlund closed 3 years ago

tomsoderlund commented 3 years ago

Is your feature request related to a problem? Please describe. I have no need of all Design Tokens-types, so I don't have all the required frames in my Design Tokens page.

I then get this crash when running Figmagic:

Error: Error: Error: Error: Error: Error: Error: Error: Error: Error: ENOENT: no such file or directory, open 'MYPROJECT/tokens/letterSpacings.ts'

Describe the solution you'd like Silently skipping missing frames, maybe just mentioned with a console text line

Describe alternatives you've considered Creating empty frames

mikaelvesavuori commented 3 years ago

Hi @tomsoderlund,

Are you syncing elements? I see the same behavior if I have "syncElements": true but it's not giving this error if it's set to false.

I'll see what I can do, but given that it can't infer values without tokens (ergo, values) it's not surprising it breaks.

tomsoderlund commented 3 years ago

@mikaelvesavuori You're right! Only for elements. Closing.

mikaelvesavuori commented 3 years ago

Hey, I fixed this anyway :) Coming shortly in 4.0.15.

tomsoderlund commented 3 years ago

@mikaelvesavuori Amazing! Thank you