Conversation
Fixes unjs#81 Signed-off-by: Liang Xu <lx3133584@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe TypeScript generator now supports ChangesTypeScript declaration generation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change adds generation support for 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Problem
TypeScript augmentations for
declare globalanddeclare namespace <name>were not directly supported bygenAugmentation(which always generateddeclare module "...").Root Cause
genAugmentationalways wrapped the input specifier ingenString(specifier)and prefixed withdeclare module. In TypeScript,declare globalis a reserved declaration keyword without quotes ormodulekeyword.Fix
genAugmentationto emitdeclare globalwhenspecifier === "global".genNamespacehelper to generatedeclare namespace <name> { ... }declarations.Testing
test/typescript.test.tsfordeclare globalanddeclare namespace.Summary by CodeRabbit
New Features
Tests