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

External JSON sync + demo file of hardcoded templates for node types #21

Closed
jake-figma opened this issue Feb 3, 2024 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@jake-figma
Copy link
Collaborator

Add a new JSON schema / type like:

type TemplatesByNodeType = { [k in BaseNode["type"]]?: CodegenResult[] }

For folks to hang templates on in the codebase itself and have that be the fallback.

This wouldn't work in the official plugin, but would be useful for folks who clone this and want to add templates for things like Typography and Layout components.

@jake-figma jake-figma self-assigned this Feb 3, 2024
@jake-figma jake-figma added the enhancement New feature or request label Feb 3, 2024
@jake-figma
Copy link
Collaborator Author

Also worth considering hosting the templates externally on an oauth'd account (eg. #22), or even more simply in an externally hosted/public JSON endpoint.

@jake-figma jake-figma changed the title Add demo of how to hardcode templates for node types External JSON sync + demo file of hardcoded templates for node types Feb 5, 2024
@jake-figma
Copy link
Collaborator Author

first cut playing around with this global templates concept. instead of being hardcoded (templates.ts) this would be loaded from a JSON endpoint. #14412db

@jake-figma
Copy link
Collaborator Author

First draft of this is in with #30

Closing for now, but open to discussion on improvements here (especially loading via JSON). Documentation for Global Templates can be found in the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant