Skip to content

Commit

Permalink
Add support for bun
Browse files Browse the repository at this point in the history
  • Loading branch information
yatish27 committed Apr 19, 2024
1 parent 5a7fb76 commit 2c647b6
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 341 deletions.
1 change: 0 additions & 1 deletion .node-version

This file was deleted.

8 changes: 5 additions & 3 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def setup!
run "bundle install" if bundle_needed?
run "overcommit --install" if overcommit_installable?
run "bin/rails db:prepare" if database_present?
run "yarn install" if yarn_needed?
run "bun install" if bun_needed?
run "bin/rails tmp:create" if tmp_missing?
run "bin/rails restart"

Expand All @@ -19,8 +19,7 @@ def setup!
end

say_status :Ready!,
"Use #{colorize("yarn start", :yellow)} to start the app, " \
"or #{colorize("bin/rake", :yellow)} to run tests"
"#{colorize("bin/rake", :yellow)} to run tests"
end

def run(command, echo: true, silent: false, exception: true)
Expand Down Expand Up @@ -51,6 +50,9 @@ def yarn_needed?
File.exist?("yarn.lock") && !run("yarn check --check-files", silent: true, exception: false)
end

def bun_needed?
File.exist?("bun.lockb") && !run("bun check --check-files", silent: true, exception: false)

def tmp_missing?
!Dir.exist?("tmp/pids")
end
Expand Down
Binary file added bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[install.lockfile]
print = "yarn"
9 changes: 0 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"private": true,
"type": "module",
"engines": {
"node": "^18.12.0 || >= 20.0.0"
},
"dependencies": {
"@hotwired/stimulus": "^3.2.2",
"@hotwired/turbo-rails": "^8.0.4",
Expand All @@ -14,11 +11,5 @@
"stimulus-vite-helpers": "^3.1.0",
"vite": "^5.0.0",
"vite-plugin-rails": "^0.5.0"
},
"scripts": {
"start": "concurrently -i -k --kill-others-on-fail -p none 'RUBY_DEBUG_OPEN=true bin/rails s' 'bin/vite dev'"
},
"devDependencies": {
"concurrently": "^8.2.2"
}
}
Loading

0 comments on commit 2c647b6

Please sign in to comment.