Skip to content

Commit

Permalink
Generation of grpc code should also include typescript components
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed May 14, 2021
1 parent 1cab367 commit 3607598
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
14 changes: 12 additions & 2 deletions components/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*
Expand Down
9 changes: 5 additions & 4 deletions components/supervisor-api/typescript-grpcweb/build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
--ts_out="service=grpc-web:lib" \
-I${PROTOLOC:-..} ${PROTOLOC:-..}/*.proto

0 comments on commit 3607598

Please sign in to comment.