Skip to content

Commit fd585ed

Browse files
committed
Add anthropics/buffa-packaging plugin v0.3.0
protoc-gen-buffa-packaging emits a mod.rs module tree that includes per-file output from protoc-gen-buffa (or any plugin layered on it). The plugin reads the proto package structure (not message bodies) and writes a mod.rs that include!s each generated file at the right module nesting level. Requires `strategy: all` so the plugin sees the full file set in one invocation. Supports a `filter=services` option for packaging output from service-stub generators that skip files without services. Crates: https://crates.io/crates/protoc-gen-buffa-packaging Repo: https://github.com/anthropics/buffa
1 parent b429f98 commit fd585ed

4 files changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source:
2+
crates:
3+
crate_name: protoc-gen-buffa-packaging
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!Dockerfile
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# syntax=docker/dockerfile:1.19
2+
FROM rust:1.91.1-alpine3.22 AS builder
3+
RUN apk add --no-cache musl-dev
4+
WORKDIR /app
5+
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
6+
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked --mount=type=cache,target=/root/target \
7+
cargo install protoc-gen-buffa-packaging --version 0.3.0 --locked --root /app
8+
9+
FROM gcr.io/distroless/static-debian12:latest@sha256:87bce11be0af225e4ca761c40babb06d6d559f5767fbf7dc3c47f0f1a466b92c AS base
10+
11+
FROM scratch
12+
COPY --link --from=base / /
13+
COPY --link --from=builder /app/bin/protoc-gen-buffa-packaging /protoc-gen-buffa-packaging
14+
USER nobody
15+
ENTRYPOINT ["/protoc-gen-buffa-packaging"]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: v1
2+
name: buf.build/anthropics/buffa-packaging
3+
plugin_version: v0.3.0
4+
source_url: https://github.com/anthropics/buffa
5+
description: Emits a mod.rs module tree that includes per-file output from protoc-gen-buffa (and plugins layered on it). Run with strategy=all so the plugin sees the full file set in one invocation.
6+
output_languages:
7+
- rust
8+
spdx_license_id: Apache-2.0
9+
license_url: https://github.com/anthropics/buffa/blob/v0.3.0/LICENSE

0 commit comments

Comments
 (0)