-
Notifications
You must be signed in to change notification settings - Fork 132
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
Can this be used with buf? #93
Comments
Yes, protobuf-ts is a regular protoc plugin and can be used with buf. Example version: v1beta1
# The plugins to run.
plugins:
# The name of the plugin.
# Required.
# By default, buf generate will look for a binary named protoc-gen-NAME on your $PATH.
- name: ts
# The the relative output directory.
# Required.
out: gen/ts
# See "available plugin parameters"
# https://github.com/timostamm/protobuf-ts/blob/master/MANUAL.md#the-protoc-plugin
opt: generate_dependencies,long_type_string
# The custom path to the plugin binary, if not protoc-gen-NAME on your $PATH.
# Assuming you have installed @protobuf-ts/plugin in the working directory:
path: ./node_modules/@protobuf-ts/plugin/bin/protoc-gen-ts See https://docs.buf.build/generate-usage If you encounter any problems, let me know. |
Thank you for the quick response! That worked 🎉 |
As a next step, I am planning to try to package the generated files into an npm package to distribute to clients. If all goes well, is it ok to make a PR with an example where buf is used to generate the client. |
It is just a simple wrapper written in Javascript for the real protocol buffer compiler Code generation always starts with |
That would be nice! Just add packages/example-buf/ with a README |
Thank you for the detailed explanation! I am still trying to wrap my head around the gRPC ecosystem and how everything ties together 😅 |
Thank you for making this great tool for generating idiomatic TypeScript code from proto files along with RPC support as well!
I was wondering how to use this with buf. Any advice would be helpful. Thanks in advance 🙇🏼
The text was updated successfully, but these errors were encountered: