Refresh demo and listen workflow#203
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR updates Changespaykitjs listen command flow
Init listen command generation
Demo app script and auth changes
Package metadata, config loading, and docs
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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: 4
🧹 Nitpick comments (1)
apps/web/content/docs/cli.mdx (1)
46-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider updating the example to use
pnpm devto align with the pnpm migration.The PR migrates demo scripts to pnpm. While this is general documentation, using
pnpm devinstead ofbun devin the example would be more consistent with the current project state and avoids implying Bun is required for the app command.-npx paykitjs listen -- bun dev +npx paykitjs listen -- pnpm dev🤖 Prompt for 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. In `@apps/web/content/docs/cli.mdx` around lines 46 - 47, The CLI docs example still shows a Bun-based app command, which is inconsistent with the pnpm migration. Update the example in the docs content to use pnpm dev instead of bun dev, keeping the surrounding listen command intact so the documented workflow matches the current project scripts and terminology.
🤖 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 `@apps/demo/src/app/_components/auth-form.tsx`:
- Around line 90-92: The auth flow is still racy because only the buttons are
disabled; the <form onSubmit={handleSubmit}> path can still start while the
random-account flow in handleRandomAccount is in progress. Add guard clauses at
the start of both handleSubmit and handleRandomAccount in auth-form.tsx so they
return immediately if either loading state is already true, or otherwise ensure
the entire form surface is disabled while one auth action is active.
- Around line 25-31: The copy flow in copyCredentials currently returns
immediately after navigator.clipboard.writeText succeeds, but it does not handle
the case where writeText rejects while navigator.clipboard still exists. Update
copyCredentials to wrap the clipboard write in a try/catch and, on failure,
continue to the textarea fallback logic instead of exiting early so the fallback
is used on the exact error path.
In `@packages/paykit/src/cli/commands/init.ts`:
- Around line 85-92: The getWebhookListenCommand helper is no longer consistent
with its port argument because the returned PayKit CLI command does not vary by
port. Update getWebhookListenCommand so the generated command either includes
the provided port in the paykitjs listen flow or remove port from the function
signature and its callers if listen no longer uses it; use the existing
getExecPrefix, getDevCommand, and hasPaykitCli branching to keep the onboarding
command aligned with the selected port.
In `@packages/paykit/src/cli/commands/listen.ts`:
- Around line 457-458: The onAbort handler in listen.ts is waiting on
processing.finally(...) before settling, which can delay shutdown behind an
in-flight request. Update onAbort to settle the consumer immediately via
settle(() => resolve({ code: 1000, reason: "aborted" })) first, then perform the
socket close/cleanup separately so the existing processing.catch(...) path can
handle any late failure. Use the onAbort and processing symbols to locate and
adjust this shutdown flow.
---
Nitpick comments:
In `@apps/web/content/docs/cli.mdx`:
- Around line 46-47: The CLI docs example still shows a Bun-based app command,
which is inconsistent with the pnpm migration. Update the example in the docs
content to use pnpm dev instead of bun dev, keeping the surrounding listen
command intact so the documented workflow matches the current project scripts
and terminology.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 7cc5dc72-72c2-491d-bf19-2814334c75fb
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (15)
AGENTS.mdapps/demo/package.jsonapps/demo/paykit.config.tsapps/demo/scripts/deploy-sandbox.tsapps/demo/scripts/push-sandbox.tsapps/demo/scripts/sandbox.tsapps/demo/src/app/_components/auth-form.tsxapps/web/content/docs/cli.mdxapps/web/content/docs/webhook-events.mdxpackages/paykit/package.jsonpackages/paykit/src/cli/__tests__/init.test.tspackages/paykit/src/cli/commands/init.tspackages/paykit/src/cli/commands/listen.tspackages/paykit/src/cli/utils/dev-logger.tspackages/paykit/src/cli/utils/get-config.ts
💤 Files with no reviewable changes (1)
- apps/demo/paykit.config.ts
There was a problem hiding this comment.
7 issues found across 16 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@packages/paykit/src/cli/commands/init.ts`:
- Around line 579-581: The listen command selection in init.ts is using
detectPaykitCli() against the running process instead of the target project,
which can pick the wrong command. Update the webhookCommand decision to use a
project-scoped install check for the target cwd, or thread cwd into the
detection helper, before falling back to getStripeListenCommand. Keep the change
localized around detectPaykitCli(), getPaykitListenCommand(), and
getStripeListenCommand() so the command choice reflects the actual project
install.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6bcde055-b8d9-4ed9-b43d-b958aada02df
📒 Files selected for processing (7)
apps/demo/src/app/_components/auth-form.tsxapps/web/content/docs/cli.mdxapps/web/content/docs/webhook-events.mdxpackages/paykit/src/cli/__tests__/init.test.tspackages/paykit/src/cli/commands/init.tspackages/paykit/src/cli/commands/listen.tspackages/paykit/src/cli/utils/dev-logger.ts
✅ Files skipped from review due to trivial changes (1)
- apps/web/content/docs/webhook-events.mdx
🚧 Files skipped from review as they are similar to previous changes (4)
- apps/web/content/docs/cli.mdx
- apps/demo/src/app/_components/auth-form.tsx
- packages/paykit/src/cli/utils/dev-logger.ts
- packages/paykit/src/cli/commands/listen.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@packages/paykit/src/cli/commands/init.ts`:
- Around line 67-69: The current detectPaykitCli() check only reflects
package.json presence via isPackageInstalled(), so it can falsely treat paykitjs
as runnable even when the binary is not available. Update detectPaykitCli() to
verify the executable can actually be resolved for the given cwd, or otherwise
use the result of the successful paykitjs install path before selecting the
onboarding command. Make the choice in init.ts based on real CLI availability,
not just a declared dependency.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 1bc24b3f-6539-4d89-86c6-6dcf438e4e4b
📒 Files selected for processing (2)
packages/paykit/src/cli/__tests__/init.test.tspackages/paykit/src/cli/commands/init.ts
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Summary
paykitjs listen -- <command>support with prefixed output, clean non-spinner status lines, and fast single Ctrl-C shutdownChecks
pnpm --filter paykitjs typecheckpnpm exec oxlint packages/paykit/src/cli/commands/listen.tsnode ./node_modules/vitest/vitest.mjs run --config vitest.unit.config.ts packages/paykit/src/cli/__tests__pnpm exec oxfmt --check packages/paykit/src/cli/commands/listen.ts packages/paykit/package.json pnpm-lock.yamlgit diff --checkpnpm paykitjs listen -- pnpm devin the demo app with clean output and single Ctrl-C shutdownSummary by cubic
Refreshes the demo app and expands
paykitjs listento run your app and webhook listener together with clean, prefixed logs and quick Ctrl‑C shutdown.New Features
paykitjs listen -- <command>runs your dev server and listener together with prefixed output (pay/app), non‑spinner status lines, clean Ctrl‑C, and correct exit codes.--config,--retry,--forward-to).Refactors
pnpm; removed tunnel/env scripts; switched Vercel build/install topnpm; removed custompaykit.config.tsvia default config discovery.initnow detects localpaykitjsand suggests package‑manager‑awarepaykitjs listen -- <dev>or falls back tostripe listen; tests updated.concurrentlyto power the combined workflow.Written for commit 5fbd747. Summary will update on new commits.
Summary by CodeRabbit
paykitjs listenfor local webhook development, including replaying missed events and forwarding.pnpmand streamlined the demo push flow.