I have some proto files which I've been playing with using C# for both the client and server sides. As I've been learning Angular recently I'd like to import them into Typescript and play around with what I've been learning.
I thought this would be pretty straightforward, but after many hours in to trying this for Typescript and I'm getting nowhere. I'm not even quite sure where the problem is.
This is the the what I'm trying to run for generating one of the protos... (from the folder that protoc is in)
protoc --plugin=protoc-gen-ts="C:\AngularCode\MClient\node_modules\.bin\protoc-gen-ts.cmd" --js_out="service=grpc-web:C:\AngularCode\MClient\src\generated" --ts_out="service=grpc-web:C:\AngularCode\MClient\src\generated" --proto_path="C:\AngularCode\MClient\src\app\protos" C:\AngularCode\MClient\src\app\protos\control\control.proto
Which gives me
'protoc-gen-js' is not recognized as an internal or external command,
operable program or batch file.
--js_out: protoc-gen-js: Plugin failed with status code 1.
I dont see protoc-gen-js in the node_modules.bin folder where there are various protoc-gen-ts files, but I'm not sure where its supposed to come from.
If I omit the --js_out section it does generate 3 files
control_pb.d.ts
control_pb_service.d.ts
control_pb_service.js
which I thought looked promising, but I cant generate the request as it seems to be confused (or I am) between the class and namespace in control_pb.d.ts
My guess is the missing js file is stopping me from moving on, but several hours searching are getting me nowhere. I see plenty where protoc-gen-gprc-web is not recognised but not protoc-gen-js. A lot of the examples are scripts for Linux or Mac so I cant use them as is.
Any help would be much appreciated, I'm sure I'm doing something daft somewhere...