Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions plugins/community/stephenh-ts-proto/v2.11.2/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!Dockerfile
!package*.json
19 changes: 19 additions & 0 deletions plugins/community/stephenh-ts-proto/v2.11.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# syntax=docker/dockerfile:1.19
FROM node:24.13.0-bookworm AS build
WORKDIR /app
COPY --link package*.json .
RUN npm ci
RUN sed -i -e 's|/usr/bin/env node|/nodejs/bin/node|g' /app/node_modules/ts-proto/protoc-gen-ts_proto \
&& rm -f /app/node_modules/dprint-node/*darwin*.node /app/node_modules/dprint-node/*win32*.node

FROM gcr.io/distroless/nodejs24-debian12:latest@sha256:b35a10df56aa17825e81e836ff70fe3c27002809dd94e6bfd655ed05bac52230 AS node

FROM gcr.io/distroless/cc-debian12:latest@sha256:72344f7f909a8bf003c67f55687e6d51a441b49661af8f660aa7b285f00e57df AS base

FROM scratch
COPY --link --from=base / /
COPY --link --from=node --chmod=0755 /nodejs/bin/node /nodejs/bin/node
COPY --link --from=build /app /app
USER nobody
ENTRYPOINT ["/nodejs/bin/node"]
CMD [ "/app/node_modules/.bin/protoc-gen-ts_proto" ]
10 changes: 10 additions & 0 deletions plugins/community/stephenh-ts-proto/v2.11.2/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: v1
name: buf.build/community/stephenh-ts-proto
plugin_version: v2.11.2
source_url: https://github.com/stephenh/ts-proto
integration_guide_url: https://github.com/stephenh/ts-proto#quickstart
description: An idiomatic protobuf generator for TypeScript.
output_languages:
- typescript
spdx_license_id: Apache-2.0
license_url: https://github.com/stephenh/ts-proto/blob/v2.11.2/LICENSE
87 changes: 87 additions & 0 deletions plugins/community/stephenh-ts-proto/v2.11.2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions plugins/community/stephenh-ts-proto/v2.11.2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "plugins-stephenh-ts-proto",
"version": "1.0.0",
"dependencies": {
"ts-proto": "2.11.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!Dockerfile
15 changes: 15 additions & 0 deletions plugins/community/sudorandom-connect-openapi/v0.25.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# syntax=docker/dockerfile:1.19
FROM --platform=$BUILDPLATFORM golang:1.25.6-bookworm AS build

ARG TARGETOS TARGETARCH
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH

RUN --mount=type=cache,target=/go/pkg/mod \
go install -ldflags "-s -w" -tags remote_plugin -trimpath github.com/sudorandom/protoc-gen-connect-openapi@v0.25.0 \
&& mv /go/bin/${GOOS}_${GOARCH}/protoc-gen-connect-openapi /go/bin/protoc-gen-connect-openapi || true

FROM scratch
COPY --from=build --link /etc/passwd /etc/passwd
COPY --from=build --link --chown=root:root /go/bin/protoc-gen-connect-openapi .
USER nobody
ENTRYPOINT [ "/protoc-gen-connect-openapi" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v1
name: buf.build/community/sudorandom-connect-openapi
plugin_version: v0.25.0
source_url: https://github.com/sudorandom/protoc-gen-connect-openapi
description: Plugin for generating OpenAPIv3 from Protobufs matching the Connect RPC interface.
spdx_license_id: MIT
license_url: https://github.com/sudorandom/protoc-gen-connect-openapi/blob/v0.25.0/LICENSE
3 changes: 3 additions & 0 deletions plugins/grpc/go/v1.6.1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!Dockerfile
!separate-package.patch
20 changes: 20 additions & 0 deletions plugins/grpc/go/v1.6.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# syntax=docker/dockerfile:1.19
FROM --platform=$BUILDPLATFORM golang:1.25.6-bookworm AS build

ARG TARGETOS TARGETARCH
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH

WORKDIR /tmp
RUN git clone --depth 1 --branch cmd/protoc-gen-go-grpc/v1.6.1 https://github.com/grpc/grpc-go.git
WORKDIR /tmp/grpc-go
COPY separate-package.patch /tmp/grpc-go
RUN git apply separate-package.patch
WORKDIR /tmp/grpc-go/cmd/protoc-gen-go-grpc
RUN --mount=type=cache,target=/go/pkg/mod \
go build -o protoc-gen-go-grpc -ldflags "-s -w" -trimpath

FROM scratch
COPY --from=build --link /etc/passwd /etc/passwd
COPY --from=build --link --chown=root:root /tmp/grpc-go/cmd/protoc-gen-go-grpc/protoc-gen-go-grpc .
USER nobody
ENTRYPOINT [ "/protoc-gen-go-grpc" ]
22 changes: 22 additions & 0 deletions plugins/grpc/go/v1.6.1/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: v1
name: buf.build/grpc/go
plugin_version: v1.6.1
source_url: https://github.com/grpc/grpc-go
integration_guide_url: https://grpc.io/docs/languages/go/quickstart
description: Generates Go client and server stubs for the gRPC framework.
output_languages:
- go
deps:
- plugin: buf.build/protocolbuffers/go:v1.36.11
registry:
go:
min_version: "1.24"
deps:
- module: google.golang.org/grpc
version: v1.78.0
opts:
- paths=source_relative
- require_unimplemented_servers=false
- separate_package=true
spdx_license_id: Apache-2.0
license_url: https://github.com/grpc/grpc-go/blob/v1.6.1/LICENSE
62 changes: 62 additions & 0 deletions plugins/grpc/go/v1.6.1/separate-package.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
diff --git a/cmd/protoc-gen-go-grpc/grpc.go b/cmd/protoc-gen-go-grpc/grpc.go
index abc21602..7d9dd638 100644
--- a/cmd/protoc-gen-go-grpc/grpc.go
+++ b/cmd/protoc-gen-go-grpc/grpc.go
@@ -20,6 +20,7 @@ package main

import (
"fmt"
+ "path"
"strconv"
"strings"

@@ -136,8 +137,27 @@ func generateFile(gen *protogen.Plugin, file *protogen.File) *protogen.Generated
if len(file.Services) == 0 {
return nil
}
- filename := file.GeneratedFilenamePrefix + "_grpc.pb.go"
- g := gen.NewGeneratedFile(filename, file.GoImportPath)
+ var g *protogen.GeneratedFile
+ if !*separatePackage {
+ filename := file.GeneratedFilenamePrefix + "_grpc.pb.go"
+ g = gen.NewGeneratedFile(filename, file.GoImportPath)
+ } else {
+ file.GoPackageName += "grpc"
+ dir := path.Dir(file.GeneratedFilenamePrefix)
+ base := path.Base(file.GeneratedFilenamePrefix)
+ file.GeneratedFilenamePrefix = path.Join(
+ dir,
+ string(file.GoPackageName),
+ base,
+ )
+ g = gen.NewGeneratedFile(
+ file.GeneratedFilenamePrefix+"_grpc.pb.go",
+ protogen.GoImportPath(path.Join(
+ string(file.GoImportPath),
+ string(file.GoPackageName),
+ )),
+ )
+ }
// Attach all comments associated with the syntax field.
genLeadingComments(g, file.Desc.SourceLocations().ByPath(protoreflect.SourcePath{fileDescriptorProtoSyntaxFieldNumber}))
g.P("// Code generated by protoc-gen-go-grpc. DO NOT EDIT.")
diff --git a/cmd/protoc-gen-go-grpc/main.go b/cmd/protoc-gen-go-grpc/main.go
index 183ba697..d0e1be60 100644
--- a/cmd/protoc-gen-go-grpc/main.go
+++ b/cmd/protoc-gen-go-grpc/main.go
@@ -46,6 +46,7 @@ const version = "1.5.1"

var requireUnimplemented *bool
var useGenericStreams *bool
+var separatePackage *bool

func main() {
showVersion := flag.Bool("version", false, "print the version and exit")
@@ -57,6 +58,7 @@ func main() {

var flags flag.FlagSet
requireUnimplemented = flags.Bool("require_unimplemented_servers", true, "set to false to match legacy behavior")
+ separatePackage = flags.Bool("separate_package", false, "set to true to write generated files to a separate grpc package")
useGenericStreams = flags.Bool("use_generic_streams_experimental", true, "set to true to use generic types for streaming client and server objects; this flag is EXPERIMENTAL and may be changed or removed in a future release")

protogen.Options{
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:Z0aXs/8ZO+Y+QV9gaH8mQIUEROA+k70gn/O8WWqLlt4=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:LdcEcGX6qsyH/fvZ9k/Zu+gcalk4Y1r+69ZUNd+QU8o=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:bfGIUhYwyjEaVR7OEPgI7au+mx+AM7kC8eo+1ET+VTM=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:tXvqQAI2yeM8+7VlRR4LY5WOPVz6elhwUNQjC7wJpeM=
1 change: 1 addition & 0 deletions tests/testdata/buf.build/grpc/go/v1.6.1/eliza/plugin.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:AIxYa2nGzzQeMmwDHgYvmEzp/Opzw2EM+m51jiFVBWY=
1 change: 1 addition & 0 deletions tests/testdata/buf.build/grpc/go/v1.6.1/petapis/plugin.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:patjPRnmkG4+EZY3hSwmL2MibWRCWlEOUXzYqC1rP8k=