figma / code-connect

A tool for connecting your design system components in code with your design system in Figma
MIT License
940 stars 68 forks source link

Confused about "What is the URL of the Figma file containing your design system library?" #126

Open mrlubos opened 2 months ago

mrlubos commented 2 months ago

Hey! I am trying to test out Code Connect and I got stuck on this question. Is the expectation that there's a single large file containing the whole design library? A lot of large companies will have a separate documentation (read: file) per component/pattern, so I am not sure what's the expected value here? You can see in https://github.com/figma/code-connect/issues/125 I tried a single Button component design. I have many many more files with different components/patterns. Does Code Connect make assumptions about the underlying design structure?

ptomas-figma commented 2 months ago

(Sorry! I was sure I replied to this one on monday!)

Right now the figma connect assistant only accepts a single URL for each run. But you should be able to run it several times with different urls for each part of your design system.

mrlubos commented 2 months ago

Thanks @ptomas-figma! I didn't dig into this yet as I had the other issue preventing me from trying it out... how does it know which page my components are on? Is there anywhere a rough overview of the architecture behind this integration?

ptomas-figma commented 2 months ago

The assistant will check for all the components on all the pages of the file. We're considering adding ways to filter that to a specific page or frame. What do you think it would be useful for your use case?

mrlubos commented 2 months ago

Specific page would definitely help, not sure about frames. Our pages always follow the same naming pattern, e.g. Discovery, Design, Archive. The main concern I have at the moment is whether design must be aware of not renaming certain elements as that could break the links?

ptomas-figma commented 2 months ago

Renaming pages shouldn't be a problem as the links are based on the node id and not the names.