feat: add proto codegen pipeline with buf and connect-es
- 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>
This commit is contained in:
@@ -3,3 +3,4 @@
|
||||
| Issue | Title | Status | Plan |
|
||||
| ----- | ------------------------------------------------------ | ------------ | ---------------------------- |
|
||||
| #1 | Project scaffolding: SvelteKit + Tailwind + TypeScript | COMPLETED | [issue-001.md](issue-001.md) |
|
||||
| #2 | Proto codegen pipeline for TypeScript gRPC-Web stubs | IMPLEMENTING | [issue-002.md](issue-002.md) |
|
||||
|
||||
49
implementation-plans/issue-002.md
Normal file
49
implementation-plans/issue-002.md
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
---
|
||||
|
||||
# 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)
|
||||
Reference in New Issue
Block a user