This page covers the dev container configuration for the TypeScript repository, which provides a pre-configured, isolated development environment for contributors. It documents the container image, pre-installed tools, post-creation setup steps, and VS Code integration.
For general local development setup (prerequisites, cloning, and initial build steps), see Development Environment. For editor and formatting configuration details, see Editor and Formatting Configuration.
The TypeScript repository ships a Dev Containers configuration in .devcontainer/devcontainer.json1-44 This allows contributors to start developing inside a containerized environment without manually installing Node.js, Go, or other tooling on the host machine. VS Code's Dev Containers extension is the primary supported host.
The container is based on the official Microsoft JavaScript/Node image:
| Property | Value |
|---|---|
| Image | mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm |
| Base OS | Debian Bookworm |
| Node.js version | 22 (LTS) |
| Remote user | node |
Source: .devcontainer/devcontainer.json6
In addition to the base image, the configuration adds the Go toolchain via a Dev Containers feature:
| Feature | Source |
|---|---|
| Go | ghcr.io/devcontainers/features/go:1 |
Go is required because profiling tooling (pprof) is distributed as a Go module. See .devcontainer/devcontainer.json9-11
After the container is created for the first time, three setup commands run automatically. They are defined under postCreateCommand as a map, meaning they run independently (not sequentially in a shell pipeline).
Dev Container Initialization Flow
Sources: .devcontainer/devcontainer.json17-21
| Command Name | Shell Command | Purpose |
|---|---|---|
| Configure Build Tools | sudo npm install -g hereby; npm ci | Installs the hereby task runner globally and installs all project npm dependencies from package-lock.json |
| Install pprof | go install github.com/google/pprof@latest | Installs the pprof CPU/memory profiler for Go |
| Install Graphviz | sudo apt install graphviz | Installs dot and other Graphviz tools, which pprof uses to render call graphs |
herebyhereby is the task runner used throughout the TypeScript build system (see Build System with hereby). Installing it globally via npm install -g hereby makes hereby available as a direct shell command. Running npm ci then installs the project-local dependencies locked in package-lock.json.
pprof and Graphvizpprof is Google's profiling visualization tool. It reads profiling data (CPU profiles, heap profiles) and outputs reports in text, web, or graph formats. Graphviz is a runtime dependency of pprof when generating call-graph SVGs or PDFs. These tools are useful for performance investigation of the TypeScript compiler itself.
The configuration applies VS Code-specific settings and extension recommendations that activate automatically when the container starts.
VS Code Customization Mapping
Sources: .devcontainer/devcontainer.json24-39
The integrated terminal is set to use /bin/bash as its default shell on Linux. This is set via terminal.integrated.defaultProfile.linux and terminal.integrated.profiles.linux.
| Extension ID | Purpose |
|---|---|
dbaeumer.vscode-eslint | Runs ESLint checks in the editor as you type |
dprint.dprint | Provides dprint formatter integration for on-save formatting |
These correspond to the project's code quality infrastructure. See Code Formatting with dprint for details on the dprint configuration.
There are two supported workflows, both described in CONTRIBUTING.md:
Option 1 — Local clone
Dev Containers: Open Folder in Container command.Option 2 — Container volume clone (faster I/O on some systems)
Dev Containers: Clone Repository in Container Volume.Source: CONTRIBUTING.md98-104
Sources: .devcontainer/devcontainer.json1-44
The dev container image and features are kept up to date automatically. The repository's Dependabot configuration includes a devcontainers ecosystem entry that checks for updates weekly:
package-ecosystem: 'devcontainers'
directory: '/'
schedule:
interval: weekly
Source: .github/dependabot.yml18-21
This means the image and features versions in devcontainer.json receive automated pull requests when new versions are available.
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.