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

FCT-1306 Code Connect POC #3019

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

FCT-1306 Code Connect POC #3019

wants to merge 12 commits into from

Conversation

tylermorrisford
Copy link
Contributor

@tylermorrisford tylermorrisford commented Dec 12, 2024

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.

@tylermorrisford tylermorrisford added the 🚧 Status: WIP Work in progress label Dec 12, 2024
@tylermorrisford tylermorrisford self-assigned this Dec 12, 2024
Copy link

vercel bot commented Dec 12, 2024

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

Name Status Preview Comments Updated (UTC)
ui-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 5:55pm

Copy link

changeset-bot bot commented Dec 12, 2024

⚠️ No Changeset found

Latest commit: 56699f7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tylermorrisford
Copy link
Contributor Author

tylermorrisford commented Dec 20, 2024

Putting this into 'on hold' status until there is a decision on expanding access to Figma Dev Mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants