Skip to content

Conversation

@timostamm
Copy link
Member

In protovalidate/quickstart-es, start/buf.gen.yaml and finish/buf.gen.yaml differ quite a bit:

version: v2
+ clean: true
inputs:
  - directory: proto
plugins:
  - remote: buf.build/bufbuild/es:v2.5.1
    out: src/gen
+   opt:
+     - target=ts
+     - import_extension=js
    include_imports: true

This changes the diff to:

version: v2
clean: true
inputs:
  - directory: proto
plugins:
  - remote: buf.build/bufbuild/es:v2.5.1
    out: src/gen
    opt:
      - target=ts
      - import_extension=js
+   include_imports: true

Adding include_imports is almost always necessary to add with protovalidate and protobuf-es (so that the imported file buf/validate/validate_pb.ts is generated).

I don't believe it makes sense to switch from JavaScript to TypeScript to show how to use protovalidate, so I think we should generate ts right from the start. Similar for clean: true.

@timostamm timostamm merged commit ef279b2 into main Oct 20, 2025
10 checks passed
@timostamm timostamm deleted the tstamm/Reduce-diff-for-protovalidate/quickstart-es-buf.gen.yaml branch October 20, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants