Skip to content

Commit ef6070e

Browse files
authored
Merge pull request #18 from michielbdejong/node-with-typings
Node with typings
2 parents f7c4b53 + 8891504 commit ef6070e

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN sudo mv /tmp/protoc-gen-grpc-web /usr/local/bin/ && sudo chmod u+x /usr/loca
2525
# deps for node.js
2626
RUN curl -fsSL https://deb.nodesource.com/setup_15.x | bash -
2727
RUN apt-get install -y nodejs
28-
RUN npm install -g grpc-tools
28+
RUN npm install -g protoc-gen-grpc
2929

3030
# compile build tool and put it into path
3131
ADD . /root/cs3apis-build

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
# cs3apis-build
22
Docker image to build the CS3APIS
3+
4+
## Development
5+
See the [cs3apis local compiliation instructions](https://github.com/cs3org/cs3apis#local-compilation) and the
6+
[cs3apis Makefile](https://github.com/cs3org/cs3apis/blob/main/Makefile)
7+
for pointers on how to run and test the code in this repo on your local machine.
8+
9+
So for instance:
10+
```sh
11+
git clone https://github.com/cs3org/cs3apis-build
12+
cd cs3apis-build
13+
// make your changes in how e.g. `cs3apis-build -build-js` works
14+
docker build -t cs3apis-build .
15+
cd ..
16+
git clone https://github.com/cs3org/cs3apis
17+
cd cs3apis
18+
docker run -v `pwd`:/root/cs3apis cs3apis-build cs3apis-build -build-js
19+
cd build/js-cs3apis
20+
git status
21+
// see the result
22+
```

build.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -439,21 +439,20 @@ func buildNode() {
439439
checkout(protoBranch, "build/node-cs3apis")
440440
}
441441

442-
nodeProtocPlugin, err := exec.LookPath("grpc_tools_node_protoc_plugin")
443-
444-
if err != nil {
445-
panic(fmt.Sprintf("grpc_tools_node_protoc_plugin binary not found in PATH: %v\n", err))
446-
}
447-
448442
// remove leftovers (existing defs)
449443
os.RemoveAll("build/node-cs3apis/cs3")
450444

451445
files := findProtos()
452446

453-
args := []string{"--js_out=import_style=commonjs,binary:./build/node-cs3apis", "--grpc_out=./build/node-cs3apis/", "--plugin=protoc-gen-grpc=" + nodeProtocPlugin}
454-
args = append(args, files...)
455-
cmd := exec.Command("grpc_tools_node_protoc", args...)
456-
run(cmd)
447+
args1 := []string{"--ts_out=grpc_js:./build/node-cs3apis"} //, "--proto_path ."}
448+
args1 = append(args1, files...)
449+
cmd1 := exec.Command("protoc-gen-grpc-ts", args1...)
450+
run(cmd1)
451+
452+
args2 := []string{"--js_out=import_style=commonjs,binary:./build/node-cs3apis", "--grpc_out=grpc_js:./build/node-cs3apis/"} //, "--proto_path ."}
453+
args2 = append(args2, files...)
454+
cmd2 := exec.Command("protoc-gen-grpc", args2...)
455+
run(cmd2)
457456

458457
// get proto repo commit id
459458
hash := getCommitID(".")

0 commit comments

Comments
 (0)