35 lines
1.0 KiB
Bash
Executable File
35 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
|
|
|
|
PROTO_DIR="./api/proto/v1"
|
|
PKG_DIR="./pkg/api/v1"
|
|
|
|
protoc \
|
|
--js_out=import_style=commonjs,binary:"${PKG_DIR}"/ \
|
|
--ts_out=import_style=commonjs,binary:"${PKG_DIR}"/ \
|
|
--grpc_out="${PKG_DIR}"/ \
|
|
--plugin=protoc-gen-grpc="${PLUGIN_GRPC}" \
|
|
--plugin=protoc-gen-ts="${PLUGIN_TS}" \
|
|
--proto_path=${PROTO_DIR} \
|
|
--proto_path=third_party \
|
|
-I ${PKG_DIR} \
|
|
${PROTO_DIR}/**/*.proto |