Skip to content

Commit

Permalink
chore: migrate to buf v2 config
Browse files Browse the repository at this point in the history
  • Loading branch information
MuZhou233 committed Aug 1, 2024
1 parent c65c0c5 commit 74b99e4
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 52 deletions.
52 changes: 23 additions & 29 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,73 +1,67 @@
version: v1
version: v2
plugins:
#Document
- name: doc
- local: protoc-gen-doc
out: docs
opt: docs/markdown.tmpl,protos.md
strategy: all

#Go
- name: go
- local: protoc-gen-go
out: pkg
opt:
- paths=source_relative
- name: go-grpc
opt: paths=source_relative
- local: protoc-gen-go-grpc
out: pkg
opt:
- paths=source_relative
- name: go-errors
opt: paths=source_relative
- local: protoc-gen-go-errors
out: pkg
opt:
- paths=source_relative
opt: paths=source_relative

#JS
- plugin: buf.build/protocolbuffers/js:v3.21.2
- remote: buf.build/protocolbuffers/js:v3.21.2
out: node
opt:
- import_style=commonjs
- binary
- local: node_modules/.bin/grpc_tools_node_protoc_plugin
out: node
- name: js-grpc
path: node_modules/.bin/grpc_tools_node_protoc_plugin
opt: grpc_js
out: node

#TS
- name: ts
path: node_modules/.bin/protoc-gen-ts
opt:
- local: node_modules/.bin/protoc-gen-ts
out: node
opt:
- mode=grpc-js
- service=grpc-node
out: node

#Rust
- plugin: buf.build/community/neoeinstein-prost:v0.3.1
- remote: buf.build/community/neoeinstein-prost:v0.3.1
out: src
opt:
- bytes=.
- compile_well_known_types
- extern_path=.google.protobuf=::pbjson_types
- file_descriptor_set
- plugin: buf.build/community/neoeinstein-prost-serde:v0.3.0
- remote: buf.build/community/neoeinstein-prost-serde:v0.3.0
out: src
- plugin: buf.build/community/neoeinstein-tonic:v0.4.0
- remote: buf.build/community/neoeinstein-tonic:v0.4.0
out: src
opt:
- compile_well_known_types
- extern_path=.google.protobuf=::pbjson_types
- name: prost-crate
- local: protoc-gen-prost-crate
out: .
opt: gen_crate=Cargo.toml
strategy: all
opt:
- gen_crate=Cargo.toml

#CSharp
- name: csharp
- protoc_builtin: csharp
out: Assets/src
opt: base_namespace=
- plugin: buf.build/grpc/csharp:v1.65.0
- remote: buf.build/grpc/csharp:v1.65.0
out: Assets/src

#Dart
- name: dart
- local: protoc-gen-dart
out: lib
opt: grpc
opt: grpc
6 changes: 6 additions & 0 deletions buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Generated by buf. DO NOT EDIT.
version: v2
deps:
- name: buf.build/bufbuild/protovalidate
commit: 3757a25ff0b9479eae89d3e80a508d34
digest: b5:b595de493fe51003d0523b5980c5f9710eb2b061b2bbdf73eb5eb572ef8500764186660349cbe491f92476fb66b048f1aca68a1d23856a542834c19e654cea78
3 changes: 0 additions & 3 deletions buf.work.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: v2
modules:
- path: proto
deps:
- buf.build/bufbuild/protovalidate
lint:
use:
- DEFAULT
except:
- FIELD_NOT_REQUIRED
- PACKAGE_NO_IMPORT_CYCLE
ignore_only:
PACKAGE_VERSION_SUFFIX:
- proto/errors/errors.proto
disallow_comment_ignores: true
breaking:
use:
- FILE
except:
- EXTENSION_NO_DELETE
- FIELD_SAME_DEFAULT
8 changes: 0 additions & 8 deletions proto/buf.lock

This file was deleted.

12 changes: 0 additions & 12 deletions proto/buf.yaml

This file was deleted.

0 comments on commit 74b99e4

Please sign in to comment.