pbsync allows your IDE to properly resolve protobuf sources that are built with Bazel.
Currently supports most Go protos and some TypeScript protos (.d.ts
definitions built with protobufjs).
Install it with go:
go install github.com/buildbuddy-io/pbsync@latest
# Then run as `pbsync`Or install it as a bb plugin:
bb install --user buildbuddy-io/pbsyncYou can get a nice development workflow by combining this plugin with the
--watch flag, which will build and copy protos immediately after you
edit them.
go1.19 or highermake
When you run pbsync:
-
It looks for all
.protofiles in your repo, usinggit ls-filesfor speed. -
For each proto, it looks for BUILD rules that depend on the proto.
-
For supported language-specific rules, it looks for the file in the bazel generated source tree, and copies it to the workspace.
NOTE: pbsync does NOT build anything for you (yet). It just
copies protos that are already built.
- Original implementation by Vadim Berezniker in https://github.com/vadimberezniker/sgp
- Adapted from Zoey Greer's implementation in https://github.com/tempoz/sgp