From bba3a227df1f103da7146576f1a30f3d1e502a4f Mon Sep 17 00:00:00 2001 From: Yun Lai Date: Mon, 26 Oct 2020 15:44:43 +1100 Subject: [PATCH] rename generated protobuf ts file to have suffix .pb.ts --- README.md | 13 +++++++++++++ data/file.go | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c7b0be7 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +#protoc-gen-grpc-gateway-ts + +`protoc-gen-grpc-gateway-ts` is a Typescript client generator for the [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway/) project. It generates idiomatic Typescript clients that connect the web frontend and golang backend fronted by grpc-gateway. + + +Features: +1. idiomatic Typescript clients and messages +2. Supports both One way and server side streaming gRPC calls +3. POJO request construction guarded by message type definitions, which is way easier compare to `grpc-web` +4. No need to use swagger/open api to generate client code for the web. + +License +protoc-gen-grpc-gateway-ts is licensed under the MIT License. See LICENSE.txt for more details. \ No newline at end of file diff --git a/data/file.go b/data/file.go index dc42f95..28e2691 100644 --- a/data/file.go +++ b/data/file.go @@ -97,7 +97,7 @@ func GetTSFileName(fileName string) string { baseName := filepath.Base(fileName) ext := filepath.Ext(fileName) name := baseName[0 : len(baseName)-len(ext)] - return path.Join(filepath.Dir(fileName), name+".ts") + return path.Join(filepath.Dir(fileName), name+".pb.ts") } // Type is an interface to get type out of field and method arguments