Open-Source Wikis

/

TypeScript

/

Systems

microsoft/TypeScript

Systems

The TypeScript compiler is decomposed into roughly a dozen internal subsystems, almost all of which live under src/compiler/ (with the language service and tsserver-specific systems under src/services/ and src/server/). Each subsystem has a single, focused responsibility and a relatively narrow public surface used by its callers.

Compilation pipeline

System Source Page
Host abstraction src/compiler/sys.ts system-host
Command-line + config src/compiler/commandLineParser.ts + executeCommandLine.ts command-line-and-config
Scanner src/compiler/scanner.ts scanner
Parser src/compiler/parser.ts parser
Binder src/compiler/binder.ts binder
Module resolution src/compiler/moduleNameResolver.ts + resolutionCache.ts module-resolution
Program src/compiler/program.ts program
Type checker src/compiler/checker.ts checker
Node factory src/compiler/factory/nodeFactory.ts factory
Transformers src/compiler/transformer.ts + src/compiler/transformers/ transformers
Emitter src/compiler/emitter.ts + src/compiler/sourcemap.ts emitter
Watch + builder src/compiler/watch*.ts + src/compiler/builder*.ts watch-and-builder
Build mode src/compiler/tsbuild*.ts build-mode
Diagnostics src/compiler/diagnosticMessages.json + programDiagnostics.ts diagnostics

Editor-side systems

System Source Page
Language service src/services/ language-service
Project system src/server/editorServices.ts + project.ts + scriptInfo.ts project-system
Automatic Type Acquisition src/jsTyping/ + src/typingsInstallerCore/ automatic-type-acquisition
Test harness src/harness/ + src/testRunner/ test-harness

Pipeline at a glance

graph LR
    Host["sys.ts"] --> CLP["commandLineParser.ts"]
    Host --> Scanner
    CLP --> Program
    Scanner --> Parser --> Binder --> Program
    MR["moduleNameResolver.ts"] --> Program
    Program --> Checker
    Checker --> Transformers
    Factory --> Transformers
    Transformers --> Emitter
    Emitter --> Output[".js / .d.ts / .map"]
    Program --> Builder["builder.ts (incremental)"]
    Builder --> Watch["watch.ts"]
    Watch --> Program
    Builder --> SolutionBuilder["tsbuildPublic.ts"]

The dependency direction is strict: the parser doesn't know about the checker, the checker doesn't know about the emitter, and so on. The single sink is the Program (in program.ts), which composes everything for callers.

For the public-API surface that wraps these systems, see primitives and features. For how a single tsc invocation drives the whole pipeline, see apps/tsc and systems/program.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Systems – TypeScript wiki | Factory