fix: change style of comment in protos for protobufjs#150
fix: change style of comment in protos for protobufjs#150alexander-fenster wants to merge 2 commits intomasterfrom
Conversation
|
Yeah, this is weird 😆 Should we be proposing a change in |
|
I'm only parsing protos, not JavaScript, so it's probably easier and more predictable.
Fixing this in Note that we don't really use these protos for anything in the runtime (they are now published just for reference, we don't load them), and if any parsing problem happens, we'll catch it when |
|
I need to think more about the proper way of doing this, given that we now can make protobuf.js releases. |
So this one is weird.
TL;DR: in this PR we convert all
//comments to/** ... */in all the proto files that are copied to the generated client library.In the monolith generator, we created the whole
src/v*/docfolder (e.g. here) that was pretty much the copy of protos with comments, converted to JavaScript forjsdoc.In the micro-generator, we don't do that. Instead, we run
pbjsto generateprotos/protos.jsand then letjsdocread that file, which just works.But, I just realized that
jsdocdoes not consider//style comments from proto files and does not copy them to the resultingprotos/protos.js. Its documentation says here:So... we must convert the proto comments from
//to/** ... */to make them go into the jsdoc. Luckily, we have a great place to do that - right in the code where we copy proto files into the resulting directory. This PR does exactly that.