Skip to content

Releases: liorcodev/trpc-docs-generator

Release v0.9.0: Fixed Node.js Native ESM Compatibility / Added SuperJSON Transformer Support

08 Apr 23:41

Choose a tag to compare

[0.9.0] - 2026-04-09

Added

  • SuperJSON Transformer Support - The test playground now fully supports tRPC routers using the
    superjson transformer. Configure with generateDocsHtml(routes, { transformer: 'superjson' })
    to automatically:
    • Wrap request inputs in { json: ... } format expected by superjson
    • Unwrap response data from { result: { data: { json: ... } } } structure
    • Enable seamless testing of endpoints that return Date objects, undefined, BigInt, Map,
      Set, and other non-JSON types
    • See the new "SuperJSON Support" section in README for complete usage guide

Fixed

  • Node.js Native ESM Compatibility - Package now works correctly with Node.js native ESM
    resolution (Node 16+, Node 22+):
    • All relative imports now include explicit .js file extensions as required by the ECMAScript
      spec
    • Updated TypeScript config to use "moduleResolution": "node16" and "module": "Node16" for
      proper ESM compliance
    • Resolves ERR_MODULE_NOT_FOUND errors when importing the package without a bundler
    • Fully backward compatible with existing bundler-based workflows (Vite, webpack, Rollup, etc.)

Release v0.8.0: UI Refresh with Scroll‑to‑Top, Mobile Topbar & Sidebar Updates

04 Apr 17:40

Choose a tag to compare

[0.8.0] - 2026-04-04

Added

  • Scroll-to-Top Button - A floating button appears on the page to quickly scroll back to the top
  • Mobile Top Bar - Redesigned mobile navigation with a topbar showing the docs title and a
    config button alongside the menu toggle
  • Sidebar Brand & Footer - Sidebar now displays the docs title as a brand label in the header
    and a GitHub link in a new footer section
  • Type Indicator Dots - Sidebar links now show a colored dot indicating the procedure type
    (query/mutation) at a glance
  • Header Pill Badge - The main header subtitle uses a styled "tRPC" pill badge for a cleaner
    look
  • __internal Exports - Internal helper functions are now exported under __internal from
    collect-routes.ts to support white-box unit testing

Changed

  • UI Design Refresh - Comprehensive CSS update introducing a unified --brand-* color token
    system, refined button styles, improved spacing, and updated font stacks across all components
  • Search Filter Bar - Moved outside the <header> element for better layout flow; results count
    and clear-filters button reordered within the controls area

Release v0.7.0: Added Search & Filter System

15 Mar 02:02

Choose a tag to compare

[0.7.0] - 2026-03-15

Added

  • Search & Filter System - Find endpoints quickly with powerful filtering capabilities:
    • Real-time Search - Instantly filter endpoints by name, path, description, or tags as you
      type (300ms debounce)
    • Type Filter - Filter by procedure type (All Types / Queries / Mutations)
    • Auth Filter - Show only public or protected endpoints
    • Tag Filter - Filter by custom tags from route metadata
    • Active Filter Highlighting - Selected filters are highlighted in blue for clear visual
      feedback
    • Filter Persistence - All filter states are automatically saved to localStorage and restored
      on page reload
    • Clear Filters Button - One-click reset with red highlighting when filters are active
    • Dynamic Results Counter - Shows "Showing X of Y endpoints" based on active filters
    • Smart UI Updates - Automatically hides empty route groups and sidebar sections when filtered

Release v0.6.1: Fixed 'meta.name' not rendered in UI

26 Feb 07:28

Choose a tag to compare

[0.6.1] - 2026-02-26

Fixed

  • meta.name not rendered in UI - The name field from route metadata was never displayed in
    the generated documentation. It now appears as a title in the route card header, with the path
    shown beneath it as a secondary label. The sidebar also uses the name when available, falling back
    to the path segment.

Release v0.6.0: Breaking Changes - RouteMeta type restructured

25 Feb 07:04

Choose a tag to compare

[0.6.0] - 2026-02-25

Breaking Changes

  • RouteMeta type restructured - The docs metadata fields (description, tags,
    deprecated, auth, roles) must now be nested under a docs sub-object. The previous flat
    shape was inconsistent with how the HTML generator read the metadata, meaning those fields were
    silently ignored in the generated documentation.

    Before (broken - fields were silently ignored):

    t.procedure.meta({
      name: 'Get User',
      description: 'Fetch a user by ID', // ❌ never rendered
      tags: ['Users'], // ❌ never rendered
      auth: true // ❌ never rendered
    });

    After (correct):

    t.procedure.meta({
      name: 'Get User',
      docs: {
        description: 'Fetch a user by ID', // ✅
        tags: ['Users'], // ✅
        auth: true // ✅
      }
    });

    name remains at the top level of RouteMeta. All other documentation fields move under docs.

Release v0.5.2: Fixed z.date() / z.coerce.date() crash

24 Feb 13:30

Choose a tag to compare

[0.5.2] - 2026-02-24

Fixed

  • z.date() / z.coerce.date() crash - Fixed a bug where procedures that used Zod date schemas
    caused schema conversion to throw "Transforms cannot be represented in JSON Schema", resulting
    in no documentation being generated for those routes
    • z.date() and z.coerce.date() fields are now correctly represented as
      { type: "string", format: "date-time" } in the generated JSON Schema, matching the ISO 8601
      strings that tRPC transports over the wire
    • Example values for date fields are rendered as a realistic ISO timestamp (e.g.
      "2024-01-01T00:00:00.000Z") instead of the generic "string" placeholder
    • Other normally unrepresentable types (transforms, functions) now fall back gracefully to an
      unconstrained schema instead of hard-crashing

Release v0.5.1: Fixed z.record() schema display

28 Jan 09:30

Choose a tag to compare

[0.5.1] - 2026-01-28

Fixed

  • z.record() schema display - Fixed issue where z.record(z.string(), z.string()) and other
    record schemas were incorrectly displayed as {} in both TypeScript types and JSON examples
    • Now properly generates Record<string, string> TypeScript notation
    • Generates sample JSON examples like { "key": "string" }
    • Supports all record value types (primitives, objects, arrays, etc.)
    • Root cause: Zod's toJSONSchema() converts records using additionalProperties instead of
      properties, which wasn't being handled

Release v0.5.0: First release

22 Jan 18:50

Choose a tag to compare

[0.5.0] - 2026-01-22

Added

🧪 Interactive API Testing (Killer Feature)

  • Live endpoint testing - Test APIs directly from documentation with real fetch requests
  • Smart request builder with pre-filled JSON from schemas (required fields only)
  • Optional fields manager - Click-to-add badges for optional parameters
  • Custom header management - Add auth tokens, content-type, custom headers
  • Header persistence - Save/load common headers (localStorage)
  • Auto-method detection - GET for queries, POST for mutations
  • Real-time response display - Formatted JSON with syntax highlighting
  • Status indicators - Visual success/error badges
  • Debug information - Full request details on errors (URL, headers, body)
  • Configurable endpoint URL - Point to localhost, staging, or production

📚 Documentation Generation

  • Core functionality for automatic tRPC documentation generation
  • collectRoutes() function for router traversal and route extraction
  • generateDocsHtml() function for beautiful HTML documentation generation
  • Automatic schema extraction from Zod validators via toJSONSchema() method
  • Smart TypeScript type generation from JSON schemas
  • JSON example generation with realistic data
  • Optional field detection and documentation
  • Support for complex Zod schemas:
    • Objects with nested properties
    • Arrays and tuples
    • Unions (oneOf/anyOf)
    • Intersections (allOf)
    • Enums and literals
    • Optional and required fields

Features

Route Metadata Support

  • Route names and descriptions
  • Tag-based grouping
  • Authentication requirement indicators
  • Role-based access control badges
  • Deprecation warnings

Modern UI Components

  • Responsive design (mobile, tablet, desktop)
  • Sidebar navigation with smooth scrolling
  • Expandable route cards with detailed information
  • Visual procedure type badges (query/mutation/subscription)
  • Authentication and role badges
  • Syntax-highlighted code blocks
  • Smooth animations and transitions
  • Professional glassmorphism effects
  • Statistics overview with route counts

Developer Experience

  • Full TypeScript support with type definitions
  • Zero configuration required
  • Works with any tRPC v11 router
  • Deploy anywhere (Express, Next.js, Cloudflare Workers, etc.)
  • Self-contained HTML output (no external dependencies)

🔌 Fetch Logic & API Communication

  • Native Fetch API integration - Direct HTTP requests to tRPC endpoints
  • Automatic method selection - GET for queries, POST for mutations
  • Query parameter serialization - Automatic input encoding for GET requests
  • Request body handling - JSON serialization for POST requests
  • Response parsing - Smart content-type detection and JSON parsing
  • Error handling - Comprehensive error catching and user feedback
  • Base URL configuration - Configurable endpoint with localStorage persistence
    • Modal-based configuration UI with validation
    • Full URL validation (requires protocol http:// or https://)
    • Helpful hints about including mount path (e.g., /trpc)
    • CORS troubleshooting guidance - Warns about host matching (localhost vs 127.0.0.1)
    • Persistent storage across sessions
    • Visual button state shows when configured
  • Header management - Custom headers support with persistence
  • Loading states - Visual feedback during request lifecycle
  • Debug information - Full request details displayed on errors