From b0a52807581f5a8c4426471caa6a0aa488356001 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Thu, 4 Nov 2021 09:16:30 +0100 Subject: [PATCH] Revert "Node with typings" --- Dockerfile | 2 +- README.md | 20 -------------------- build.go | 19 ++++++++++--------- 3 files changed, 11 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index 23091c2..82ee12e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN sudo mv /tmp/protoc-gen-grpc-web /usr/local/bin/ && sudo chmod u+x /usr/loca # deps for node.js RUN curl -fsSL https://deb.nodesource.com/setup_15.x | bash - RUN apt-get install -y nodejs -RUN npm install -g protoc-gen-grpc +RUN npm install -g grpc-tools # compile build tool and put it into path ADD . /root/cs3apis-build diff --git a/README.md b/README.md index 41336bc..404590d 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,2 @@ # cs3apis-build Docker image to build the CS3APIS - -## Development -See the [cs3apis local compiliation instructions](https://github.com/cs3org/cs3apis#local-compilation) and the -[cs3apis Makefile](https://github.com/cs3org/cs3apis/blob/main/Makefile) -for pointers on how to run and test the code in this repo on your local machine. - -So for instance: -```sh -git clone https://github.com/cs3org/cs3apis-build -cd cs3apis-build -// make your changes in how e.g. `cs3apis-build -build-js` works -docker build -t cs3apis-build . -cd .. -git clone https://github.com/cs3org/cs3apis -cd cs3apis -docker run -v `pwd`:/root/cs3apis cs3apis-build cs3apis-build -build-js -cd build/js-cs3apis -git status -// see the result -``` diff --git a/build.go b/build.go index c615862..678bbac 100644 --- a/build.go +++ b/build.go @@ -439,20 +439,21 @@ func buildNode() { checkout(protoBranch, "build/node-cs3apis") } + nodeProtocPlugin, err := exec.LookPath("grpc_tools_node_protoc_plugin") + + if err != nil { + panic(fmt.Sprintf("grpc_tools_node_protoc_plugin binary not found in PATH: %v\n", err)) + } + // remove leftovers (existing defs) os.RemoveAll("build/node-cs3apis/cs3") files := findProtos() - args1 := []string{"--ts_out=grpc_js:./build/node-cs3apis"} //, "--proto_path ."} - args1 = append(args1, files...) - cmd1 := exec.Command("protoc-gen-grpc-ts", args1...) - run(cmd1) - - args2 := []string{"--js_out=import_style=commonjs,binary:./build/node-cs3apis", "--grpc_out=grpc_js:./build/node-cs3apis/"} //, "--proto_path ."} - args2 = append(args2, files...) - cmd2 := exec.Command("protoc-gen-grpc", args2...) - run(cmd2) + args := []string{"--js_out=import_style=commonjs,binary:./build/node-cs3apis", "--grpc_out=./build/node-cs3apis/", "--plugin=protoc-gen-grpc=" + nodeProtocPlugin} + args = append(args, files...) + cmd := exec.Command("grpc_tools_node_protoc", args...) + run(cmd) // get proto repo commit id hash := getCommitID(".")