totopia-proto/third_party/protoc-gen-web.sh

20 lines
467 B
Bash
Raw Normal View History

2019-07-02 15:28:46 +00:00
#!/usr/bin/env bash
# https://help.sonatype.com/repomanager3/formats/npm-registry
set -eu
PROTO_DIR="./api/proto/v1"
PKG_DIR="./pkg/api/v1/web"
rm -fR ${PKG_DIR}
mkdir -p ${PKG_DIR}
protoc \
--proto_path=${PROTO_DIR} \
--proto_path=third_party \
--js_out=import_style=commonjs:${PKG_DIR} \
--grpc-web_out=import_style=commonjs+dts,mode=grpcweb:${PKG_DIR} \
-I ${PROTO_DIR} ${PROTO_DIR}/**/*.proto
cp ./third_party/_package.json ${PKG_DIR}/package.json