Skip to content

Commit

Permalink
chore: use v2 of buf config (#552)
Browse files Browse the repository at this point in the history
* chore: use v2 of buf config

this should not result in any changes of generated code or linting. Used the [migration tool](https://buf.build/docs/migration-guides/migrate-v2-config-files) for the changes

* fixed local ts plugin path

* removed exclusions from lint and breaking
  • Loading branch information
moritzzimmer authored Jul 2, 2024
1 parent d38be7c commit 1626ac5
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 45 deletions.
12 changes: 5 additions & 7 deletions buf.gen.go.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
version: v1
version: v2

plugins:
- plugin: buf.build/protocolbuffers/go:v1.31.0
- remote: buf.build/protocolbuffers/go:v1.31.0
out: gen/go
opt:
- module=github.com/stroeer/go-tapir
opt: module=github.com/stroeer/go-tapir

- plugin: buf.build/grpc/go:v1.3.0
- remote: buf.build/grpc/go:v1.3.0
out: gen/go
opt:
- module=github.com/stroeer/go-tapir
opt: module=github.com/stroeer/go-tapir
7 changes: 3 additions & 4 deletions buf.gen.node-proto.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: v1
version: v2

plugins:
- plugin: buf.build/bufbuild/es:v1.3.1
- remote: buf.build/bufbuild/es:v1.3.1
out: ./node-proto/
opt:
- target=ts
opt: target=ts
13 changes: 6 additions & 7 deletions buf.gen.node.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
version: v1
version: v2

plugins:
# Typescript/Node
- plugin: buf.build/protocolbuffers/js:v3.21.2
- remote: buf.build/protocolbuffers/js:v3.21.2
out: ./node
opt: import_style=commonjs,binary

- plugin: buf.build/grpc/node:v1.12.4
- remote: buf.build/grpc/node:v1.12.4
out: ./node
opt: grpc_js

# TODO: migrate to a remote plugin for Typescript generation
- plugin: protoc-gen-ts
- local: ./node/node_modules/.bin/protoc-gen-ts
out: ./node
path: ./node/node_modules/.bin/protoc-gen-ts
opt:
- mode=grpc-js
- service=grpc-node
- mode=grpc-js
- service=grpc-node
28 changes: 15 additions & 13 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
version: v1
version: v2

managed:
enabled: true
optimize_for: SPEED
java_multiple_files: true
java_package_prefix:
default: de
except:
- buf.build/googleapis/googleapis
disable:
- file_option: java_package
module: buf.build/googleapis/googleapis
override:
- file_option: java_multiple_files
value: true
- file_option: java_package_prefix
value: de
- file_option: optimize_for
value: SPEED

plugins:
# Java
- plugin: buf.build/protocolbuffers/java:v24.4
- remote: buf.build/protocolbuffers/java:v24.4
out: ./java/src/main/java

- plugin: buf.build/grpc/java:v1.59.0
- remote: buf.build/grpc/java:v1.59.0
out: ./java/src/main/java

# Python
- plugin: buf.build/protocolbuffers/python:v24.4
- remote: buf.build/protocolbuffers/python:v24.4
out: gen/python

- plugin: buf.build/grpc/python:v1.59.2
- remote: buf.build/grpc/python:v1.59.2
out: gen/python
2 changes: 1 addition & 1 deletion buf.lock
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Generated by buf. DO NOT EDIT.
version: v1
version: v2
25 changes: 12 additions & 13 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
version: v1
version: v2

name: buf.build/stroeer/tapir

build:
excludes:
- node
- java

breaking:
use:
- FILE
modules:
- path: .
name: buf.build/stroeer/tapir
excludes:
- java
- node

lint:
use:
- DEFAULT
except:
- RPC_RESPONSE_STANDARD_NAME
- ENUM_VALUE_PREFIX
allow_comment_ignores: true
- RPC_RESPONSE_STANDARD_NAME

breaking:
use:
- FILE

0 comments on commit 1626ac5

Please sign in to comment.