Repository navigation
Conversation
Bun is now the primary JS runtime on a growing share of Prisma projects. `bunx prisma <sub>` is semantically equivalent to `npx prisma <sub>` — same CLI, same output format, same subcommands — but the hook didn't recognise it, so 45+ monthly invocations per reporter were flowing through the Bash hook completely unfiltered. Add `bunx` to the existing Prisma `RtkRule`: - Regex pattern: insert `|bunx` into the runner alternation so `bunx prisma …` classifies as `Supported(rtk prisma)`. - `rewrite_prefixes`: add `"bunx prisma"` so the rewrite path produces `rtk prisma …` and main.rs's filter dispatch picks up the existing `src/cmds/js/prisma_cmd.rs` handler unchanged. No new output-filtering logic is needed — the entire Bun-Prisma stack goes through the same code path as npx/pnpm/npm; only the rewrite recognition was missing. Tests: - Extend `test_classify_prisma` and `test_rewrite_prisma` with `bunx prisma` so the same per-runner invariant fence guards bun. - Add `test_rewrite_bunx_prisma_subcommands` covering the six surface shapes the reporter calls out (`migrate dev`, `migrate dev --name …`, `migrate deploy`, `migrate status`, `generate`, `db seed`, `studio`). Pins the regex against a future tweak that silently drops one shape. cargo fmt / clippy --all-targets / test --bin rtk: 1910 passed, 0 warnings. Fixes rtk-ai#1401
|
Reviewer guide to reduce review time: Expert lens: rewrite registry / JS tooling. This is a narrow rule-table change: Suggested review checks:
|
|
Heads-up rather than a review: #988 (bun/deno runtime support) is close to landing and adds a broad That does not supersede this PR — routing It does mean the two rules overlap, and |
|
Thanks for this, and for the scoping notes that made the Prisma surface explicit. #988 (merged 2026-09-03) added Bun and Deno support, including a general |
Summary
Bun is the primary JS runtime on a growing share of Prisma projects. `bunx prisma ` is semantically equivalent to `npx prisma ` — same CLI, same output format, same subcommands — but the hook didn't recognise it, so the reporter's 45 monthly `bunx prisma` invocations (#1401) were flowing through the Bash hook completely unfiltered.
Fix
One `RtkRule` change in `src/discover/rules.rs`:
```diff
rtk_cmd: "rtk prisma",
rewrite_prefixes: &[
```
No new output-filtering logic — the entire Bun-Prisma stack goes through the same `src/cmds/js/prisma_cmd.rs` handler as npx/pnpm/npm; only the rewrite recognition was missing.
Behaviour
`npx prisma` / `pnpm prisma` / `pnpm dlx prisma` continue to work exactly as before — same rule, just one more alternation branch.
Scope notes
Test plan
Fixes #1401