add protobuf transport and refactor to support (#24)

This commit is contained in:
Josh Thomas 2024-12-11 20:28:57 -06:00 committed by GitHub
parent b3e0ee7b6e
commit 643a47953e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 406 additions and 74 deletions

37
.just/proto.just Normal file
View file

@ -0,0 +1,37 @@
set unstable := true
justfile := justfile_directory() + "/.just/proto.just"
[private]
default:
@just --list --justfile {{ justfile }}
[no-cd]
[private]
check:
#!/usr/bin/env sh
if ! command -v protoc > /dev/null 2>&1; then
echo "protoc is not installed. Please install protobuf-compiler"
exit 1
fi
[private]
fmt:
@just --fmt --justfile {{ justfile }}
# Generate protobuf code for both Rust and Python
[no-cd]
gen:
@just proto rust
@just proto py
# Generate protobuf code for Rust
[no-cd]
rust: check
cargo build -p djls-types
# Generate protobuf code for Python
[no-cd]
py: check
protoc -I=proto --python_out=python/djls proto/*.proto