Developing Discourse on GitHub Codespaces
GitHub Codespaces is a very fast way to get started with Discourse development. Their free tier is good for 30 hours per month of a 4-core machine.
Getting Started
The VSCode environment will automatically be configured with our recommended settings and extensions, including automatic linting and formatting.
To minimize usage, make sure to run "Codespaces: Stop Current Codespace" from the command palette (Ctrl + Shift + P or Cmd + Shift + P) when you're finished. If you forget to do this, the Codespace should be shut down automatically after your account's configured idle time (default 30 mins). But, there are some situations where the codespace will not be detected as idle, so it's best to stop it deliberately.
Running tests
The first time you run tests, you'll need to install testing dependencies, including Playwright and the discourse_test DB. You can run the deps/testing task to install those. Open the command palette, select "Tasks: Run Tasks". It will present a menu of tasks; select deps/testing off of that list.
Once the test dependencies are installed, you can run bin/lint, bin/qunit, or the system specs
Tips
-
You can launch a codespace from specific branches/PRs - just visit it, and press ,
-
You can manage all your codespaces at https://github.com/codespaces/
-
Discourse's sample vscode
.vscode/settings.jsonand.vscode/tasks.jsonwill be copied when you first boot the codespace. From that point forward, if you want to use the latest sample config, you'll need to manually copy.vscode/settings.json.sampleto.vscode/settings.json.
谢谢你的反馈!



