-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add _pb
or .pb
suffix to generated filenames
#186
Labels
enhancement
New feature or request
Comments
I've always found it best to generate into a dedicated directory. But I see your point. It looks like every official code generator for languages that import based on file names to add a |
_pb
or .pb
suffix to generated filenames
timostamm
added a commit
that referenced
this issue
Jan 3, 2022
5e07925 adds a new plugin option:
I'll close this issue when it is released. |
Released as v2.2.0-alpha.0 in the |
What about |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the generated file with the messages cannot be recognized by filename alone unlike some of the standard generators like for C++ and Python. This can be considered an issue since developers may wish to exclude checkin of generated files like with a
.gitignore
file, or perform automatic analysis on the files. Also there is the issue of accidentally overwriting Typescript source code with the same filename if the protos are kept in separate source tree.If it is not possible to evolve the default naming scheme, I'd highly recommend adding a plugin option to make the generated file names distinctive. For example, given
kw/admin.proto
, it should generate file names likekw/admin.pb.ts
,kw/admin.pb_grpc_client.ts
, andkw/admin.pb_grpc_server.ts
.The
pb_
part informs us that it is generated withprotoc
andgrpc_
for the transport. It's slightly unfortunate that most assume that gRPC always implies Protobuf, but FlatBuffers is also a supported message serialization type... so always having thepb_
part helps avoiding conflicts depending on the FlatBuffer generator implementation.The text was updated successfully, but these errors were encountered: