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

feat: Add type annotations flag #786

Merged
merged 5 commits into from
May 2, 2023

Conversation

Ekrekr
Copy link
Contributor

@Ekrekr Ekrekr commented Feb 24, 2023

Fixes #780

@Ekrekr Ekrekr changed the title Add type annotations flag feat: Add type annotations flag Feb 24, 2023
@stephenh
Copy link
Owner

@Ekrekr this looks great! Looks like a build failure, hopefully minor but I haven't had a chance to take a look, can you see if it's an easy fix? Thanks!

Copy link
Contributor Author

@Ekrekr Ekrekr left a comment

Choose a reason for hiding this comment

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

Have fixed this now - culprit was a options.outputTypeRegistry || options.outputTypeRegistry rather than options.outputTypeAnnotations || options.outputTypeRegistry.

Was having trouble with having to do docker-compose with no --rm vs docker compose previously so couldn't run tests locally, but got it working now.

src/main.ts Outdated
@@ -688,7 +695,8 @@ function makeTimestampMethods(options: Options, longs: ReturnType<typeof makeLon
seconds = "Math.trunc(date.getTime() / 1_000).toString()";
}

const maybeTypeField = options.outputTypeRegistry ? `$type: 'google.protobuf.Timestamp',` : "";
const maybeTypeField =
options.outputTypeRegistry || options.outputTypeRegistry ? `$type: 'google.protobuf.Timestamp',` : "";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

main culprit

@stephenh
Copy link
Owner

stephenh commented May 2, 2023

Looks great, thanks @Ekrekr !

@stephenh stephenh merged commit b565ff5 into stephenh:main May 2, 2023
stephenh pushed a commit that referenced this pull request May 2, 2023
# [1.147.0](v1.146.0...v1.147.0) (2023-05-02)

### Features

* Add type annotations flag ([#786](#786)) ([b565ff5](b565ff5))
@stephenh
Copy link
Owner

stephenh commented May 2, 2023

🎉 This PR is included in version 1.147.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Why are outputted protos not classes
2 participants