0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/.devcontainer/scripts/start.rb
David Taylor 9527868295
DEV: Replace JS build system with Rolldown (#35963)
This replaces the old ember-cli build with a modern Rolldown build. In
local testing, this provides an 80% improvement in build times, while
remaining 100% backwards compatible for themes and plugins.

As part of this move, we have decided to stop using a proxy in front of
Discourse for development. Development should now be done directly
against the Rails server.

`bin/ember-cli -u` has been replaced with `bin/dev`. This will launch
Rails on `:3000`, and will run the rolldown build in the background. Log
output from both processes will be shown with an appropriate prefix. You
should visit `:3000` in your browser. `:4200` will no longer serve
anything.

To help with migration, `bin/ember-cli` is now a backwards-compatible
shim. It will print help information, and will launch a lightweight
server on `:4200` with instructions to move to `:3000`.

If you prefer to launch Rails and the JS build as separate commands, you
can still do that. Rails boot commands are unchanged, and the rolldown
development builder can be run using `bin/dev --only ember`.

https://meta.discourse.org/t/403908

---------

Co-authored-by: Jarek Radosz <jarek@cvx.dev>
Co-authored-by: Chris Manson <chris@manson.ie>
2026-05-29 11:11:55 +01:00

34 lines
1.2 KiB
Ruby
Executable file
Vendored

#!/usr/bin/env ruby
# frozen_string_literal: true
puts "👋 Welcome to the Discourse devcontainer! Let's get everything ready..."
puts "Setting permissions on volume mounts..."
system "sudo chown discourse .", exception: true
system "sudo chown discourse node_modules", exception: true
system "sudo chown -R postgres /shared/postgres_data", exception: true
system "sudo ln -sf #{File.expand_path(".devcontainer/scripts/chrome_wrapper", Dir.pwd)} /usr/bin/google-chrome",
exception: true
puts "Starting services..."
fork do
Process.daemon
exec "sudo nohup /sbin/boot"
end
system "cp -n .vscode/settings.json.sample .vscode/settings.json", exception: true
system "cp -n .vscode/tasks.json.sample .vscode/tasks.json", exception: true
puts <<~TXT
🎉 All done!
Next steps:
1. Cmd/Ctrl + Shift + B to run the shortcuts/boot-dev task
2. Wait for the server to start
3. Run the "dev/admin/create" task once to create an admin account
4. Open your browser to http://localhost:3000
Running tests:
Run the "deps/testing" task once to install Playwright + discourse_test DB
Then you can run qunit and rspec tests (boot-dev server should be running)
TXT