Commit Graph

30 Commits

Author SHA1 Message Date
charles 7e43e09f66 Clean up generated code and implement strip_boilerplate
Remove redundant newlines and duplicate headers from generated files
and prevent the creation of empty sub-modules. Implement the
`strip_boilerplate` function to remove generated headers and
attributes, including a comprehensive test suite.
2026-05-19 23:08:05 -07:00
charles 117cbf812b Introduce alloc feature for optional allocation
Wrap heap-allocated types and service generation in the `alloc` feature
flag to support environments without a memory allocator.
2026-05-19 21:55:18 -07:00
charles 6910f11d69 Add no_std test example and update alloc gating
Update codegen to make `bytes` imports conditional on the `alloc`
feature and add a test example for the `thumbv7em-none-eabihf`
target.
2026-05-18 08:43:22 -07:00
charles fa4d8cca83 Support no_std in roto-runtime
Add #![no_std] to the runtime crate and introduce optional std and
alloc features. Update the code generator to be compatible and add a
no_std_test example. Remove the generator binary.
2026-05-17 19:55:44 -07:00
charles 956993d1d0 Split service and proto gen 2026-05-17 18:53:00 -07:00
charles 33f3e58f74 Use original method names for gRPC paths
Stop converting method names to snake_case when generating the gRPC
service paths to maintain compatibility with protobuf definitions.
2026-05-17 10:44:07 -07:00
charles 89455190b1 Many fixes later 2026-05-17 00:43:21 -07:00
charles b11b068345 Update crate references in codegen tests
Update imports to use `roto_tonic` instead of `crate` for BufferPool
and StatusBody. Remove the broad replacement of `crate` with `roto`
and add error output to `test_map_build.rs`.
2026-05-16 19:45:46 -07:00
charles 2202548ae5 Support gRPC packages in generated code
Include package names in the `NamedService` identifier and request
paths. Change generated imports to use `crate` and add `tokio` and
`tokio-stream` dependencies to `roto-tonic`.
2026-05-16 16:57:01 -07:00
charles 809a0d844c Update StatusBody to support gRPC trailers
Change StatusBody from a tuple struct to a struct containing both data
and trailers. Update the codegen to use the new StatusBody::new
constructor to specify gRPC status codes.

Also remove the temp_test_project.
2026-05-15 18:57:15 -07:00
charles db89c9842a Add http dependency to helloworld build test 2026-05-15 14:25:16 -07:00
charles 546b74149e Fix code generator and add compilation test
Correct module paths and accessor usage in the generator to ensure
generated code builds. Add a test that verifies this by compiling the
generated code in a temporary project.
2026-05-15 14:13:18 -07:00
charles 372eab94d4 Fix path resolution in codegen build tests
Use absolute paths for temporary project directories and dependencies
to improve reliability. Update the generated Cargo.toml with additional
dependencies and remove the offline flag from cargo build.
2026-05-15 11:00:50 -07:00
charles cc82e990ba Update generated code build test
Use absolute paths for the test project, add roto-tonic and other
dependencies, and capture build output on failure.
2026-05-15 10:49:56 -07:00
charles da7ba47505 Fix generated code and update example integration
Resolve `Result` ambiguity and lifetime issues in generated services.
Use `file_stem` for proto filenames. Make `StatusBody` public in
`roto-tonic` and update the `hello_world` build process.
2026-05-15 10:29:54 -07:00
charles 08be61966c Fix stuff 2026-05-13 23:08:21 -07:00
charles daa42d2d07 Update dependencies in codegen build tests
Bump bytes version to 1.7 and synchronize dependencies across all
generated Cargo.toml files in codegen tests.
2026-05-12 14:03:28 -07:00
charles 804ff3ead0 Checkpoint for gRPC implementation 2026-05-12 13:44:53 -07:00
charles 02a0b0d908 Initial commit of AI generated slop 2026-05-11 22:31:04 -07:00
charles 17ab0d1670 Update generated protobuf code 2026-05-11 17:43:56 -07:00
charles 792f2d5f5d Ensure we use roto_runtime rather than crate for error types 2026-05-11 17:43:25 -07:00
charles 6e045fd808 Add _or_default accessors to generated messages
Update map_type_to_rust_accessor to provide default values for each
type, which are used to generate helper methods that return a default
value when a field is missing.
2026-05-08 23:20:40 -07:00
charles 7e368feddf Add method signature for repeated fields 2026-05-07 21:21:29 -07:00
charles d9186e697e Fix merge conflicts and generated code logic in generator.rs 2026-05-07 20:53:08 -07:00
charles 13625a48c9 Add support for Protobuf oneof fields in generator
Generate `which_<oneof>` methods and corresponding enums to handle
oneof fields in generated messages. Also add `has_<field>` helper
methods for all fields.
2026-05-07 20:15:16 -07:00
charles a20eed7223 Add support for protobuf map fields
Update the generator to detect map fields and use MapFieldIterator.
Implement MapFieldIterator in the runtime to handle key-value pair
extraction and add write_map_entry to ProtoBuilder. Add tests to
verify that map-bearing messages generate and compile correctly.
2026-05-07 20:15:08 -07:00
charles 8395195ac1 Clean tests 2026-05-07 17:59:39 -07:00
charles f76a020b1e Add test to verify generated code builds
Create a temporary Cargo project to ensure that the Rust code generated from
`test_types.desc` compiles successfully.
2026-05-06 16:21:21 -07:00
charles 80f3aa49ba Fix bug in codegen 2026-05-06 16:03:56 -07:00
charles ea68537f0b Refactor crate into multiple subcrates 2026-05-04 22:48:26 -07:00