Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update detect_package_manager to look for new Bun lockfile #530

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update detect_package_manager to look for new Bun lockfile
Bun is in the process of switching from the binary `bun.lockb` file to a new, text-based `bun.lock` file. 

As of Bun 1.2, the new text-based lockfile is the default. We need to update the `detect_package_manager` to look for both lockfile formats, but we should be able to eventually retire the binary lockfile format.

More info: https://bun.sh/docs/install/lockfile#text-based-lockfile
raybrownco authored Jan 31, 2025
commit dc7a96f0b1ffb877e54e3b61b126f12b6607443c
2 changes: 1 addition & 1 deletion vite_ruby/lib/vite_ruby/config.rb
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ def coerce_booleans(config, *names)
def detect_package_manager(root)
return "npm" if root.join("package-lock.json").exist?
return "pnpm" if root.join("pnpm-lock.yaml").exist?
return "bun" if root.join("bun.lockb").exist?
return "bun" if root.join("bun.lockb").exist? || root.join("bun.lock").exist?
return "yarn" if root.join("yarn.lock").exist?

"npm"