From fd585ed4de5fd3d561edf63c48e4b95e30b65b6e Mon Sep 17 00:00:00 2001 From: Iain McGinniss <309153+iainmcgin@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:26:42 +0000 Subject: [PATCH] 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 --- plugins/anthropics/buffa-packaging/source.yaml | 3 +++ .../buffa-packaging/v0.3.0/.dockerignore | 2 ++ .../anthropics/buffa-packaging/v0.3.0/Dockerfile | 15 +++++++++++++++ .../buffa-packaging/v0.3.0/buf.plugin.yaml | 9 +++++++++ 4 files changed, 29 insertions(+) create mode 100644 plugins/anthropics/buffa-packaging/source.yaml create mode 100644 plugins/anthropics/buffa-packaging/v0.3.0/.dockerignore create mode 100644 plugins/anthropics/buffa-packaging/v0.3.0/Dockerfile create mode 100644 plugins/anthropics/buffa-packaging/v0.3.0/buf.plugin.yaml diff --git a/plugins/anthropics/buffa-packaging/source.yaml b/plugins/anthropics/buffa-packaging/source.yaml new file mode 100644 index 000000000..0bd8f8e95 --- /dev/null +++ b/plugins/anthropics/buffa-packaging/source.yaml @@ -0,0 +1,3 @@ +source: + crates: + crate_name: protoc-gen-buffa-packaging diff --git a/plugins/anthropics/buffa-packaging/v0.3.0/.dockerignore b/plugins/anthropics/buffa-packaging/v0.3.0/.dockerignore new file mode 100644 index 000000000..5d0f124ff --- /dev/null +++ b/plugins/anthropics/buffa-packaging/v0.3.0/.dockerignore @@ -0,0 +1,2 @@ +* +!Dockerfile diff --git a/plugins/anthropics/buffa-packaging/v0.3.0/Dockerfile b/plugins/anthropics/buffa-packaging/v0.3.0/Dockerfile new file mode 100644 index 000000000..9554ab167 --- /dev/null +++ b/plugins/anthropics/buffa-packaging/v0.3.0/Dockerfile @@ -0,0 +1,15 @@ +# syntax=docker/dockerfile:1.19 +FROM rust:1.91.1-alpine3.22 AS builder +RUN apk add --no-cache musl-dev +WORKDIR /app +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked --mount=type=cache,target=/root/target \ + cargo install protoc-gen-buffa-packaging --version 0.3.0 --locked --root /app + +FROM gcr.io/distroless/static-debian12:latest@sha256:87bce11be0af225e4ca761c40babb06d6d559f5767fbf7dc3c47f0f1a466b92c AS base + +FROM scratch +COPY --link --from=base / / +COPY --link --from=builder /app/bin/protoc-gen-buffa-packaging /protoc-gen-buffa-packaging +USER nobody +ENTRYPOINT ["/protoc-gen-buffa-packaging"] diff --git a/plugins/anthropics/buffa-packaging/v0.3.0/buf.plugin.yaml b/plugins/anthropics/buffa-packaging/v0.3.0/buf.plugin.yaml new file mode 100644 index 000000000..f7e77b850 --- /dev/null +++ b/plugins/anthropics/buffa-packaging/v0.3.0/buf.plugin.yaml @@ -0,0 +1,9 @@ +version: v1 +name: buf.build/anthropics/buffa-packaging +plugin_version: v0.3.0 +source_url: https://github.com/anthropics/buffa +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. +output_languages: + - rust +spdx_license_id: Apache-2.0 +license_url: https://github.com/anthropics/buffa/blob/v0.3.0/LICENSE