Skip to content

Commit d813828

Browse files
committed
feat(tooling): add devcontainer developing environment
1 parent e2ce0a2 commit d813828

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
// Display name shown by editor when selecting this dev container
3+
"name": "${localWorkspaceFolderBasename} Dev Environment",
4+
5+
// Base image from Microsoft devcontainers for a TypeScript + Node environment
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:24",
7+
8+
// Persisted volumes to speed installs and avoid repeated network requests
9+
"mounts": [
10+
// Persist node_modules so reinstalling or rebuilding the container doesn't force repeated network installs
11+
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
12+
13+
// Share a pnpm store cache volume to speed package resolution and install times across projects/containers
14+
"source=pnpm-cache,target=/home/node/.pnpm-store,type=volume"
15+
],
16+
17+
// Run once after the container filesystem is created.
18+
// - Fix ownership so the non-root node user can access workspace files
19+
// - Install latest pnpm globally so postStartCommand and developer workflows use pnpm
20+
"postCreateCommand": "sudo corepack enable",
21+
22+
// Run each time the container starts. Ensures dependencies are installed inside the container user environment.
23+
"postStartCommand": "pnpm install --frozen-lockfile",
24+
25+
// Use the non-root 'node' user provided by the base image for safer file access and to mirror deployment permissions
26+
"remoteUser": "node",
27+
28+
"customizations": {
29+
"vscode": {
30+
// Recommended and enforced editor settings for consistent linting/validation across contributors
31+
"settings": {
32+
// Prefer editor config over global formatting where appropriate
33+
"editor.formatOnSave": true,
34+
"editor.codeActionsOnSave": {
35+
"source.fixAll.eslint": "explicit"
36+
},
37+
"eslint.validate": [
38+
"json",
39+
"javascript",
40+
"javascriptreact",
41+
"typescript",
42+
"typescriptreact"
43+
],
44+
// Disable telemetry to avoid sending usage data to Microsoft
45+
"telemetry.enableTelemetry": false
46+
},
47+
48+
// Recommended extensions preinstalled in the container to provide a consistent developer experience
49+
"extensions": [
50+
"streetsidesoftware.code-spell-checker", // basic spell checking in docs/comments
51+
"bradlc.vscode-tailwindcss", // Tailwind CSS IntelliSense if project uses Tailwind
52+
"dbaeumer.vscode-eslint", // ESLint integration for linting and autofix
53+
"esbenp.prettier-vscode", // Prettier for consistent formatting
54+
"yoavbls.pretty-ts-errors", // Improved TypeScript error messages
55+
"davidanson.vscode-markdownlint", // Markdown linting for docs
56+
"github.vscode-github-actions", // GitHub Actions workflow support
57+
"github.vscode-pull-request-github" // PR and issue integration with GitHub
58+
]
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)