From 9a39c829b644456b18db41864a8f3770c4a1d43f Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Thu, 26 Jan 2023 12:15:38 -0600 Subject: [PATCH] Add connect-query v0.1.0 plugin (#330) Create a plugin for bufbuild/connect-query. Fixes #328. --- plugins/bufbuild/connect-query/source.yaml | 3 + .../connect-query/v0.1.0/.dockerignore | 3 + .../bufbuild/connect-query/v0.1.0/Dockerfile | 11 ++ .../connect-query/v0.1.0/buf.plugin.yaml | 21 +++ .../connect-query/v0.1.0/package-lock.json | 146 ++++++++++++++++++ .../connect-query/v0.1.0/package.json | 7 + .../connect-query/v0.1.0/eliza/plugin.sum | 1 + .../connect-query/v0.1.0/petapis/plugin.sum | 1 + 8 files changed, 193 insertions(+) create mode 100644 plugins/bufbuild/connect-query/source.yaml create mode 100644 plugins/bufbuild/connect-query/v0.1.0/.dockerignore create mode 100644 plugins/bufbuild/connect-query/v0.1.0/Dockerfile create mode 100644 plugins/bufbuild/connect-query/v0.1.0/buf.plugin.yaml create mode 100644 plugins/bufbuild/connect-query/v0.1.0/package-lock.json create mode 100644 plugins/bufbuild/connect-query/v0.1.0/package.json create mode 100644 tests/testdata/buf.build/bufbuild/connect-query/v0.1.0/eliza/plugin.sum create mode 100644 tests/testdata/buf.build/bufbuild/connect-query/v0.1.0/petapis/plugin.sum diff --git a/plugins/bufbuild/connect-query/source.yaml b/plugins/bufbuild/connect-query/source.yaml new file mode 100644 index 000000000..4b2d6f34b --- /dev/null +++ b/plugins/bufbuild/connect-query/source.yaml @@ -0,0 +1,3 @@ +source: + npm_registry: + name: "@bufbuild/protoc-gen-connect-query" diff --git a/plugins/bufbuild/connect-query/v0.1.0/.dockerignore b/plugins/bufbuild/connect-query/v0.1.0/.dockerignore new file mode 100644 index 000000000..771bbbaa9 --- /dev/null +++ b/plugins/bufbuild/connect-query/v0.1.0/.dockerignore @@ -0,0 +1,3 @@ +* +!Dockerfile +!package*.json diff --git a/plugins/bufbuild/connect-query/v0.1.0/Dockerfile b/plugins/bufbuild/connect-query/v0.1.0/Dockerfile new file mode 100644 index 000000000..3b3595eb1 --- /dev/null +++ b/plugins/bufbuild/connect-query/v0.1.0/Dockerfile @@ -0,0 +1,11 @@ +# syntax=docker/dockerfile:1.4 +FROM node:18.13.0-alpine3.17 AS build +WORKDIR /app +COPY --link package*.json . +RUN npm ci +RUN sed -i -e 's|/usr/bin/env node|/nodejs/bin/node|g' /app/node_modules/@bufbuild/protoc-gen-connect-query/bin/protoc-gen-connect-query + +FROM gcr.io/distroless/nodejs18-debian11 +COPY --link --from=build /app /app +USER nobody +ENTRYPOINT [ "/app/node_modules/.bin/protoc-gen-connect-query" ] diff --git a/plugins/bufbuild/connect-query/v0.1.0/buf.plugin.yaml b/plugins/bufbuild/connect-query/v0.1.0/buf.plugin.yaml new file mode 100644 index 000000000..012c10e51 --- /dev/null +++ b/plugins/bufbuild/connect-query/v0.1.0/buf.plugin.yaml @@ -0,0 +1,21 @@ +version: v1 +name: buf.build/bufbuild/connect-query +plugin_version: v0.1.0 +source_url: https://github.com/bufbuild/connect-query +description: Generates client stubs for calling Connect services with TanStack Query. +deps: + - plugin: buf.build/bufbuild/es:v1.0.0 +output_languages: + - javascript + - typescript +registry: + npm: + import_style: module + rewrite_import_path_suffix: connectquery.js + deps: + - package: '@bufbuild/connect-query' + version: ^0.1.0 + - package: '@bufbuild/protobuf' + version: ^1.0.0 +spdx_license_id: Apache-2.0 +license_url: https://github.com/bufbuild/connect-query/blob/main/LICENSE diff --git a/plugins/bufbuild/connect-query/v0.1.0/package-lock.json b/plugins/bufbuild/connect-query/v0.1.0/package-lock.json new file mode 100644 index 000000000..2748f5cfe --- /dev/null +++ b/plugins/bufbuild/connect-query/v0.1.0/package-lock.json @@ -0,0 +1,146 @@ +{ + "name": "plugins-bufbuild-connect-query", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "plugins-bufbuild-connect-query", + "version": "1.0.0", + "dependencies": { + "@bufbuild/protoc-gen-connect-query": "0.1.0" + } + }, + "node_modules/@bufbuild/protobuf": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.0.0.tgz", + "integrity": "sha512-oH3jHBrZ6to8Qf4zLg7O8KqSY42kQZNBRXJRMp5uSi0mqE4L8NbyMnZHeOsbXmTb0xpptRyH11LfS+KeVhXzAA==" + }, + "node_modules/@bufbuild/protoc-gen-connect-query": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoc-gen-connect-query/-/protoc-gen-connect-query-0.1.0.tgz", + "integrity": "sha512-ZsjLpN3+xBuLHnhmGOMlX3SStbVZBEUuR0AqF73v5NOm31v4eb3GRWpU8N2MZnWr1IFuK8L4niFxAgGvdc6/oA==", + "dependencies": { + "@bufbuild/protobuf": "^1.0.0", + "@bufbuild/protoplugin": "^1.0.0" + }, + "bin": { + "protoc-gen-connect-query": "bin/protoc-gen-connect-query" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@bufbuild/protoc-gen-es": "1.x" + }, + "peerDependenciesMeta": { + "@bufbuild/protoc-gen-es": { + "optional": true + } + } + }, + "node_modules/@bufbuild/protoplugin": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoplugin/-/protoplugin-1.0.0.tgz", + "integrity": "sha512-L7z2/4MgP36QGEAh8T4OYrdMRv//LAw4gGpL8D3cziE21uP6FLzLKpIxJ4aJBoUyHyS53tpZMpb0djbxYDecFA==", + "dependencies": { + "@bufbuild/protobuf": "1.0.0", + "@typescript/vfs": "^1.4.0", + "typescript": "4.5.2" + } + }, + "node_modules/@typescript/vfs": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.4.0.tgz", + "integrity": "sha512-Pood7yv5YWMIX+yCHo176OnF8WUlKGImFG7XlsuH14Zb1YN5+dYD3uUtS7lqZtsH7tAveNUi2NzdpQCN0yRbaw==", + "dependencies": { + "debug": "^4.1.1" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "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==" + }, + "node_modules/typescript": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", + "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + } + }, + "dependencies": { + "@bufbuild/protobuf": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.0.0.tgz", + "integrity": "sha512-oH3jHBrZ6to8Qf4zLg7O8KqSY42kQZNBRXJRMp5uSi0mqE4L8NbyMnZHeOsbXmTb0xpptRyH11LfS+KeVhXzAA==" + }, + "@bufbuild/protoc-gen-connect-query": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoc-gen-connect-query/-/protoc-gen-connect-query-0.1.0.tgz", + "integrity": "sha512-ZsjLpN3+xBuLHnhmGOMlX3SStbVZBEUuR0AqF73v5NOm31v4eb3GRWpU8N2MZnWr1IFuK8L4niFxAgGvdc6/oA==", + "requires": { + "@bufbuild/protobuf": "^1.0.0", + "@bufbuild/protoplugin": "^1.0.0" + } + }, + "@bufbuild/protoplugin": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoplugin/-/protoplugin-1.0.0.tgz", + "integrity": "sha512-L7z2/4MgP36QGEAh8T4OYrdMRv//LAw4gGpL8D3cziE21uP6FLzLKpIxJ4aJBoUyHyS53tpZMpb0djbxYDecFA==", + "requires": { + "@bufbuild/protobuf": "1.0.0", + "@typescript/vfs": "^1.4.0", + "typescript": "4.5.2" + } + }, + "@typescript/vfs": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.4.0.tgz", + "integrity": "sha512-Pood7yv5YWMIX+yCHo176OnF8WUlKGImFG7XlsuH14Zb1YN5+dYD3uUtS7lqZtsH7tAveNUi2NzdpQCN0yRbaw==", + "requires": { + "debug": "^4.1.1" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "typescript": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", + "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==" + } + } +} diff --git a/plugins/bufbuild/connect-query/v0.1.0/package.json b/plugins/bufbuild/connect-query/v0.1.0/package.json new file mode 100644 index 000000000..12f86f2cb --- /dev/null +++ b/plugins/bufbuild/connect-query/v0.1.0/package.json @@ -0,0 +1,7 @@ +{ + "name": "plugins-bufbuild-connect-query", + "version": "1.0.0", + "dependencies": { + "@bufbuild/protoc-gen-connect-query": "0.1.0" + } +} diff --git a/tests/testdata/buf.build/bufbuild/connect-query/v0.1.0/eliza/plugin.sum b/tests/testdata/buf.build/bufbuild/connect-query/v0.1.0/eliza/plugin.sum new file mode 100644 index 000000000..896cbb931 --- /dev/null +++ b/tests/testdata/buf.build/bufbuild/connect-query/v0.1.0/eliza/plugin.sum @@ -0,0 +1 @@ +h1:38B4PIpgi0T3FvfVmQb8fxqiFiFG8JzhG4DSGuhATqA= diff --git a/tests/testdata/buf.build/bufbuild/connect-query/v0.1.0/petapis/plugin.sum b/tests/testdata/buf.build/bufbuild/connect-query/v0.1.0/petapis/plugin.sum new file mode 100644 index 000000000..b12072a45 --- /dev/null +++ b/tests/testdata/buf.build/bufbuild/connect-query/v0.1.0/petapis/plugin.sum @@ -0,0 +1 @@ +h1:n6eN1SBkxst5nQq8rwlcdXXBrlm17UiLnHi/xprHBUY=