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

34 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
SRC_DIR=./api/proto/v1
DIST_DIR=./pkg/api/v1
protoc \
--js_out=import_style=commonjs,binary:"${DIST_DIR}"/ \
--ts_out=import_style=commonjs,binary:"${DIST_DIR}"/ \
--grpc_out="${DIST_DIR}"/ \
--plugin=protoc-gen-grpc="${PLUGIN_GRPC}" \
--plugin=protoc-gen-ts="${PLUGIN_TS}" \
--proto_path=${SRC_DIR} \
--proto_path=third_party \
-I ${DIST_DIR} \
${SRC_DIR}/*.proto