Languages
Go
Protip includes protoc-gen-go
for generating Go code and (optionally) gRPC client/server stub code.
[[proto]]
[proto.go]
# Output path described where to write generated code. Path is relative to the
# root of the repository.
#
# The input paths will be appended to the output path, example:
# proto/foo/foo.proto -> golang/src/proto/foo/foo.go.pb
# proto/bar/example/example.proto -> golang/src/proto/bar/example/example.go.pb
#
# Type: string
# Required.
output_path = "golang/src/"
# Whether to generate gRPC client/server stub code.
#
# Type: boolean
# Optional, default is false.
grpc = true
Javascript
Protip includes the default Javascript Protocol Buffer compiler.
[[proto]]
[proto.js]
# Output path described where to write generated code. Path is relative to the
# root of the repository.
#
# The input paths will be appended to the output path, example:
# proto/foo/foo.proto -> js/src/proto/foo/foo_pb.js
# proto/bar/example/example.proto -> js/src/proto/bar/example/example_pb.js
#
# Type: string
# Required.
output_path = "js/src/"
Typescript (Definitions)
Protip includes protoc-gen-grpc-web
, which is capable of generating Typescript definition files
for generated Javascript code using CommonJS-style import code (see above).
Use the following configuration to generate Typescript definition files. gRPC-Web code will only be generated if services are defined.
[[proto]]
[proto.grpcweb]
# Output path described where to write generated code. Path is relative to the
# root of the repository.
#
# The input paths will be appended to the output path, example:
# proto/foo/foo.proto -> js/src/proto/foo/foo_pb.d.ts
# proto/bar/example/example.proto -> js/src/proto/bar/example/example_pb.d.ts
#
# Type: string
# Required.
output_path = "js/src/"
# Whether to generate Typescript definition files.
#
# Type: boolean
# Optional, default is false.
typescript = true
gRPC-Web
Protip includes protoc-gen-grpc-web
, which is capable of generating Javascript
(and optionally Typescript) gRPC client/server stub code.
[[proto]]
[proto.grpcweb]
# Output path described where to write generated code. Path is relative to the
# root of the repository.
#
# The input paths will be appended to the output path, example:
# proto/foo/foo.proto -> js/src/proto/foo/foo_pb.d.ts
# proto/bar/example/example.proto -> js/src/proto/bar/example/example_pb.d.ts
#
# Type: string
# Required.
output_path = "js/src/"
# Whether to generate Typescript definition files.
#
# Type: boolean
# Optional, default is false.
typescript = true