Gallery · Architecture explained · Score · TypeScript
tRPC architecture: modules, API surface, dependency graph
End-to-end typesafe APIs. Generated from trpc/trpc at 1c9bf51, MIT.
Scanned packages/server. Client and framework adapters are not included.
- Files
- 73
- Modules
- 8
- API routes
- 0
- Documents
- 17
TypeScriptNode.jsExpress
Executive Summary
At a Glance
| Aspect | Summary |
|---|---|
| What | tRPC is a production-grade command-line tool |
| Built With | Express + TypeScript, Node.js |
| Scale | 8 modules across 73 files |
| Maturity | Production-grade (3/3 indicators) |
What This System Does
tRPC is a Express command-line tool built with TypeScript, Node.js. It operates as a command-line interface, enabling users to interact with the system through terminal commands. This architecture is optimized for automation, scripting, and integration into CI/CD pipelines.
Business Capabilities
The system is organized around 5 functional domains, each representing a distinct business capability:
| Domain | Capability | Scale |
|---|---|---|
| Core Engine | path packages/server/src/unstable-core-do-not-import matches core | 2 modules, 41 files |
| Integrations | path packages/server/src/adapters matches adapter | 1 modules, 23 files |
| Other | Uncategorized module | 3 modules, 7 files |
| Search & Discovery | path packages/server/src/index.ts matches index | 1 modules, 1 files |
| Shared Utilities | path packages/server/src/shared.ts matches shared | 1 modules, 1 files |
Technical Foundation
| Layer | Technologies | Purpose |
|---|---|---|
| Application | Express | Core runtime framework |
| Language | TypeScript, Node.js | Primary development language |
| Build | Vite, Turborepo | Compilation and bundling |
| Testing | Vitest | Quality assurance |
Module Composition
The codebase follows a layered architecture with clear separation of concerns:
| Layer | Count | Key Modules | Responsibility |
|---|---|---|---|
| core | 2 | unstable-core-do-not-import, unstable-core-do-not-import.ts | Supporting application functionality |
| integration | 1 | adapters | Supporting application functionality |
| Other Modules | 4 | observable, http.ts | General purpose functionality |
| Shared Libraries | 1 | shared.ts | Provides shared utilities and abstractions used across modules |
Monorepo Structure
This is a pnpm workspaces monorepo containing 1 packages. This structure enables:
- Independent versioning and deployment of packages
- Shared code reuse across internal projects
- Coordinated development with clear ownership boundaries
Key packages:
@trpc/server— packages/server
Codebase Health
Overall Health: 🟢 100/100
| Metric | Value | Status |
|---|---|---|
| Internal imports | 146 edges | ✅ Connected |
| External Packages | 3 | ✅ Manageable |
| Circular Dependencies | cycle-free | ✅ None |
| Orphan Files | 5 | ⚠️ 5 unused |
Key Insights
- ✅ Clean module boundaries — No circular dependencies detected, enabling safe refactoring and testing.
- ✅ Healthy coupling — Most-imported module (
packages/server/src/unstable-core-do-not-import/utils) serves 16 files without excessive centralization.
Key Data Flows
The system processes information through 5 identified flows:
- next-app-dir Request Flow — Import chain starting from
packages/server/src/adapters/next-app-dir— traces how this entry point depends on 1 downstream module - express Request Flow — Import chain starting from
packages/server/src/adapters/express— traces how this entry point depends on 2 downstream modules - next Request Flow — Import chain starting from
packages/server/src/adapters/next— traces how this entry point depends on 2 downstream modules - standalone Request Flow — Import chain starting from
packages/server/src/adapters/standalone— traces how this entry point depends on 2 downstream modules - fastify Request Flow — Import chain starting from
packages/server/src/adapters/fastify— traces how this entry point depends on 3 downstream modules
Strategic Observations
- The codebase follows Core/kernel architecture — `packages/server/src/unstable-core-do-not-import`, `packages/server/src/unstable-core-do-not-import.ts`; high fan-in, Integration adapters — `packages/server/src/adapters`, Acyclic dependency graph — clean layering architectural patterns, providing a familiar structure for developers.
- With 5 distinct domains, the system has clear separation of concerns suitable for team-based development.
- Strong engineering practices are in place: automated testing and clean dependency boundaries support ongoing development.
- As a CLI tool, this system is automation-friendly and can integrate into existing workflows and pipelines.
This executive summary was generated from comprehensive repository analysis including dependency graphs, data flow detection, and architectural pattern recognition. Enable AI enhancement with `GITHUB_TOKEN` for strategic recommendations, risk assessments, and plain-language explanations tailored for non-technical stakeholders.
<!-- repolens:docs-badge -->  · Examples
System Overview
The Big Picture
tRPC is a focused codebase with a clear purpose, containing 8 modules spread across 73 files.
| Dimension | Details |
|---|---|
| Total Files | 73 |
| Module Count | 8 |
| Functional Domains | 5 |
| Interface Type | Command-Line Tool |
Technology Stack
The system is built on a modern technology foundation:
| Layer | Technologies | Purpose |
|---|---|---|
| Runtime | Express | HTTP server and middleware |
| Language | TypeScript, Node.js | Primary development language |
| Build | Vite, Turborepo | Compilation and asset processing |
| Quality | Vitest | Automated testing |
Architecture Patterns
The codebase follows 3 identified architectural patterns:
- Core/kernel architecture — `packages/server/src/unstable-core-do-not-import`, `packages/server/src/unstable-core-do-not-import.ts`; high fan-in — A structured approach to organizing code and managing complexity.
- Integration adapters — `packages/server/src/adapters` — A structured approach to organizing code and managing complexity.
- Acyclic dependency graph — clean layering — The system operates as a command-line interface, accepting user input through terminal commands and producing structured output.
Module Architecture
The system is organized into 4 architectural layers:
| Layer | Modules | Key Examples | Responsibility |
|---|---|---|---|
| core | 2 | unstable-core-do-not-import, unstable-core-do-not-import.ts | Supporting application functionality |
| integration | 1 | adapters | Supporting application functionality |
| Other Modules | 4 | observable, http.ts | General purpose functionality |
| Shared Libraries | 1 | shared.ts | Provides shared utilities and abstractions used across modules |
Layer Details
core — 2 modules
packages/server/src/unstable-core-do-not-import— 40 files — Core application modulepackages/server/src/unstable-core-do-not-import.ts— 1 files — Core application module
integration — 1 module
packages/server/src/adapters— 23 files — Core application module
Other Modules — 4 modules
packages/server/src/observable— 5 files — Core application modulepackages/server/src/http.ts— 1 files — Core application modulepackages/server/src/index.ts— 1 files — Core application modulepackages/server/src/rpc.ts— 1 files — Core application module
Shared Libraries — 1 module
packages/server/src/shared.ts— 1 files — Core application module
Functional Domains
The following domains represent the largest functional areas by file count:
| Rank | Domain | Scale | Business Capability |
|---|---|---|---|
| 1 | Core Engine | 41 files | path packages/server/src/unstable-core-do-not-import matches core |
| 2 | Integrations | 23 files | path packages/server/src/adapters matches adapter |
| 3 | Other | 7 files | Uncategorized module |
| 4 | Search & Discovery | 1 files | path packages/server/src/index.ts matches index |
| 5 | Shared Utilities | 1 files | path packages/server/src/shared.ts matches shared |
Dependency Graph
Codebase Health: 🟢 100/100
| Metric | Value | Assessment |
|---|---|---|
| Internal Imports | 146 | Modules are connected |
| External Packages | 3 | Lean dependencies |
| Circular Dependencies | 0 | ✅ Clean |
| Orphan Files | 5 | ⚠️ 5 unused |
Hub modules (most imported):
packages/server/src/unstable-core-do-not-import/utils— imported by 16 filespackages/server/src/unstable-core-do-not-import/error/TRPCError— imported by 8 filespackages/server/src/unstable-core-do-not-import— imported by 7 files
Monorepo Structure
This is a pnpm workspaces monorepo containing 1 packages:
| Package | Location | Description |
|---|---|---|
@trpc/server | packages/server | Backend/API server |
This system overview was generated from comprehensive repository analysis. Enable AI enhancement with `GITHUB_TOKEN` for narrative context, architectural rationale, technology trade-off analysis, and scalability recommendations.
<!-- repolens:docs-badge -->  · Examples
Business Domains
Overview
tRPC is organized into 5 functional domains, each representing a distinct area of business capability. This document maps the technical structure to business-oriented functional areas.
Quick Reference:
| Domain | Modules | Files | Primary Capability |
|---|---|---|---|
| Core Engine | 2 | 41 | Supporting business operations |
| Integrations | 1 | 23 | Supporting business operations |
| Other | 3 | 7 | Supporting business operations |
| Search & Discovery | 1 | 1 | Search and content discovery |
| Shared Utilities | 1 | 1 | Cross-cutting utility functions |
1. Core Engine
Business Capability
path packages/server/src/unstable-core-do-not-import matches core
This is a significant domain with 2 modules and 41 source files.
Key Modules
| Module | Purpose |
|---|---|
packages/server/src/unstable-core-do-not-import | Core application module |
packages/server/src/unstable-core-do-not-import.ts | Core application module |
Business Impact
- Change Frequency Impact: Medium — Changes here affect 41 files
- Domain Complexity: Simple
2. Integrations
Business Capability
path packages/server/src/adapters matches adapter
This is a significant domain with 1 module and 23 source files.
Key Modules
| Module | Purpose |
|---|---|
packages/server/src/adapters | Core application module |
Business Impact
- Change Frequency Impact: Medium — Changes here affect 23 files
- Domain Complexity: Simple
3. Other
Business Capability
Uncategorized module
This is a focused domain with 3 modules and 7 source files.
Key Modules
| Module | Purpose |
|---|---|
packages/server/src/observable | Core application module |
packages/server/src/http.ts | Core application module |
packages/server/src/rpc.ts | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 7 files
- Domain Complexity: Moderate
4. Search & Discovery
Business Capability
path packages/server/src/index.ts matches index
This is a focused domain with 1 module and 1 source file.
Key Modules
| Module | Purpose |
|---|---|
packages/server/src/index.ts | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 1 file
- Domain Complexity: Simple
5. Shared Utilities
Business Capability
path packages/server/src/shared.ts matches shared
This is a focused domain with 1 module and 1 source file.
Key Modules
| Module | Purpose |
|---|---|
packages/server/src/shared.ts | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 1 file
- Domain Complexity: Simple
Cross-Domain Dependencies
The following modules serve as shared infrastructure across multiple domains:
| Module | Consumers | Role |
|---|---|---|
packages/server/src/unstable-core-do-not-import/utils | 16 modules | Utility and helper functions |
packages/server/src/unstable-core-do-not-import/error/TRPCError | 8 modules | Core application module |
packages/server/src/unstable-core-do-not-import | 7 modules | Core application module |
Cross-Domain Integration Points
These modules facilitate communication and data sharing between domains:
- `packages/server/src/unstable-core-do-not-import/utils` serves as a central integration point, imported by 16 different modules. Changes to this module have wide-ranging impact and should be carefully coordinated.
- `packages/server/src/unstable-core-do-not-import/error/TRPCError` serves as a central integration point, imported by 8 different modules. Changes to this module have wide-ranging impact and should be carefully coordinated.
- `packages/server/src/unstable-core-do-not-import` serves as a central integration point, imported by 7 different modules. Changes to this module have wide-ranging impact and should be carefully coordinated.
Domain Health Summary
| Metric | Value | Assessment |
|---|---|---|
| Total Domains | 5 | Well-balanced |
| Avg Files/Domain | 15 | Appropriate size |
| Largest Domain | Core Engine (41 files) | Consider breaking down |
| Domain Concentration | 56% in largest | ✅ Well distributed |
Domain mapping is based on directory naming conventions and code organization patterns. Enable AI enhancement with `GITHUB_TOKEN` for business-language descriptions, stakeholder impact analysis, strategic recommendations, and cross-domain relationship narratives.
<!-- repolens:docs-badge -->  · Examples
Architecture Overview
Architectural Philosophy
tRPC follows a Core/kernel architecture — `packages/server/src/unstable-core-do-not-import`, `packages/server/src/unstable-core-do-not-import.ts`; high fan-in architecture with elements of Integration adapters — `packages/server/src/adapters`, Acyclic dependency graph — clean layering.
Pattern Analysis
Core/kernel architecture — `packages/server/src/unstable-core-do-not-import`, `packages/server/src/unstable-core-do-not-import.ts`; high fan-in
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Integration adapters — `packages/server/src/adapters`
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Acyclic dependency graph — clean layering
The system operates as a command-line interface, accepting user input through terminal commands and producing structured output.
Benefits: Automation-friendly, scriptable, integrates with CI/CD pipelines
System Layers
The system is organized into 5 functional layers, each encapsulating a distinct area of responsibility:
| Layer | Responsibility | Scale | Key Insight |
|---|---|---|---|
| Core Engine | path packages/server/src/unstable-core-do-not-import matches core | 41 files | Standard domain |
| Integrations | path packages/server/src/adapters matches adapter | 23 files | Standard domain |
| Other | Uncategorized module | 7 files | Standard domain |
| Search & Discovery | path `packages/server/src/index | 1 files | Standard domain |
| Shared Utilities | path `packages/server/src/shared | 1 files | Shared infrastructure — high reuse |
Module Layers
Modules are classified into 4 architectural roles:
core
Role: Supporting application functionality
| Module | Files | Description |
|---|---|---|
packages/server/src/unstable-core-do-not-import | 40 | Core application module |
packages/server/src/unstable-core-do-not-import.ts | 1 | Core application module |
integration
Role: Supporting application functionality
| Module | Files | Description |
|---|---|---|
packages/server/src/adapters | 23 | Core application module |
Other Modules
Role: General purpose functionality
| Module | Files | Description |
|---|---|---|
packages/server/src/observable | 5 | Core application module |
packages/server/src/http.ts | 1 | Core application module |
packages/server/src/index.ts | 1 | Core application module |
packages/server/src/rpc.ts | 1 | Core application module |
Shared Libraries
Role: Provides shared utilities and abstractions used across modules
| Module | Files | Description |
|---|---|---|
packages/server/src/shared.ts | 1 | Core application module |
Technology Foundation
| Layer | Technologies | Architectural Implication |
|---|---|---|
| Application | Express | Middleware pipeline, request/response cycle |
| Language | TypeScript, Node.js | Static typing enables tooling and refactoring confidence |
| Build | Vite, Turborepo | Modern bundling and optimization |
| Quality | Vitest | Enables confident refactoring |
Scale & Complexity Analysis
| Dimension | Value | Assessment |
|---|---|---|
| Total Files | 73 | medium project |
| Module Count | 8 | low complexity |
| Domain Spread | 5 domains | Focused scope |
| Interface | CLI | Terminal-driven interaction |
Dependency Health
Architecture Health Score: 🟢 100/100
| Metric | Value | Status | Recommendation |
|---|---|---|---|
| Import Edges | 146 | ✅ | Healthy module connectivity |
| External Packages | 3 | ✅ | Lean dependency set |
| Circular Deps | 0 | ✅ | Clean module boundaries |
| Orphan Files | 5 | ⚠️ | Review for dead code |
Architectural Strengths
- Clean module boundaries — No circular dependencies detected. This enables safe refactoring, isolated testing, and clear ownership boundaries.
- Balanced coupling — No single module dominates the import graph. This reduces change risk and enables parallel development.
- Testing infrastructure — Automated testing with Vitest supports confident evolution.
Hub modules (most imported):
packages/server/src/unstable-core-do-not-import/utils— imported by 16 filespackages/server/src/unstable-core-do-not-import/error/TRPCError— imported by 8 filespackages/server/src/unstable-core-do-not-import— imported by 7 files
Monorepo Architecture
This project uses a pnpm workspaces monorepo with 1 packages.
Package Structure
| Package | Location | Architectural Role |
|---|---|---|
@trpc/server | packages/server | Backend/API server |
Monorepo Benefits
- Shared infrastructure — Common tooling and configurations
- Atomic changes — Cross-package updates in single commits
- Independent deployment — Each package can be released separately
- Clear ownership — Package boundaries define team responsibilities
This architecture overview was generated from comprehensive dependency graph analysis and pattern detection. Enable AI enhancement with `GITHUB_TOKEN` for architectural narratives, design rationale explanations, scalability analysis, and refactoring recommendations.
<!-- repolens:docs-badge -->  · Examples
Module Catalog
A complete inventory of all code modules in the repository, organized by location and size. Each module represents a distinct area of responsibility within the codebase.
Total modules: 8
Module Inventory
| Module | Files | Role |
|---|---|---|
packages/server/src/unstable-core-do-not-import | 40 | Core business logic and shared foundations · Shared infrastructure (imported by 8 modules) |
packages/server/src/adapters | 23 | Application module · Orchestrator (coordinates 10 modules) |
packages/server/src/observable | 5 | Application module · Leaf module (consumed only, 3 importers) |
packages/server/src/http.ts | 1 | Application module |
packages/server/src/index.ts | 1 | Application module |
packages/server/src/rpc.ts | 1 | Application module |
packages/server/src/shared.ts | 1 | Application module |
packages/server/src/unstable-core-do-not-import.ts | 1 | Core business logic and shared foundations |
Module detection is based on the `module_roots` setting in your RepoLens configuration. Adjust this setting to change how modules are grouped.
<!-- repolens:docs-badge -->  · Examples
Route Map
A complete listing of user-facing pages and backend API endpoints. This map shows every URL a user or client can interact with, along with the source file that handles each route.
Route Detection
This project is a CLI tool — it does not expose HTTP routes or serve web pages. This is expected behavior, not a detection failure.
CLI tools interact through terminal commands rather than URLs. See the System Overview or Developer Onboarding documents for command documentation.
<!-- repolens:docs-badge -->  · Examples
API Surface
This page documents both the API endpoints the application exposes and the external services it integrates with. Use it as a reference for understanding the system's interfaces.
Internal API Endpoints
These are the backend services the application provides to handle incoming requests.
No API routes were detected in this scan. If your project uses a routing framework (Express, Fastify, NestJS, etc.), ensure the relevant directories are included in your scan.include patterns.
External API Integrations
Third-party services the application connects to, grouped by category.
No external API integrations were detected. This section populates automatically when RepoLens identifies SDK imports or API client usage in your codebase.
Documented Exports
Exported functions with JSDoc/TSDoc documentation. Documentation coverage: 47%
Function Documentation
packages/server/src/adapters/ws.ts
`handleKeepAlive()`
Handle WebSocket keep-alive messages
packages/server/src/adapters/next-app-dir/redirect.ts
`redirect()`
Like next/navigation's redirect() but throws a TRPCError that later will be handled by Next.js This provides better typesafety than the next/navigation's redirect() since the action continues to execute on the frontend even if Next's redirect() has a return type of never.
packages/server/src/adapters/next-app-dir/rethrowNextErrors.ts
`rethrowNextErrors()`
Rethrow errors that should be handled by Next.js
packages/server/src/adapters/node-http/incomingMessageToRequest.ts
`incomingMessageToRequest()`
Convert an `IncomingMessage` to a `Request`
packages/server/src/adapters/node-http/writeResponse.ts
`writeResponseBody()`
`writeResponse()`
packages/server/src/observable/observable.ts
`isObservable()`
packages/server/src/unstable-core-do-not-import/middleware.ts
`createErrorFormatterMiddleware()`
packages/server/src/unstable-core-do-not-import/rootConfig.ts
`isDevDefault()`
The default check to see if we're in development
packages/server/src/unstable-core-do-not-import/router.ts
`getProcedureAtPath()`
`callProcedure()`
packages/server/src/unstable-core-do-not-import/transformer.ts
`getDataTransformer()`
packages/server/src/unstable-core-do-not-import/utils.ts
`isObject()`
Check that value is object
`assert()`
Generic runtime assertion function. Throws, if the condition is not true. Can be used as a slightly less dangerous variant of type assertions. Code mistakes would be revealed at runtime then (hopefully during testing).
`abortSignalsAnyPonyfill()`
Ponyfill for `AbortSignal.any`.
packages/server/src/unstable-core-do-not-import/error/formatter.ts
`getDefaultErrorShape()`
`setFormattedErrorShape()`
`getFormattedErrorShape()`
packages/server/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts
`parseTRPCMessage()`
packages/server/src/unstable-core-do-not-import/stream/jsonl.ts
`jsonlStreamProducer()`
JSON Lines stream producer
Documentation Summary:
- Total exports: 43
- Documented: 20
- Undocumented: 23
- Coverage: 47%
HTTP method reference — GET: retrieve data, POST: create, PUT/PATCH: update, DELETE: remove.
<!-- repolens:docs-badge -->  · Examples
Data Flows
Understanding Data Movement
Data flows describe how information moves through tRPC — from external inputs through processing layers to storage or presentation. Understanding these flows is essential for debugging, performance optimization, and architectural decisions.
Flow Summary
5 data flows identified in the codebase:
| Flow | Type | Complexity | Critical |
|---|---|---|---|
| next-app-dir Request Flow | Integration | Low (2 steps) | — |
| express Request Flow | Integration | Medium (3 steps) | — |
| next Request Flow | Integration | Medium (3 steps) | — |
| standalone Request Flow | Integration | Medium (3 steps) | — |
| fastify Request Flow | Integration | Medium (4 steps) | — |
1. next-app-dir Request Flow
Description
Import chain starting from packages/server/src/adapters/next-app-dir — traces how this entry point depends on 1 downstream module
Characteristics
| Property | Value |
|---|---|
| Steps | 2 |
| Modules Involved | 2 |
| Criticality | Standard |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | next-app-dir (entry point, imports 4 modules) | Data acquisition |
| 2 | redirect (leaf — no further dependencies) | Processing step |
Flow Diagram
┌─ START ─┐
│ `next-app-dir` (entry point, imports 4 modules) │
│ ↓
│ `redirect` (leaf — no further dependencies) │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
next-app-dir | Core application module |
redirect | Core application module |
Insights
- Standard integration flow with 2 processing steps
2. express Request Flow
Description
Import chain starting from packages/server/src/adapters/express — traces how this entry point depends on 2 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 3 |
| Modules Involved | 3 |
| Criticality | Standard |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | express (entry point, imports 2 modules) | Data acquisition |
| 2 | unstable-core-do-not-import (shared infrastructure, used by 7 files) | Data acquisition |
| 3 | utils (shared infrastructure, used by 16 files) | Processing step |
Flow Diagram
┌─ START ─┐
│ `express` (entry point, imports 2 modules) │
│ ↓
│ `unstable-core-do-not-import` (shared infrastru... │
│ ↓
│ `utils` (shared infrastructure, used by 16 files) │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
express | Core application module |
unstable-core-do-not-import | Core application module |
utils | Utility and helper functions |
Insights
- Standard integration flow with 3 processing steps
3. next Request Flow
Description
Import chain starting from packages/server/src/adapters/next — traces how this entry point depends on 2 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 3 |
| Modules Involved | 3 |
| Criticality | Standard |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | next (entry point, imports 2 modules) | Data acquisition |
| 2 | unstable-core-do-not-import (shared infrastructure, used by 7 files) | Data acquisition |
| 3 | utils (shared infrastructure, used by 16 files) | Processing step |
Flow Diagram
┌─ START ─┐
│ `next` (entry point, imports 2 modules) │
│ ↓
│ `unstable-core-do-not-import` (shared infrastru... │
│ ↓
│ `utils` (shared infrastructure, used by 16 files) │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
next | Core application module |
unstable-core-do-not-import | Core application module |
utils | Utility and helper functions |
Insights
- Standard integration flow with 3 processing steps
4. standalone Request Flow
Description
Import chain starting from packages/server/src/adapters/standalone — traces how this entry point depends on 2 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 3 |
| Modules Involved | 3 |
| Criticality | Standard |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | standalone (entry point, imports 2 modules) | Data acquisition |
| 2 | unstable-core-do-not-import (shared infrastructure, used by 7 files) | Data acquisition |
| 3 | utils (shared infrastructure, used by 16 files) | Processing step |
Flow Diagram
┌─ START ─┐
│ `standalone` (entry point, imports 2 modules) │
│ ↓
│ `unstable-core-do-not-import` (shared infrastru... │
│ ↓
│ `utils` (shared infrastructure, used by 16 files) │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
standalone | Core application module |
unstable-core-do-not-import | Core application module |
utils | Utility and helper functions |
Insights
- Standard integration flow with 3 processing steps
5. fastify Request Flow
Description
Import chain starting from packages/server/src/adapters/fastify — traces how this entry point depends on 3 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 4 |
| Modules Involved | 4 |
| Criticality | Standard |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | fastify (entry point, imports 2 modules) | Data acquisition |
| 2 | fastifyRequestHandler → imports 1 module | Data acquisition |
| 3 | node-http (shared infrastructure, used by 5 files) | Processing step |
| 4 | incomingMessageToRequest (leaf — no further dependencies) | Data acquisition |
Flow Diagram
┌─ START ─┐
│ `fastify` (entry point, imports 2 modules) │
│ ↓
│ `fastifyRequestHandler` → imports 1 module │
│ ↓
│ `node-http` (shared infrastructure, used by 5 f... │
│ ↓
│ `incomingMessageToRequest` (leaf — no further d... │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
fastify | Core application module |
fastifyRequestHandler | Core application module |
node-http | Core application module |
incomingMessageToRequest | Core application module |
Insights
- Standard integration flow with 4 processing steps
Import Network
The system has 146 internal import edges connecting 73 source files.
Network Topology
| Metric | Value | Meaning |
|---|---|---|
| Total Edges | 146 | Direct import relationships |
| Hub Count | 3 | Central integration points |
| Avg Connections | ~2 per file | Coupling density |
Key Integration Points
These modules aggregate data from multiple sources:
| Hub | Inbound | Role |
|---|---|---|
utils | 16 files | Utility and helper functions |
TRPCError | 8 files | Core application module |
unstable-core-do-not-import | 7 files | Core application module |
Flow detection uses naming conventions, import patterns, and dependency graph analysis. Enable AI enhancement with `GITHUB_TOKEN` for end-to-end flow narratives, failure mode analysis, data transformation descriptions, and performance bottleneck identification.
<!-- repolens:docs-badge -->  · Examples
Architecture Diff
No changes detected.
<!-- repolens:docs-badge -->  · Examples
System Map
What is this? This visual diagram shows how different parts of your codebase connect to each other. Arrows indicate dependencies (which modules use which).
Showing: 8 modules and 6 relationships
Source: Real import analysis
Architecture Diagram
┌─────────────────────────────────────────────────────────────┐
│ 🏗️ SYSTEM ARCHITECTURE MAP │
└─────────────────────────────────────────────────────────────┘
⚙️ CORE LOGIC
│
├── unstable-core-do-not-import (40 files)
│ → unstable-core-do-not-import.ts
└── unstable-core-do-not-import.ts (1 file)
→ observable
│
🔌 INTEGRATION
│
└── adapters (23 files)
→ unstable-core-do-not-import
→ http.ts
→ observable
... +1 more
│
📦 OTHER
│
├── observable (5 files)
├── http.ts (1 file)
├── index.ts (1 file)
├── rpc.ts (1 file)
└── shared.ts (1 file)
│
Legend:
→ imports / depends on
╌→ tests
Key Connections
Most depended-on modules (highest import count):
| Module | Imported by |
|---|---|
packages/server/src/unstable-core-do-not-import.ts | 34 modules |
packages/server/src/unstable-core-do-not-import | 7 modules |
packages/server/src/observable | 3 modules |
packages/server/src/http.ts | 1 module |
Most dependent modules (highest dependency count):
| Module | Depends on |
|---|---|
packages/server/src/unstable-core-do-not-import | 33 modules |
packages/server/src/adapters | 10 modules |
packages/server/src/unstable-core-do-not-import.ts | 2 modules |
<!-- repolens:docs-badge -->  · Examples
Developer Onboarding
Welcome to tRPC! 👋
This guide will help you get up to speed quickly. tRPC is a Express project built with TypeScript, Node.js, containing 8 modules across 73 files.
What You'll Learn
- ✅ Repository structure and organization
- ✅ Technology stack and tools
- ✅ Key modules to understand first
- ✅ How data flows through the system
- ✅ How to start contributing
Quick Reference Card
| Aspect | Details |
|---|---|
| Languages | TypeScript, Node.js |
| Frameworks | Express |
| Build Tools | Vite, Turborepo |
| Testing | Vitest |
| Size | 8 modules, 73 files |
| Domains | 5 functional areas |
| Type | Command-line interface |
Repository Structure
Understanding the directory layout is your first step to navigating the codebase:
| Directory | Purpose | Start Here? |
|---|---|---|
packages/server/src | Project files | ⭐ Yes |
Where to Begin
Focus on these directories first:
- `packages/server/src` — Project files
Monorepo Navigation
This is a pnpm workspaces monorepo with 1 packages. Here's how to navigate:
| Package | Location | What It Does |
|---|---|---|
@trpc/server | packages/server | Backend/API server |
Pro tip: Each package can typically be developed independently. Check the package's own README.md for specific setup instructions.
Technology Stack
| Layer | Technologies | What to Learn |
|---|---|---|
| Framework | Express | Understand middleware chains and route handling |
| Language | TypeScript, Node.js | Strong typing — check types when debugging |
| Build | Vite, Turborepo | Understand the build pipeline |
| Testing | Vitest | Run existing tests to understand behavior |
Core Modules to Understand
These are the most important modules by size and centrality. Understanding them will unlock the rest of the codebase:
| Priority | Module | Files | Type | Why It Matters |
|---|---|---|---|---|
| ⭐ High | packages/server/src/unstable-core-do-not-import | 40 | core | Large module — core functionality |
| ⭐ High | packages/server/src/adapters | 23 | integration | Large module — core functionality |
| ⭐ High | packages/server/src/observable | 5 | Other Modules | Key system component |
| Medium | packages/server/src/http.ts | 1 | Other Modules | Key system component |
| Medium | packages/server/src/index.ts | 1 | Other Modules | Key system component |
| Medium | packages/server/src/rpc.ts | 1 | Other Modules | Key system component |
| Low | packages/server/src/shared.ts | 1 | Shared Libraries | Shared code — reused throughout |
| Low | packages/server/src/unstable-core-do-not-import.ts | 1 | core | Key system component |
Key Integration Points
These modules are imported by many other files. Changes here have wide impact:
- `packages/server/src/unstable-core-do-not-import/utils` — Used by 16 files — Utility and helper functions
- `packages/server/src/unstable-core-do-not-import/error/TRPCError` — Used by 8 files — Core application module
- `packages/server/src/unstable-core-do-not-import` — Used by 7 files — Core application module
⚠️ Caution: Be extra careful when modifying these files. Consider the ripple effects.
How Data Flows
Understanding these flows helps you see how the system processes information end-to-end:
| Flow | Description | Key Modules |
|---|---|---|
| next-app-dir Request Flow | Import chain starting from `packages/server/src/adapters/nex... | next-app-dir, redirect |
| express Request Flow | Import chain starting from `packages/server/src/adapters/exp... | express, unstable-core-do-not-import |
| next Request Flow | Import chain starting from `packages/server/src/adapters/nex... | next, unstable-core-do-not-import |
| standalone Request Flow | Import chain starting from `packages/server/src/adapters/sta... | standalone, unstable-core-do-not-import |
| fastify Request Flow | Import chain starting from `packages/server/src/adapters/fas... | fastify, fastifyRequestHandler |
Debugging tip: When investigating issues, trace the data flow from input to output to identify where problems occur.
Getting Started Checklist
Follow these steps to set up your development environment:
1. Clone and Install
git clone <repository-url>
cd trpc
npm install # or yarn, pnpm
2. Explore the Structure
- Review the directory structure above
- Open the
README.mdfor project-specific instructions - Look for
CONTRIBUTING.mdfor contribution guidelines
3. Understand Core Modules
Start with the high-priority modules listed above. Read the code and comments to understand:
- What problem each module solves
- How modules interact with each other
- What data structures are used
4. Run the Tests
npm test # or: npx vitest run
Running tests helps you:
- Verify your setup is correct
- See expected behavior documented in test cases
- Understand module interfaces through test examples
5. Make Your First Change
Start small:
- Find a small bug or typo to fix
- Make the change in a feature branch
- Run tests to ensure nothing breaks
- Submit a pull request for review
Common Pitfalls
New contributors often run into these issues:
- Monorepo boundaries — Remember to build dependent packages when making changes.
- Environment setup — Check for
.env.examplefiles and ensure you have all required environment variables. - Branch naming — Follow the team's branch naming conventions (usually
feature/,fix/,docs/).
Additional Resources
| Resource | Purpose |
|---|---|
README.md | Project overview and quick start |
CONTRIBUTING.md | Contribution guidelines (if exists) |
CHANGELOG.md | Recent changes and release history |
package.json | Available scripts and dependencies |
Root package.json | Monorepo workspace configuration |
This onboarding guide was generated from comprehensive repository analysis. Enable AI enhancement with `GITHUB_TOKEN` for narrative walkthroughs, common pitfall documentation, debugging tips, architecture deep-dives, and personalized contribution recommendations.
Welcome to the team! Happy coding! 🚀
<!-- repolens:docs-badge -->  · Examples
GraphQL Schema
No GraphQL schema was detected in this repository.
RepoLens scans for .graphql and .gql schema files, inline SDL via tagged template literals (e.g. gql\...\``), resolver patterns, and popular GraphQL libraries including Apollo, Yoga, Nexus, Pothos, Mercurius, type-graphql, Relay, and urql.
If your project uses GraphQL, ensure the relevant source directories are included in your scan.include configuration.
<!-- repolens:docs-badge -->  · Examples
TypeScript Type Graph
43 file(s) with type declarations · 29 interface(s) · 231 type alias(es) · 6 class(es) · 185 relationship(s)
This document maps the type system of the project, showing how interfaces, classes, and type aliases relate to one another. Understanding these relationships helps navigate the codebase and identify coupling between modules.
Interfaces
29 interfaces define the data contracts used across the application:
| Interface | Extends | Source |
|---|---|---|
Encoder | — | packages/server/src/adapters/wsEncoder.ts |
ShareConfig | — | packages/server/src/observable/operators.ts |
Unsubscribable | — | packages/server/src/observable/types.ts |
ProxyCallbackOptions | — | packages/server/src/unstable-core-do-not-import/createProxy.ts |
MiddlewareResultBase | — | packages/server/src/unstable-core-do-not-import/middleware.ts |
BuiltProcedureDef | — | packages/server/src/unstable-core-do-not-import/procedure.ts |
RootTypes | — | packages/server/src/unstable-core-do-not-import/rootConfig.ts |
RouterRecord | — | packages/server/src/unstable-core-do-not-import/router.ts |
DataTransformer | — | packages/server/src/unstable-core-do-not-import/transformer.ts |
InputDataTransformer | DataTransformer | packages/server/src/unstable-core-do-not-import/transformer.ts |
OutputDataTransformer | DataTransformer | packages/server/src/unstable-core-do-not-import/transformer.ts |
CombinedDataTransformer | — | packages/server/src/unstable-core-do-not-import/transformer.ts |
DefaultErrorShape | TRPCErrorShape | packages/server/src/unstable-core-do-not-import/error/formatter.ts |
FileLike | Blob | packages/server/src/unstable-core-do-not-import/http/contentTypeParsers.ts |
ContextManager | — | packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts |
RPCResultOk | — | packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts |
ResponseMeta | — | packages/server/src/unstable-core-do-not-import/http/types.ts |
TRPCRequestInfoProcedureCall | — | packages/server/src/unstable-core-do-not-import/http/types.ts |
TRPCRequestInfo | — | packages/server/src/unstable-core-do-not-import/http/types.ts |
BaseEnvelope | — | packages/server/src/unstable-core-do-not-import/rpc/envelopes.ts |
JSONLProducerOptions | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
SSEPingOptions | — | packages/server/src/unstable-core-do-not-import/stream/sse.ts |
SSEClientOptions | — | packages/server/src/unstable-core-do-not-import/stream/sse.ts |
SSEvent | — | packages/server/src/unstable-core-do-not-import/stream/sse.ts |
ConsumerConfig | — | packages/server/src/unstable-core-do-not-import/stream/sse.ts |
InitDict | — | packages/server/src/unstable-core-do-not-import/stream/sse.types.ts |
MessageEvent | Event | packages/server/src/unstable-core-do-not-import/stream/sse.types.ts |
Event | — | packages/server/src/unstable-core-do-not-import/stream/sse.types.ts |
Instance | — | packages/server/src/unstable-core-do-not-import/stream/sse.types.ts |
Classes
6 classes provide concrete implementations:
| Class | Extends | Implements | Source |
|---|---|---|---|
TRPCRedirectError | TRPCError | — | packages/server/src/adapters/next-app-dir/redirect.ts |
TransformResultError | Error | — | packages/server/src/unstable-core-do-not-import/transformer.ts |
UnknownCauseError | Error | — | packages/server/src/unstable-core-do-not-import/error/TRPCError.ts |
TRPCError | Error | — | packages/server/src/unstable-core-do-not-import/error/TRPCError.ts |
MaxDepthError | Error | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
AsyncError | Error | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
Type Aliases
231 type aliases define computed or composite types:
| Type | References | Source |
|---|---|---|
LambdaEvent | APIGatewayProxyEvent, APIGatewayProxyEventV2 | packages/server/src/adapters/aws-lambda/getPlanner.ts |
APIGatewayResult | APIGatewayProxyResult, APIGatewayProxyStructuredResultV2 | packages/server/src/adapters/aws-lambda/getPlanner.ts |
inferAPIGWReturn | TEvent, APIGatewayProxyEvent, APIGatewayProxyResult, APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2 | packages/server/src/adapters/aws-lambda/getPlanner.ts |
CreateAWSLambdaContextOptions | TEvent | packages/server/src/adapters/aws-lambda/index.ts |
AWSLambdaOptions | HTTPBaseHandlerOptions, TRouter, TEvent, CreateContextCallback, AnyRouter, AWSLambdaCreateContextFn | packages/server/src/adapters/aws-lambda/index.ts |
AWSLambdaCreateContextFn | CreateAWSLambdaContextOptions, TEvent, TRouter | packages/server/src/adapters/aws-lambda/index.ts |
CreateExpressContextOptions | NodeHTTPCreateContextFnOptions, Request, Response | packages/server/src/adapters/express.ts |
CreateNextContextOptions | NodeHTTPCreateContextFnOptions, NextApiRequest, NextApiResponse | packages/server/src/adapters/next.ts |
StandaloneHandlerOptions | NodeHTTPHandlerOptions, TRouter, TRequest, TResponse, The, This, Do | packages/server/src/adapters/standalone.ts |
CreateHTTPHandlerOptions | StandaloneHandlerOptions, TRouter, IncomingMessage, ServerResponse | packages/server/src/adapters/standalone.ts |
CreateHTTPContextOptions | NodeHTTPCreateContextFnOptions, IncomingMessage, ServerResponse | packages/server/src/adapters/standalone.ts |
CreateHTTP2HandlerOptions | StandaloneHandlerOptions, TRouter, Http2ServerRequest, Http2ServerResponse | packages/server/src/adapters/standalone.ts |
CreateHTTP2ContextOptions | NodeHTTPCreateContextFnOptions, Http2ServerRequest, Http2ServerResponse | packages/server/src/adapters/standalone.ts |
CreateWSSContextFnOptions | NodeHTTPCreateContextFnOptions, IncomingMessage, WebSocket | packages/server/src/adapters/ws.ts |
CreateWSSContextFn | CreateWSSContextFnOptions, MaybePromise, TRouter | packages/server/src/adapters/ws.ts |
WSConnectionHandlerOptions | BaseHandlerOptions, TRouter, IncomingMessage, CreateContextCallback, CreateWSSContextFn | packages/server/src/adapters/ws.ts |
WSSHandlerOptions | WSConnectionHandlerOptions, TRouter, WebSocketServer | packages/server/src/adapters/ws.ts |
Context | TRouter | packages/server/src/adapters/ws.ts |
ContextResult | Result, Context | packages/server/src/adapters/ws.ts |
FastifyHandlerOptions | HTTPBaseHandlerOptions, TRouter, TRequest, NodeHTTPCreateContextOption, TResponse | packages/server/src/adapters/fastify/fastifyRequestHandler.ts |
FastifyRequestHandlerOptions | FastifyHandlerOptions, TRouter, TRequest, TResponse | packages/server/src/adapters/fastify/fastifyRequestHandler.ts |
CreateFastifyContextOptions | NodeHTTPCreateContextFnOptions, FastifyRequest, FastifyReply | packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts |
FetchCreateContextFnOptions | Request | packages/server/src/adapters/fetch/types.ts |
FetchCreateContextFn | FetchCreateContextFnOptions, TRouter | packages/server/src/adapters/fetch/types.ts |
FetchCreateContextOption | CreateContextCallback, TRouter, FetchCreateContextFn | packages/server/src/adapters/fetch/types.ts |
FetchHandlerOptions | FetchCreateContextOption, TRouter, HTTPBaseHandlerOptions, Request | packages/server/src/adapters/fetch/types.ts |
FetchHandlerRequestOptions | HTTPBaseHandlerOptions, TRouter, Request, CreateContextCallback, FetchCreateContextFn | packages/server/src/adapters/fetch/types.ts |
NodeHTTPRequest | DistributiveOmit, IncomingMessage, Http2ServerRequest, Many | packages/server/src/adapters/node-http/types.ts |
NodeHTTPResponse | DistributiveOmit, ServerResponse, Http2ServerResponse, Force, Added, Next, Express | packages/server/src/adapters/node-http/types.ts |
NodeHTTPCreateContextOption | CreateContextCallback, TRouter, NodeHTTPCreateContextFn, TRequest, TResponse | packages/server/src/adapters/node-http/types.ts |
ConnectMiddleware | TRequest, TResponse | packages/server/src/adapters/node-http/types.ts |
NodeHTTPHandlerOptions | HTTPBaseHandlerOptions, TRouter, TRequest, By, OPTIONS, CORS, This, You, Express, ConnectMiddleware, TResponse | packages/server/src/adapters/node-http/types.ts |
NodeHTTPRequestHandlerOptions | NodeHTTPHandlerOptions, TRouter, TRequest, TResponse | packages/server/src/adapters/node-http/types.ts |
NodeHTTPCreateContextFnOptions | TRequest | packages/server/src/adapters/node-http/types.ts |
NodeHTTPCreateContextFn | NodeHTTPCreateContextFnOptions, TRequest, TResponse, MaybePromise, TRouter | packages/server/src/adapters/node-http/types.ts |
inferObservableValue | TObservable, Observable, TValue | packages/server/src/observable/observable.ts |
UnsubscribeFn | — | packages/server/src/observable/types.ts |
TeardownLogic | SubscriptionLike, Unsubscribable, UnsubscribeFn | packages/server/src/observable/types.ts |
UnaryFunction | TSource, TReturn | packages/server/src/observable/types.ts |
OperatorFunction | UnaryFunction, Subscribable, TValueBefore, TErrorBefore, TValueAfter, TErrorAfter | packages/server/src/observable/types.ts |
MonoTypeOperatorFunction | OperatorFunction, TValue, TError | packages/server/src/observable/types.ts |
inferTransformedProcedureOutput | TInferrable, Serialize, TProcedure | packages/server/src/unstable-core-do-not-import/clientish/inference.ts |
inferProcedureErrorShape | TProcedure, Shape, TInferrable | packages/server/src/unstable-core-do-not-import/clientish/inference.ts |
inferTransformedSubscriptionOutput | TInferrable, Serialize, TProcedure | packages/server/src/unstable-core-do-not-import/clientish/inference.ts |
GetInferenceHelpers | TKey, TRecord, Value, AnyProcedure, TType, TRoot, RouterRecord, GetInferenceHelpers | packages/server/src/unstable-core-do-not-import/clientish/inference.ts |
inferRouterInputs | GetInferenceHelpers, TRouter | packages/server/src/unstable-core-do-not-import/clientish/inference.ts |
inferRouterOutputs | GetInferenceHelpers, TRouter | packages/server/src/unstable-core-do-not-import/clientish/inference.ts |
AnyClientTypes | AnyRootTypes | packages/server/src/unstable-core-do-not-import/clientish/inferrable.ts |
InitLike | AnyClientTypes | packages/server/src/unstable-core-do-not-import/clientish/inferrable.ts |
RouterLike | InitLike | packages/server/src/unstable-core-do-not-import/clientish/inferrable.ts |
RootConfigLike | AnyClientTypes | packages/server/src/unstable-core-do-not-import/clientish/inferrable.ts |
InferrableClientTypes | RouterLike, InitLike, RootConfigLike, AnyClientTypes | packages/server/src/unstable-core-do-not-import/clientish/inferrable.ts |
PickTypes | T | packages/server/src/unstable-core-do-not-import/clientish/inferrable.ts |
inferClientTypes | TInferrable, AnyClientTypes, PickTypes, RootConfigLike, InitLike, RouterLike | packages/server/src/unstable-core-do-not-import/clientish/inferrable.ts |
JsonPrimitive | — | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
JsonArray | JsonValue | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
JsonObject | JsonValue | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
JsonValue | JsonPrimitive, JsonObject, JsonArray | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
IsJson | T, JsonValue | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
NonJsonPrimitive | Function | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
IsAny | T | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
JsonReturnable | JsonPrimitive | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
IsRecord | WithoutIndexSignature, T | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
Serialize | IsAny, T, IsJson, AsyncIterable, Return, Next, Serialize, PromiseLike, JsonReturnable, NonJsonPrimitive, U, SerializeTuple, IsRecord, SerializeRecord, Simplify, SerializeObject, UndefinedToOptional | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
SerializeRecord | P, K, Serialize, T | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
SerializeTuple | K, T, NonJsonPrimitive, Serialize | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
SerializeObject | K, T, SerializeObjectKey, Serialize | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
FilterDefinedKeys | Exclude, K, T | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
ExactOptionalPropertyTypes | — | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
HasIndexSignature | T | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
HandleIndexSignature | K, T, WithoutIndexSignature, Exclude | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
HandleUndefined | K, T, FilterDefinedKeys, Exclude | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
UndefinedToOptional | Property, WithoutIndexSignature, T, FilterDefinedKeys, If, ExactOptionalPropertyTypes, HandleIndexSignature, HandleUndefined, HasIndexSignature | packages/server/src/unstable-core-do-not-import/clientish/serialize.ts |
ProxyCallback | ProxyCallbackOptions | packages/server/src/unstable-core-do-not-import/createProxy.ts |
inferErrorFormatterShape | TType, ErrorFormatter, TShape, DefaultErrorShape | packages/server/src/unstable-core-do-not-import/initTRPC.ts |
ContextCallback | — | packages/server/src/unstable-core-do-not-import/initTRPC.ts |
MiddlewareMarker | — | packages/server/src/unstable-core-do-not-import/middleware.ts |
MiddlewareResult | MiddlewareErrorResult, MiddlewareOKResult | packages/server/src/unstable-core-do-not-import/middleware.ts |
MiddlewareFunction | Simplify, Overwrite, TContext, TContextOverridesIn | packages/server/src/unstable-core-do-not-import/middleware.ts |
AnyMiddlewareFunction | MiddlewareFunction | packages/server/src/unstable-core-do-not-import/middleware.ts |
AnyMiddlewareBuilder | MiddlewareBuilder | packages/server/src/unstable-core-do-not-import/middleware.ts |
ParserZodEsque | TInput | packages/server/src/unstable-core-do-not-import/parser.ts |
ParserValibotEsque | TInput | packages/server/src/unstable-core-do-not-import/parser.ts |
ParserArkTypeEsque | TInput | packages/server/src/unstable-core-do-not-import/parser.ts |
ParserStandardSchemaEsque | StandardSchemaV1, TInput, TParsedInput | packages/server/src/unstable-core-do-not-import/parser.ts |
ParserMyZodEsque | TInput | packages/server/src/unstable-core-do-not-import/parser.ts |
ParserSuperstructEsque | TInput | packages/server/src/unstable-core-do-not-import/parser.ts |
ParserCustomValidatorEsque | TInput | packages/server/src/unstable-core-do-not-import/parser.ts |
ParserYupEsque | TInput | packages/server/src/unstable-core-do-not-import/parser.ts |
ParserScaleEsque | TInput | packages/server/src/unstable-core-do-not-import/parser.ts |
ParserWithoutInput | ParserCustomValidatorEsque, TInput, ParserMyZodEsque, ParserScaleEsque, ParserSuperstructEsque, ParserYupEsque | packages/server/src/unstable-core-do-not-import/parser.ts |
ParserWithInputOutput | ParserZodEsque, TInput, TParsedInput, ParserValibotEsque, ParserArkTypeEsque, ParserStandardSchemaEsque | packages/server/src/unstable-core-do-not-import/parser.ts |
Parser | ParserWithInputOutput, ParserWithoutInput | packages/server/src/unstable-core-do-not-import/parser.ts |
inferParser | TParser, ParserStandardSchemaEsque, TIn, TOut | packages/server/src/unstable-core-do-not-import/parser.ts |
ParseFn | TType | packages/server/src/unstable-core-do-not-import/parser.ts |
ProcedureType | — | packages/server/src/unstable-core-do-not-import/procedure.ts |
AnyQueryProcedure | QueryProcedure | packages/server/src/unstable-core-do-not-import/procedure.ts |
AnyMutationProcedure | MutationProcedure | packages/server/src/unstable-core-do-not-import/procedure.ts |
AnySubscriptionProcedure | SubscriptionProcedure, LegacyObservableSubscriptionProcedure | packages/server/src/unstable-core-do-not-import/procedure.ts |
AnyProcedure | AnyQueryProcedure, AnyMutationProcedure, AnySubscriptionProcedure | packages/server/src/unstable-core-do-not-import/procedure.ts |
inferProcedureInput | TProcedure | packages/server/src/unstable-core-do-not-import/procedure.ts |
inferProcedureParams | TProcedure, AnyProcedure | packages/server/src/unstable-core-do-not-import/procedure.ts |
inferProcedureOutput | TProcedure | packages/server/src/unstable-core-do-not-import/procedure.ts |
inferSubscriptionInput | TProcedure | packages/server/src/unstable-core-do-not-import/procedure.ts |
inferSubscriptionOutput | TProcedure, LegacyObservableSubscriptionProcedure | packages/server/src/unstable-core-do-not-import/procedure.ts |
IntersectIfDefined | TType, UnsetMarker, TWith, Simplify | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
DefaultValue | TValue, UnsetMarker, TFallback | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
FoldErrorShape | Extract, Shape, TRPCErrorShape, TErrorShape | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
inferAsyncIterable | TOutput, AsyncIterable, Yield, Return, Next | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
inferSubscriptionOutput | TOutput, AsyncIterable, TypeError, Subscription | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
CallerOverride | — | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
ProcedureBuilderDef | — | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
AnyProcedureBuilderDef | ProcedureBuilderDef | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
ProcedureResolver | ProcedureResolverOptions, TContext, TMeta, TContextOverrides, TInputOut, MaybePromise, If, DefaultValue, TOutputParserIn, Output | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
AnyResolver | ProcedureResolver | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
AnyProcedureBuilder | ProcedureBuilder | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
inferProcedureBuilderResolverOptions | TProcedureBuilder, ProcedureBuilder, TContext, TMeta, TContextOverrides, TInputOut, ProcedureResolverOptions, UnsetMarker, Simplify, Extra | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
ProcedureBuilderResolver | ProcedureResolverOptions | packages/server/src/unstable-core-do-not-import/procedureBuilder.ts |
JSONLContentType | — | packages/server/src/unstable-core-do-not-import/rootConfig.ts |
CreateRootTypes | TGenerics | packages/server/src/unstable-core-do-not-import/rootConfig.ts |
AnyRootTypes | CreateRootTypes | packages/server/src/unstable-core-do-not-import/rootConfig.ts |
PartialIf | TCondition, TType | packages/server/src/unstable-core-do-not-import/rootConfig.ts |
DecorateProcedure | TProcedure, LegacyObservableSubscriptionProcedure, Observable, TRPCError | packages/server/src/unstable-core-do-not-import/router.ts |
DecorateRouterRecord | TKey, TRecord, Value, AnyProcedure, DecorateProcedure, RouterRecord, DecorateRouterRecord | packages/server/src/unstable-core-do-not-import/router.ts |
RouterCallerErrorHandler | ErrorHandlerOptions, TContext | packages/server/src/unstable-core-do-not-import/router.ts |
RouterCaller | If, React, TRoot, MaybePromise, RouterCallerErrorHandler | packages/server/src/unstable-core-do-not-import/router.ts |
Lazy | TAny | packages/server/src/unstable-core-do-not-import/router.ts |
LazyLoader | — | packages/server/src/unstable-core-do-not-import/router.ts |
BuiltRouter | Router, TRoot, TRecord | packages/server/src/unstable-core-do-not-import/router.ts |
AnyRouter | Router | packages/server/src/unstable-core-do-not-import/router.ts |
inferRouterRootTypes | TRouter | packages/server/src/unstable-core-do-not-import/router.ts |
inferRouterContext | TRouter | packages/server/src/unstable-core-do-not-import/router.ts |
inferRouterError | TRouter | packages/server/src/unstable-core-do-not-import/router.ts |
inferRouterMeta | TRouter | packages/server/src/unstable-core-do-not-import/router.ts |
CreateRouterOptions | AnyProcedure, AnyRouter, CreateRouterOptions, Lazy | packages/server/src/unstable-core-do-not-import/router.ts |
DecorateCreateRouterOptions | K, TRouterOptions, Value, AnyProcedure, Router, TRecord, Lazy, CreateRouterOptions, DecorateCreateRouterOptions | packages/server/src/unstable-core-do-not-import/router.ts |
Context | TRoot | packages/server/src/unstable-core-do-not-import/router.ts |
MergeRouters | TRouters, Head, AnyRouter, Tail, MergeRouters, TRoot, TRecord, BuiltRouter | packages/server/src/unstable-core-do-not-import/router.ts |
CombinedDataTransformerClient | CombinedDataTransformer | packages/server/src/unstable-core-do-not-import/transformer.ts |
DataTransformerOptions | CombinedDataTransformer, DataTransformer | packages/server/src/unstable-core-do-not-import/transformer.ts |
Maybe | TType | packages/server/src/unstable-core-do-not-import/types.ts |
Simplify | TType, K | packages/server/src/unstable-core-do-not-import/types.ts |
Dict | TType | packages/server/src/unstable-core-do-not-import/types.ts |
MaybePromise | TType | packages/server/src/unstable-core-do-not-import/types.ts |
FilterKeys | TKey, TObj, TFilter | packages/server/src/unstable-core-do-not-import/types.ts |
Result | — | packages/server/src/unstable-core-do-not-import/types.ts |
Filter | TObj, FilterKeys, TFilter | packages/server/src/unstable-core-do-not-import/types.ts |
Unwrap | TType, R, Awaited | packages/server/src/unstable-core-do-not-import/types.ts |
DeepPartial | TObject, P, DeepPartial | packages/server/src/unstable-core-do-not-import/types.ts |
DistributiveOmit | TObj, TKey | packages/server/src/unstable-core-do-not-import/types.ts |
WithoutIndexSignature | K, TObj | packages/server/src/unstable-core-do-not-import/types.ts |
Overwrite | TWith, TType, K, Exclude, WithoutIndexSignature | packages/server/src/unstable-core-do-not-import/types.ts |
ValidateShape | TActualShape, TExpectedShape, Exclude | packages/server/src/unstable-core-do-not-import/types.ts |
PickFirstDefined | TType, TPick | packages/server/src/unstable-core-do-not-import/types.ts |
IntersectionError | The, TKey | packages/server/src/unstable-core-do-not-import/types.ts |
ProtectedIntersection | TType, TWith, IntersectionError | packages/server/src/unstable-core-do-not-import/types.ts |
GetRawInputFn | — | packages/server/src/unstable-core-do-not-import/types.ts |
ErrorSymbol | — | packages/server/src/unstable-core-do-not-import/types.ts |
TypeError | TMessage | packages/server/src/unstable-core-do-not-import/types.ts |
ValueOf | TObj | packages/server/src/unstable-core-do-not-import/types.ts |
coerceAsyncIterableToArray | TValue, AsyncIterable, Inferred | packages/server/src/unstable-core-do-not-import/types.ts |
inferAsyncIterableYield | T, AsyncIterable, U | packages/server/src/unstable-core-do-not-import/types.ts |
UnsetMarker | — | packages/server/src/unstable-core-do-not-import/utils.ts |
AnyFn | — | packages/server/src/unstable-core-do-not-import/utils.ts |
ErrorFormatter | ErrorFormatterOptions, TContext, TShape | packages/server/src/unstable-core-do-not-import/error/formatter.ts |
ProcedureErrorFormatter | ErrorFormatterOptions, Simplify, Overwrite, TContext, TContextOverrides, TShape | packages/server/src/unstable-core-do-not-import/error/formatter.ts |
AnyProcedureErrorFormatter | ProcedureErrorFormatter | packages/server/src/unstable-core-do-not-import/error/formatter.ts |
DefaultErrorData | TRPC_ERROR_CODE_KEY | packages/server/src/unstable-core-do-not-import/error/formatter.ts |
GetRequestInfoOptions | — | packages/server/src/unstable-core-do-not-import/http/contentType.ts |
ContentTypeHandler | Request | packages/server/src/unstable-core-do-not-import/http/contentType.ts |
InputRecord | — | packages/server/src/unstable-core-do-not-import/http/contentType.ts |
UtilityParser | ParserZodEsque, TInput, TOutput | packages/server/src/unstable-core-do-not-import/http/contentTypeParsers.ts |
OctetInput | Blob, Uint8Array, FileLike | packages/server/src/unstable-core-do-not-import/http/contentTypeParsers.ts |
HTTPMethods | GET, POST, HEAD, OPTIONS, PUT, DELETE, PATCH | packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts |
ResultTuple | T, TRPCError | packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts |
RPCResult | ResultTuple, RPCResultOk | packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts |
HTTPHeaders | Dict | packages/server/src/unstable-core-do-not-import/http/types.ts |
ResponseMetaFn | TRPCResponse, TRouter | packages/server/src/unstable-core-do-not-import/http/types.ts |
TRPCAcceptHeader | — | packages/server/src/unstable-core-do-not-import/http/types.ts |
ResolveHTTPRequestOptionsContextFn | TRPCRequestInfo, TRouter | packages/server/src/unstable-core-do-not-import/http/types.ts |
HTTPErrorHandler | HTTPErrorHandlerOptions, TRouter, TRequest | packages/server/src/unstable-core-do-not-import/http/types.ts |
TRPC_ERROR_CODE_NUMBER | ValueOf, TRPC_ERROR_CODES_BY_KEY | packages/server/src/unstable-core-do-not-import/rpc/codes.ts |
TRPC_ERROR_CODE_KEY | TRPC_ERROR_CODES_BY_KEY | packages/server/src/unstable-core-do-not-import/rpc/codes.ts |
RequestId | — | packages/server/src/unstable-core-do-not-import/rpc/envelopes.ts |
TRPCResponse | TRPCErrorResponse, TError, TRPCSuccessResponse, TData | packages/server/src/unstable-core-do-not-import/rpc/envelopes.ts |
TRPCRequestMessage | TRPCRequest, JSONRPC2, RequestId | packages/server/src/unstable-core-do-not-import/rpc/envelopes.ts |
TRPCClientOutgoingRequest | TRPCSubscriptionStopNotification | packages/server/src/unstable-core-do-not-import/rpc/envelopes.ts |
TRPCClientOutgoingMessage | TRPCRequestMessage, JSONRPC2, BaseRequest, RequestId | packages/server/src/unstable-core-do-not-import/rpc/envelopes.ts |
TRPCResponseMessage | JSONRPC2, RequestId, TRPCErrorResponse, TError, TRPCResultMessage, TData | packages/server/src/unstable-core-do-not-import/rpc/envelopes.ts |
TRPCClientIncomingRequest | TRPCReconnectNotification | packages/server/src/unstable-core-do-not-import/rpc/envelopes.ts |
TRPCClientIncomingMessage | TRPCClientIncomingRequest, TRPCResponseMessage, TResult, TError | packages/server/src/unstable-core-do-not-import/rpc/envelopes.ts |
WebReadableStreamEsque | ReadableStreamDefaultReader, Uint8Array | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
NodeJSReadableStreamEsque | NodeJSReadableStreamEsque | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
CHUNK_VALUE_TYPE_PROMISE | CHUNK_VALUE_TYPE_PROMISE | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
CHUNK_VALUE_TYPE_ASYNC_ITERABLE | CHUNK_VALUE_TYPE_ASYNC_ITERABLE | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
PROMISE_STATUS_FULFILLED | PROMISE_STATUS_FULFILLED | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
PROMISE_STATUS_REJECTED | PROMISE_STATUS_REJECTED | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
ASYNC_ITERABLE_STATUS_RETURN | ASYNC_ITERABLE_STATUS_RETURN | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
ASYNC_ITERABLE_STATUS_YIELD | ASYNC_ITERABLE_STATUS_YIELD | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
ASYNC_ITERABLE_STATUS_ERROR | ASYNC_ITERABLE_STATUS_ERROR | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
ChunkDefinitionKey | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
ChunkIndex | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
ChunkValueType | CHUNK_VALUE_TYPE_PROMISE, CHUNK_VALUE_TYPE_ASYNC_ITERABLE | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
ChunkDefinition | ChunkDefinitionKey, ChunkValueType, ChunkIndex | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
EncodedValue | ChunkDefinition | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
Head | EncodedValue | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
PromiseChunk | ChunkIndex, PROMISE_STATUS_FULFILLED, EncodedValue, PROMISE_STATUS_REJECTED | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
IterableChunk | ChunkIndex, ASYNC_ITERABLE_STATUS_RETURN, EncodedValue, ASYNC_ITERABLE_STATUS_YIELD, ASYNC_ITERABLE_STATUS_ERROR | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
ChunkData | PromiseChunk, IterableChunk | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
PlaceholderValue | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
Serialize | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
Deserialize | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
PathArray | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
ProducerOnError | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
ConsumerOnError | — | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts |
Serialize | — | packages/server/src/unstable-core-do-not-import/stream/sse.ts |
Deserialize | — | packages/server/src/unstable-core-do-not-import/stream/sse.ts |
TIteratorValue | Awaited, TValue, PING_SYM | packages/server/src/unstable-core-do-not-import/stream/sse.ts |
ConsumerStreamResult | ConsumerStreamResultData, TConfig, ConsumerStreamResultError, ConsumerStreamResultConnecting, ConsumerStreamResultTimeout, ConsumerStreamResultPing, ConsumerStreamResultConnected | packages/server/src/unstable-core-do-not-import/stream/sse.ts |
EventSourceListenerLike | Event | packages/server/src/unstable-core-do-not-import/stream/sse.types.ts |
AnyConstructorLike | TInit, Instance | packages/server/src/unstable-core-do-not-import/stream/sse.types.ts |
AnyConstructor | AnyConstructorLike | packages/server/src/unstable-core-do-not-import/stream/sse.types.ts |
ListenerOf | Parameters, InstanceType, T | packages/server/src/unstable-core-do-not-import/stream/sse.types.ts |
EventOf | Parameters, ListenerOf, T | packages/server/src/unstable-core-do-not-import/stream/sse.types.ts |
InitDictOf | ConstructorParameters, T | packages/server/src/unstable-core-do-not-import/stream/sse.types.ts |
TrackedId | TrackedId | packages/server/src/unstable-core-do-not-import/stream/tracked.ts |
TrackedEnvelope | TrackedId, TData | packages/server/src/unstable-core-do-not-import/stream/tracked.ts |
inferTrackedOutput | TData, TrackedEnvelope, Data, TrackedData | packages/server/src/unstable-core-do-not-import/stream/tracked.ts |
Deferred | ReturnType, TValue | packages/server/src/unstable-core-do-not-import/stream/utils/createDeferred.ts |
ManagedIteratorResult | — | packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts |
ManagedIterator | ReturnType, TYield, TReturn | packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts |
Type Relationships
The following diagram shows inheritance, implementation, and reference relationships between types:
AWSLambdaOptions
├── uses → AnyRouter
└── uses → AWSLambdaCreateContextFn
AWSLambdaCreateContextFn
└── uses → CreateAWSLambdaContextOptions
CreateExpressContextOptions
└── uses → NodeHTTPCreateContextFnOptions
CreateNextContextOptions
└── uses → NodeHTTPCreateContextFnOptions
StandaloneHandlerOptions
└── uses → NodeHTTPHandlerOptions
CreateHTTPHandlerOptions
└── uses → StandaloneHandlerOptions
CreateHTTPContextOptions
└── uses → NodeHTTPCreateContextFnOptions
CreateHTTP2HandlerOptions
└── uses → StandaloneHandlerOptions
CreateHTTP2ContextOptions
└── uses → NodeHTTPCreateContextFnOptions
CreateWSSContextFnOptions
└── uses → NodeHTTPCreateContextFnOptions
CreateWSSContextFn
├── uses → CreateWSSContextFnOptions
└── uses → MaybePromise
WSConnectionHandlerOptions
└── uses → CreateWSSContextFn
WSSHandlerOptions
└── uses → WSConnectionHandlerOptions
ContextResult
├── uses → Result
└── uses → Context
FastifyHandlerOptions
└── uses → NodeHTTPCreateContextOption
FastifyRequestHandlerOptions
└── uses → FastifyHandlerOptions
CreateFastifyContextOptions
└── uses → NodeHTTPCreateContextFnOptions
FetchCreateContextFn
└── uses → FetchCreateContextFnOptions
FetchCreateContextOption
└── uses → FetchCreateContextFn
FetchHandlerOptions
└── uses → FetchCreateContextOption
FetchHandlerRequestOptions
└── uses → FetchCreateContextFn
TRPCRedirectError
└── extends → TRPCError
NodeHTTPRequest
└── uses → DistributiveOmit
NodeHTTPResponse
└── uses → DistributiveOmit
NodeHTTPCreateContextOption
└── uses → NodeHTTPCreateContextFn
NodeHTTPHandlerOptions
└── uses → ConnectMiddleware
NodeHTTPRequestHandlerOptions
└── uses → NodeHTTPHandlerOptions
NodeHTTPCreateContextFn
├── uses → NodeHTTPCreateContextFnOptions
└── uses → MaybePromise
TeardownLogic
├── uses → Unsubscribable
└── uses → UnsubscribeFn
OperatorFunction
└── uses → UnaryFunction
MonoTypeOperatorFunction
└── uses → OperatorFunction
inferTransformedProcedureOutput
└── uses → Serialize
inferTransformedSubscriptionOutput
└── uses → Serialize
GetInferenceHelpers
├── uses → AnyProcedure
└── uses → RouterRecord
inferRouterInputs
└── uses → GetInferenceHelpers
inferRouterOutputs
└── uses → GetInferenceHelpers
AnyClientTypes
└── uses → AnyRootTypes
InitLike
└── uses → AnyClientTypes
RouterLike
└── uses → InitLike
RootConfigLike
└── uses → AnyClientTypes
InferrableClientTypes
├── uses → RouterLike
├── uses → InitLike
├── uses → RootConfigLike
└── uses → AnyClientTypes
inferClientTypes
├── uses → AnyClientTypes
├── uses → PickTypes
├── uses → RootConfigLike
├── uses → InitLike
└── uses → RouterLike
JsonArray
└── uses → JsonValue
JsonObject
└── uses → JsonValue
JsonValue
├── uses → JsonPrimitive
├── uses → JsonObject
└── uses → JsonArray
IsJson
└── uses → JsonValue
JsonReturnable
└── uses → JsonPrimitive
IsRecord
└── uses → WithoutIndexSignature
Serialize
├── uses → IsAny
├── uses → IsJson
├── uses → JsonReturnable
├── uses → NonJsonPrimitive
├── uses → SerializeTuple
├── uses → IsRecord
├── uses → SerializeRecord
├── uses → Simplify
├── uses → SerializeObject
└── uses → UndefinedToOptional
SerializeRecord
└── uses → Serialize
SerializeTuple
├── uses → NonJsonPrimitive
└── uses → Serialize
SerializeObject
└── uses → Serialize
HandleIndexSignature
└── uses → WithoutIndexSignature
HandleUndefined
└── uses → FilterDefinedKeys
UndefinedToOptional
├── uses → WithoutIndexSignature
├── uses → FilterDefinedKeys
├── uses → ExactOptionalPropertyTypes
├── uses → HandleIndexSignature
├── uses → HandleUndefined
└── uses → HasIndexSignature
ProxyCallback
└── uses → ProxyCallbackOptions
inferErrorFormatterShape
├── uses → ErrorFormatter
└── uses → DefaultErrorShape
MiddlewareFunction
├── uses → Simplify
└── uses → Overwrite
AnyMiddlewareFunction
└── uses → MiddlewareFunction
ParserWithoutInput
├── uses → ParserCustomValidatorEsque
├── uses → ParserMyZodEsque
├── uses → ParserScaleEsque
├── uses → ParserSuperstructEsque
└── uses → ParserYupEsque
ParserWithInputOutput
├── uses → ParserZodEsque
├── uses → ParserValibotEsque
├── uses → ParserArkTypeEsque
└── uses → ParserStandardSchemaEsque
Parser
├── uses → ParserWithInputOutput
└── uses → ParserWithoutInput
inferParser
└── uses → ParserStandardSchemaEsque
AnyProcedure
├── uses → AnyQueryProcedure
├── uses → AnyMutationProcedure
└── uses → AnySubscriptionProcedure
inferProcedureParams
└── uses → AnyProcedure
IntersectIfDefined
├── uses → UnsetMarker
└── uses → Simplify
DefaultValue
└── uses → UnsetMarker
inferSubscriptionOutput
└── uses → TypeError
AnyProcedureBuilderDef
└── uses → ProcedureBuilderDef
ProcedureResolver
├── uses → MaybePromise
└── uses → DefaultValue
AnyResolver
└── uses → ProcedureResolver
inferProcedureBuilderResolverOptions
├── uses → UnsetMarker
└── uses → Simplify
AnyRootTypes
└── uses → CreateRootTypes
DecorateProcedure
└── uses → TRPCError
DecorateRouterRecord
├── uses → AnyProcedure
├── uses → DecorateProcedure
└── uses → RouterRecord
RouterCaller
├── uses → MaybePromise
└── uses → RouterCallerErrorHandler
CreateRouterOptions
├── uses → AnyProcedure
├── uses → AnyRouter
└── uses → Lazy
DecorateCreateRouterOptions
├── uses → AnyProcedure
├── uses → Lazy
└── uses → CreateRouterOptions
MergeRouters
├── uses → Head
├── uses → AnyRouter
└── uses → BuiltRouter
InputDataTransformer
└── extends → DataTransformer
OutputDataTransformer
└── extends → DataTransformer
CombinedDataTransformerClient
└── uses → CombinedDataTransformer
DataTransformerOptions
├── uses → CombinedDataTransformer
└── uses → DataTransformer
Filter
└── uses → FilterKeys
Overwrite
└── uses → WithoutIndexSignature
ProtectedIntersection
└── uses → IntersectionError
ProcedureErrorFormatter
├── uses → Simplify
└── uses → Overwrite
AnyProcedureErrorFormatter
└── uses → ProcedureErrorFormatter
DefaultErrorData
└── uses → TRPC_ERROR_CODE_KEY
UtilityParser
└── uses → ParserZodEsque
OctetInput
└── uses → FileLike
ResultTuple
└── uses → TRPCError
RPCResult
├── uses → ResultTuple
└── uses → RPCResultOk
HTTPHeaders
└── uses → Dict
ResponseMetaFn
└── uses → TRPCResponse
ResolveHTTPRequestOptionsContextFn
└── uses → TRPCRequestInfo
TRPC_ERROR_CODE_NUMBER
└── uses → ValueOf
TRPCRequestMessage
└── uses → RequestId
TRPCClientOutgoingMessage
├── uses → TRPCRequestMessage
└── uses → RequestId
TRPCResponseMessage
└── uses → RequestId
TRPCClientIncomingMessage
├── uses → TRPCClientIncomingRequest
└── uses → TRPCResponseMessage
ChunkValueType
├── uses → CHUNK_VALUE_TYPE_PROMISE
└── uses → CHUNK_VALUE_TYPE_ASYNC_ITERABLE
ChunkDefinition
├── uses → ChunkDefinitionKey
├── uses → ChunkValueType
└── uses → ChunkIndex
EncodedValue
└── uses → ChunkDefinition
Head
└── uses → EncodedValue
PromiseChunk
├── uses → ChunkIndex
├── uses → PROMISE_STATUS_FULFILLED
├── uses → EncodedValue
└── uses → PROMISE_STATUS_REJECTED
IterableChunk
├── uses → ChunkIndex
├── uses → ASYNC_ITERABLE_STATUS_RETURN
├── uses → EncodedValue
├── uses → ASYNC_ITERABLE_STATUS_YIELD
└── uses → ASYNC_ITERABLE_STATUS_ERROR
ChunkData
├── uses → PromiseChunk
└── uses → IterableChunk
MessageEvent
└── extends → Event
EventSourceListenerLike
└── uses → Event
AnyConstructorLike
└── uses → Instance
AnyConstructor
└── uses → AnyConstructorLike
EventOf
└── uses → ListenerOf
TrackedEnvelope
└── uses → TrackedId
inferTrackedOutput
└── uses → TrackedEnvelope
Generated by RepoLens static analysis. Type detection uses regex-based parsing and may not capture all advanced TypeScript patterns.
<!-- repolens:docs-badge -->  · Examples
Dependency Graph
73 files · 146 imports · 3 external packages · ✓ no circular dependencies · 5 orphan file(s)
This document maps every import relationship in the codebase, identifies the most-connected modules, and flags circular dependencies that may complicate refactoring or increase build times.
Overview
| Metric | Value |
|---|---|
| Source files | 73 |
| Import edges | 146 |
| External packages | 3 |
| Circular dependencies | 0 |
| Orphan files (no imports or importers) | 5 |
Hub Modules
These are the most-imported modules in the codebase. Changes to hub modules have the widest blast radius and should be reviewed carefully:
| Module | Imported By |
|---|---|
packages/server/src/unstable-core-do-not-import/utils | 16 files |
packages/server/src/unstable-core-do-not-import/error/TRPCError | 8 files |
packages/server/src/unstable-core-do-not-import | 7 files |
External Dependencies
The codebase imports 3 external packages. These are third-party modules (not the language standard library):
| Package |
| --------- |
@trpc/server |
http |
next |
Generated by RepoLens import analysis. Dependency detection covers JavaScript and TypeScript (ES modules, dynamic import, CommonJS, re-exports; comments, strings, and type-only imports are skipped), Python (`import` / `from ... import`, including relative imports), and Go (`go.mod` module paths). Go `_test.go` files are not part of the graph.*
<!-- repolens:docs-badge -->  · Examples
Architecture Drift
No baseline found. Run
repolens publishonce to establish a baseline.
A baseline snapshot of the current architecture has been saved. On subsequent runs, this report will track structural changes across the following dimensions:
| Dimension | What is Tracked |
|---|---|
| Modules | New, removed, or significantly resized modules |
| API Endpoints | Added or removed backend routes |
| Dependencies | Changes to external package imports |
| Frameworks | Technology stack additions or removals |
| Circular Dependencies | Increases in dependency cycles |
| GraphQL Schema | Type additions or removals |
| Codebase Scale | Overall file count changes |
<!-- repolens:docs-badge -->  · Examples
Security Hotspots
5 security finding(s) · 5 low severity · across 4 file(s)
This report identifies code patterns that are commonly associated with security vulnerabilities. Each finding includes the relevant CWE classification and a recommended remediation.
Severity Overview
| Severity | Count |
|---|---|
| 🔵 Low | 5 |
73 source files scanned · 4 files with findings
Prototype Pollution
Deep merge utilities may be vulnerable to prototype pollution if they don't check hasOwnProperty. Verify the implementation.
| File | Line | Pattern | Severity | CWE |
|---|---|---|---|---|
packages/server/src/unstable-core-do-not-import/router.ts | 249 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/server/src/unstable-core-do-not-import/router.ts | 257 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/server/src/unstable-core-do-not-import/utils.ts | 14 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/server/src/unstable-core-do-not-import/error/TRPCError.ts | 9 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/server/src/unstable-core-do-not-import/stream/jsonl.ts | 457 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
Affected Files
packages/server/src/unstable-core-do-not-import/router.tspackages/server/src/unstable-core-do-not-import/utils.tspackages/server/src/unstable-core-do-not-import/error/TRPCError.tspackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
Generated by RepoLens security pattern analysis. Detection is regex-based and may produce false positives. Findings should be triaged by a security-aware engineer.
<!-- repolens:docs-badge -->  · Examples
Code Health Report
73 files analyzed · Average health: 89/100 · 58 A, 7 B, 7 C, 1 D, 0 F
This report synthesizes complexity, coupling, documentation, and security signals into a single health score per module. Lower scores indicate higher risk and maintenance burden.
Overview
| Metric | Value |
|---|---|
| Files analyzed | 73 |
| Average health score | 89/100 |
| Average complexity | 13 |
| Hotspots (score < 60) | 8 |
Grade Distribution
| Grade | Count | Meaning |
|---|---|---|
| 🟢 A (80–100) | 58 | Healthy — low complexity, well-documented |
| 🔵 B (60–79) | 7 | Acceptable — minor improvements possible |
| 🟡 C (40–59) | 7 | Needs attention — elevated complexity or coupling |
| 🟠 D (20–39) | 1 | At risk — multiple quality signals degraded |
| 🔴 F (0–19) | 0 | Critical — immediate refactoring recommended |
Hotspots — Priority Refactoring Targets
These modules have the lowest health scores and should be prioritized for improvement:
| Module | Score | Grade | Complexity | Coupling | Doc% | Security |
|---|---|---|---|---|---|---|
packages/server/src/unstable-core-do-not-import/http/contentType.ts | 36 | 🟠 D | 37 | 2↓ 4↑ | 0% | — |
packages/server/src/adapters/aws-lambda/getPlanner.ts | 45 | 🟡 C | 43 | 1↓ 0↑ | — | — |
packages/server/src/adapters/ws.ts | 45 | 🟡 C | 50 | 1↓ 6↑ | 100% | — |
packages/server/src/unstable-core-do-not-import/router.ts | 45 | 🟡 C | 57 | 3↓ 5↑ | 100% | 2 (0 high) |
packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts | 45 | 🟡 C | 81 | 1↓ 9↑ | — | — |
packages/server/src/unstable-core-do-not-import/stream/jsonl.ts | 45 | 🟡 C | 64 | 2↓ 7↑ | 50% | 1 (0 high) |
packages/server/src/unstable-core-do-not-import/procedureBuilder.ts | 56 | 🟡 C | 55 | 2↓ 5↑ | — | — |
packages/server/src/unstable-core-do-not-import/clientish/serialize.ts | 59 | 🟡 C | 32 | 1↓ 0↑ | — | — |
Most Complex Functions
These functions have the highest cyclomatic complexity and are the most likely sources of bugs:
| Function | File | Line | Complexity |
|---|---|---|---|
isDataStream() | packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts | 239 | 47 |
getHeadersAndCookiesFromResponse() | packages/server/src/adapters/aws-lambda/getPlanner.ts | 46 | 39 |
handleRequest() | packages/server/src/adapters/ws.ts | 207 | 34 |
hasContentType() | packages/server/src/unstable-core-do-not-import/http/contentType.ts | 93 | 21 |
abortOnCancel() | packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts | 70 | 18 |
onAbort() | packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts | 586 | 17 |
initIterable() | packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts | 100 | 17 |
createCaller() | packages/server/src/unstable-core-do-not-import/router.ts | 458 | 16 |
getDataTransformer() | packages/server/src/unstable-core-do-not-import/transformer.ts | 70 | 13 |
decodeChunkDefinition() | packages/server/src/unstable-core-do-not-import/stream/jsonl.ts | 542 | 13 |
resetIfNeeded() | packages/server/src/observable/operators.ts | 63 | 12 |
createInnerProxy() | packages/server/src/unstable-core-do-not-import/createProxy.ts | 19 | 12 |
getTRPCErrorFromUnknown() | packages/server/src/unstable-core-do-not-import/error/TRPCError.ts | 59 | 12 |
handleError() | packages/server/src/adapters/next-app-dir/nextAppDirCaller.ts | 64 | 11 |
getLastEventId() | packages/server/src/unstable-core-do-not-import/http/contentType.ts | 20 | 11 |
All Modules by Health Score
Showing 50 of 73 modules (sorted worst-first)
| Module | Score | Grade | Lines | Complexity | Fan-In | Fan-Out |
|---|---|---|---|---|---|---|
packages/server/src/unstable-core-do-not-import/http/contentType.ts | 36 | 🟠 D | 336 | 37 | 2 | 4 |
packages/server/src/adapters/aws-lambda/getPlanner.ts | 45 | 🟡 C | 254 | 43 | 1 | 0 |
packages/server/src/adapters/ws.ts | 45 | 🟡 C | 646 | 50 | 1 | 6 |
packages/server/src/unstable-core-do-not-import/router.ts | 45 | 🟡 C | 574 | 57 | 3 | 5 |
packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts | 45 | 🟡 C | 832 | 81 | 1 | 9 |
packages/server/src/unstable-core-do-not-import/stream/jsonl.ts | 45 | 🟡 C | 662 | 64 | 2 | 7 |
packages/server/src/unstable-core-do-not-import/procedureBuilder.ts | 56 | 🟡 C | 771 | 55 | 2 | 5 |
packages/server/src/unstable-core-do-not-import/clientish/serialize.ts | 59 | 🟡 C | 146 | 32 | 1 | 0 |
packages/server/src/unstable-core-do-not-import/stream/sse.ts | 60 | 🔵 B | 486 | 45 | 2 | 9 |
packages/server/src/unstable-core-do-not-import/error/TRPCError.ts | 69 | 🔵 B | 104 | 23 | 8 | 1 |
packages/server/src/unstable-core-do-not-import/types.ts | 72 | 🔵 B | 185 | 23 | 1 | 0 |
packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts | 75 | 🔵 B | 197 | 20 | 1 | 2 |
packages/server/src/adapters/node-http/incomingMessageToRequest.ts | 76 | 🔵 B | 199 | 27 | 2 | 0 |
packages/server/src/unstable-core-do-not-import/initTRPC.ts | 78 | 🔵 B | 226 | 17 | 1 | 6 |
packages/server/src/unstable-core-do-not-import/parser.ts | 79 | 🔵 B | 141 | 16 | 2 | 0 |
packages/server/src/unstable-core-do-not-import.ts | 85 | 🟢 A | 47 | 1 | 7 | 33 |
packages/server/src/observable/operators.ts | 85 | 🟢 A | 162 | 17 | 1 | 1 |
packages/server/src/unstable-core-do-not-import/utils.ts | 85 | 🟢 A | 122 | 15 | 16 | 0 |
packages/server/src/unstable-core-do-not-import/middleware.ts | 86 | 🟢 A | 336 | 24 | 3 | 4 |
packages/server/src/adapters/next-app-dir/nextAppDirCaller.ts | 87 | 🟢 A | 136 | 17 | 1 | 3 |
packages/server/src/unstable-core-do-not-import/transformer.ts | 87 | 🟢 A | 192 | 13 | 4 | 1 |
packages/server/src/unstable-core-do-not-import/createProxy.ts | 89 | 🟢 A | 102 | 13 | 2 | 1 |
packages/server/src/adapters/standalone.ts | 90 | 🟢 A | 122 | 4 | 0 | 2 |
packages/server/src/adapters/next-app-dir/rethrowNextErrors.ts | 90 | 🟢 A | 69 | 18 | 2 | 1 |
packages/server/src/unstable-core-do-not-import/http/abortError.ts | 90 | 🟢 A | 12 | 2 | 3 | 1 |
packages/server/src/unstable-core-do-not-import/http/formDataToObject.ts | 90 | 🟢 A | 48 | 9 | 1 | 1 |
packages/server/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts | 90 | 🟢 A | 99 | 8 | 3 | 2 |
packages/server/src/unstable-core-do-not-import/http/parseConnectionParams.ts | 90 | 🟢 A | 50 | 6 | 2 | 2 |
packages/server/src/unstable-core-do-not-import/stream/utils/timerResource.ts | 90 | 🟢 A | 30 | 3 | 3 | 1 |
packages/server/src/observable/observable.ts | 92 | 🟢 A | 207 | 16 | 4 | 0 |
packages/server/src/unstable-core-do-not-import/rootConfig.ts | 94 | 🟢 A | 154 | 14 | 3 | 0 |
packages/server/src/unstable-core-do-not-import/error/formatter.ts | 95 | 🟢 A | 135 | 7 | 5 | 2 |
packages/server/src/adapters/fetch/fetchRequestHandler.ts | 96 | 🟢 A | 81 | 10 | 1 | 0 |
packages/server/src/unstable-core-do-not-import/http/types.ts | 96 | 🟢 A | 173 | 10 | 1 | 0 |
packages/server/src/unstable-core-do-not-import/clientish/inference.ts | 98 | 🟢 A | 72 | 9 | 1 | 0 |
packages/server/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts | 98 | 🟢 A | 89 | 12 | 1 | 2 |
packages/server/src/adapters/node-http/writeResponse.ts | 99 | 🟢 A | 102 | 11 | 1 | 1 |
packages/server/src/adapters/aws-lambda/index.ts | 100 | 🟢 A | 115 | 1 | 0 | 1 |
packages/server/src/adapters/express.ts | 100 | 🟢 A | 49 | 2 | 0 | 2 |
packages/server/src/adapters/next-app-dir.ts | 100 | 🟢 A | 8 | 1 | 0 | 4 |
packages/server/src/adapters/next.ts | 100 | 🟢 A | 70 | 4 | 0 | 2 |
packages/server/src/adapters/wsEncoder.ts | 100 | 🟢 A | 36 | 2 | 1 | 0 |
packages/server/src/adapters/fastify/fastifyRequestHandler.ts | 100 | 🟢 A | 82 | 2 | 2 | 1 |
packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts | 100 | 🟢 A | 92 | 8 | 1 | 2 |
packages/server/src/adapters/fastify/index.ts | 100 | 🟢 A | 3 | 1 | 0 | 2 |
packages/server/src/adapters/fetch/index.ts | 100 | 🟢 A | 3 | 1 | 0 | 2 |
packages/server/src/adapters/fetch/types.ts | 100 | 🟢 A | 54 | 1 | 1 | 0 |
packages/server/src/adapters/next-app-dir/notFound.ts | 100 | 🟢 A | 13 | 1 | 1 | 0 |
packages/server/src/adapters/next-app-dir/redirect.ts | 100 | 🟢 A | 31 | 3 | 3 | 0 |
packages/server/src/adapters/node-http/index.ts | 100 | 🟢 A | 4 | 1 | 5 | 3 |
Scoring Methodology
The health score (0–100) is computed from four dimensions:
| Factor | Weight | How It's Measured |
|---|---|---|
| Complexity | –1/pt above 10, –2/pt above 30 | Cyclomatic complexity for JavaScript/TypeScript, Python, and Go (regex, not AST) |
| Function complexity | –2/pt above 8 per function | Highest complexity function in the file |
| Coupling | –1/5 units above 20 | Fan-in × Fan-out (import connections) |
| Documentation | –10 if <50%, –5 if <80% | JSDoc/TSDoc coverage of exports |
| Security | –10/high, –5/medium finding | Security anti-pattern findings in file |
Generated by RepoLens code health analysis. Complexity covers JavaScript/TypeScript, Python, and Go. It is regex-based and may differ from AST-based tools. Scores are relative indicators, not absolute quality measures.
<!-- repolens:docs-badge -->  · Examples