Output Structure

Typeweaver generates a folder of artifacts, not just one SDK file. The exact output depends on the plugins you enable, but the structure stays predictable enough that you can quickly find what you need.

A typical generated folder

api/generated/
├── index.ts
├── todo/
│   ├── GetTodoRequest.ts
│   ├── GetTodoRequestCommand.ts
│   ├── GetTodoRequestValidator.ts
│   ├── GetTodoResponse.ts
│   ├── GetTodoResponseValidator.ts
│   ├── TodoClient.ts
│   └── TodoRouter.ts
├── responses/
│   ├── GetTodoSuccessResponse.ts
│   └── TodoNotFoundErrorResponse.ts
└── lib/
    ├── clients/
    ├── server/
    └── types/

You may also see plugin-specific output such as TodoHono.ts when you enable the hono plugin.

How to think about the folders

Resource folders

Folders like todo/ contain the operation-specific files you touch most often.

That usually includes:

  • request types
  • request commands
  • request validators
  • response unions
  • response validators
  • resource clients
  • resource server artifacts

If you are working on GetTodo, this is usually the first folder to open.

Shared responses

The responses/ folder contains named response artifacts that can be reused across operations.

This is where response-specific types and factory functions usually live, such as:

  • IGetTodoSuccessResponse
  • ITodoNotFoundErrorResponse
  • createGetTodoSuccessResponse(...)

Think of this folder as the shared catalog of concrete response shapes.

lib helpers

The lib/ folder contains runtime helpers that generated files build on top of.

You usually do not read every file in lib/, but it is useful to know what lives there:

  • lib/clients supports generated request commands and clients
  • lib/server supports the dependency-free server path, middleware helpers, and the nodeAdapter for Node.js http.createServer compatibility
  • lib/types supports validators and generated type-aware utilities

Most application code imports from the generated root or resource folders, not directly from deep internal files.

The files most users touch

In day-to-day usage, most teams mainly work with:

  • <ResourceName>Client
  • <OperationId>RequestCommand
  • <OperationId>Request and <OperationId>Response types
  • response factory functions such as createGetTodoSuccessResponse(...)
  • generated server artifacts such as <ResourceName>Router or <ResourceName>Hono

You do not need to memorize the entire tree. Find the resource folder, then follow the operation name.

What changes when you enable different plugins

The base generated output already includes types and validators. Plugins add more runtime-facing artifacts on top.

  • clients adds generated clients and request commands
  • server adds dependency-free server routers and server helpers
  • hono adds generated Hono routers

So the shape stays familiar even as the output grows.

Was this page helpful?