diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 8cf4755c..1d8ab6c2 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile index ab325202..88ee4659 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ ARG ALPINE_VERSION ARG GO_VERSION +ARG NODE_VERSION ARG RUST_VERSION ARG SWIFT_VERSION @@ -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 @@ -331,6 +343,7 @@ RUN find /out -name "*.a" -delete -or -name "*.la" -delete FROM alpine:${ALPINE_VERSION} LABEL maintainer="Roman Volosatovs " COPY --from=upx /out/ / +COPY --from=protoc_gen_ts /out/ / RUN apk add --no-cache \ bash\ grpc \ @@ -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 \ diff --git a/README.md b/README.md index 881a354d..7a1e07d2 100644 --- a/README.md +++ b/README.md @@ -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) @@ -40,6 +41,7 @@ It started out as https://github.com/znly/docker-protobuf fork, but grew into a - Ruby - Rust - Swift +- Typescript ## Usage ``` diff --git a/check-versions.go b/check-versions.go index 00b3c7bd..1c8cfe65 100755 --- a/check-versions.go +++ b/check-versions.go @@ -60,6 +60,7 @@ func main() { {"stepancheg", "rust-protobuf"}, {"rust-lang", "rust"}, {"apple", "swift"}, + {"improbable-eng", "ts-protoc-gen"}, {"upx", "upx"}, } { tag := "n/a" diff --git a/deps.list b/deps.list index dd61edb2..9894169f 100644 --- a/deps.list +++ b/deps.list @@ -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 @@ -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