Skip to content

Repoless gen for TS #462

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

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Repoless gen for TS #462

merged 2 commits into from
Sep 26, 2024

Conversation

DavidSGK
Copy link
Member

Updated TS code generation methods to allow generating from repo contents instead of relying on local repository.

  • Split GenTS into GenTS (this will essentially be used as a library) and GenTSFromLocal
  • Cleaned up some code to pass explicit type registry
  • Moved DecodeRepositoryContents method
  • Added option in lekko gen ts to take encoded repo contents and output generated TS code
lekko gen ts -n <namespace> --repo-contents <output of npx lekko-sync>

@DavidSGK DavidSGK self-assigned this Sep 26, 2024
}

// Output is expected to be base64 encoded serialized RepositoryContents message
func syncTSOutputToRepositoryContents(output []byte) (*featurev1beta1.RepositoryContents, error) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was moved to be repo/contents/DecodeRepositoryContents

Copy link
Contributor

@lekko-jonathan lekko-jonathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kind of nice that go and ts are slowly becoming more similar again in their interfaces

@lekko-jonathan
Copy link
Contributor

It probably makes sense to commit this one before 463 since they collide, but 463 will be trivial to update

@DavidSGK DavidSGK merged commit 4174dc4 into main Sep 26, 2024
1 check passed
@DavidSGK DavidSGK deleted the david/ts-repoless-gen branch September 26, 2024 00:56
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.

2 participants