feat: migrate adapter to TypeScript#61
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR migrates the GCSAdapter from JavaScript to TypeScript by replacing ChangesTypeScript Migration for GCSAdapter
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@index.ts`:
- Around line 163-173: The exists callback currently rejects with the incoming
err (often null) when the file is not found; update the file.exists branch so
that when exists === false you either resolve(undefined) to match the method
signature or reject with a concrete Error (e.g., new Error('file not found')),
instead of rejecting with err; locate the callback where file.exists(...),
file.download(...), resolve and reject are used and change the else branch to
return resolve(undefined) or reject(new Error(...)) so consumers receive a
proper value or Error.
- Around line 78-79: The environment value for GCS_DIRECT_ACCESS is being stored
as a string via fromEnvironmentOrDefault and later used in conditionals
(this._directAccess) so values like "false" are truthy; coerce the option to a
boolean when resolving options: after calling fromEnvironmentOrDefault for the
'directAccess' key, normalize the string (e.g., toLowerCase) and convert common
truthy strings ("true","1","yes") to true and everything else to false, then
assign that boolean into options before returning as ResolvedGCSAdapterOptions
so the later checks (this._directAccess, calls to makePublic(), and public URL
logic) behave correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 061446d3-2310-4023-9b9a-609f53f6986d
📒 Files selected for processing (7)
.gitignoreindex.jsindex.tspackage-lock.jsonpackage.jsonspec/test.spec.jstsconfig.json
💤 Files with no reviewable changes (1)
- index.js
|
Follow-up pushed. Current head is 1921a15. Review fixes addressed:
Local verification after the latest commit: TypeScript compile, Jasmine (9 specs), coverage (9 specs), and |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Closes #49.
This is my submission for the
bounty:$10TypeScript upgrade issue.What changed:
index.jstoindex.tsdist/mainandtypesat the compiled package entrypointsrequire()export shape, including.default.d.tsfiles are present before publishVerification:
npm testnpm run coveragenpm pack --dry-runI can provide payout details privately if this is accepted for the bounty.
Summary by CodeRabbit
New Features
Chores