fix(cli): merge headers instead of overwriting#1381
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change adds header spreading in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This PR fixes the CLI SDK template to properly merge headers instead of overwriting them.
Problem
In
templates/cli/lib/sdks.ts, theclient.headersobject was being directly overwritten:This caused any existing headers set by the Client instance to be lost.
Solution
Changed both
sdkForConsoleandsdkForProjectfunctions to spread existing headers before adding new ones:Changes
...client.headersspread operator in bothsdkForConsoleandsdkForProjectfunctionsexamples/cli/lib/sdks.tswith the fixTesting
Summary by CodeRabbit