-
Notifications
You must be signed in to change notification settings - Fork 25
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
FCT-1306 Code Connect POC #3019
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
packages/components/buttons/link-button/src/link-button.figma.tsx
Outdated
Show resolved
Hide resolved
6644d36
to
cce888e
Compare
b504935
to
cd0c297
Compare
cd0c297
to
a865d3e
Compare
Putting this into 'on hold' status until there is a decision on expanding access to Figma Dev Mode. |
Summary
This PR is a POC of both Figma's code connect CLI tool and a homegrown script meant to assist with the creation and auditing of Figma connect files. The script is only a starting point meant to show a POC of how we would maintain the proper coverage of code connect files after they are generated. Inline comments point out the difference in the results of these two methods.
Description
In testing the Figma's code connect CLI we learned that it is largely a manual process; the user must supply the figma design component url(as in manually copy it out of the Figma UI) and then manually map the props(the largest part of this effort) before making a few other updates to the file before it is ready to be 'published' to Figma, which results in the 'connection' we want.
The decision was made to ignore the mapping of props between components and figma assets, and to focus on linking the components to the figma design components as this still provides a much easier method for understanding the component tree of a given design.
The script added in 5b5bf19 requests component information and returns a map to be used in the
scan-figma-connection
script, which attempts to crawl the./packages/components/
directory and locate the root component file, then if a.figma.tsx
file is not found, it checks the aformentioned map for a matching figma component and generates the figma connect file based on a template. If the.figma.tsx
file is found, the content is read and checked for strings like 'TODO' and `<placeholder> '. The intent here is to give us an easy way to know what figma connect files we have that are incomplete.From there, we use
npx figma connect publish
to register the connection between code and figma assets.Challenges
-Some components (DataTableManager, Icon Master) are difficult to map to figma assets due to differences in the way they are named in this codebase vs. composed in the design system.