Skip to content

Commit 9c0cf63

Browse files
docs: add devcontainer for examples (#386)
## Summary Add a Dev Container configuration for Moss contributors. ## Changes - Provide Python 3.12, Node.js 22, and Go 1.23 in Codespaces/dev containers. - Install the root, Python example, JavaScript example, and Go example dependencies after container creation. - Forward Moss credentials from the local environment without committing secrets. - Include common VS Code language extensions and development ports. ## Testing - Parsed and structurally validated `.devcontainer/devcontainer.json` locally. - `git diff --check` passed. - `npm run lint` was attempted but is blocked on Windows by the existing `ESLINT_USE_FLAT_CONFIG=true eslint .` script syntax before ESLint starts. - Full container startup could not be run because Docker is not installed in the development environment. Closes #378 --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 57499a1 commit 9c0cf63

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "Moss development",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4+
"features": {
5+
"ghcr.io/devcontainers/features/python:1": {
6+
"version": "3.12"
7+
},
8+
"ghcr.io/devcontainers/features/node:1": {
9+
"version": "22"
10+
},
11+
"ghcr.io/devcontainers/features/go:1": {
12+
"version": "1.23"
13+
}
14+
},
15+
"customizations": {
16+
"vscode": {
17+
"extensions": [
18+
"ms-python.python",
19+
"ms-python.vscode-pylance",
20+
"dbaeumer.vscode-eslint",
21+
"golang.go"
22+
]
23+
}
24+
},
25+
"postCreateCommand": "python -m pip install --upgrade pip && python -m pip install -r examples/python/requirements.txt && npm ci && npm ci --prefix examples/javascript && go -C examples/go mod download",
26+
"remoteEnv": {
27+
"MOSS_PROJECT_ID": "${localEnv:MOSS_PROJECT_ID}",
28+
"MOSS_PROJECT_KEY": "${localEnv:MOSS_PROJECT_KEY}"
29+
},
30+
"forwardPorts": [3000, 5173, 8000],
31+
"portsAttributes": {
32+
"3000": {
33+
"label": "Web app"
34+
},
35+
"5173": {
36+
"label": "Vite dev server"
37+
},
38+
"8000": {
39+
"label": "Python app"
40+
}
41+
},
42+
"remoteUser": "vscode"
43+
}
44+

0 commit comments

Comments
 (0)