registry-sdk/scripts/proto-gen.sh
prathamesh0 ce3cfbd457
Update proto files and regenerate ts bindings (#1)
* Update proto files

* Update script to generate typescript definitions

* Generate typescript definitions from protobuf files

* Cleanup unnecessary proto files

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
2024-03-06 12:01:09 +05:30

20 lines
416 B
Bash
Executable File

#!/bin/bash
# NOTE: protoc is required
set -e
REPO_ROOT=$(pwd)
I=$REPO_ROOT/proto
DEST_TS=$REPO_ROOT/src/proto2/
echo "Generating protobuf files"
mkdir -p $DEST_TS
protoc \
--plugin=$REPO_ROOT/node_modules/.bin/protoc-gen-ts_proto \
--ts_proto_out=$DEST_TS \
--proto_path=$I \
--ts_proto_opt="esModuleInterop=true,forceLong=long,useOptionals=messages" \
$(find $REPO_ROOT/proto/cerc -iname "*.proto")