Add a utility to render the template file with props to string locally.
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 54/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- typescript
- Bereich
- developer-experience, tooling
Rechercherichtung
Start by reading the existing CLI preview implementation and the Code Connect template handling path; the issue does not name specific files or tests. Work out how a local props map could render a template to the string shown in Figma’s dev panel. Done means the utility returns that output for supplied props and can support local tests that validate the generated code.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the feature you'd like:
I would love for the figma code-connect module to export a utility (similar to cli's preview) that will take in the template file and allow us to provide a handwritten local "props" map/config and then it would spit out the exact string output that could be expected in the dev panel in figma.
We have a lot of components and we would like to write unit tests to validate that our template files are syntactically correct and match our expected output. The only way to validate this currently is to manually publish and go view every components output in the dev panel in figma directly, then copy that code into a ts file and ensure it has no type errors. Sure it's not too bad for one component, but we would like to have the logic validated in local test to give ourselves more confidence that our template is syntactically correct and valid and getting output exactly how we would expect and does not have errors in the dev panel.
psudocode just as an example:
const output = previewFigmaTemplate(
()=> import('Button.figma.ts'),
{
Variant: 'Outlined - Secondary',
Size: 'Large',
State: 'Disabled',
'Typography.Text': 'Save',
});
Then i could take that string output turn it into a virtual file and run it through typescript to type check and validate that its outputting real valid code that works with our library.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.6k
- Forks
- 126
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus figma/code-connect
-
normalizePropName strips `#` characters from Figma property names instead of only the `#id` suffixOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
figma/code-connect#419 ·
-
feature request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
figma/code-connect#403 ·
-
feature request
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 38/100
figma/code-connect#414 ·
-
feature request
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
figma/code-connect#413 · 1 Kommentar ·
-
feature request
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 54/100
figma/code-connect#412 · 1 Kommentar ·
Alle Issues in figma/code-connect
Ähnliche Issues
-
area: web
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
inabagumi/shinju-date#6823 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
vercel-labs/ui#540 ·
Maintainer antworten meist innerhalb von 1 Tag
-
accepted ai-dev ai-implementing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
livesport/homer#218 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag