feat(js): add bun and bunx to command rewrite rules#1340
Open
niklasmarderx wants to merge 1 commit intortk-ai:developfrom
Open
feat(js): add bun and bunx to command rewrite rules#1340niklasmarderx wants to merge 1 commit intortk-ai:developfrom
niklasmarderx wants to merge 1 commit intortk-ai:developfrom
Conversation
Adds bun/bunx as recognized package manager prefixes for three command types discovered in the wild (rtk-ai#1316): - `bunx tsc` now rewrites to `rtk tsc` - `bun test` / `bunx vitest` rewrite to `rtk vitest` - `detect_package_manager()` returns "bun" when bun.lockb or bun.lock is present, so `package_manager_exec()` uses `bunx` as fallback Tests added for each new rewrite path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1316
Bun projects use
bun test,bunx tsc, andbunx vitestin place of the npm/pnpm/npx equivalents. None of these were matched by the rewrite registry, so they passed through unfiltered.Three changes:
rules.rs — extend two existing patterns:
^(npx|pnpm|bunx)?tscsobunx tsc --noEmit→rtk tsc --noEmitbunxprefix variant and a dedicated^bun testalternative sobun test src/→rtk vitest src/utils.rs — teach
detect_package_manager()to recognisebun.lockb/bun.lockand return"bun", then routepackage_manager_exec()tobunxwhen the lockfile says bun. This matches the pattern already in place for pnpm / yarn.Test plan
cargo fmt --all && cargo clippy --all-targets && cargo test— 1228 passed, 0 failed (4 new tests)test_rewrite_bunx_tsc,test_rewrite_bun_test,test_rewrite_bun_test_with_path,test_rewrite_bunx_vitest