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

Always generate files when no services exist #598

Conversation

sjbarag
Copy link
Contributor

@sjbarag sjbarag commented Apr 29, 2023

Previously, protoc-gen-connect-es would not emit a file when an input .proto file had no services declared within it. This unfortunately broke the keep_empty_files option, as there was never an empty file to keep. Ensure a file is always generated for each input file, allowing keep_empty_files to determine if it should remain before exiting.

fixes #597

Copy link
Member

@timostamm timostamm left a comment

Choose a reason for hiding this comment

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

Thank for the update, Sean. We actually don't need the if statement at all - updating the docs in bufbuild/protobuf-es#480. Do you mind removing the if statement completely as suggested in the three generator functions?

packages/protoc-gen-connect-es/src/declaration.ts Outdated Show resolved Hide resolved
@sjbarag sjbarag force-pushed the protoc-gen-connect-es_generate-file-when-no-services-found branch from e67fd1e to ceeb0cc Compare May 1, 2023 15:41
Previously, protoc-gen-connect-es would not emit a file when an
input .proto file had no services declared within it. This unfortunately
broke the keep_empty_files option, as there was never an empty file to
keep. Ensure a file is always generated for each input file, allowing
keep_empty_files to determine if it should remain before exiting.

fixes connectrpc#597
@sjbarag sjbarag force-pushed the protoc-gen-connect-es_generate-file-when-no-services-found branch from ceeb0cc to cfd5600 Compare May 1, 2023 17:55
Copy link
Member

@timostamm timostamm left a comment

Choose a reason for hiding this comment

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

Thank you for for the contribution 🙂

@timostamm timostamm merged commit 29dc336 into connectrpc:main May 2, 2023
2 of 3 checks passed
@sjbarag sjbarag deleted the protoc-gen-connect-es_generate-file-when-no-services-found branch May 2, 2023 15:18
@timostamm timostamm mentioned this pull request May 17, 2023
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.

protoc-gen-connect-es: keep_empty_files=true doesn't emit some empty files
2 participants