From e2dcfde48cafa2e6af1cf06ad9fd163740278fd6 Mon Sep 17 00:00:00 2001 From: sundbp Date: Thu, 22 Mar 2018 13:04:44 +0000 Subject: [PATCH] Add support to generate nodejs output. (#51) * Add support to generate nodejs output. Currently the commonjs import_style seems to be working a lot better than the closure style, at least when using grpc. * Remove stray unused env var. * include node in test.sh --- all/entrypoint.sh | 5 ++++- all/test.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/all/entrypoint.sh b/all/entrypoint.sh index 3c4f8334..f830e506 100755 --- a/all/entrypoint.sh +++ b/all/entrypoint.sh @@ -19,7 +19,7 @@ printUsage() { } GEN_GATEWAY=false -SUPPORTED_LANGUAGES=("go" "ruby" "csharp" "java" "python" "objc") +SUPPORTED_LANGUAGES=("go" "ruby" "csharp" "java" "python" "objc" "node") EXTRA_INCLUDES="" OUT_DIR="" @@ -143,6 +143,9 @@ case $GEN_LANG in "java") GEN_STRING="--grpc_out=$OUT_DIR --${GEN_LANG}_out=$OUT_DIR --plugin=protoc-gen-grpc=`which protoc-gen-grpc-java`" ;; + "node") + GEN_STRING="--grpc_out=$OUT_DIR --js_out=import_style=commonjs,binary:$OUT_DIR --plugin=protoc-gen-grpc=`which grpc_${PLUGIN_LANG}_plugin`" + ;; *) GEN_STRING="--grpc_out=$OUT_DIR --${GEN_LANG}_out=$OUT_DIR --plugin=protoc-gen-grpc=`which grpc_${PLUGIN_LANG}_plugin`" ;; diff --git a/all/test.sh b/all/test.sh index b616331c..56f7c355 100755 --- a/all/test.sh +++ b/all/test.sh @@ -1,6 +1,6 @@ #!/bin/bash -LANGS=("go" "ruby" "csharp" "java" "python" "objc") +LANGS=("go" "ruby" "csharp" "java" "python" "objc" "node") CONTAINER=$1