Expand description
Bundle a protobuf source into the artefacts the descriptor toolkit and an
operator need: one combined FileDescriptorSet (.pb), one proto3 file per
package, and a fully-qualified message-type manifest. See ADR-0063 and
docs/blueprints/proto-bundle-implementation-plan.md.
The source may be a single .proto, a bare directory of protos, or a
Java/Maven/Gradle repo with many src/main/proto roots — all resolved through
one entry point. Compilation is pure Rust via protox (no protoc on PATH).
use std::path::Path;
use twg_proto_bundle::{bundle, BundleOptions};
let out = bundle(Path::new("/path/to/proto-source"), Path::new("./out"), &BundleOptions::default())?;
// out.messages.roots contains e.g. "com.example.orders.Order"
std::fs::write("./out/bundle.pb", &out.descriptor_set).unwrap();Structs§
- Bundle
- The in-memory result of bundling, returned regardless of what was written.
- Bundle
Options - Options controlling source resolution, conflict handling, and rendering.
- EmitSet
- Which artefacts to write to the output directory. All default on.
- Message
Manifest - The message-type inventory written to
<name>.messages.json. - Missing
Import - One unresolved
importand the staged files that require it. - Rendered
Proto - One rendered
proto3file.
Enums§
- Bundle
Error - Anything that can go wrong resolving, deduping, compiling, or rendering a proto source into a bundle.
- OnConflict
- How to treat an import path that resolves to differing content under different include roots.
- WktImports
- Where the Google well-known-type imports live.