-
Notifications
You must be signed in to change notification settings - Fork 44
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
Generate typescript definitions from content model #241
Conversation
@@ -19,6 +19,17 @@ java_library( | |||
deps = lib_deps, | |||
) | |||
|
|||
java_binary( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lucapette and @paulodiniz as long as we don't want to create ts definitions for anything else (which I think makes sense, because this problem is so unique), I would keep the generator as a binary that is local to this package.
text: string; | ||
} | ||
|
||
export type ContentUnion = Text; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this, we can build a switch { case }
function in the components lib that takes a Content
payload and depending on the type field returns a react component.
3abba2b
to
3d829a1
Compare
Nice work! |
parameters.debug = false; | ||
parameters.classNamePatterns = List.of("co.airy.mapping.model.**"); | ||
|
||
final File output = new File(System.getenv().get("BUILD_WORKSPACE_DIRECTORY") + "/frontend/components/src/content.ts"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the same spirit, everything here is hardcoded on purpose.
3d829a1
to
82a4476
Compare
fixes #217