Replies: 7 comments 6 replies
-
|
Thanks for proposing this, @frantjc! We've gone back and forth on this, most recently in #70. We'd rather not do this because it makes it hard to move away from local code generation. With the current approach, you can That said, we're willing to add an option if there's significant interest. I'm going to convert this issue to a discussion and wait a bit to see if it accumulates a bunch of upvotes or comments. |
Beta Was this translation helpful? Give feedback.
-
|
@frantjc , I did not know you asked the same thing I need (#389). @akshayjshah I hope you put this behavior behind a flag, for example I wanted to switch from |
Beta Was this translation helpful? Give feedback.
-
|
Thank you all. I have successfully replaced |
Beta Was this translation helpful? Give feedback.
-
|
I understand (and agree) that it's cleaner to generate a separate package. However, not exposing the option to generate in the same output package and directory (as most plugins do) means that A specific example is that |
Beta Was this translation helpful? Give feedback.
-
|
I am open to create the PR for this feature |
Beta Was this translation helpful? Give feedback.
-
|
I am not familiar with bazel, but I wonder if it is possible to generate a subfolder inside the Having different output path is a terrible user experience when switching local buf to bazel, as it changed the import path of ConnectRPC. |
Beta Was this translation helpful? Give feedback.
-
|
A new option For example to generate output into the same directory, update to the latest And include the new option in your version: v2
plugins:
- local: protoc-gen-go
out: .
opt: paths=source_relative
- local: protoc-gen-connect-go
out: .
- opt: paths=source_relative
+ opt:
+ - paths=source_relative
+ - package_suffixSee the docs for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I had a use-case where I wanted
.connect.gofiles generated withprotoc-gen-connect-goto output to the same directory as.pb.gofiles generated withprotoc-gen-go.The reason I needed this was to preserve import paths when switching from Go structs that I'd written myself with ones generated from
.protofiles. The same package previously referenced Service Clients generated byprotoc-gen-grpc-gowhich, when extracted to the___connectpackage thatprotoc-gen-connect-gooutputs to, caused an import cycle.I forked and modified
proton-gen-connect-goto never append the___connectpart to the import path and I would like to contribute it back upstream. However, I was hoping for some direction on what flag I should check to disable appending___connectto the import path: an environment variable? A flag passed toprotoc-gen-connect-go? Something else entirely?Hope that was clearly articulated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions