Refresh demo and listen workflow

Merged
MA
5mo ago
+432-51

Summary

  • add a random demo account signup path that copies generated credentials and shows toasts
  • migrate demo command orchestration to pnpm while keeping Bun as the PayKit CLI runtime where needed
  • simplify demo PayKit config discovery and remove local tunnel/env-sourcing scripts
  • add paykitjs listen -- <command> support with prefixed output, clean non-spinner status lines, and fast single Ctrl-C shutdown
  • document the combined listen/run workflow

Checks

  • pnpm --filter paykitjs typecheck
  • pnpm exec oxlint packages/paykit/src/cli/commands/listen.ts
  • node ./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.yaml
  • git diff --check
  • manually verified pnpm paykitjs listen -- pnpm dev in the demo app with clean output and single Ctrl-C shutdown

Summary by cubic

Refreshes the demo app and expands paykitjs listen to 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.
    • Random demo signup: generates email/password, copies to clipboard, and shows toasts; falls back gracefully if clipboard fails.
    • Docs: added CLI and webhook local dev examples, plus options (--config, --retry, --forward-to).
  • Refactors

    • Demo: moved orchestration to pnpm; removed tunnel/env scripts; switched Vercel build/install to pnpm; removed custom paykit.config.ts via default config discovery.
    • CLI: improved config loading (default export interop); init now detects local paykitjs and suggests package‑manager‑aware paykitjs listen -- <dev> or falls back to stripe listen; tests updated.
    • Dependencies: added concurrently to power the combined workflow.

Summary by CodeRabbit

  • New Features
    • Added paykitjs listen for local webhook development, including replaying missed events and forwarding.
    • Added one-click random test account creation with credential copy in the demo auth form.
  • Bug Fixes
    • Improved CLI webhook command generation to better match the active package manager.
    • Enhanced the webhook listener to shut down cleanly on abort, including clearer output when the spinner is disabled.
  • Documentation
    • Expanded CLI and webhook docs with local development instructions and command examples.
  • Chores
    • Updated demo deploy/push/sandbox scripts to use pnpm and streamlined the demo push flow.