Skip to content

Commit

Permalink
chore: add protoc-gen-js
Browse files Browse the repository at this point in the history
  • Loading branch information
strophy committed Jan 29, 2023
1 parent a63377c commit 414230e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@
"depNameTemplate": "danielvladco/go-proto-gql",
"datasourceTemplate": "github-releases"
},
{
"fileMatch": ["^deps\\.list$"],
"matchStrings": ["PROTOC_GEN_JS_VERSION=(?<currentValue>.*?)\\n"],
"depNameTemplate": "protocolbuffers/protobuf-javascript",
"datasourceTemplate": "github-releases"
},
{
"fileMatch": ["^deps\\.list$"],
"matchStrings": ["PROTOC_GEN_JSONSCHEMA_VERSION=(?<currentValue>.*?)\\n"],
Expand Down
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,26 @@ ARG TARGETPLATFORM
RUN xx-verify /out/usr/bin/protoc-gen-lint


# Build protoc_gen_js from source until it becomes available as an alpine package
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/14399
FROM alpine:${ALPINE_IMAGE_VERSION} as protoc_gen_js
COPY --from=xx / /
RUN mkdir -p /out
RUN echo "@edge-testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk add --no-cache \
bazel4@edge-testing \
build-base \
curl
RUN mkdir -p /protoc_gen_js
ARG PROTOC_GEN_JS_VERSION
RUN curl -sSL https://api.github.com/repos/protocolbuffers/protobuf-javascript/tarball/${PROTOC_GEN_JS_VERSION} | tar xz --strip 1 -C /protoc_gen_js
WORKDIR /protoc_gen_js
RUN bazel build plugin_files
RUN install -D /protoc_gen_js/bazel-bin/generator/protoc-gen-js /out/usr/bin/protoc-gen-js
ARG TARGETPLATFORM
RUN xx-verify /out/usr/bin/protoc-gen-js


FROM node:${NODE_IMAGE_VERSION} as protoc_gen_ts
ARG NODE_IMAGE_VERSION
ARG PROTOC_GEN_TS_VERSION
Expand Down Expand Up @@ -368,6 +388,7 @@ COPY --from=protoc_gen_gorm /out/ /out/
COPY --from=protoc_gen_gotemplate /out/ /out/
COPY --from=protoc_gen_govalidators /out/ /out/
COPY --from=protoc_gen_gql /out/ /out/
COPY --from=protoc_gen_js /out/ /out/
COPY --from=protoc_gen_jsonschema /out/ /out/
COPY --from=protoc_gen_lint /out/ /out/
COPY --from=protoc_gen_rust /out/ /out/
Expand Down
1 change: 1 addition & 0 deletions deps.list
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ PROTOC_GEN_GORM_VERSION=v1.1.2
PROTOC_GEN_GOTEMPLATE_VERSION=v1.11.3
PROTOC_GEN_GOVALIDATORS_VERSION=v0.3.2
PROTOC_GEN_GQL_VERSION=v0.8.0
PROTOC_GEN_JS_VERSION=v3.21.2
PROTOC_GEN_JSONSCHEMA_VERSION=1.3.10
PROTOC_GEN_LINT_VERSION=v0.3.0
PROTOC_GEN_RUST_VERSION=v3.2.0
Expand Down

0 comments on commit 414230e

Please sign in to comment.