Skip to content

Commit 3607598

Browse files
committed
Generation of grpc code should also include typescript components
1 parent 1cab367 commit 3607598

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

components/BUILD.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,24 @@ scripts:
9393
srcs:
9494
- components/**/*
9595
script: |
96-
COMPONENTS=( content-service-api image-builder-api registry-facade-api supervisor-api ws-daemon-api ws-manager-api ws-manager-bridge-api )
96+
GO_COMPONENTS=( content-service-api image-builder-api registry-facade-api supervisor-api ws-daemon-api ws-manager-api ws-manager-bridge-api )
9797
98-
for COMPONENT in "${COMPONENTS[@]}";do
98+
for COMPONENT in "${GO_COMPONENTS[@]}";do
9999
echo "Generating code for component $COMPONENT..."
100100
pushd $COMPONENT > /dev/null
101101
./generate.sh
102102
popd > /dev/null
103103
done
104+
105+
WEB_COMPONENTS=( supervisor-api/typescript-grpc supervisor-api/typescript-rest supervisor-api/typescript-grpcweb )
106+
for COMPONENT in "${WEB_COMPONENTS[@]}";do
107+
echo "Generating code for component $COMPONENT..."
108+
pushd $COMPONENT > /dev/null
109+
yarn install
110+
./build.sh
111+
popd > /dev/null
112+
done
113+
104114
- name: update-go-modules
105115
srcs:
106116
- components/**/*

components/supervisor-api/typescript-grpcweb/build.sh

100644100755
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
# Licensed under the GNU Affero General Public License (AGPL).
44
# See License-AGPL.txt in the project root for license information.
55

6+
DIR=$(cd $(dirname "${BASH_SOURCE}") && pwd -P)
67

7-
THIRD_PARTY_INCLUDES=${PROTOLOC:-..}
8+
THIRD_PARTY_INCLUDES=${PROTOLOC:-$DIR/..}
89
if [ ! -d $THIRD_PARTY_INCLUDES/third_party/google/api ]; then
910
echo "missing $THIRD_PARTY_INCLUDES/third_party/google/api"
1011
exit -1
@@ -15,7 +16,7 @@ mkdir -p lib
1516
export PROTO_INCLUDE="-I$THIRD_PARTY_INCLUDES/third_party -I /usr/lib/protoc/include"
1617

1718
protoc $PROTO_INCLUDE \
18-
--plugin="protoc-gen-ts=`which protoc-gen-ts`" \
19+
--plugin="protoc-gen-ts=$DIR/node_modules/.bin/protoc-gen-ts" \
1920
--js_out="import_style=commonjs,binary:lib" \
20-
--ts_out="grpc_js,service=grpc-web:lib" \
21-
-I${PROTOLOC:-..} ${PROTOLOC:-..}/*.proto
21+
--ts_out="service=grpc-web:lib" \
22+
-I${PROTOLOC:-..} ${PROTOLOC:-..}/*.proto

0 commit comments

Comments
 (0)