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

[Feature Request] Expose buildThemeObject when using ReactThemeStudioTemplateRenderer #338

Closed
SwaySway opened this issue Jan 19, 2022 · 3 comments
Assignees

Comments

@SwaySway
Copy link
Contributor

I'd like the ability to codegen the shape of the object so it's easy to pass into createTheme in memory.
The following function returns the shape already though it's private

private buildThemeObject(): ObjectLiteralExpression {
return factory.createObjectLiteralExpression(
[
factory.createPropertyAssignment(
factory.createIdentifier('name'),
factory.createStringLiteral(this.component.name),
),
]
.concat(this.buildThemeValues(this.component.values))
.concat(this.buildThemeOverrides(this.component.overrides)),
true,
);
}

@dpilch
Copy link
Member

dpilch commented Jan 19, 2022

This function returns the TypeScript AST of the object. I'm assuming you want the JSON object itself?

@SwaySway
Copy link
Contributor Author

This function returns the TypeScript AST of the object. I'm assuming you want the JSON object itself?

Yea it might end up being a different function but yea it would the JSON object.

@alharris-at
Copy link
Contributor

New API has been pushed, and is available in the q1-release tagged version on NPM. Resolving.

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

No branches or pull requests

3 participants