1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: v2
# Standalone-repo codegen config.
#
# Outputs are self-contained inside the repo so consumers can either:
# a) pull the published artifacts (Composer / npm / Maven / NuGet / PyPI), or
# b) clone the repo and run `buf generate` to regen locally.
#
# Each SDK directory hosts its own `gen/` so the language-native
# package can autoload / import the generated stubs without
# reaching out of its own tree.
managed:
enabled: true
disable:
# Preserve explicit `option php_namespace = "Udb\\Entity\\V1"` etc.
# in the proto files so the generated PHP autoload keys stay
# stable across regen.
- file_option: php_namespace
- file_option: php_metadata_namespace
# Preserve explicit `option csharp_namespace = "udb.core.Authn.Services.V1"`
# etc. Managed mode otherwise force-PascalCases every segment
# ("Udb.Core.Authn..."), diverging from the namespaces the proto authors
# declared and the handwritten C# client (UdbAuthClient.cs) consumes.
- file_option: csharp_namespace
override:
- file_option: go_package_prefix
value: github.com/fahara02/udb/sdk/go/gen
plugins:
# ── PHP / Laravel SDK ──────────────────────────────────────────────
- remote: buf.build/protocolbuffers/php
out: sdk/php/gen
- remote: buf.build/grpc/php
out: sdk/php/gen
# ── TypeScript SDK ─────────────────────────────────────────────────
- remote: buf.build/bufbuild/es:v2.12.0
out: sdk/typescript/gen
opt:
# ── OpenAPI v2 — for HTTP/JSON gateway transcoding + docs ──────────
# NOTE: after `buf generate`, run `node scripts/openapi-postprocess.mjs` to set
# the merged document's title/version/scope (the openapiv2 merge mode titles it
# after the first proto and emits "version not set"). CI runs this automatically
# before the drift check; run it locally too or the committed swagger will drift.
- remote: buf.build/grpc-ecosystem/openapiv2
out: api
opt:
- logtostderr=true
- allow_merge=true
- merge_file_name=udb-broker
- json_names_for_fields=true
- include_package_in_tags=false
- fqn_for_openapi_name=false
# ── Go SDK ─────────────────────────────────────────────────────────
# Emits Go structs + gRPC service code into sdk/go/gen, importable
# as github.com/fahara02/udb/sdk/go/gen/udb/{entity,events,services}/v1
# via the `go_package_prefix` managed override above.
- remote: buf.build/protocolbuffers/go
out: sdk/go/gen
opt:
- remote: buf.build/grpc/go
out: sdk/go/gen
opt:
# ── Python SDK ─────────────────────────────────────────────────────
- remote: buf.build/protocolbuffers/python:v31.1
out: sdk/python/gen
- remote: buf.build/grpc/python:v1.76.0
out: sdk/python/gen
- remote: buf.build/protocolbuffers/pyi:v31.1
out: sdk/python/gen
# ── C# SDK ─────────────────────────────────────────────────────────
# base_namespace= (empty) emits namespace-based subdirectories so the
# duplicate proto basenames across domains (entities.proto, enums.proto,
# core.proto) don't collide into one flat output dir.
- remote: buf.build/protocolbuffers/csharp
out: sdk/csharp/gen
opt:
- remote: buf.build/grpc/csharp
out: sdk/csharp/gen
# ── Java SDK ───────────────────────────────────────────────────────
- remote: buf.build/protocolbuffers/java
out: sdk/java/gen
- remote: buf.build/grpc/java:v1.81.0
out: sdk/java/gen