Skip to content

Commit fe2c1d3

Browse files
committed
chore: introduce dev containers
1 parent 50808c2 commit fe2c1d3

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

.devcontainer/devcontainer.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:0-18",
7+
"features": {
8+
"ghcr.io/devcontainers-contrib/features/pnpm:2": {}
9+
},
10+
11+
// Features to add to the dev container. More info: https://containers.dev/features.
12+
// "features": {},
13+
14+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
15+
"forwardPorts": [3000],
16+
17+
// Use 'postCreateCommand' to run commands after the container is created.
18+
"postCreateCommand": "pnpm install && git config --global core.editor 'code --wait'",
19+
20+
// Configure tool-specific properties.
21+
"customizations": {
22+
"vscode": {
23+
"extensions": [
24+
"dbaeumer.vscode-eslint"
25+
]
26+
}
27+
}
28+
29+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
30+
// "remoteUser": "root"
31+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
node_modules
55
.pnp
66
.pnp.js
7+
.pnpm-store/
78

89
# testing
910
coverage

.vscode/extensions.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
44
"recommendations": [
5-
"dbaeumer.vscode-eslint"
6-
]
5+
"dbaeumer.vscode-eslint",
6+
"ms-vscode-remote.remote-containers"
7+
]
78
}

CONTRIBUTING.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,22 @@ Your contributions will eventually help save countless hours for people struggli
1212
1. Node.js version installed, [latest LTS is recommended](https://nodejs.org/en/about/releases/)
1313
2. Install pnpm
1414

15+
### Using [devcontainer](https://code.visualstudio.com/docs/devcontainers/create-dev-container)
16+
17+
Devcontainers is an easy way to avoid "works on my machine" situations. Essentially, the development happens in a Docker container.
18+
19+
1. Make sure you've got Docker installed on your machine
20+
2. Do install the recommended by VSCode extensions
21+
3. Click "Reopen in Container" button in a popup
22+
1523
## How to start developing?
1624

1725
Clone the repo and install the needed dependencies for all the packages by following these steps:
1826

1927
```sh
2028
git clone https://github.com/mattpocock/ts-error-translator.git
2129
cd ts-error-translator
22-
pnpm
30+
pnpm install
2331
pnpm dev # This will run the next app
2432
```
2533

0 commit comments

Comments
 (0)