Closed tatemz closed 2 years ago
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To complete the pull request process, please assign marcuslongmuir
You can assign the PR to them by writing /assign @marcuslongmuir
in a comment when ready.
The full list of commands accepted by this bot can be found here.
Dev Note: This feature may not be needed by most, but I found that it is helpful when wanting to generate for grpc-node
and grpc-web
simultaneously. Feel free to suggest any alternative methods for accomplishing this.
I was hoping that grpc-tools
allowed for the commonjs+dts
option, but it does not, and the proto-loader
is not a protoc plugin - https://github.com/grpc/proposal/pull/183#discussion_r453237722
/assign @marcuslongmuir
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Changes
This change adds the
grpcOnly
parameter to the plugin in order to handle the cases where the user wants to exclusively generate the types for the grpc service only.Prior to this change, users could not use
grpc-tools
,grpc-web
, andts-protoc-gen
simultaneously.After this change, it is possible to let
grpc-web
generate the.d.ts
files (using thecommonjs+dts
ortypescript
options) for the non-gRPC generated files, while lettingts-protoc-gen
singularly manage the generation of the.d.ts
files forgrpc-node
Verification
Tested it with the following
buf.gen.yml
configuration: