Skip to content

Commit

Permalink
Add additional options for generating imports (#243)
Browse files Browse the repository at this point in the history
Including imports is not enabled by default in the Buf CLI. As a result,
users have been getting tripped up on generating code when they have
dependencies on protovalidate.

This adds some additional guidance in our generating code docs to make
sure they include imports since these should essentially always be
included when generating with Protobuf-ES.

---------

Signed-off-by: Steve Ayers <[email protected]>
  • Loading branch information
smaye81 authored Dec 5, 2024
1 parent 1ec4ff4 commit d69a15c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/node/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ version: v2
plugins:
- local: protoc-gen-es
out: gen
# Also generate any imported dependencies
include_imports: true
opt: target=ts
```

Expand Down
2 changes: 2 additions & 0 deletions docs/web/generating-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ plugins:
# This will invoke protoc-gen-es and write output to src/gen
- local: protoc-gen-es
out: src/gen
# Also generate any imported dependencies
include_imports: true
# Add more plugin options here
opt: target=ts
```
Expand Down

0 comments on commit d69a15c

Please sign in to comment.