Files
trackgo-fe/.devcontainer/devcontainer.json
T

65 lines
2.8 KiB
JSON

// For format details, see https://aka.ms/devcontainer.json
// This container standardizes the local development environment for the Monorepo.
{
"name": "FE Monorepo Template",
// Base image providing Node.js v24, TypeScript, and a Debian Bookworm environment.
"image": "mcr.microsoft.com/devcontainers/typescript-node:24-bookworm",
// DevContainer Features: Pre-installed tools needed for our workflow.
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers-extra/features/pnpm:2": {},
"ghcr.io/devcontainers/features/sshd:1": {}
},
// ─── Port Topology ──────────────────────────────────────────────────────────
// 6006: Storybook (Docs)
// 5173: Web App (Must be strictly 5173 for Electron IPC compatibility)
// 3000: Landing App (Isolated from Vite's default 517x blast radius)
"forwardPorts": [6006, 5173, 3000],
"portsAttributes": {
"6006": {
"label": "Storybook",
"onAutoForward": "notify"
},
"5173": {
"label": "Web App (Electron Target)",
"onAutoForward": "notify"
},
"3000": {
"label": "Landing App (Public)",
"onAutoForward": "notify"
}
},
// ─── Lifecycle Hooks ────────────────────────────────────────────────────────
// Automatically install all workspace dependencies once the container is built.
"postCreateCommand": "pnpm install",
// ─── Editor Standardization ─────────────────────────────────────────────────
// Enforces code style and tooling across all developers' machines.
"customizations": {
"vscode": {
"settings": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"extensions": [
"dbaeumer.vscode-eslint", // Linting
"esbenp.prettier-vscode", // Formatting
"bradlc.vscode-tailwindcss", // Tailwind v4 IntelliSense
"yoavbls.pretty-ts-errors", // Human-readable TypeScript errors
"editorconfig.editorconfig" // Standardized indentation
]
}
},
// ─── Security & Permissions ─────────────────────────────────────────────────
// CRITICAL: Run the container as 'node' instead of 'root'.
// This prevents 'Permission Denied' errors on the host OS when trying to
// delete or modify the 'node_modules' folder created inside the container.
"remoteUser": "node"
}