odds-crawler-proto/third_party/protoc-gen-ts.sh

35 lines
1.0 KiB
Bash
Raw Normal View History

2019-05-01 13:23:18 +00:00
#!/usr/bin/env bash
set -eu
2019-05-11 04:06:16 +00:00
# ./node_modules/.bin/grpc_tools_node_protoc \
# --js_out=import_style=commonjs,binary:pkg/api/v1 \
# --grpc_out=pkg/api/v1 \
# --plugin=protoc-gen-grpc=./node_modules/.bin/grpc_tools_node_protoc_plugin \
# --proto_path=api/proto/v1
# --proto_path=third_party
# -I api/proto/v1 api/proto/v1/*.proto
2019-05-01 13:23:18 +00:00
2019-05-11 04:06:16 +00:00
# ./node_modules/.bin/grpc_tools_node_protoc \
# --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \
# --ts_out=pkg/api/v1 \
# --proto_path=api/proto/v1
# --proto_path=third_party
# -I api/proto/v1 api/proto/v1/*.proto
2019-05-01 13:23:18 +00:00
2019-05-11 04:06:16 +00:00
PLUGIN_TS=./node_modules/.bin/protoc-gen-ts
PLUGIN_GRPC=./node_modules/.bin/grpc_tools_node_protoc_plugin
2019-05-12 06:03:01 +00:00
PROTO_DIR="./api/proto/v1"
PKG_DIR="./pkg/api/v1"
2019-05-11 04:06:16 +00:00
protoc \
2019-05-12 06:03:01 +00:00
--js_out=import_style=commonjs,binary:"${PKG_DIR}"/ \
--ts_out=import_style=commonjs,binary:"${PKG_DIR}"/ \
--grpc_out="${PKG_DIR}"/ \
2019-05-11 04:06:16 +00:00
--plugin=protoc-gen-grpc="${PLUGIN_GRPC}" \
--plugin=protoc-gen-ts="${PLUGIN_TS}" \
2019-05-12 06:03:01 +00:00
--proto_path=${PROTO_DIR} \
2019-05-11 04:06:16 +00:00
--proto_path=third_party \
2019-05-12 06:03:01 +00:00
-I ${PKG_DIR} \
${PROTO_DIR}/**/*.proto