Skip to content

Commit

Permalink
Switch Node.js SDK grpc dependency to grpc-js (#1529)
Browse files Browse the repository at this point in the history
* update generation of libs. update libs. update sdk. update and fix tests. change emitter to stream. update example to 1.5.0

* Move grpc-tools installation to Dockerfile and fix version

* hopefully fix node-pre-gyp bug
  • Loading branch information
steven-supersolid committed May 12, 2020
1 parent f491005 commit 6c909e8
Show file tree
Hide file tree
Showing 11 changed files with 525 additions and 1,185 deletions.
3 changes: 3 additions & 0 deletions build/build-sdk-images/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ FROM $BASE_IMAGE
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs

# Installing request is to address a bug with node-pre-gyp
RUN npm install --unsafe-perm --global request@2.88.2 grpc-tools@1.8.1

# code generation scripts
COPY *.sh /root/
RUN chmod +x /root/*.sh
4 changes: 2 additions & 2 deletions build/build-sdk-images/node/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ googleapis=/go/src/agones.dev/agones/proto/googleapis

cd /go/src/agones.dev/agones

protoc -I ${googleapis} -I ${sdk} --grpc_out=minimum_node_version=12:./sdks/nodejs/lib --plugin=protoc-gen-grpc=`which grpc_node_plugin` sdk.proto
protoc -I ${googleapis} -I ${sdk} --js_out=import_style=commonjs,binary:./sdks/nodejs/lib sdk.proto ${googleapis}/google/api/annotations.proto ${googleapis}/google/api/http.proto
grpc_tools_node_protoc --proto_path=${googleapis} --proto_path=${sdk} --js_out=import_style=commonjs,binary:./sdks/nodejs/lib google/api/annotations.proto google/api/http.proto
grpc_tools_node_protoc --proto_path=${googleapis} --proto_path=${sdk} --grpc_out=generate_package_definition:./sdks/nodejs/lib --js_out=import_style=commonjs,binary:./sdks/nodejs/lib sdk.proto

header ./sdks/nodejs/lib/sdk_pb.js
header ./sdks/nodejs/lib/google/api/annotations_pb.js
Expand Down
136 changes: 76 additions & 60 deletions examples/nodejs-simple/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/nodejs-simple/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@google-cloud/agones-sdk": "1.4.0"
"@google-cloud/agones-sdk": "1.5.0"
},
"scripts": {
"start": "node src/index.js"
Expand Down

0 comments on commit 6c909e8

Please sign in to comment.