Skip to content

Commit 80f617a

Browse files
Upgrade protobuf-ts and mercari-grpc-federation (#1758)
1 parent 56a7da1 commit 80f617a

File tree

13 files changed

+634
-0
lines changed

13 files changed

+634
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!Dockerfile
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# syntax=docker/dockerfile:1.12
2+
FROM --platform=$BUILDPLATFORM golang:1.24.1-bookworm AS build
3+
4+
ARG TARGETOS TARGETARCH
5+
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH
6+
7+
RUN --mount=type=cache,target=/go/pkg/mod \
8+
go install -ldflags="-s -w" -trimpath github.com/mercari/grpc-federation/cmd/[email protected] \
9+
&& mv /go/bin/${GOOS}_${GOARCH}/protoc-gen-grpc-federation /go/bin/protoc-gen-grpc-federation || true
10+
11+
FROM scratch
12+
COPY --from=build --link --chown=root:root /etc/passwd /etc/passwd
13+
COPY --from=build --link --chown=root:root /go/bin/protoc-gen-grpc-federation .
14+
ENV GOROOT /
15+
USER nobody
16+
ENTRYPOINT [ "/protoc-gen-grpc-federation" ]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: v1
2+
name: buf.build/community/mercari-grpc-federation
3+
plugin_version: v1.9.8
4+
source_url: https://github.com/mercari/grpc-federation
5+
integration_guide_url: https://github.com/mercari/grpc-federation/blob/main/docs/getting_started.md
6+
description: Generates a gRPC server by writing a custom option in Protocol Buffers
7+
output_languages:
8+
- go
9+
spdx_license_id: MIT
10+
license_url: https://github.com/mercari/grpc-federation/blob/v1.9.8/LICENSE
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!Dockerfile
3+
!package*.json
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# syntax=docker/dockerfile:1.12
2+
FROM node:22.14.0-bookworm AS build
3+
WORKDIR /app
4+
COPY --link package*.json .
5+
RUN npm ci \
6+
&& ./node_modules/.bin/esbuild ./node_modules/.bin/protoc-gen-ts --bundle --external:typescript --platform=node --outfile=protoc-gen-ts.js
7+
8+
FROM gcr.io/distroless/nodejs22-debian12:latest@sha256:881157f8399d3ab71c54068f148c25296f7f9bee6d36279febad5a6f46f41c2b AS node
9+
10+
FROM gcr.io/distroless/cc-debian12:latest@sha256:b7550f0b15838de14c564337eef2b804ba593ae55d81ca855421bd52f19bb480 AS base
11+
12+
FROM scratch
13+
COPY --link --from=base / /
14+
COPY --link --from=node --chmod=0755 /nodejs/bin/node /nodejs/bin/node
15+
COPY --link --from=build --chmod=0755 /app/protoc-gen-ts.js /app/protoc-gen-ts.js
16+
COPY --link --from=build /app/node_modules/typescript /app/node_modules/typescript
17+
USER nobody
18+
ENTRYPOINT ["/nodejs/bin/node"]
19+
CMD [ "/app/protoc-gen-ts.js" ]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: v1
2+
name: buf.build/community/timostamm-protobuf-ts
3+
plugin_version: v2.9.5
4+
source_url: https://github.com/timostamm/protobuf-ts
5+
integration_guide_url: https://github.com/timostamm/protobuf-ts#quickstart
6+
description: Generates Protobuf and RPC for TypeScript.
7+
output_languages:
8+
- javascript
9+
- typescript
10+
registry:
11+
npm:
12+
import_style: module
13+
deps:
14+
- package: '@protobuf-ts/runtime'
15+
version: ^2.9.5
16+
- package: '@protobuf-ts/runtime-rpc'
17+
version: ^2.9.5
18+
opts:
19+
- output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable
20+
spdx_license_id: Apache-2.0
21+
license_url: https://github.com/timostamm/protobuf-ts/blob/v2.9.5/LICENSE

0 commit comments

Comments
 (0)