-
Notifications
You must be signed in to change notification settings - Fork 272
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
Monorepository package based buf generator #2440
Labels
Feature
New feature or request
Comments
doriable
added
Feature
New feature or request
and removed
Feature
New feature or request
labels
Jun 10, 2024
This is a similar feature request to #3060, which is supporting plugin configurations on a per module/input basis, so closing as a duplicate of that issue to consolidate all discussion there. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey all,
I have a monorepository with multiple APIs. I am migrating from protoc to buf for generating my gRPC, gRPC-Gateway, and openapiv2 code from my .proto files for each API. Currently, I have a root buf.worker.yaml that contains my shared libraries in my libs/proto and a buf.gen.yaml file per API that uses the same plugins, but different output paths since I want the generated code to be output relative to the API the code is being generated for. I'm not sure if this is the right approach and am looking for feedback if there is a way to control the output path to be relative to the API the code is being generated for. If I am able to do that I can create a buf.gen.api.yaml file in my root and reuse that as my template for each API if I can specify the root output to be the API the code is being generated for.
For example, I have a mono repository structure like this:
I would prefer to be able to remove the buf.gen.yaml per API and instead have a template in my root called "buf.gen.api.yaml" since the only part that is different is the output path. Then I would bbe able to use a command such as
buf generate --template buf.gen.api.yaml --path apps/api-a/internal/proto --outputroot apps/api-a
and then output the generated code relative to the outputroot path.Does my current solution work or is there a way to create an approach similiar to the one above and remove the duplication buf.gen.yaml files per API since they use the same plugins and just need the output to be relative to the api the code is being generated for?
The text was updated successfully, but these errors were encountered: