Skip to content

Conversation

@SebastienMelki
Copy link
Owner

Summary

  • Add protoc-gen-ts-client, a new protoc plugin that generates TypeScript HTTP clients from protobuf service definitions
  • Generated clients include typed interfaces, service/method header helpers, query parameter encoding, path parameter substitution, and structured error handling (ValidationError/ApiError)
  • Fix query parameter serialization bug where undefined fields were sent as the string "undefined" (added null guard before zero-value checks)
  • Add end-to-end ts-client-demo example with a NoteService CRUD API (Go server + TypeScript client)
  • Update all project documentation (README, CLAUDE.md, architecture, getting-started, client-generation, examples, contributing, CI/CD)

Commits

  • feat(ts-client): add protoc-gen-ts-client TypeScript HTTP client generator — core plugin: generator, type mapping, annotations, helpers
  • test(ts-client): add golden file tests for TypeScript client generation — golden tests for query params, HTTP verbs, backward compat
  • fix(ts-client): guard query params against undefined/null values — null-safe zero-value checks in generated query param code
  • feat(ts-client): add TypeScript client demo example — NoteService CRUD demo with Go server and TS client
  • docs: add protoc-gen-ts-client to all project docs — 8 documentation files updated

Test plan

  • go test ./internal/tsclientgen/ — all golden file tests pass
  • cd examples/ts-client-demo && make demo — full end-to-end demo works (create, list, get, update, delete, query params, error handling)
  • Verify CI passes on all platforms
  • Review generated TypeScript client API ergonomics

🤖 Generated with Claude Code

SebastienMelki and others added 5 commits February 3, 2026 03:25
…rator

Go-based protoc plugin that generates standalone TypeScript HTTP clients
from protobuf service definitions. Uses native fetch, plain TS interfaces,
JSON-only serialization, and idiomatic TypeScript patterns (options objects,
async/await, AbortSignal).

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Three test cases using symlinked proto files shared with httpgen/clientgen:
- http_verbs_comprehensive: all HTTP verbs, path/query params, headers
- query_params: scalar types, custom names, mixed path+query
- backward_compat: services without annotations, base-path-only

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Query param zero-value checks like `req.limit !== 0` pass when the
field is undefined, causing "undefined" to be sent as a string value.
Add `!= null` guard before each zero-value check so omitted fields
are correctly skipped.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
End-to-end example showing protoc-gen-ts-client with a NoteService
CRUD API. Includes Go server, TypeScript client exercising all
endpoints (GET/POST/PUT/DELETE), query parameters, service/method
headers, and error handling. Makefile handles the full workflow:
build plugins, generate code, install deps, and run demo.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Update README, CLAUDE.md, architecture, getting-started,
client-generation, examples, contributing, and CI/CD docs
to document the new TypeScript HTTP client generator plugin.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 0% with 550 lines in your changes missing coverage. Please review.
✅ Project coverage is 5.91%. Comparing base (5987c53) to head (415420f).

Files with missing lines Patch % Lines
internal/tsclientgen/generator.go 0.00% 253 Missing ⚠️
internal/tsclientgen/types.go 0.00% 153 Missing ⚠️
internal/tsclientgen/annotations.go 0.00% 123 Missing ⚠️
internal/tsclientgen/helpers.go 0.00% 21 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #104      +/-   ##
========================================
- Coverage   6.69%   5.91%   -0.78%     
========================================
  Files         15      19       +4     
  Lines       4170    4720     +550     
========================================
  Hits         279     279              
- Misses      3886    4436     +550     
  Partials       5       5              
Flag Coverage Δ
unittests 5.91% <0.00%> (-0.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

🔍 CI Pipeline Status

Lint: success
Test: success
Coverage: success
Build: success
Integration: success


📊 Coverage Report: Available in checks above
🔗 Artifacts: Test results and coverage reports uploaded

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.

2 participants