Skip to content

Commit efcda40

Browse files
committed
chore: upgrade buf config to v2 to fix everything
1 parent 37e8ba9 commit efcda40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+5991
-13054
lines changed

Makefile

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,35 @@ PROTO_OPTS=--proto_path=protos --go_out=paths=source_relative:protos
77

88
all: build
99

10-
deps: deps/go
10+
.PHONY: deps/system
11+
deps/system:
1112
./scripts/installDeps.sh
1213

14+
.PHONY: deps/local-plugin
15+
deps/local-plugin:
16+
git submodule update --init --recursive
17+
cd buf-plugin-openapi && make clean install
18+
19+
1320
.PHONY: deps/dev
14-
deps/dev:
21+
deps/dev: deps/system deps/local-plugin
22+
${GO} get google.golang.org/protobuf/cmd/protoc-gen-go
23+
${GO} get google.golang.org/grpc/cmd/protoc-gen-go-grpc
24+
${GO} get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
1525
${GO} get github.com/grpc-ecosystem/protoc-gen-grpc-gateway-ts
16-
cd protos && buf dep update
26+
${GO} get github.com/akuity/grpc-gateway-client/protoc-gen-grpc-gateway-client@latest
27+
buf dep update
1728

18-
.PHONY: deps
29+
.PHONY: deps/go
1930
deps/go:
2031
${GO} mod tidy
2132
npm install
2233

23-
pre-build:
24-
git submodule update --init --recursive
25-
cd buf-plugin-openapi && make clean install
26-
2734
.PHONY: proto
28-
proto: pre-build
35+
proto:
2936
rm -rf gen/python || true
3037
rm -rf gen/pre-python || true
31-
buf generate protos
38+
buf generate
3239
# ./scripts/generatePipModule.sh
3340
# mkdir gen/openapiv3 || true
3441
# ./node_modules/.bin/swagger2openapi --outfile gen/openapiv3/openapi.yaml gen/openapiv2/apidocs.swagger.json

buf.gen.yaml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,27 @@
1-
version: v1
1+
version: v2
2+
clean: true
23
managed:
34
enabled: true
45
plugins:
56
# Generate Go code for annotations in OpenAPI plugin
6-
- plugin: go
7+
- local: protoc-gen-go
78
out: gen/protos
89
opt: paths=source_relative
9-
- plugin: go-grpc
10+
- local: protoc-gen-go-grpc
1011
out: gen/protos
1112
opt: paths=source_relative,require_unimplemented_servers=false
12-
- plugin: grpc-gateway
13+
- local: protoc-gen-grpc-gateway
1314
out: gen/protos
1415
opt: paths=source_relative
15-
- plugin: openapiv2
16-
out: gen/openapiv2
17-
opt: allow_merge=true,merge_file_name=apidocs
18-
strategy: all
19-
# https://grpc-ecosystem.github.io/grpc-gateway/docs/mapping/customizing_openapi_output/#merging-output
20-
- plugin: grpc-gateway-ts
16+
- local: protoc-gen-grpc-gateway-ts
2117
out: gen/api-ts
22-
- name: gateway-client
23-
path: protoc-gen-grpc-gateway-client
18+
- local: protoc-gen-grpc-gateway-client
2419
out: gen/protos
2520
opt:
2621
- paths=source_relative
27-
- plugin: buf-plugin-openapi
22+
- local: buf-plugin-openapi
2823
out: gen/openapi
2924
strategy: all
3025
opt:
3126
- emit_defaults=true
3227
- json_names_for_fields=true
33-
###############################################################################
34-
# Unused
35-
###############################################################################
36-
# - plugin: buf.build/protocolbuffers/python
37-
# out: gen/pre-python
38-
# - plugin: buf.build/grpc/python
39-
# out: gen/pre-python
40-
# - plugin: buf.build/community/google-gnostic-openapi
41-
# out: gen/openapi

buf.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Generated by buf. DO NOT EDIT.
2+
version: v2
3+
deps:
4+
- name: buf.build/googleapis/googleapis
5+
commit: 61b203b9a9164be9a834f58c37be6f62
6+
digest: b5:7811a98b35bd2e4ae5c3ac73c8b3d9ae429f3a790da15de188dc98fc2b77d6bb10e45711f14903af9553fa9821dff256054f2e4b7795789265bc476bec2f088c
7+
- name: buf.build/grpc-ecosystem/grpc-gateway
8+
commit: 4c5ba75caaf84e928b7137ae5c18c26a
9+
digest: b5:c113e62fb3b29289af785866cae062b55ec8ae19ab3f08f3004098928fbca657730a06810b2012951294326b95669547194fa84476b9e9b688d4f8bf77a0691d

buf.work.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

buf.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: v2
2+
3+
modules:
4+
- path: protos
5+
- path: submodules/protobuf-libs/protos
6+
7+
deps:
8+
- buf.build/googleapis/googleapis
9+
- buf.build/grpc-ecosystem/grpc-gateway
10+
# - buf.build/layr-labs/protobuf-libs
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default {}

0 commit comments

Comments
 (0)