Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ If you modify the rules of one of the Protobuf messages, make sure to re-generat

With the [Buf CLI](https://github.com/bufbuild/buf), simply run `npx buf generate` in this directory. [`buf.gen.yaml`](./buf.gen.yaml)
contains the plugin configuration.

Note that this example does not generate code for `buf/validate/validate.proto`, even though its Protobuf files
import it. Instead, the plugin option `rewrite_imports` points the generated imports at the code that
`@bufbuild/protovalidate` already ships as `@bufbuild/protovalidate/gen/buf/validate/validate_pb.js`.
6 changes: 4 additions & 2 deletions packages/example/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ plugins:
- target=ts
# This option enables Valid types
- valid_types=protovalidate_required+legacy_required
# Use the validate.proto artifacts exported by @bufbuild/protovalidate
# instead of generating a local copy. This requires @bufbuild/protobuf
# v2.14.1 or later.
- rewrite_imports=./buf/validate/*_pb.js:@bufbuild/protovalidate/gen
out: src/gen
# Also generate any imported dependencies
include_imports: true
2 changes: 1 addition & 1 deletion packages/example/src/gen/banking/v1/money_transfer_pb.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4,816 changes: 0 additions & 4,816 deletions packages/example/src/gen/buf/validate/validate_pb.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/example/src/gen/store/v1/order_pb.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading