Skip to content

Commit

Permalink
Update detect_package_manager to look for new Bun lockfile
Browse files Browse the repository at this point in the history
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
  • Loading branch information
raybrownco authored Jan 31, 2025
1 parent 98d3d5f commit dc7a96f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vite_ruby/lib/vite_ruby/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit dc7a96f

Please sign in to comment.