JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q61105F
  • License MIT

Package Exports

  • @rsc-xray/cli

Readme

@rsc-xray/cli

npm Downloads

Command-line wrapper for the rsc-xray analyzer, report generator, and Flight tap capture workflow.

What it solves

  • Produces model.json from a Next.js App Router project with one command.
  • Generates a fully offline HTML report for sharing analyzer findings.
  • Streams React Flight chunks so you can understand suspense delivery order and chunk sizes.

Installation

pnpm add -D @rsc-xray/cli

Step-by-step usage

  1. Prepare your project

    pnpm next build
  2. Generate the model

    pnpm -F @rsc-xray/cli analyze --project ./examples/next-app --out ./model.json
    • Validates the analyzer output against the shared JSON schema.
    • Overwrites the target file only when validation succeeds.
  3. Create the HTML report

    pnpm -F @rsc-xray/cli report --model ./model.json --out ./report.html
    • Produces a static report you can open locally or upload as a CI artifact.
  4. (Optional) Capture Flight streaming data

    pnpm -C examples/next-app dev &
    pnpm -F @rsc-xray/cli flight-tap      --url http://localhost:3000/products/1      --route /products/[id]      --out ./.scx/flight.json      --timeout 30000
    • The timeout guard aborts hung streams; pass --timeout 0 to disable it when debugging slower routes.

Tests

Command behavior is covered by:

  • packages/cli/src/commands/__tests__/analyze.test.ts
  • packages/cli/src/commands/__tests__/report.test.ts
  • packages/cli/src/commands/__tests__/flightTap.test.ts

Run the suite with:

pnpm -F @rsc-xray/cli test -- --run

RSC X‑Ray Pro

Paid plans available — unlock the full toolkit:

  • Overlay UI — live boundary tree, Suspense markers, bundle bytes, hydration timings
  • Flight tap & timeline — capture React Flight streaming; visualize chunk order, sizes, labels
  • Cache lens — inspect tags, revalidate policies, and route impact
  • Waterfall detector — find sequential awaits; guided fixes (preload/parallelize)
  • Codemods — use client, wrap with Suspense, add preload/hydration hook
  • VS Code extension — analyzer diagnostics + “Open in XRay” deep links
  • CI budgets & trends — PR comments, thresholds, and historical deltas

Learn more → https://rsc-xray.dev • Pricing → https://rsc-xray.dev/pricing