diff --git a/src/discover/registry.rs b/src/discover/registry.rs index bb7b11f2a..9a14d718e 100644 --- a/src/discover/registry.rs +++ b/src/discover/registry.rs @@ -2851,6 +2851,7 @@ mod tests { "npx prisma", "pnpm prisma", "pnpx prisma", + "bunx prisma", "prisma", ]; for command in commands { @@ -2885,6 +2886,7 @@ mod tests { "npx prisma", "pnpm prisma", "pnpx prisma", + "bunx prisma", "prisma", ]; for command in commands { @@ -2897,6 +2899,34 @@ mod tests { } } + #[test] + fn test_rewrite_bunx_prisma_subcommands() { + // #1401: exercise the full Prisma surface that the reporter said hits + // unfiltered with bun. The classify_command/rewrite tests above already + // cover `migrate dev` for every runner; this nails down each subcommand + // shape verbatim so a future regex tweak doesn't silently drop one. + let cases = [ + ("bunx prisma migrate dev", "rtk prisma migrate dev"), + ( + "bunx prisma migrate dev --name add_col", + "rtk prisma migrate dev --name add_col", + ), + ("bunx prisma migrate deploy", "rtk prisma migrate deploy"), + ("bunx prisma migrate status", "rtk prisma migrate status"), + ("bunx prisma generate", "rtk prisma generate"), + ("bunx prisma db seed", "rtk prisma db seed"), + ("bunx prisma studio", "rtk prisma studio"), + ]; + for (input, expected) in cases { + assert_eq!( + rewrite_command_no_prefixes(input, &[]), + Some(expected.into()), + "Failed for input: {}", + input + ); + } + } + #[test] fn test_rewrite_prettier() { let commands = vec![ diff --git a/src/discover/rules.rs b/src/discover/rules.rs index df7c72d03..ce3b20165 100644 --- a/src/discover/rules.rs +++ b/src/discover/rules.rs @@ -346,10 +346,15 @@ pub const RULES: &[RtkRule] = &[ subcmd_savings: &[], subcmd_status: &[], }, + // #1401: Bun is now the primary JS runtime on a growing share of Prisma + // projects. `bunx prisma ` is semantically equivalent to + // `npx prisma ` (same CLI, same output format), so it routes through + // the same `rtk prisma` filter — no new output-handling logic required. RtkRule { - pattern: r"^((p?np(m|x)|p?npm\s+(exec|run|run-script)|npm\s+(rum|urn|x)|pnpm\s+dlx)\s+)?prisma", + pattern: r"^((p?np(m|x)|p?npm\s+(exec|run|run-script)|npm\s+(rum|urn|x)|pnpm\s+dlx|bunx)\s+)?prisma", rtk_cmd: "rtk prisma", rewrite_prefixes: &[ + "bunx prisma", "npm exec prisma", "npm prisma", "npm rum prisma",