mirror of
https://github.com/tiennm99/noitu.git
synced 2026-10-11 12:28:54 +00:00
proto/noitu/v1/game.proto is the single source of truth for every WebSocket message. buf generates Go types into server/gen and JavaScript types into web/src/lib/proto; both trees are committed so building needs no codegen toolchain. The Go suite emits binary fixtures into proto/testdata and the JavaScript suite decodes the same bytes, so the two generated clients are checked against one artifact rather than against each other's assumptions. CI lints the schema, rejects breaking changes against main, and fails when the committed generated trees drift from the schema. game.NumRejectReasons and game.NumEndReasons let the mapping tests prove every engine reason has a wire value without guessing where the enum ends.
22 lines
765 B
YAML
22 lines
765 B
YAML
version: v2
|
|
clean: true
|
|
managed:
|
|
enabled: false
|
|
plugins:
|
|
# Messages only. The WebSocket layer does its own framing, so there is no
|
|
# gRPC service definition and no grpc plugin.
|
|
#
|
|
# Both plugins are resolved from the repo's own dependency manifests — the
|
|
# Go tool directive in server/go.mod and web/package.json — so regenerating
|
|
# needs no globally installed codegen binaries, only `buf` itself.
|
|
- local: ["go", "-C", "server", "tool", "protoc-gen-go"]
|
|
out: server/gen
|
|
opt: paths=source_relative
|
|
|
|
# ESM + .d.ts so the SvelteKit bundle can tree-shake the runtime.
|
|
- local: ["node", "./web/node_modules/@bufbuild/protoc-gen-es/bin/protoc-gen-es"]
|
|
out: web/src/lib/proto
|
|
opt:
|
|
- target=js+dts
|
|
- import_extension=.js
|