Skip to content

feat(ts): emit protobuf-es client as standalone tree-shakeable functions - #242

Merged
SebastienMelki merged 1 commit into
mainfrom
feat/ts-es-client-factory-v2
Aug 6, 2026
Merged

feat(ts): emit protobuf-es client as standalone tree-shakeable functions#242
SebastienMelki merged 1 commit into
mainfrom
feat/ts-es-client-factory-v2

Conversation

@SebastienMelki

Copy link
Copy Markdown
Owner

Summary

This is @hishamank's work from #211, rebased cleanly onto main after the stacked PRs (#207, #210) were squash-merged.

All code authored by @hishamank — original PR: #211. Previously approved by @SebastienMelki.

Changes

  • ES mode: each RPC as top-level export async function instead of class method (tree-shakeable)
  • Shared client.ts module with RequestOptions interface
  • Service-specific RequestOptions extends base when typed headers are declared
  • recv() method centralizes this. vs local variable access
  • const vs let optimization for non-mutated path variables (hand-rolled goldens)
  • Docs bug fix: apiKey header snippet was sending literal apiKey key instead of X-API-Key
  • baseURL reuse pattern documented

Test plan

  • CI passes (first-ever CI run for this code)
  • Golden files match expected output
  • Hand-rolled goldens unchanged (except const/let optimization)
  • go test ./internal/tsclientgen/... ./internal/tscommon/... all pass

🤖 Generated with Claude Code

Each RPC as top-level export async function instead of class method.
Shared client.ts module with RequestOptions interface. Service-specific
RequestOptions extends base when typed headers are declared. const vs let
optimization for non-mutated path variables. Docs bug fix: apiKey header
snippet was sending literal "apiKey" key instead of "X-API-Key".

Original work from PR #211 by @hishamank.

Co-Authored-By: Hicham <53556927+hishamank@users.noreply.github.com>
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 53.33333% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.76%. Comparing base (6ba2ebf) to head (31f0fce).

Files with missing lines Patch % Lines
internal/tsclientgen/generator.go 62.62% 29 Missing and 8 partials ⚠️
internal/tscommon/client.go 0.00% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #242      +/-   ##
==========================================
+ Coverage   28.64%   28.76%   +0.11%     
==========================================
  Files          74       75       +1     
  Lines       13048    13146      +98     
==========================================
+ Hits         3738     3781      +43     
- Misses       9119     9166      +47     
- Partials      191      199       +8     
Flag Coverage Δ
unittests 28.76% <53.33%> (+0.11%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

🔍 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

@SebastienMelki
SebastienMelki merged commit fa45cf4 into main Aug 6, 2026
10 checks passed
@SebastienMelki
SebastienMelki deleted the feat/ts-es-client-factory-v2 branch August 6, 2026 09:09
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