RepoLens

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

Stakeholders · High-level overview for leadership, product, and stakeholders

At a Glance

AspectSummary
WhattRPC is a production-grade command-line tool
Built WithExpress + TypeScript, Node.js
Scale8 modules across 73 files
MaturityProduction-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:

DomainCapabilityScale
Core Enginepath packages/server/src/unstable-core-do-not-import matches core2 modules, 41 files
Integrationspath packages/server/src/adapters matches adapter1 modules, 23 files
OtherUncategorized module3 modules, 7 files
Search & Discoverypath packages/server/src/index.ts matches index1 modules, 1 files
Shared Utilitiespath packages/server/src/shared.ts matches shared1 modules, 1 files

Technical Foundation

LayerTechnologiesPurpose
ApplicationExpressCore runtime framework
LanguageTypeScript, Node.jsPrimary development language
BuildVite, TurborepoCompilation and bundling
TestingVitestQuality assurance

Module Composition

The codebase follows a layered architecture with clear separation of concerns:

LayerCountKey ModulesResponsibility
core2unstable-core-do-not-import, unstable-core-do-not-import.tsSupporting application functionality
integration1adaptersSupporting application functionality
Other Modules4observable, http.tsGeneral purpose functionality
Shared Libraries1shared.tsProvides 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

MetricValueStatus
Internal imports146 edges✅ Connected
External Packages3✅ Manageable
Circular Dependenciescycle-free✅ None
Orphan Files5⚠️ 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

System Overview

Mixed audience · Concise technical overview readable by all

The Big Picture

tRPC is a focused codebase with a clear purpose, containing 8 modules spread across 73 files.

DimensionDetails
Total Files73
Module Count8
Functional Domains5
Interface TypeCommand-Line Tool

Technology Stack

The system is built on a modern technology foundation:

LayerTechnologiesPurpose
RuntimeExpressHTTP server and middleware
LanguageTypeScript, Node.jsPrimary development language
BuildVite, TurborepoCompilation and asset processing
QualityVitestAutomated 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:

LayerModulesKey ExamplesResponsibility
core2unstable-core-do-not-import, unstable-core-do-not-import.tsSupporting application functionality
integration1adaptersSupporting application functionality
Other Modules4observable, http.tsGeneral purpose functionality
Shared Libraries1shared.tsProvides shared utilities and abstractions used across modules
Layer Details

core — 2 modules

  • packages/server/src/unstable-core-do-not-import — 40 files — Core application module
  • packages/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 module
  • packages/server/src/http.ts — 1 files — Core application module
  • packages/server/src/index.ts — 1 files — Core application module
  • packages/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:

RankDomainScaleBusiness Capability
1Core Engine41 filespath packages/server/src/unstable-core-do-not-import matches core
2Integrations23 filespath packages/server/src/adapters matches adapter
3Other7 filesUncategorized module
4Search & Discovery1 filespath packages/server/src/index.ts matches index
5Shared Utilities1 filespath packages/server/src/shared.ts matches shared

Dependency Graph

Codebase Health: 🟢 100/100

MetricValueAssessment
Internal Imports146Modules are connected
External Packages3Lean dependencies
Circular Dependencies0✅ Clean
Orphan Files5⚠️ 5 unused

Hub modules (most imported):

  • packages/server/src/unstable-core-do-not-import/utils — imported by 16 files
  • packages/server/src/unstable-core-do-not-import/error/TRPCError — imported by 8 files
  • packages/server/src/unstable-core-do-not-import — imported by 7 files

Monorepo Structure

This is a pnpm workspaces monorepo containing 1 packages:

PackageLocationDescription
@trpc/serverpackages/serverBackend/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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Business Domains

Mixed audience · Codebase structure translated into business language

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:

DomainModulesFilesPrimary Capability
Core Engine241Supporting business operations
Integrations123Supporting business operations
Other37Supporting business operations
Search & Discovery11Search and content discovery
Shared Utilities11Cross-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
ModulePurpose
packages/server/src/unstable-core-do-not-importCore application module
packages/server/src/unstable-core-do-not-import.tsCore 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
ModulePurpose
packages/server/src/adaptersCore 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
ModulePurpose
packages/server/src/observableCore application module
packages/server/src/http.tsCore application module
packages/server/src/rpc.tsCore 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
ModulePurpose
packages/server/src/index.tsCore 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
ModulePurpose
packages/server/src/shared.tsCore 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:

ModuleConsumersRole
packages/server/src/unstable-core-do-not-import/utils16 modulesUtility and helper functions
packages/server/src/unstable-core-do-not-import/error/TRPCError8 modulesCore application module
packages/server/src/unstable-core-do-not-import7 modulesCore 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

MetricValueAssessment
Total Domains5Well-balanced
Avg Files/Domain15Appropriate size
Largest DomainCore Engine (41 files)Consider breaking down
Domain Concentration56% 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Architecture Overview

Engineers · Layered architecture and design patterns

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:

LayerResponsibilityScaleKey Insight
Core Enginepath packages/server/src/unstable-core-do-not-import matches core41 filesStandard domain
Integrationspath packages/server/src/adapters matches adapter23 filesStandard domain
OtherUncategorized module7 filesStandard domain
Search & Discoverypath `packages/server/src/index1 filesStandard domain
Shared Utilitiespath `packages/server/src/shared1 filesShared infrastructure — high reuse

Module Layers

Modules are classified into 4 architectural roles:

core

Role: Supporting application functionality

ModuleFilesDescription
packages/server/src/unstable-core-do-not-import40Core application module
packages/server/src/unstable-core-do-not-import.ts1Core application module
integration

Role: Supporting application functionality

ModuleFilesDescription
packages/server/src/adapters23Core application module
Other Modules

Role: General purpose functionality

ModuleFilesDescription
packages/server/src/observable5Core application module
packages/server/src/http.ts1Core application module
packages/server/src/index.ts1Core application module
packages/server/src/rpc.ts1Core application module
Shared Libraries

Role: Provides shared utilities and abstractions used across modules

ModuleFilesDescription
packages/server/src/shared.ts1Core application module

Technology Foundation

LayerTechnologiesArchitectural Implication
ApplicationExpressMiddleware pipeline, request/response cycle
LanguageTypeScript, Node.jsStatic typing enables tooling and refactoring confidence
BuildVite, TurborepoModern bundling and optimization
QualityVitestEnables confident refactoring

Scale & Complexity Analysis

DimensionValueAssessment
Total Files73medium project
Module Count8low complexity
Domain Spread5 domainsFocused scope
InterfaceCLITerminal-driven interaction

Dependency Health

Architecture Health Score: 🟢 100/100

MetricValueStatusRecommendation
Import Edges146✅Healthy module connectivity
External Packages3✅Lean dependency set
Circular Deps0✅Clean module boundaries
Orphan Files5⚠️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 files
  • packages/server/src/unstable-core-do-not-import/error/TRPCError — imported by 8 files
  • packages/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
PackageLocationArchitectural Role
@trpc/serverpackages/serverBackend/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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Module Catalog

Engineers · Complete inventory of code modules with AI explanations

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

ModuleFilesRole
packages/server/src/unstable-core-do-not-import40Core business logic and shared foundations · Shared infrastructure (imported by 8 modules)
packages/server/src/adapters23Application module · Orchestrator (coordinates 10 modules)
packages/server/src/observable5Application module · Leaf module (consumed only, 3 importers)
packages/server/src/http.ts1Application module
packages/server/src/index.ts1Application module
packages/server/src/rpc.ts1Application module
packages/server/src/shared.ts1Application module
packages/server/src/unstable-core-do-not-import.ts1Core 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Route Map

Mixed audience · Application routes and API endpoints with context

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

API Surface

Engineers · Backend API endpoints with usage examples

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Data Flows

Mixed audience · Major information flows through the system

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:

FlowTypeComplexityCritical
next-app-dir Request FlowIntegrationLow (2 steps)—
express Request FlowIntegrationMedium (3 steps)—
next Request FlowIntegrationMedium (3 steps)—
standalone Request FlowIntegrationMedium (3 steps)—
fastify Request FlowIntegrationMedium (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
PropertyValue
Steps2
Modules Involved2
CriticalityStandard
Processing Steps
StepActionPurpose
1next-app-dir (entry point, imports 4 modules)Data acquisition
2redirect (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
ModuleRole
next-app-dirCore application module
redirectCore 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
PropertyValue
Steps3
Modules Involved3
CriticalityStandard
Processing Steps
StepActionPurpose
1express (entry point, imports 2 modules)Data acquisition
2unstable-core-do-not-import (shared infrastructure, used by 7 files)Data acquisition
3utils (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
ModuleRole
expressCore application module
unstable-core-do-not-importCore application module
utilsUtility 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
PropertyValue
Steps3
Modules Involved3
CriticalityStandard
Processing Steps
StepActionPurpose
1next (entry point, imports 2 modules)Data acquisition
2unstable-core-do-not-import (shared infrastructure, used by 7 files)Data acquisition
3utils (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
ModuleRole
nextCore application module
unstable-core-do-not-importCore application module
utilsUtility 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
PropertyValue
Steps3
Modules Involved3
CriticalityStandard
Processing Steps
StepActionPurpose
1standalone (entry point, imports 2 modules)Data acquisition
2unstable-core-do-not-import (shared infrastructure, used by 7 files)Data acquisition
3utils (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
ModuleRole
standaloneCore application module
unstable-core-do-not-importCore application module
utilsUtility 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
PropertyValue
Steps4
Modules Involved4
CriticalityStandard
Processing Steps
StepActionPurpose
1fastify (entry point, imports 2 modules)Data acquisition
2fastifyRequestHandler → imports 1 moduleData acquisition
3node-http (shared infrastructure, used by 5 files)Processing step
4incomingMessageToRequest (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
ModuleRole
fastifyCore application module
fastifyRequestHandlerCore application module
node-httpCore application module
incomingMessageToRequestCore 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
MetricValueMeaning
Total Edges146Direct import relationships
Hub Count3Central integration points
Avg Connections~2 per fileCoupling density
Key Integration Points

These modules aggregate data from multiple sources:

HubInboundRole
utils16 filesUtility and helper functions
TRPCError8 filesCore application module
unstable-core-do-not-import7 filesCore 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Architecture Diff

Mixed audience · Git diff analysis and impact assessment

No changes detected.

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

System Map

Mixed audience · Visual dependency graph with explanation

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):

ModuleImported by
packages/server/src/unstable-core-do-not-import.ts34 modules
packages/server/src/unstable-core-do-not-import7 modules
packages/server/src/observable3 modules
packages/server/src/http.ts1 module

Most dependent modules (highest dependency count):

ModuleDepends on
packages/server/src/unstable-core-do-not-import33 modules
packages/server/src/adapters10 modules
packages/server/src/unstable-core-do-not-import.ts2 modules

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Developer Onboarding

Engineers · Quick start guide for new developers

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
  1. ✅ Repository structure and organization
  2. ✅ Technology stack and tools
  3. ✅ Key modules to understand first
  4. ✅ How data flows through the system
  5. ✅ How to start contributing

Quick Reference Card

AspectDetails
LanguagesTypeScript, Node.js
FrameworksExpress
Build ToolsVite, Turborepo
TestingVitest
Size8 modules, 73 files
Domains5 functional areas
TypeCommand-line interface

Repository Structure

Understanding the directory layout is your first step to navigating the codebase:

DirectoryPurposeStart Here?
packages/server/srcProject files⭐ Yes
Where to Begin

Focus on these directories first:

  1. `packages/server/src` — Project files

Monorepo Navigation

This is a pnpm workspaces monorepo with 1 packages. Here's how to navigate:

PackageLocationWhat It Does
@trpc/serverpackages/serverBackend/API server

Pro tip: Each package can typically be developed independently. Check the package's own README.md for specific setup instructions.


Technology Stack

LayerTechnologiesWhat to Learn
FrameworkExpressUnderstand middleware chains and route handling
LanguageTypeScript, Node.jsStrong typing — check types when debugging
BuildVite, TurborepoUnderstand the build pipeline
TestingVitestRun 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:

PriorityModuleFilesTypeWhy It Matters
⭐ Highpackages/server/src/unstable-core-do-not-import40coreLarge module — core functionality
⭐ Highpackages/server/src/adapters23integrationLarge module — core functionality
⭐ Highpackages/server/src/observable5Other ModulesKey system component
Mediumpackages/server/src/http.ts1Other ModulesKey system component
Mediumpackages/server/src/index.ts1Other ModulesKey system component
Mediumpackages/server/src/rpc.ts1Other ModulesKey system component
Lowpackages/server/src/shared.ts1Shared LibrariesShared code — reused throughout
Lowpackages/server/src/unstable-core-do-not-import.ts1coreKey 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:

FlowDescriptionKey Modules
next-app-dir Request FlowImport chain starting from `packages/server/src/adapters/nex...next-app-dir, redirect
express Request FlowImport chain starting from `packages/server/src/adapters/exp...express, unstable-core-do-not-import
next Request FlowImport chain starting from `packages/server/src/adapters/nex...next, unstable-core-do-not-import
standalone Request FlowImport chain starting from `packages/server/src/adapters/sta...standalone, unstable-core-do-not-import
fastify Request FlowImport 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.md for project-specific instructions
  • Look for CONTRIBUTING.md for 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:

  1. Find a small bug or typo to fix
  2. Make the change in a feature branch
  3. Run tests to ensure nothing breaks
  4. 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.example files and ensure you have all required environment variables.
  • Branch naming — Follow the team's branch naming conventions (usually feature/, fix/, docs/).

Additional Resources

ResourcePurpose
README.mdProject overview and quick start
CONTRIBUTING.mdContribution guidelines (if exists)
CHANGELOG.mdRecent changes and release history
package.jsonAvailable scripts and dependencies
Root package.jsonMonorepo 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

GraphQL Schema

Engineers · GraphQL types, queries, mutations, and resolver map

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

TypeScript Type Graph

Engineers · TypeScript interfaces, types, classes, and relationships

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:

InterfaceExtendsSource
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
InputDataTransformerDataTransformerpackages/server/src/unstable-core-do-not-import/transformer.ts
OutputDataTransformerDataTransformerpackages/server/src/unstable-core-do-not-import/transformer.ts
CombinedDataTransformer—packages/server/src/unstable-core-do-not-import/transformer.ts
DefaultErrorShapeTRPCErrorShapepackages/server/src/unstable-core-do-not-import/error/formatter.ts
FileLikeBlobpackages/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
MessageEventEventpackages/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:

ClassExtendsImplementsSource
TRPCRedirectErrorTRPCError—packages/server/src/adapters/next-app-dir/redirect.ts
TransformResultErrorError—packages/server/src/unstable-core-do-not-import/transformer.ts
UnknownCauseErrorError—packages/server/src/unstable-core-do-not-import/error/TRPCError.ts
TRPCErrorError—packages/server/src/unstable-core-do-not-import/error/TRPCError.ts
MaxDepthErrorError—packages/server/src/unstable-core-do-not-import/stream/jsonl.ts
AsyncErrorError—packages/server/src/unstable-core-do-not-import/stream/jsonl.ts

Type Aliases

231 type aliases define computed or composite types:

TypeReferencesSource
LambdaEventAPIGatewayProxyEvent, APIGatewayProxyEventV2packages/server/src/adapters/aws-lambda/getPlanner.ts
APIGatewayResultAPIGatewayProxyResult, APIGatewayProxyStructuredResultV2packages/server/src/adapters/aws-lambda/getPlanner.ts
inferAPIGWReturnTEvent, APIGatewayProxyEvent, APIGatewayProxyResult, APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2packages/server/src/adapters/aws-lambda/getPlanner.ts
CreateAWSLambdaContextOptionsTEventpackages/server/src/adapters/aws-lambda/index.ts
AWSLambdaOptionsHTTPBaseHandlerOptions, TRouter, TEvent, CreateContextCallback, AnyRouter, AWSLambdaCreateContextFnpackages/server/src/adapters/aws-lambda/index.ts
AWSLambdaCreateContextFnCreateAWSLambdaContextOptions, TEvent, TRouterpackages/server/src/adapters/aws-lambda/index.ts
CreateExpressContextOptionsNodeHTTPCreateContextFnOptions, Request, Responsepackages/server/src/adapters/express.ts
CreateNextContextOptionsNodeHTTPCreateContextFnOptions, NextApiRequest, NextApiResponsepackages/server/src/adapters/next.ts
StandaloneHandlerOptionsNodeHTTPHandlerOptions, TRouter, TRequest, TResponse, The, This, Dopackages/server/src/adapters/standalone.ts
CreateHTTPHandlerOptionsStandaloneHandlerOptions, TRouter, IncomingMessage, ServerResponsepackages/server/src/adapters/standalone.ts
CreateHTTPContextOptionsNodeHTTPCreateContextFnOptions, IncomingMessage, ServerResponsepackages/server/src/adapters/standalone.ts
CreateHTTP2HandlerOptionsStandaloneHandlerOptions, TRouter, Http2ServerRequest, Http2ServerResponsepackages/server/src/adapters/standalone.ts
CreateHTTP2ContextOptionsNodeHTTPCreateContextFnOptions, Http2ServerRequest, Http2ServerResponsepackages/server/src/adapters/standalone.ts
CreateWSSContextFnOptionsNodeHTTPCreateContextFnOptions, IncomingMessage, WebSocketpackages/server/src/adapters/ws.ts
CreateWSSContextFnCreateWSSContextFnOptions, MaybePromise, TRouterpackages/server/src/adapters/ws.ts
WSConnectionHandlerOptionsBaseHandlerOptions, TRouter, IncomingMessage, CreateContextCallback, CreateWSSContextFnpackages/server/src/adapters/ws.ts
WSSHandlerOptionsWSConnectionHandlerOptions, TRouter, WebSocketServerpackages/server/src/adapters/ws.ts
ContextTRouterpackages/server/src/adapters/ws.ts
ContextResultResult, Contextpackages/server/src/adapters/ws.ts
FastifyHandlerOptionsHTTPBaseHandlerOptions, TRouter, TRequest, NodeHTTPCreateContextOption, TResponsepackages/server/src/adapters/fastify/fastifyRequestHandler.ts
FastifyRequestHandlerOptionsFastifyHandlerOptions, TRouter, TRequest, TResponsepackages/server/src/adapters/fastify/fastifyRequestHandler.ts
CreateFastifyContextOptionsNodeHTTPCreateContextFnOptions, FastifyRequest, FastifyReplypackages/server/src/adapters/fastify/fastifyTRPCPlugin.ts
FetchCreateContextFnOptionsRequestpackages/server/src/adapters/fetch/types.ts
FetchCreateContextFnFetchCreateContextFnOptions, TRouterpackages/server/src/adapters/fetch/types.ts
FetchCreateContextOptionCreateContextCallback, TRouter, FetchCreateContextFnpackages/server/src/adapters/fetch/types.ts
FetchHandlerOptionsFetchCreateContextOption, TRouter, HTTPBaseHandlerOptions, Requestpackages/server/src/adapters/fetch/types.ts
FetchHandlerRequestOptionsHTTPBaseHandlerOptions, TRouter, Request, CreateContextCallback, FetchCreateContextFnpackages/server/src/adapters/fetch/types.ts
NodeHTTPRequestDistributiveOmit, IncomingMessage, Http2ServerRequest, Manypackages/server/src/adapters/node-http/types.ts
NodeHTTPResponseDistributiveOmit, ServerResponse, Http2ServerResponse, Force, Added, Next, Expresspackages/server/src/adapters/node-http/types.ts
NodeHTTPCreateContextOptionCreateContextCallback, TRouter, NodeHTTPCreateContextFn, TRequest, TResponsepackages/server/src/adapters/node-http/types.ts
ConnectMiddlewareTRequest, TResponsepackages/server/src/adapters/node-http/types.ts
NodeHTTPHandlerOptionsHTTPBaseHandlerOptions, TRouter, TRequest, By, OPTIONS, CORS, This, You, Express, ConnectMiddleware, TResponsepackages/server/src/adapters/node-http/types.ts
NodeHTTPRequestHandlerOptionsNodeHTTPHandlerOptions, TRouter, TRequest, TResponsepackages/server/src/adapters/node-http/types.ts
NodeHTTPCreateContextFnOptionsTRequestpackages/server/src/adapters/node-http/types.ts
NodeHTTPCreateContextFnNodeHTTPCreateContextFnOptions, TRequest, TResponse, MaybePromise, TRouterpackages/server/src/adapters/node-http/types.ts
inferObservableValueTObservable, Observable, TValuepackages/server/src/observable/observable.ts
UnsubscribeFn—packages/server/src/observable/types.ts
TeardownLogicSubscriptionLike, Unsubscribable, UnsubscribeFnpackages/server/src/observable/types.ts
UnaryFunctionTSource, TReturnpackages/server/src/observable/types.ts
OperatorFunctionUnaryFunction, Subscribable, TValueBefore, TErrorBefore, TValueAfter, TErrorAfterpackages/server/src/observable/types.ts
MonoTypeOperatorFunctionOperatorFunction, TValue, TErrorpackages/server/src/observable/types.ts
inferTransformedProcedureOutputTInferrable, Serialize, TProcedurepackages/server/src/unstable-core-do-not-import/clientish/inference.ts
inferProcedureErrorShapeTProcedure, Shape, TInferrablepackages/server/src/unstable-core-do-not-import/clientish/inference.ts
inferTransformedSubscriptionOutputTInferrable, Serialize, TProcedurepackages/server/src/unstable-core-do-not-import/clientish/inference.ts
GetInferenceHelpersTKey, TRecord, Value, AnyProcedure, TType, TRoot, RouterRecord, GetInferenceHelperspackages/server/src/unstable-core-do-not-import/clientish/inference.ts
inferRouterInputsGetInferenceHelpers, TRouterpackages/server/src/unstable-core-do-not-import/clientish/inference.ts
inferRouterOutputsGetInferenceHelpers, TRouterpackages/server/src/unstable-core-do-not-import/clientish/inference.ts
AnyClientTypesAnyRootTypespackages/server/src/unstable-core-do-not-import/clientish/inferrable.ts
InitLikeAnyClientTypespackages/server/src/unstable-core-do-not-import/clientish/inferrable.ts
RouterLikeInitLikepackages/server/src/unstable-core-do-not-import/clientish/inferrable.ts
RootConfigLikeAnyClientTypespackages/server/src/unstable-core-do-not-import/clientish/inferrable.ts
InferrableClientTypesRouterLike, InitLike, RootConfigLike, AnyClientTypespackages/server/src/unstable-core-do-not-import/clientish/inferrable.ts
PickTypesTpackages/server/src/unstable-core-do-not-import/clientish/inferrable.ts
inferClientTypesTInferrable, AnyClientTypes, PickTypes, RootConfigLike, InitLike, RouterLikepackages/server/src/unstable-core-do-not-import/clientish/inferrable.ts
JsonPrimitive—packages/server/src/unstable-core-do-not-import/clientish/serialize.ts
JsonArrayJsonValuepackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
JsonObjectJsonValuepackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
JsonValueJsonPrimitive, JsonObject, JsonArraypackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
IsJsonT, JsonValuepackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
NonJsonPrimitiveFunctionpackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
IsAnyTpackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
JsonReturnableJsonPrimitivepackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
IsRecordWithoutIndexSignature, Tpackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
SerializeIsAny, T, IsJson, AsyncIterable, Return, Next, Serialize, PromiseLike, JsonReturnable, NonJsonPrimitive, U, SerializeTuple, IsRecord, SerializeRecord, Simplify, SerializeObject, UndefinedToOptionalpackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
SerializeRecordP, K, Serialize, Tpackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
SerializeTupleK, T, NonJsonPrimitive, Serializepackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
SerializeObjectK, T, SerializeObjectKey, Serializepackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
FilterDefinedKeysExclude, K, Tpackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
ExactOptionalPropertyTypes—packages/server/src/unstable-core-do-not-import/clientish/serialize.ts
HasIndexSignatureTpackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
HandleIndexSignatureK, T, WithoutIndexSignature, Excludepackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
HandleUndefinedK, T, FilterDefinedKeys, Excludepackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
UndefinedToOptionalProperty, WithoutIndexSignature, T, FilterDefinedKeys, If, ExactOptionalPropertyTypes, HandleIndexSignature, HandleUndefined, HasIndexSignaturepackages/server/src/unstable-core-do-not-import/clientish/serialize.ts
ProxyCallbackProxyCallbackOptionspackages/server/src/unstable-core-do-not-import/createProxy.ts
inferErrorFormatterShapeTType, ErrorFormatter, TShape, DefaultErrorShapepackages/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
MiddlewareResultMiddlewareErrorResult, MiddlewareOKResultpackages/server/src/unstable-core-do-not-import/middleware.ts
MiddlewareFunctionSimplify, Overwrite, TContext, TContextOverridesInpackages/server/src/unstable-core-do-not-import/middleware.ts
AnyMiddlewareFunctionMiddlewareFunctionpackages/server/src/unstable-core-do-not-import/middleware.ts
AnyMiddlewareBuilderMiddlewareBuilderpackages/server/src/unstable-core-do-not-import/middleware.ts
ParserZodEsqueTInputpackages/server/src/unstable-core-do-not-import/parser.ts
ParserValibotEsqueTInputpackages/server/src/unstable-core-do-not-import/parser.ts
ParserArkTypeEsqueTInputpackages/server/src/unstable-core-do-not-import/parser.ts
ParserStandardSchemaEsqueStandardSchemaV1, TInput, TParsedInputpackages/server/src/unstable-core-do-not-import/parser.ts
ParserMyZodEsqueTInputpackages/server/src/unstable-core-do-not-import/parser.ts
ParserSuperstructEsqueTInputpackages/server/src/unstable-core-do-not-import/parser.ts
ParserCustomValidatorEsqueTInputpackages/server/src/unstable-core-do-not-import/parser.ts
ParserYupEsqueTInputpackages/server/src/unstable-core-do-not-import/parser.ts
ParserScaleEsqueTInputpackages/server/src/unstable-core-do-not-import/parser.ts
ParserWithoutInputParserCustomValidatorEsque, TInput, ParserMyZodEsque, ParserScaleEsque, ParserSuperstructEsque, ParserYupEsquepackages/server/src/unstable-core-do-not-import/parser.ts
ParserWithInputOutputParserZodEsque, TInput, TParsedInput, ParserValibotEsque, ParserArkTypeEsque, ParserStandardSchemaEsquepackages/server/src/unstable-core-do-not-import/parser.ts
ParserParserWithInputOutput, ParserWithoutInputpackages/server/src/unstable-core-do-not-import/parser.ts
inferParserTParser, ParserStandardSchemaEsque, TIn, TOutpackages/server/src/unstable-core-do-not-import/parser.ts
ParseFnTTypepackages/server/src/unstable-core-do-not-import/parser.ts
ProcedureType—packages/server/src/unstable-core-do-not-import/procedure.ts
AnyQueryProcedureQueryProcedurepackages/server/src/unstable-core-do-not-import/procedure.ts
AnyMutationProcedureMutationProcedurepackages/server/src/unstable-core-do-not-import/procedure.ts
AnySubscriptionProcedureSubscriptionProcedure, LegacyObservableSubscriptionProcedurepackages/server/src/unstable-core-do-not-import/procedure.ts
AnyProcedureAnyQueryProcedure, AnyMutationProcedure, AnySubscriptionProcedurepackages/server/src/unstable-core-do-not-import/procedure.ts
inferProcedureInputTProcedurepackages/server/src/unstable-core-do-not-import/procedure.ts
inferProcedureParamsTProcedure, AnyProcedurepackages/server/src/unstable-core-do-not-import/procedure.ts
inferProcedureOutputTProcedurepackages/server/src/unstable-core-do-not-import/procedure.ts
inferSubscriptionInputTProcedurepackages/server/src/unstable-core-do-not-import/procedure.ts
inferSubscriptionOutputTProcedure, LegacyObservableSubscriptionProcedurepackages/server/src/unstable-core-do-not-import/procedure.ts
IntersectIfDefinedTType, UnsetMarker, TWith, Simplifypackages/server/src/unstable-core-do-not-import/procedureBuilder.ts
DefaultValueTValue, UnsetMarker, TFallbackpackages/server/src/unstable-core-do-not-import/procedureBuilder.ts
FoldErrorShapeExtract, Shape, TRPCErrorShape, TErrorShapepackages/server/src/unstable-core-do-not-import/procedureBuilder.ts
inferAsyncIterableTOutput, AsyncIterable, Yield, Return, Nextpackages/server/src/unstable-core-do-not-import/procedureBuilder.ts
inferSubscriptionOutputTOutput, AsyncIterable, TypeError, Subscriptionpackages/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
AnyProcedureBuilderDefProcedureBuilderDefpackages/server/src/unstable-core-do-not-import/procedureBuilder.ts
ProcedureResolverProcedureResolverOptions, TContext, TMeta, TContextOverrides, TInputOut, MaybePromise, If, DefaultValue, TOutputParserIn, Outputpackages/server/src/unstable-core-do-not-import/procedureBuilder.ts
AnyResolverProcedureResolverpackages/server/src/unstable-core-do-not-import/procedureBuilder.ts
AnyProcedureBuilderProcedureBuilderpackages/server/src/unstable-core-do-not-import/procedureBuilder.ts
inferProcedureBuilderResolverOptionsTProcedureBuilder, ProcedureBuilder, TContext, TMeta, TContextOverrides, TInputOut, ProcedureResolverOptions, UnsetMarker, Simplify, Extrapackages/server/src/unstable-core-do-not-import/procedureBuilder.ts
ProcedureBuilderResolverProcedureResolverOptionspackages/server/src/unstable-core-do-not-import/procedureBuilder.ts
JSONLContentType—packages/server/src/unstable-core-do-not-import/rootConfig.ts
CreateRootTypesTGenericspackages/server/src/unstable-core-do-not-import/rootConfig.ts
AnyRootTypesCreateRootTypespackages/server/src/unstable-core-do-not-import/rootConfig.ts
PartialIfTCondition, TTypepackages/server/src/unstable-core-do-not-import/rootConfig.ts
DecorateProcedureTProcedure, LegacyObservableSubscriptionProcedure, Observable, TRPCErrorpackages/server/src/unstable-core-do-not-import/router.ts
DecorateRouterRecordTKey, TRecord, Value, AnyProcedure, DecorateProcedure, RouterRecord, DecorateRouterRecordpackages/server/src/unstable-core-do-not-import/router.ts
RouterCallerErrorHandlerErrorHandlerOptions, TContextpackages/server/src/unstable-core-do-not-import/router.ts
RouterCallerIf, React, TRoot, MaybePromise, RouterCallerErrorHandlerpackages/server/src/unstable-core-do-not-import/router.ts
LazyTAnypackages/server/src/unstable-core-do-not-import/router.ts
LazyLoader—packages/server/src/unstable-core-do-not-import/router.ts
BuiltRouterRouter, TRoot, TRecordpackages/server/src/unstable-core-do-not-import/router.ts
AnyRouterRouterpackages/server/src/unstable-core-do-not-import/router.ts
inferRouterRootTypesTRouterpackages/server/src/unstable-core-do-not-import/router.ts
inferRouterContextTRouterpackages/server/src/unstable-core-do-not-import/router.ts
inferRouterErrorTRouterpackages/server/src/unstable-core-do-not-import/router.ts
inferRouterMetaTRouterpackages/server/src/unstable-core-do-not-import/router.ts
CreateRouterOptionsAnyProcedure, AnyRouter, CreateRouterOptions, Lazypackages/server/src/unstable-core-do-not-import/router.ts
DecorateCreateRouterOptionsK, TRouterOptions, Value, AnyProcedure, Router, TRecord, Lazy, CreateRouterOptions, DecorateCreateRouterOptionspackages/server/src/unstable-core-do-not-import/router.ts
ContextTRootpackages/server/src/unstable-core-do-not-import/router.ts
MergeRoutersTRouters, Head, AnyRouter, Tail, MergeRouters, TRoot, TRecord, BuiltRouterpackages/server/src/unstable-core-do-not-import/router.ts
CombinedDataTransformerClientCombinedDataTransformerpackages/server/src/unstable-core-do-not-import/transformer.ts
DataTransformerOptionsCombinedDataTransformer, DataTransformerpackages/server/src/unstable-core-do-not-import/transformer.ts
MaybeTTypepackages/server/src/unstable-core-do-not-import/types.ts
SimplifyTType, Kpackages/server/src/unstable-core-do-not-import/types.ts
DictTTypepackages/server/src/unstable-core-do-not-import/types.ts
MaybePromiseTTypepackages/server/src/unstable-core-do-not-import/types.ts
FilterKeysTKey, TObj, TFilterpackages/server/src/unstable-core-do-not-import/types.ts
Result—packages/server/src/unstable-core-do-not-import/types.ts
FilterTObj, FilterKeys, TFilterpackages/server/src/unstable-core-do-not-import/types.ts
UnwrapTType, R, Awaitedpackages/server/src/unstable-core-do-not-import/types.ts
DeepPartialTObject, P, DeepPartialpackages/server/src/unstable-core-do-not-import/types.ts
DistributiveOmitTObj, TKeypackages/server/src/unstable-core-do-not-import/types.ts
WithoutIndexSignatureK, TObjpackages/server/src/unstable-core-do-not-import/types.ts
OverwriteTWith, TType, K, Exclude, WithoutIndexSignaturepackages/server/src/unstable-core-do-not-import/types.ts
ValidateShapeTActualShape, TExpectedShape, Excludepackages/server/src/unstable-core-do-not-import/types.ts
PickFirstDefinedTType, TPickpackages/server/src/unstable-core-do-not-import/types.ts
IntersectionErrorThe, TKeypackages/server/src/unstable-core-do-not-import/types.ts
ProtectedIntersectionTType, TWith, IntersectionErrorpackages/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
TypeErrorTMessagepackages/server/src/unstable-core-do-not-import/types.ts
ValueOfTObjpackages/server/src/unstable-core-do-not-import/types.ts
coerceAsyncIterableToArrayTValue, AsyncIterable, Inferredpackages/server/src/unstable-core-do-not-import/types.ts
inferAsyncIterableYieldT, AsyncIterable, Upackages/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
ErrorFormatterErrorFormatterOptions, TContext, TShapepackages/server/src/unstable-core-do-not-import/error/formatter.ts
ProcedureErrorFormatterErrorFormatterOptions, Simplify, Overwrite, TContext, TContextOverrides, TShapepackages/server/src/unstable-core-do-not-import/error/formatter.ts
AnyProcedureErrorFormatterProcedureErrorFormatterpackages/server/src/unstable-core-do-not-import/error/formatter.ts
DefaultErrorDataTRPC_ERROR_CODE_KEYpackages/server/src/unstable-core-do-not-import/error/formatter.ts
GetRequestInfoOptions—packages/server/src/unstable-core-do-not-import/http/contentType.ts
ContentTypeHandlerRequestpackages/server/src/unstable-core-do-not-import/http/contentType.ts
InputRecord—packages/server/src/unstable-core-do-not-import/http/contentType.ts
UtilityParserParserZodEsque, TInput, TOutputpackages/server/src/unstable-core-do-not-import/http/contentTypeParsers.ts
OctetInputBlob, Uint8Array, FileLikepackages/server/src/unstable-core-do-not-import/http/contentTypeParsers.ts
HTTPMethodsGET, POST, HEAD, OPTIONS, PUT, DELETE, PATCHpackages/server/src/unstable-core-do-not-import/http/resolveResponse.ts
ResultTupleT, TRPCErrorpackages/server/src/unstable-core-do-not-import/http/resolveResponse.ts
RPCResultResultTuple, RPCResultOkpackages/server/src/unstable-core-do-not-import/http/resolveResponse.ts
HTTPHeadersDictpackages/server/src/unstable-core-do-not-import/http/types.ts
ResponseMetaFnTRPCResponse, TRouterpackages/server/src/unstable-core-do-not-import/http/types.ts
TRPCAcceptHeader—packages/server/src/unstable-core-do-not-import/http/types.ts
ResolveHTTPRequestOptionsContextFnTRPCRequestInfo, TRouterpackages/server/src/unstable-core-do-not-import/http/types.ts
HTTPErrorHandlerHTTPErrorHandlerOptions, TRouter, TRequestpackages/server/src/unstable-core-do-not-import/http/types.ts
TRPC_ERROR_CODE_NUMBERValueOf, TRPC_ERROR_CODES_BY_KEYpackages/server/src/unstable-core-do-not-import/rpc/codes.ts
TRPC_ERROR_CODE_KEYTRPC_ERROR_CODES_BY_KEYpackages/server/src/unstable-core-do-not-import/rpc/codes.ts
RequestId—packages/server/src/unstable-core-do-not-import/rpc/envelopes.ts
TRPCResponseTRPCErrorResponse, TError, TRPCSuccessResponse, TDatapackages/server/src/unstable-core-do-not-import/rpc/envelopes.ts
TRPCRequestMessageTRPCRequest, JSONRPC2, RequestIdpackages/server/src/unstable-core-do-not-import/rpc/envelopes.ts
TRPCClientOutgoingRequestTRPCSubscriptionStopNotificationpackages/server/src/unstable-core-do-not-import/rpc/envelopes.ts
TRPCClientOutgoingMessageTRPCRequestMessage, JSONRPC2, BaseRequest, RequestIdpackages/server/src/unstable-core-do-not-import/rpc/envelopes.ts
TRPCResponseMessageJSONRPC2, RequestId, TRPCErrorResponse, TError, TRPCResultMessage, TDatapackages/server/src/unstable-core-do-not-import/rpc/envelopes.ts
TRPCClientIncomingRequestTRPCReconnectNotificationpackages/server/src/unstable-core-do-not-import/rpc/envelopes.ts
TRPCClientIncomingMessageTRPCClientIncomingRequest, TRPCResponseMessage, TResult, TErrorpackages/server/src/unstable-core-do-not-import/rpc/envelopes.ts
WebReadableStreamEsqueReadableStreamDefaultReader, Uint8Arraypackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
NodeJSReadableStreamEsqueNodeJSReadableStreamEsquepackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
CHUNK_VALUE_TYPE_PROMISECHUNK_VALUE_TYPE_PROMISEpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
CHUNK_VALUE_TYPE_ASYNC_ITERABLECHUNK_VALUE_TYPE_ASYNC_ITERABLEpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
PROMISE_STATUS_FULFILLEDPROMISE_STATUS_FULFILLEDpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
PROMISE_STATUS_REJECTEDPROMISE_STATUS_REJECTEDpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
ASYNC_ITERABLE_STATUS_RETURNASYNC_ITERABLE_STATUS_RETURNpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
ASYNC_ITERABLE_STATUS_YIELDASYNC_ITERABLE_STATUS_YIELDpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
ASYNC_ITERABLE_STATUS_ERRORASYNC_ITERABLE_STATUS_ERRORpackages/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
ChunkValueTypeCHUNK_VALUE_TYPE_PROMISE, CHUNK_VALUE_TYPE_ASYNC_ITERABLEpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
ChunkDefinitionChunkDefinitionKey, ChunkValueType, ChunkIndexpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
EncodedValueChunkDefinitionpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
HeadEncodedValuepackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
PromiseChunkChunkIndex, PROMISE_STATUS_FULFILLED, EncodedValue, PROMISE_STATUS_REJECTEDpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
IterableChunkChunkIndex, ASYNC_ITERABLE_STATUS_RETURN, EncodedValue, ASYNC_ITERABLE_STATUS_YIELD, ASYNC_ITERABLE_STATUS_ERRORpackages/server/src/unstable-core-do-not-import/stream/jsonl.ts
ChunkDataPromiseChunk, IterableChunkpackages/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
TIteratorValueAwaited, TValue, PING_SYMpackages/server/src/unstable-core-do-not-import/stream/sse.ts
ConsumerStreamResultConsumerStreamResultData, TConfig, ConsumerStreamResultError, ConsumerStreamResultConnecting, ConsumerStreamResultTimeout, ConsumerStreamResultPing, ConsumerStreamResultConnectedpackages/server/src/unstable-core-do-not-import/stream/sse.ts
EventSourceListenerLikeEventpackages/server/src/unstable-core-do-not-import/stream/sse.types.ts
AnyConstructorLikeTInit, Instancepackages/server/src/unstable-core-do-not-import/stream/sse.types.ts
AnyConstructorAnyConstructorLikepackages/server/src/unstable-core-do-not-import/stream/sse.types.ts
ListenerOfParameters, InstanceType, Tpackages/server/src/unstable-core-do-not-import/stream/sse.types.ts
EventOfParameters, ListenerOf, Tpackages/server/src/unstable-core-do-not-import/stream/sse.types.ts
InitDictOfConstructorParameters, Tpackages/server/src/unstable-core-do-not-import/stream/sse.types.ts
TrackedIdTrackedIdpackages/server/src/unstable-core-do-not-import/stream/tracked.ts
TrackedEnvelopeTrackedId, TDatapackages/server/src/unstable-core-do-not-import/stream/tracked.ts
inferTrackedOutputTData, TrackedEnvelope, Data, TrackedDatapackages/server/src/unstable-core-do-not-import/stream/tracked.ts
DeferredReturnType, TValuepackages/server/src/unstable-core-do-not-import/stream/utils/createDeferred.ts
ManagedIteratorResult—packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts
ManagedIteratorReturnType, TYield, TReturnpackages/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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Dependency Graph

Engineers · Module dependency analysis with cycle detection

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

MetricValue
Source files73
Import edges146
External packages3
Circular dependencies0
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:

ModuleImported By
packages/server/src/unstable-core-do-not-import/utils16 files
packages/server/src/unstable-core-do-not-import/error/TRPCError8 files
packages/server/src/unstable-core-do-not-import7 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Architecture Drift

Mixed audience · Structural changes compared to baseline snapshot

No baseline found. Run repolens publish once 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:

DimensionWhat is Tracked
ModulesNew, removed, or significantly resized modules
API EndpointsAdded or removed backend routes
DependenciesChanges to external package imports
FrameworksTechnology stack additions or removals
Circular DependenciesIncreases in dependency cycles
GraphQL SchemaType additions or removals
Codebase ScaleOverall file count changes

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Security Hotspots

Engineers · Security anti-pattern detection with CWE classification

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

SeverityCount
🔵 Low5

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.

FileLinePatternSeverityCWE
packages/server/src/unstable-core-do-not-import/router.ts249Recursive object merge without prototype check🔵 LowCWE-1321
packages/server/src/unstable-core-do-not-import/router.ts257Recursive object merge without prototype check🔵 LowCWE-1321
packages/server/src/unstable-core-do-not-import/utils.ts14Recursive object merge without prototype check🔵 LowCWE-1321
packages/server/src/unstable-core-do-not-import/error/TRPCError.ts9Recursive object merge without prototype check🔵 LowCWE-1321
packages/server/src/unstable-core-do-not-import/stream/jsonl.ts457Recursive object merge without prototype check🔵 LowCWE-1321

Affected Files

  • packages/server/src/unstable-core-do-not-import/router.ts
  • packages/server/src/unstable-core-do-not-import/utils.ts
  • packages/server/src/unstable-core-do-not-import/error/TRPCError.ts
  • packages/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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples

Code Health Report

Mixed audience · Per-module health scores from complexity, coupling, docs, and security

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

MetricValue
Files analyzed73
Average health score89/100
Average complexity13
Hotspots (score < 60)8

Grade Distribution

GradeCountMeaning
🟢 A (80–100)58Healthy — low complexity, well-documented
🔵 B (60–79)7Acceptable — minor improvements possible
🟡 C (40–59)7Needs attention — elevated complexity or coupling
🟠 D (20–39)1At risk — multiple quality signals degraded
🔴 F (0–19)0Critical — immediate refactoring recommended

Hotspots — Priority Refactoring Targets

These modules have the lowest health scores and should be prioritized for improvement:

ModuleScoreGradeComplexityCouplingDoc%Security
packages/server/src/unstable-core-do-not-import/http/contentType.ts36🟠 D372↓ 4↑0%—
packages/server/src/adapters/aws-lambda/getPlanner.ts45🟡 C431↓ 0↑——
packages/server/src/adapters/ws.ts45🟡 C501↓ 6↑100%—
packages/server/src/unstable-core-do-not-import/router.ts45🟡 C573↓ 5↑100%2 (0 high)
packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts45🟡 C811↓ 9↑——
packages/server/src/unstable-core-do-not-import/stream/jsonl.ts45🟡 C642↓ 7↑50%1 (0 high)
packages/server/src/unstable-core-do-not-import/procedureBuilder.ts56🟡 C552↓ 5↑——
packages/server/src/unstable-core-do-not-import/clientish/serialize.ts59🟡 C321↓ 0↑——

Most Complex Functions

These functions have the highest cyclomatic complexity and are the most likely sources of bugs:

FunctionFileLineComplexity
isDataStream()packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts23947
getHeadersAndCookiesFromResponse()packages/server/src/adapters/aws-lambda/getPlanner.ts4639
handleRequest()packages/server/src/adapters/ws.ts20734
hasContentType()packages/server/src/unstable-core-do-not-import/http/contentType.ts9321
abortOnCancel()packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts7018
onAbort()packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts58617
initIterable()packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts10017
createCaller()packages/server/src/unstable-core-do-not-import/router.ts45816
getDataTransformer()packages/server/src/unstable-core-do-not-import/transformer.ts7013
decodeChunkDefinition()packages/server/src/unstable-core-do-not-import/stream/jsonl.ts54213
resetIfNeeded()packages/server/src/observable/operators.ts6312
createInnerProxy()packages/server/src/unstable-core-do-not-import/createProxy.ts1912
getTRPCErrorFromUnknown()packages/server/src/unstable-core-do-not-import/error/TRPCError.ts5912
handleError()packages/server/src/adapters/next-app-dir/nextAppDirCaller.ts6411
getLastEventId()packages/server/src/unstable-core-do-not-import/http/contentType.ts2011

All Modules by Health Score

Showing 50 of 73 modules (sorted worst-first)

ModuleScoreGradeLinesComplexityFan-InFan-Out
packages/server/src/unstable-core-do-not-import/http/contentType.ts36🟠 D3363724
packages/server/src/adapters/aws-lambda/getPlanner.ts45🟡 C2544310
packages/server/src/adapters/ws.ts45🟡 C6465016
packages/server/src/unstable-core-do-not-import/router.ts45🟡 C5745735
packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts45🟡 C8328119
packages/server/src/unstable-core-do-not-import/stream/jsonl.ts45🟡 C6626427
packages/server/src/unstable-core-do-not-import/procedureBuilder.ts56🟡 C7715525
packages/server/src/unstable-core-do-not-import/clientish/serialize.ts59🟡 C1463210
packages/server/src/unstable-core-do-not-import/stream/sse.ts60🔵 B4864529
packages/server/src/unstable-core-do-not-import/error/TRPCError.ts69🔵 B1042381
packages/server/src/unstable-core-do-not-import/types.ts72🔵 B1852310
packages/server/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts75🔵 B1972012
packages/server/src/adapters/node-http/incomingMessageToRequest.ts76🔵 B1992720
packages/server/src/unstable-core-do-not-import/initTRPC.ts78🔵 B2261716
packages/server/src/unstable-core-do-not-import/parser.ts79🔵 B1411620
packages/server/src/unstable-core-do-not-import.ts85🟢 A471733
packages/server/src/observable/operators.ts85🟢 A1621711
packages/server/src/unstable-core-do-not-import/utils.ts85🟢 A12215160
packages/server/src/unstable-core-do-not-import/middleware.ts86🟢 A3362434
packages/server/src/adapters/next-app-dir/nextAppDirCaller.ts87🟢 A1361713
packages/server/src/unstable-core-do-not-import/transformer.ts87🟢 A1921341
packages/server/src/unstable-core-do-not-import/createProxy.ts89🟢 A1021321
packages/server/src/adapters/standalone.ts90🟢 A122402
packages/server/src/adapters/next-app-dir/rethrowNextErrors.ts90🟢 A691821
packages/server/src/unstable-core-do-not-import/http/abortError.ts90🟢 A12231
packages/server/src/unstable-core-do-not-import/http/formDataToObject.ts90🟢 A48911
packages/server/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts90🟢 A99832
packages/server/src/unstable-core-do-not-import/http/parseConnectionParams.ts90🟢 A50622
packages/server/src/unstable-core-do-not-import/stream/utils/timerResource.ts90🟢 A30331
packages/server/src/observable/observable.ts92🟢 A2071640
packages/server/src/unstable-core-do-not-import/rootConfig.ts94🟢 A1541430
packages/server/src/unstable-core-do-not-import/error/formatter.ts95🟢 A135752
packages/server/src/adapters/fetch/fetchRequestHandler.ts96🟢 A811010
packages/server/src/unstable-core-do-not-import/http/types.ts96🟢 A1731010
packages/server/src/unstable-core-do-not-import/clientish/inference.ts98🟢 A72910
packages/server/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts98🟢 A891212
packages/server/src/adapters/node-http/writeResponse.ts99🟢 A1021111
packages/server/src/adapters/aws-lambda/index.ts100🟢 A115101
packages/server/src/adapters/express.ts100🟢 A49202
packages/server/src/adapters/next-app-dir.ts100🟢 A8104
packages/server/src/adapters/next.ts100🟢 A70402
packages/server/src/adapters/wsEncoder.ts100🟢 A36210
packages/server/src/adapters/fastify/fastifyRequestHandler.ts100🟢 A82221
packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts100🟢 A92812
packages/server/src/adapters/fastify/index.ts100🟢 A3102
packages/server/src/adapters/fetch/index.ts100🟢 A3102
packages/server/src/adapters/fetch/types.ts100🟢 A54110
packages/server/src/adapters/next-app-dir/notFound.ts100🟢 A13110
packages/server/src/adapters/next-app-dir/redirect.ts100🟢 A31330
packages/server/src/adapters/node-http/index.ts100🟢 A4153

Scoring Methodology

The health score (0–100) is computed from four dimensions:

FactorWeightHow It's Measured
Complexity–1/pt above 10, –2/pt above 30Cyclomatic complexity for JavaScript/TypeScript, Python, and Go (regex, not AST)
Function complexity–2/pt above 8 per functionHighest complexity function in the file
Coupling–1/5 units above 20Fan-in × Fan-out (import connections)
Documentation–10 if <50%, –5 if <80%JSDoc/TSDoc coverage of exports
Security–10/high, –5/medium findingSecurity 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) · Examples