From 360759883778f3414e5c54fdfc8cae16068a19c9 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Fri, 14 May 2021 09:03:19 -0400 Subject: [PATCH] Generation of grpc code should also include typescript components --- components/BUILD.yaml | 14 ++++++++++++-- .../supervisor-api/typescript-grpcweb/build.sh | 9 +++++---- 2 files changed, 17 insertions(+), 6 deletions(-) mode change 100644 => 100755 components/supervisor-api/typescript-grpcweb/build.sh diff --git a/components/BUILD.yaml b/components/BUILD.yaml index 8eec5955d14dd9..c2b9f1614758ec 100644 --- a/components/BUILD.yaml +++ b/components/BUILD.yaml @@ -93,14 +93,24 @@ scripts: srcs: - components/**/* script: | - COMPONENTS=( content-service-api image-builder-api registry-facade-api supervisor-api ws-daemon-api ws-manager-api ws-manager-bridge-api ) + GO_COMPONENTS=( content-service-api image-builder-api registry-facade-api supervisor-api ws-daemon-api ws-manager-api ws-manager-bridge-api ) - for COMPONENT in "${COMPONENTS[@]}";do + for COMPONENT in "${GO_COMPONENTS[@]}";do echo "Generating code for component $COMPONENT..." pushd $COMPONENT > /dev/null ./generate.sh popd > /dev/null done + + WEB_COMPONENTS=( supervisor-api/typescript-grpc supervisor-api/typescript-rest supervisor-api/typescript-grpcweb ) + for COMPONENT in "${WEB_COMPONENTS[@]}";do + echo "Generating code for component $COMPONENT..." + pushd $COMPONENT > /dev/null + yarn install + ./build.sh + popd > /dev/null + done + - name: update-go-modules srcs: - components/**/* diff --git a/components/supervisor-api/typescript-grpcweb/build.sh b/components/supervisor-api/typescript-grpcweb/build.sh old mode 100644 new mode 100755 index 33658e144ddc67..56eb46c0f9e256 --- a/components/supervisor-api/typescript-grpcweb/build.sh +++ b/components/supervisor-api/typescript-grpcweb/build.sh @@ -3,8 +3,9 @@ # Licensed under the GNU Affero General Public License (AGPL). # See License-AGPL.txt in the project root for license information. +DIR=$(cd $(dirname "${BASH_SOURCE}") && pwd -P) -THIRD_PARTY_INCLUDES=${PROTOLOC:-..} +THIRD_PARTY_INCLUDES=${PROTOLOC:-$DIR/..} if [ ! -d $THIRD_PARTY_INCLUDES/third_party/google/api ]; then echo "missing $THIRD_PARTY_INCLUDES/third_party/google/api" exit -1 @@ -15,7 +16,7 @@ mkdir -p lib export PROTO_INCLUDE="-I$THIRD_PARTY_INCLUDES/third_party -I /usr/lib/protoc/include" protoc $PROTO_INCLUDE \ - --plugin="protoc-gen-ts=`which protoc-gen-ts`" \ + --plugin="protoc-gen-ts=$DIR/node_modules/.bin/protoc-gen-ts" \ --js_out="import_style=commonjs,binary:lib" \ - --ts_out="grpc_js,service=grpc-web:lib" \ - -I${PROTOLOC:-..} ${PROTOLOC:-..}/*.proto \ No newline at end of file + --ts_out="service=grpc-web:lib" \ + -I${PROTOLOC:-..} ${PROTOLOC:-..}/*.proto