odds-crawler-proto/third_party/protoc-gen-ts.sh
2019-05-11 13:06:16 +09:00

34 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -eu
# ./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
# ./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
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