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

Generate typescript definitions from content model #241

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

chrismatix
Copy link
Contributor

fixes #217

@@ -19,6 +19,17 @@ java_library(
deps = lib_deps,
)

java_binary(
Copy link
Contributor Author

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;
Copy link
Contributor Author

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.

@lucapette lucapette changed the base branch from main to develop November 9, 2020 08:06
@paulodiniz
Copy link
Contributor

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");
Copy link
Contributor Author

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.

@chrismatix chrismatix merged commit ad89011 into develop Nov 9, 2020
@chrismatix chrismatix deleted the generate-typescript-defs branch November 9, 2020 15:33
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

Successfully merging this pull request may close these issues.

Generate Typescript definitions from message content
2 participants