Skip to content

Commit

Permalink
feat: add ts-protoc-gen plugin support
Browse files Browse the repository at this point in the history
  • Loading branch information
markin-io authored and rvolosatovs committed Nov 25, 2022
1 parent f092d99 commit e42e045
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
GRPC_RUST_VERSION=${{ env.GRPC_RUST_VERSION }}
GRPC_SWIFT_VERSION=${{ env.GRPC_SWIFT_VERSION }}
GRPC_WEB_VERSION=${{ env.GRPC_WEB_VERSION }}
NODE_VERSION=${{ env.NODE_VERSION }}
PROTOC_GEN_DART_VERSION=${{ env.PROTOC_GEN_DART_VERSION }}
PROTOC_GEN_DOC_VERSION=${{ env.PROTOC_GEN_DOC_VERSION }}
PROTOC_GEN_GO_GRPC_VERSION=${{ env.PROTOC_GEN_GO_GRPC_VERSION }}
Expand Down
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

ARG ALPINE_VERSION
ARG GO_VERSION
ARG NODE_VERSION
ARG RUST_VERSION
ARG SWIFT_VERSION

Expand Down Expand Up @@ -295,6 +296,17 @@ ARG TARGETPLATFORM
RUN xx-verify /out/usr/bin/protoc-gen-lint


FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} as protoc_gen_ts
ARG PROTOC_GEN_TS_VERSION
RUN npm install -g pkg ts-protoc-gen@${PROTOC_GEN_TS_VERSION}
RUN pkg \
--compress Brotli \
--targets node${NODE_VERSION}-alpine \
-o protoc-gen-ts \
/usr/local/lib/node_modules/ts-protoc-gen
RUN install -D protoc-gen-ts /out/usr/bin/protoc-gen-ts


FROM --platform=$BUILDPLATFORM alpine_host as upx
RUN mkdir -p /upx
ARG BUILDARCH BUILDOS UPX_VERSION
Expand Down Expand Up @@ -331,6 +343,7 @@ RUN find /out -name "*.a" -delete -or -name "*.la" -delete
FROM alpine:${ALPINE_VERSION}
LABEL maintainer="Roman Volosatovs <[email protected]>"
COPY --from=upx /out/ /
COPY --from=protoc_gen_ts /out/ /
RUN apk add --no-cache \
bash\
grpc \
Expand Down Expand Up @@ -378,6 +391,7 @@ RUN protoc-wrapper \
--python_out=/test \
--ruby_out=/test \
--rust_out=/test \
--ts_out=/test \
--validate_out=lang=go:/test \
google/protobuf/any.proto
RUN protoc-wrapper \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ It started out as https://github.com/znly/docker-protobuf fork, but grew into a
- [grpc/grpc-java](https://github.com/grpc/grpc-java) (not on `arm64`)
- [grpc/grpc-swift](https://github.com/grpc/grpc-swift) (not on `arm64`, see https://github.com/rvolosatovs/docker-protobuf/issues/77 for potential issues)
- [grpc/grpc-web](https://github.com/grpc/grpc-web)
- [improbable-eng/ts-protoc-gen](https://github.com/improbable-eng/ts-protoc-gen)
- [protobuf-c/protobuf-c](https://github.com/protobuf-c/protobuf-c)
- [pseudomuto/protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc)
- [stepancheg/grpc-rust](https://github.com/stepancheg/grpc-rust)
Expand All @@ -40,6 +41,7 @@ It started out as https://github.com/znly/docker-protobuf fork, but grew into a
- Ruby
- Rust
- Swift
- Typescript

## Usage
```
Expand Down
1 change: 1 addition & 0 deletions check-versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func main() {
{"stepancheg", "rust-protobuf"},
{"rust-lang", "rust"},
{"apple", "swift"},
{"improbable-eng", "ts-protoc-gen"},
{"upx", "upx"},
} {
tag := "n/a"
Expand Down
2 changes: 2 additions & 0 deletions deps.list
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ GRPC_GATEWAY_VERSION=2.14.0
GRPC_RUST_VERSION=0.8.3
GRPC_SWIFT_VERSION=1.13.0
GRPC_WEB_VERSION=1.4.2
NODE_VERSION=18.5.0
PROTOC_GEN_DOC_VERSION=1.5.1
PROTOC_GEN_GO_GRPC_VERSION=1.51.0
PROTOC_GEN_GO_VERSION=1.28.1
Expand All @@ -15,6 +16,7 @@ PROTOC_GEN_GQL_VERSION=0.8.0
PROTOC_GEN_JSONSCHEMA_VERSION=1.3.10
PROTOC_GEN_LINT_VERSION=0.3.0
PROTOC_GEN_RUST_VERSION=3.2.0
PROTOC_GEN_TS_VERSION=0.15.0
PROTOC_GEN_VALIDATE_VERSION=0.9.0
RUST_VERSION=1.65.0
SWIFT_VERSION=5.7-focal
Expand Down

0 comments on commit e42e045

Please sign in to comment.