Run an npm binary with Bun instead of Node

The executable in node_modules/.bin is often a shell shim that explicitly starts Node. Running the shim with Bun does not change that.

For example, a shim may eventually execute:

exec node "$basedir/../@react-router/dev/bin.js" "$@"

Call the target JavaScript file directly instead:

bun --bun --import=./tests/mocks/index.ts \
  node_modules/@react-router/dev/bin.js dev --host

The --bun flag tells Bun to run the command. Inspect the .bin file to find its target. This keeps pnpm as the package manager while choosing Bun as the runtime for the binary.

See the cmd-shim implementation for the kind of wrapper npm creates.