From dc7a96f0b1ffb877e54e3b61b126f12b6607443c Mon Sep 17 00:00:00 2001 From: Ray Brown Date: Fri, 31 Jan 2025 10:56:49 -0500 Subject: [PATCH] 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 --- vite_ruby/lib/vite_ruby/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite_ruby/lib/vite_ruby/config.rb b/vite_ruby/lib/vite_ruby/config.rb index 4421834d..52a45d91 100644 --- a/vite_ruby/lib/vite_ruby/config.rb +++ b/vite_ruby/lib/vite_ruby/config.rb @@ -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"