diff --git a/internal/cmd/fetcher/main.go b/internal/cmd/fetcher/main.go index d411464ae..05ea601d3 100644 --- a/internal/cmd/fetcher/main.go +++ b/internal/cmd/fetcher/main.go @@ -25,9 +25,11 @@ import ( ) var ( - bazelDownloadRegexp = regexp.MustCompile(`bazelbuild/bazel/releases/download/[^/]+/bazel-[^-]+-linux`) - bazelImageName = "gcr.io/bazel-public/bazel" - errNoVersions = errors.New("no versions found") + bazelDownloadRegexp = regexp.MustCompile(`bazelbuild/bazel/releases/download/[^/]+/bazel-[^-]+-linux`) + bazelImageName = "gcr.io/bazel-public/bazel" + dockerfileImageName = "docker/dockerfile" + dockerfileSyntaxPrefix = "# syntax=docker/dockerfile:" + errNoVersions = errors.New("no versions found") ) func main() { @@ -306,6 +308,10 @@ func copyFile( if latestBazelVersion == "" { return fmt.Errorf("failed to find latest version for bazel image %q", bazelImageName) } + latestDockerfileVersion := latestBaseImages.ImageVersion(dockerfileImageName) + if latestDockerfileVersion == "" { + return fmt.Errorf("failed to find latest version for dockerfile image %q", bazelImageName) + } s := bufio.NewScanner(srcFile) for s.Scan() { line := strings.ReplaceAll(s.Text(), prevVersion, newVersion) @@ -335,6 +341,9 @@ func copyFile( } } } + if isDockerfile && strings.HasPrefix(line, dockerfileSyntaxPrefix) { + line = dockerfileSyntaxPrefix + latestDockerfileVersion + } if _, err := fmt.Fprintln(destFile, line); err != nil { return err } diff --git a/plugins/bufbuild/es/v2.0.0/.dockerignore b/plugins/bufbuild/es/v2.0.0/.dockerignore new file mode 100644 index 000000000..771bbbaa9 --- /dev/null +++ b/plugins/bufbuild/es/v2.0.0/.dockerignore @@ -0,0 +1,3 @@ +* +!Dockerfile +!package*.json diff --git a/plugins/bufbuild/es/v2.0.0/Dockerfile b/plugins/bufbuild/es/v2.0.0/Dockerfile new file mode 100644 index 000000000..846c678e7 --- /dev/null +++ b/plugins/bufbuild/es/v2.0.0/Dockerfile @@ -0,0 +1,21 @@ +# syntax=docker/dockerfile:1.9 +FROM node:20.16.0-bookworm AS build +WORKDIR /app +COPY --link package*.json . +RUN npm ci \ + && find node_modules/typescript ! -name 'typescript.js' ! -name 'package.json' -type f -exec rm -f {} + \ + && find node_modules/typescript -depth -type d -empty -delete \ + && ./node_modules/.bin/esbuild ./node_modules/.bin/protoc-gen-es --bundle --external:typescript --platform=node --outfile=protoc-gen-es.js + +FROM gcr.io/distroless/nodejs20-debian12:latest@sha256:3d8ce4f2928114e4c1a89c1fd327064b8a0aea40fe967793fb3f9dbea2213a39 AS node + +FROM gcr.io/distroless/cc-debian12:latest@sha256:3b75fdd33932d16e53a461277becf57c4f815c6cee5f6bc8f52457c095e004c8 AS base + +FROM scratch +COPY --link --from=base / / +COPY --link --from=node --chmod=0755 /nodejs/bin/node /nodejs/bin/node +COPY --link --from=build --chmod=0755 /app/protoc-gen-es.js /app/protoc-gen-es.js +COPY --link --from=build /app/node_modules/typescript /app/node_modules/typescript +USER nobody +ENTRYPOINT ["/nodejs/bin/node"] +CMD [ "/app/protoc-gen-es.js" ] diff --git a/plugins/bufbuild/es/v2.0.0/buf.plugin.yaml b/plugins/bufbuild/es/v2.0.0/buf.plugin.yaml new file mode 100644 index 000000000..ec114bcda --- /dev/null +++ b/plugins/bufbuild/es/v2.0.0/buf.plugin.yaml @@ -0,0 +1,18 @@ +version: v1 +name: buf.build/bufbuild/es +plugin_version: v2.0.0 +source_url: https://github.com/bufbuild/protobuf-es +integration_guide_url: https://github.com/bufbuild/protobuf-es#quickstart +description: Base types for TypeScript/JavaScript for use in web browsers and Node.js. Generates message and enum types. +output_languages: + - javascript + - typescript +registry: + npm: + import_style: module + rewrite_import_path_suffix: pb.js + deps: + - package: '@bufbuild/protobuf' + version: ^2.0.0 +spdx_license_id: Apache-2.0 +license_url: https://github.com/bufbuild/protobuf-es/blob/v2.0.0/LICENSE diff --git a/plugins/bufbuild/es/v2.0.0/package-lock.json b/plugins/bufbuild/es/v2.0.0/package-lock.json new file mode 100644 index 000000000..9ae7709da --- /dev/null +++ b/plugins/bufbuild/es/v2.0.0/package-lock.json @@ -0,0 +1,537 @@ +{ + "name": "plugins-bufbuild-protobuf-es", + "version": "2.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "plugins-bufbuild-protobuf-es", + "version": "2.0.0", + "dependencies": { + "@bufbuild/protoc-gen-es": "2.0.0" + }, + "devDependencies": { + "esbuild": "^0.21.4" + } + }, + "node_modules/@bufbuild/protobuf": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.0.0.tgz", + "integrity": "sha512-sw2JhwJyvyL0zlhG61aDzOVryEfJg2PDZFSV7i7IdC7nAE41WuXCru3QWLGiP87At0BMzKOoKO/FqEGoKygGZQ==", + "license": "(Apache-2.0 AND BSD-3-Clause)" + }, + "node_modules/@bufbuild/protoc-gen-es": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoc-gen-es/-/protoc-gen-es-2.0.0.tgz", + "integrity": "sha512-xXDrDFjSD97jGu9RMA8O4Myj66DdCLOFeYG7Z0mX1aCE9hayymfor+BKgKCQouUfty6CYv8709FPYpEtDurLFQ==", + "license": "Apache-2.0", + "dependencies": { + "@bufbuild/protobuf": "^2.0.0", + "@bufbuild/protoplugin": "2.0.0" + }, + "bin": { + "protoc-gen-es": "bin/protoc-gen-es" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@bufbuild/protobuf": "2.0.0" + }, + "peerDependenciesMeta": { + "@bufbuild/protobuf": { + "optional": true + } + } + }, + "node_modules/@bufbuild/protoplugin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoplugin/-/protoplugin-2.0.0.tgz", + "integrity": "sha512-y77IarGNbJfr5YZHQ+biO0O9B8rXicKLLOFRJu9mKr9LYE5/CLIKqonIBfkc/lggCK2YOtinjZJEYb39HymIog==", + "license": "Apache-2.0", + "dependencies": { + "@bufbuild/protobuf": "2.0.0", + "@typescript/vfs": "^1.5.2", + "typescript": "5.4.5" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@typescript/vfs": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.6.0.tgz", + "integrity": "sha512-hvJUjNVeBMp77qPINuUvYXj4FyWeeMMKZkxEATEU3hqBAQ7qdTBCUFT7Sp0Zu0faeEtFf+ldXxMEDr/bk73ISg==", + "license": "MIT", + "dependencies": { + "debug": "^4.1.1" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/plugins/bufbuild/es/v2.0.0/package.json b/plugins/bufbuild/es/v2.0.0/package.json new file mode 100644 index 000000000..e31bd5d58 --- /dev/null +++ b/plugins/bufbuild/es/v2.0.0/package.json @@ -0,0 +1,10 @@ +{ + "name": "plugins-bufbuild-protobuf-es", + "version": "2.0.0", + "dependencies": { + "@bufbuild/protoc-gen-es": "2.0.0" + }, + "devDependencies": { + "esbuild": "^0.21.4" + } +} diff --git a/plugins/bufbuild/protoschema-jsonschema/v0.1.5/.dockerignore b/plugins/bufbuild/protoschema-jsonschema/v0.1.5/.dockerignore new file mode 100644 index 000000000..5d0f124ff --- /dev/null +++ b/plugins/bufbuild/protoschema-jsonschema/v0.1.5/.dockerignore @@ -0,0 +1,2 @@ +* +!Dockerfile diff --git a/plugins/bufbuild/protoschema-jsonschema/v0.1.5/Dockerfile b/plugins/bufbuild/protoschema-jsonschema/v0.1.5/Dockerfile new file mode 100644 index 000000000..cda66fa1c --- /dev/null +++ b/plugins/bufbuild/protoschema-jsonschema/v0.1.5/Dockerfile @@ -0,0 +1,15 @@ +# syntax=docker/dockerfile:1.9 +FROM --platform=$BUILDPLATFORM golang:1.22.5-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" -trimpath github.com/bufbuild/protoschema-plugins/cmd/protoc-gen-jsonschema@v0.1.5 \ + && mv /go/bin/${GOOS}_${GOARCH}/protoc-gen-jsonschema /go/bin/protoc-gen-jsonschema || true + +FROM scratch +COPY --from=build --link --chown=root:root /etc/passwd /etc/passwd +COPY --from=build --link /go/bin/protoc-gen-jsonschema / +USER nobody +ENTRYPOINT [ "/protoc-gen-jsonschema" ] diff --git a/plugins/bufbuild/protoschema-jsonschema/v0.1.5/buf.plugin.yaml b/plugins/bufbuild/protoschema-jsonschema/v0.1.5/buf.plugin.yaml new file mode 100644 index 000000000..a80bd50e9 --- /dev/null +++ b/plugins/bufbuild/protoschema-jsonschema/v0.1.5/buf.plugin.yaml @@ -0,0 +1,7 @@ +version: v1 +name: buf.build/bufbuild/protoschema-jsonschema +plugin_version: v0.1.5 +source_url: https://github.com/bufbuild/protoschema-plugins +description: Generates JSON Schema files from protobuf files. This implementation uses the latest Draft 2020-12. +spdx_license_id: Apache-2.0 +license_url: https://github.com/bufbuild/protoschema-plugins/blob/v0.1.5/LICENSE diff --git a/plugins/grpc/go/source.yaml b/plugins/grpc/go/source.yaml index e2f679d3c..4837e5a30 100644 --- a/plugins/grpc/go/source.yaml +++ b/plugins/grpc/go/source.yaml @@ -1,7 +1,3 @@ source: - # Temporarily disabled until we can fix both the patch and tests. - # - # See https://github.com/bufbuild/plugins/issues/1382 for more details. - disabled: true goproxy: name: google.golang.org/grpc/cmd/protoc-gen-go-grpc diff --git a/plugins/grpc/go/v1.5.1/.dockerignore b/plugins/grpc/go/v1.5.1/.dockerignore new file mode 100644 index 000000000..7feaa9bd3 --- /dev/null +++ b/plugins/grpc/go/v1.5.1/.dockerignore @@ -0,0 +1,3 @@ +* +!Dockerfile +!separate-package.patch diff --git a/plugins/grpc/go/v1.5.1/Dockerfile b/plugins/grpc/go/v1.5.1/Dockerfile new file mode 100644 index 000000000..1cca28448 --- /dev/null +++ b/plugins/grpc/go/v1.5.1/Dockerfile @@ -0,0 +1,20 @@ +# syntax=docker/dockerfile:1.9 +FROM --platform=$BUILDPLATFORM golang:1.22.5-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.5.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" ] diff --git a/plugins/grpc/go/v1.5.1/buf.plugin.yaml b/plugins/grpc/go/v1.5.1/buf.plugin.yaml new file mode 100644 index 000000000..818486834 --- /dev/null +++ b/plugins/grpc/go/v1.5.1/buf.plugin.yaml @@ -0,0 +1,22 @@ +version: v1 +name: buf.build/grpc/go +plugin_version: v1.5.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.34.2 +registry: + go: + min_version: "1.19" + deps: + - module: google.golang.org/grpc + version: v1.64.1 + 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.5.1/LICENSE diff --git a/plugins/grpc/go/v1.5.1/separate-package.patch b/plugins/grpc/go/v1.5.1/separate-package.patch new file mode 100644 index 000000000..1d32aa2aa --- /dev/null +++ b/plugins/grpc/go/v1.5.1/separate-package.patch @@ -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{ diff --git a/tests/testdata/buf.build/bufbuild/es/v2.0.0/eliza/plugin.sum b/tests/testdata/buf.build/bufbuild/es/v2.0.0/eliza/plugin.sum new file mode 100644 index 000000000..c54a6cfa7 --- /dev/null +++ b/tests/testdata/buf.build/bufbuild/es/v2.0.0/eliza/plugin.sum @@ -0,0 +1 @@ +h1:LyFw1BwnYvlTQGyafosQmieVEcD0k466x48SbFrfvWI= diff --git a/tests/testdata/buf.build/bufbuild/es/v2.0.0/petapis/plugin.sum b/tests/testdata/buf.build/bufbuild/es/v2.0.0/petapis/plugin.sum new file mode 100644 index 000000000..0ecbdf9cc --- /dev/null +++ b/tests/testdata/buf.build/bufbuild/es/v2.0.0/petapis/plugin.sum @@ -0,0 +1 @@ +h1:GjGY5hxrz4gFytMjCKI2xXvr340uKVinp71EieVpuDw= diff --git a/tests/testdata/buf.build/bufbuild/protoschema-jsonschema/v0.1.5/eliza/plugin.sum b/tests/testdata/buf.build/bufbuild/protoschema-jsonschema/v0.1.5/eliza/plugin.sum new file mode 100644 index 000000000..1d281c789 --- /dev/null +++ b/tests/testdata/buf.build/bufbuild/protoschema-jsonschema/v0.1.5/eliza/plugin.sum @@ -0,0 +1 @@ +h1:/ZdDm57WWZpTxEM1GtqDRwgxVD0znRYkEz/k5lEbkrE= diff --git a/tests/testdata/buf.build/bufbuild/protoschema-jsonschema/v0.1.5/petapis/plugin.sum b/tests/testdata/buf.build/bufbuild/protoschema-jsonschema/v0.1.5/petapis/plugin.sum new file mode 100644 index 000000000..4f84eae5d --- /dev/null +++ b/tests/testdata/buf.build/bufbuild/protoschema-jsonschema/v0.1.5/petapis/plugin.sum @@ -0,0 +1 @@ +h1:foh7dGFdexQdYX9aIhsIDnpWPtj5g5v6NGTAsIoR+os= diff --git a/tests/testdata/buf.build/grpc/go/v1.5.1/eliza/plugin.sum b/tests/testdata/buf.build/grpc/go/v1.5.1/eliza/plugin.sum new file mode 100644 index 000000000..872f67914 --- /dev/null +++ b/tests/testdata/buf.build/grpc/go/v1.5.1/eliza/plugin.sum @@ -0,0 +1 @@ +h1:Hw5FlNjibmou08zbWixjg4gwdD98daXkj3tix8Ayyks= diff --git a/tests/testdata/buf.build/grpc/go/v1.5.1/petapis/plugin.sum b/tests/testdata/buf.build/grpc/go/v1.5.1/petapis/plugin.sum new file mode 100644 index 000000000..1a2ee0e96 --- /dev/null +++ b/tests/testdata/buf.build/grpc/go/v1.5.1/petapis/plugin.sum @@ -0,0 +1 @@ +h1:Qw+INA2Fzb7LE0XXp7RnC3YPs59EElj79WTH20OfOfg=