- Add llm-multiverse repo as git submodule for proto files - Configure buf with @bufbuild/protoc-gen-es for TypeScript codegen - Generate typed Connect service stubs to src/lib/proto/ - Add `generate` npm script for proto regeneration - Exclude generated proto files from ESLint Closes #2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50 lines
1.6 KiB
Markdown
50 lines
1.6 KiB
Markdown
---
|
|
---
|
|
|
|
# Issue #2: Proto codegen pipeline for TypeScript gRPC-Web stubs
|
|
|
|
**Status:** IMPLEMENTING
|
|
**Issue:** https://git.shahondin1624.de/llm-multiverse/llm-multiverse-ui/issues/2
|
|
**Branch:** `feature/issue-2-proto-codegen`
|
|
|
|
## Summary
|
|
|
|
Set up buf + @connectrpc/connect-web to generate TypeScript client stubs from the llm-multiverse proto files. Use a git submodule to consume proto files. Output generated code to `src/lib/proto/`.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] Codegen toolchain chosen and configured (buf + connect-es)
|
|
- [ ] Proto files from llm-multiverse repo consumed (git submodule)
|
|
- [ ] TypeScript gRPC-Web client stubs generated to `src/lib/proto/`
|
|
- [ ] `generate` npm script added to package.json
|
|
- [ ] Generated types are importable and type-safe
|
|
|
|
## Implementation Phases
|
|
|
|
### Phase 1: Add proto files via git submodule
|
|
|
|
Add the `llm-multiverse` repo as a git submodule at `proto/upstream` to keep proto files in sync.
|
|
|
|
### Phase 2: Configure buf for connect-es codegen
|
|
|
|
Install buf CLI dependencies and configure:
|
|
- `@bufbuild/protobuf` — runtime protobuf library
|
|
- `@connectrpc/connect` — Connect protocol runtime
|
|
- `@connectrpc/connect-web` — browser transport
|
|
- `@bufbuild/protoc-gen-es` — protobuf ES codegen plugin
|
|
- `@connectrpc/protoc-gen-connect-es` — Connect service codegen plugin
|
|
|
|
Create `buf.gen.yaml` in project root targeting `src/lib/proto/` output.
|
|
|
|
### Phase 3: Generate stubs and verify
|
|
|
|
Run `npx buf generate` and verify generated TypeScript files are importable and type-safe.
|
|
|
|
### Phase 4: Add npm script
|
|
|
|
Add `"generate": "buf generate proto/upstream/proto"` to package.json.
|
|
|
|
## Deviations
|
|
|
|
(none yet)
|