Skip to content

Add initial config for devcontainers. #689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "Node.js & TypeScript & Yarn",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"features": {
"ghcr.io/devcontainers/features/node:1": {}
},
"postCreateCommand": {
"Install dependencies": "yarn install"
}
Comment on lines +7 to +9
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Verify the format of postCreateCommand.
The current format uses an object with a label ("Install dependencies") mapping to the command. According to standard devcontainer.json schema, postCreateCommand is typically defined as a string or an array of strings. Consider revising it to a simpler format, for example:

-  "postCreateCommand": {
-    "Install dependencies": "yarn install"
-  }
+  "postCreateCommand": "yarn install"

This change helps ensure compatibility with standard dev container tooling.

}
26 changes: 24 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,30 @@ Please note that commit hooks will run automatically to perform some tasks;
#### Windows users

Make sure your editor and terminal that run the tests are set to `Powershell 7` or above with
`Git's Unix tools for Windows` installed. This is because some tests require you to be able to run `sh` and other
unix commands.
`Git's Unix tools for Windows` installed. This is because some tests require you to be able to run `sh` and other unix
commands.

#### Development Containers

This project supports development containers (dev containers) which provide a consistent, pre-configured development
environment. Using dev containers is recommended as it ensures all contributors work with the same development setup.

To use dev containers:

1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop/)
2. Install the
[Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in
VS Code
3. Clone the repository and open it in VS Code
4. When prompted, click "Reopen in Container" or use the command palette (F1) and select "Dev Containers: Reopen in
Container"

The dev container will automatically:

- Set up Node.js and TypeScript environment
- Install project dependencies using Yarn

This eliminates the need to manually install Node.js, Yarn, and other dependencies on your local machine.

#### License

Expand Down
Loading