diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f9ccba93f2..df664ba5ff 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose { - "name": "Actual development", + "name": "Actual Devcontainer", "dockerComposeFile": ["../docker-compose.yml", "docker-compose.yml"], // Alternatively: // "image": "mcr.microsoft.com/devcontainers/typescript-node:0-16", diff --git a/.github/actions/docs-spelling/expect.txt b/.github/actions/docs-spelling/expect.txt index ef18c107d2..07f250cf23 100644 --- a/.github/actions/docs-spelling/expect.txt +++ b/.github/actions/docs-spelling/expect.txt @@ -44,6 +44,7 @@ CLP CMCIFRPAXXX COBADEFF CODEOWNERS +Codespaces COEP commerzbank Copiar diff --git a/packages/docs/docs/contributing/development-setup.md b/packages/docs/docs/contributing/development-setup.md index e43b383f95..36e4b85b38 100644 --- a/packages/docs/docs/contributing/development-setup.md +++ b/packages/docs/docs/contributing/development-setup.md @@ -6,6 +6,10 @@ This guide will help you set up your development environment for contributing to ## Prerequisites +:::tip +If you prefer not to install Node and Yarn locally, you can use the [Dev Container](#dev-container) or run [Docker Compose](#docker-compose) directly. +::: + Before you begin, ensure you have the following installed: - **Node.js**: Version 22 or greater. You can download it from the [Node.js website](https://nodejs.org/en/download) (we recommend the LTS version). @@ -39,6 +43,34 @@ Before you begin, ensure you have the following installed: yarn typecheck ``` +## Dev Container + +The repo includes a [`.devcontainer/`](https://github.com/actualbudget/actual/tree/master/.devcontainer) configuration that follows the [Dev Containers spec](https://containers.dev/). Any tool that supports the spec can use it — for example VS Code or Cursor (with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)), JetBrains IDEs (via Gateway), GitHub Codespaces, or the [`@devcontainers/cli`](https://github.com/devcontainers/cli). + +In an editor that supports the spec, open the cloned repo and accept the **Reopen in Container** prompt (or run the equivalent command from your editor's command palette). The container will build, `yarn install` will run automatically via `postCreateCommand`, and you'll be dropped into a shell with the toolchain ready. + +To start the dev server, open a terminal inside the container and run: + +```bash +yarn start +``` + +The dev server will be available at `http://localhost:3001/`. Most editors automatically forward the port from the container to your host. + +## Docker Compose + +For other editors, run from the repo root: + +```bash +docker compose up --build +``` + +This starts a container that runs `yarn start:browser` on port 3001. Open `http://localhost:3001/` in your browser. + +:::note +The container mounts your repo at `/app`. If you've already run `yarn install` on your host, the native modules (`better-sqlite3`, `bcrypt`, `electron`, `sharp`) will be compiled for your host OS and won't work inside the Linux container. Either delete `node_modules/` first and let the container reinstall, or run the dev container path above (which rebuilds them automatically). +::: + ## Essential Development Commands All commands should be run from the **root directory** of the repository. Never run yarn commands from child workspace directories. diff --git a/upcoming-release-notes/7729.md b/upcoming-release-notes/7729.md new file mode 100644 index 0000000000..8ea4bb66d8 --- /dev/null +++ b/upcoming-release-notes/7729.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [nikhilweee] +--- + +Document the Dev Container and Docker Compose options as alternatives to local Node and Yarn setup in the contributor development-setup guide.