there's nothing to see here#242
Conversation
🦋 Changeset detectedLatest commit: db0af3d The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ 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 ignored due to path filters (1)
📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis pull request adds a new private workspace package Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Review rate limit: 0/1 reviews remaining, refill in 51 minutes and 34 seconds.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/extras/src/clerk-bird/flap.ts (1)
260-266: Minor:Bun.writeis async but called without await.The try-catch won't catch promise rejections. Since this is a best-effort high score save that rarely fails, it's not blocking, but you could make it fire-and-forget explicitly:
Optional fix
function saveBest(n: number): void { - try { - Bun.write(BEST_FILE, String(n)); - } catch { - /* best-effort */ - } + Bun.write(BEST_FILE, String(n)).catch(() => { + /* best-effort */ + }); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/extras/src/clerk-bird/flap.ts` around lines 260 - 266, The saveBest function calls the async Bun.write without awaiting, so promise rejections won't be caught; update saveBest to either be async and await Bun.write inside the try/catch, or keep it sync and explicitly fire-and-forget by calling Bun.write(BEST_FILE, String(n)).catch(() => {}) (or prefix with void) so any rejection is handled and no unhandled promise rejection occurs; reference the saveBest function, Bun.write call, and BEST_FILE constant when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/extras/src/clerk-bird/flap.ts`:
- Around line 260-266: The saveBest function calls the async Bun.write without
awaiting, so promise rejections won't be caught; update saveBest to either be
async and await Bun.write inside the try/catch, or keep it sync and explicitly
fire-and-forget by calling Bun.write(BEST_FILE, String(n)).catch(() => {}) (or
prefix with void) so any rejection is handled and no unhandled promise rejection
occurs; reference the saveBest function, Bun.write call, and BEST_FILE constant
when making the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8a105937-c231-4ae2-8d38-884b78508a90
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (8)
package.jsonpackages/cli-core/package.jsonpackages/cli-core/src/cli-program.tspackages/extras/package.jsonpackages/extras/src/clerk-bird/flap.tspackages/extras/src/clerk-bird/index.tspackages/extras/src/index.tspackages/extras/tsconfig.json
b0f130c to
ad91dba
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/extras/src/clerk-bird/flap.ts`:
- Around line 260-263: The saveBest function currently calls
Bun.write(BEST_FILE, String(n)) without awaiting or handling its returned
Promise, so write failures will produce unhandled rejections; update saveBest
(the function named saveBest and the Bun.write call) to handle the Promise
explicitly—either make saveBest async and await Bun.write inside the try/catch,
or attach .catch(...) to Bun.write to swallow/log the error (e.g., log via your
logger or ignore) so filesystem write failures to BEST_FILE do not produce
unhandled rejections while the program runs in raw/alt-screen mode.
🪄 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: 7410d2db-9657-4fc5-80a3-27523a6f618f
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (9)
.changeset/modern-bats-pick.mdpackage.jsonpackages/cli-core/package.jsonpackages/cli-core/src/cli-program.tspackages/extras/package.jsonpackages/extras/src/clerk-bird/flap.tspackages/extras/src/clerk-bird/index.tspackages/extras/src/index.tspackages/extras/tsconfig.json
✅ Files skipped from review due to trivial changes (5)
- packages/cli-core/package.json
- packages/extras/src/clerk-bird/index.ts
- packages/extras/tsconfig.json
- .changeset/modern-bats-pick.md
- packages/extras/package.json
🚧 Files skipped from review as they are similar to previous changes (3)
- packages/extras/src/index.ts
- packages/cli-core/src/cli-program.ts
- package.json
Introduces a new private workspace package, @clerk/cli-extras, that
registers extra/easter-egg commands on the main Clerk CLI program via a
single registerExtras(program) call. The first such command is
`clerk clerk-bird`, a Flappy Bird game that runs entirely in the
terminal (alt-screen buffer, 30 FPS delta-time physics, persistent high
score, parallax clouds). The command is registered with { hidden: true }
so it does not appear in `clerk --help` or `clerk help`.
Why a separate package: keeps cli-core focused on the CLI's real surface
area. cli-core depends on cli-extras (one-way), so future easter eggs
can be added without touching cli-program.ts.
Root scripts (typecheck/lint/format/format:check) now use
--filter './packages/*' so they automatically cover any new workspace
package.
Bun.write() returns a Promise, so wrapping it in a sync try/catch does not catch rejections. Use void with .catch() instead.
4f18a9a to
db0af3d
Compare
Summary
@clerk/cli-extrasthat registers extra/easter-egg commands on the main Clerk CLI via a singleregisterExtras(program)callclerk bird— a Flappy Bird game that runs in the terminal (alt-screen buffer, 30 FPS delta-time physics, persistent high score in~/.flap-best, parallax clouds, screen shake on death){ hidden: true }so it does not appear inclerk --helporclerk helptypecheck/lint/format/format:checkscripts now use--filter './packages/*'so they cover any new workspace package automaticallyWhy a separate package
Keeps
cli-corefocused on the CLI's real surface area.cli-coredepends oncli-extras(one-way, no cycle), so future easter eggs can be added without touchingcli-program.ts. Throws plainErrorinstead ofCliErrorto keep the dep graph clean —runProgramalready mapsError→log.error(message)+EXIT_CODE.GENERAL.Test plan
bun install --frozen-lockfile— clean (lockfile in sync)bun run build— bundle still produces a single ~2.4 MB binary (workspace dep inlined)bun run format:check— passes for both packagesbun run lint— 0 warnings, 0 errors across both packagesbun run typecheck— clean for both packages + scriptsbun run check:patches— passesbun run test— 82/82 passingbun changeset status --since=origin/main— empty changeset added (no release needed)clerk --help—birdnot listedclerk help—birdnot listedclerk bird --help— reachable directlyQ— terminal restored cleanly via alt-screen exit