Skip to content

Conversation

@unnoq
Copy link
Member

@unnoq unnoq commented Jun 27, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new package, @orpc/trpc, enabling integration between oRPC and tRPC applications.
    • Added comprehensive documentation for integrating oRPC with tRPC, including installation, usage, error handling, and OpenAPI support.
    • Enhanced documentation site navigation with new sidebar links to the tRPC integration guide.
  • Tests

    • Added extensive tests to verify type transformations and runtime behavior of the tRPC-to-oRPC router conversion.
  • Chores

    • Added configuration, README, and .gitignore files to support development and publishing of the new package.

@vercel
Copy link

vercel bot commented Jun 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2025 2:36pm

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jun 27, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 27, 2025

Walkthrough

This change introduces a new @orpc/trpc package that provides an experimental bridge between tRPC routers and oRPC routers. It includes implementation code, type-level and runtime tests, documentation, and configuration files. The documentation and site configuration are updated to reference the new tRPC integration, and supporting files such as .gitignore and package.json are added.

Changes

Files/Groups Change Summary
apps/content/.vitepress/config.ts Added sidebar entries for tRPC integration in documentation navigation.
apps/content/docs/openapi/integrations/trpc.md Added documentation for integrating oRPC with tRPC, including usage, error handling, and schema conversion instructions.
packages/trpc/.gitignore, packages/trpc/README.md, packages/trpc/package.json, packages/trpc/tsconfig.json Added package metadata, ignore rules, README, and TypeScript configuration for the new @orpc/trpc package.
packages/trpc/src/to-orpc-router.ts Implemented experimental conversion utility to transform tRPC routers to oRPC routers, including error mapping and lazy loading.
packages/trpc/src/to-orpc-router.test.ts Added runtime tests for the tRPC to oRPC router conversion, covering procedure calls, schema validation, and error handling.
packages/trpc/src/to-orpc-router.test-d.ts Added type-level tests to verify type transformations and typings of the converted routers and procedures.
packages/trpc/tests/shared.ts Added shared test setup defining a sample tRPC router with various procedures, metadata, and lazy loading for use in tests.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant tRPCRouter
    participant toORPCRouter
    participant ORPCRouter

    App->>tRPCRouter: Define router with procedures and metadata
    App->>toORPCRouter: Call experimental_toORPCRouter(tRPCRouter)
    toORPCRouter->>tRPCRouter: Traverse procedures and sub-routers
    toORPCRouter->>ORPCRouter: Convert each procedure and metadata
    toORPCRouter-->>App: Return ORPCRouter
    App->>ORPCRouter: Use router (procedures, OpenAPI, etc.)
Loading

Possibly related PRs

  • unnoq/orpc#219: Introduces an unlazyRouter utility to recursively unwrap lazy routers, related to lazy router handling alongside the toORPCRouter conversion utility in this PR.

Poem

In the warren where code and types meet,
A bridge was built—tRPC to oRPC, neat!
Routers now hop from one world to the next,
With schemas and errors all nicely indexed.
Tests and docs bloom, as rabbits rejoice—
Integration made easy, with a hop and a choice!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @unnoq, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new @orpc/trpc package that allows developers to convert existing tRPC routers into oRPC routers. This conversion enables the use of oRPC's features, such as OpenAPI specification generation and request handling, within tRPC applications. The pull request also includes documentation to guide users through the integration process.

Highlights

  • tRPC to oRPC Conversion: Introduces a function to convert tRPC routers to oRPC routers, enabling the use of oRPC features like OpenAPI specification generation and request handling in tRPC applications.
  • Documentation: Adds documentation on how to integrate oRPC with tRPC, including installation instructions, OpenAPI support, and error formatting.
  • Package Creation: Creates a new @orpc/trpc package to bridge tRPC and oRPC functionality.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

Attention: Patch coverage is 97.80220% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/trpc/src/to-orpc-router.ts 97.80% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 27, 2025

More templates

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@699

@orpc/client

npm i https://pkg.pr.new/@orpc/client@699

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@699

@orpc/experimental-durable-event-iterator

npm i https://pkg.pr.new/@orpc/experimental-durable-event-iterator@699

@orpc/hey-api

npm i https://pkg.pr.new/@orpc/hey-api@699

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@699

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@699

@orpc/openapi-client

npm i https://pkg.pr.new/@orpc/openapi-client@699

@orpc/react

npm i https://pkg.pr.new/@orpc/react@699

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@699

@orpc/server

npm i https://pkg.pr.new/@orpc/server@699

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@699

@orpc/solid-query

npm i https://pkg.pr.new/@orpc/solid-query@699

@orpc/standard-server

npm i https://pkg.pr.new/@orpc/standard-server@699

@orpc/standard-server-aws-lambda

npm i https://pkg.pr.new/@orpc/standard-server-aws-lambda@699

@orpc/standard-server-fetch

npm i https://pkg.pr.new/@orpc/standard-server-fetch@699

@orpc/standard-server-node

npm i https://pkg.pr.new/@orpc/standard-server-node@699

@orpc/standard-server-peer

npm i https://pkg.pr.new/@orpc/standard-server-peer@699

@orpc/svelte-query

npm i https://pkg.pr.new/@orpc/svelte-query@699

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@699

@orpc/trpc

npm i https://pkg.pr.new/@orpc/trpc@699

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@699

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@699

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@699

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@699

commit: 4fa2e60

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new @orpc/trpc package that bridges tRPC and oRPC, allowing the conversion of tRPC routers to oRPC routers. The changes include adding a new documentation page, updating package dependencies, and implementing the core conversion logic in to-orpc-router.ts. The review focuses on improving the clarity of route assignment and enhancing error handling by preserving stack traces.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
packages/trpc/.gitignore (1)

1-5: Over-broad “dot-file” ignore may hide wanted config

.* ignores every hidden file except .gitignore / .*.example.
That will unintentionally hide useful project files such as:

  • .npmrc – registry auth / config
  • .eslintrc, .prettierrc – linter & formatter rules
  • .pnp.* – Yarn PnP

Consider whitelisting the config files you do want committed instead of a blanket ignore:

 .*           # current – too broad
+.*           # keep default
+!.npmrc
+!.eslintrc*
+!.prettierrc*
+!.pnp.*
packages/trpc/README.md (1)

1-6: Invalid HTML tag <image> — switch to standard <img>

GitHub markdown does not recognise <image>; the logo will not render.

-<image align="center" src="https://orpc.unnoq.com/logo.webp" width=280 alt="oRPC logo" />
+<img align="center" src="https://orpc.unnoq.com/logo.webp" width="280" alt="oRPC logo" />

You can also remove the empty <h1></h1> which adds useless vertical space.

apps/content/docs/openapi/integrations/trpc.md (1)

80-97: 404 fallback example slightly misleading

handler.handle() already returns { matched: boolean; response?: Response }.
When matched is false, response is undefined. The example ignores matched; you can simplify:

-const { matched, response } = await handler.handle(request, { … })
-
-return response ?? new Response('Not Found', { status: 404 })
+const { response } = await handler.handle(request, { … })
+return response ?? new Response('Not Found', { status: 404 })

Or log matched for debugging.

packages/trpc/src/to-orpc-router.ts (1)

7-41: Consider documenting the experimental status of the API.

All exported APIs are prefixed with experimental_, indicating they may change in future versions. Consider adding JSDoc comments to warn users about the unstable nature of these APIs.

+/**
+ * @experimental This API is experimental and may change in future versions.
+ */
 export interface experimental_ORPCMeta extends ORPC.Route {

 }

+/**
+ * @experimental This API is experimental and may change in future versions.
+ */
 export type experimental_ToORPCRouterResult<TContext extends ORPC.Context, TMeta extends ORPC.Meta, TRecord extends Record<string, any>>

+/**
+ * @experimental This API is experimental and may change in future versions.
+ * Converts a tRPC router to an ORPC-compatible router.
+ */
 export function experimental_toORPCRouter<T extends AnyRouter>(
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f4a918 and c681275.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • apps/content/.vitepress/config.ts (2 hunks)
  • apps/content/docs/openapi/integrations/trpc.md (1 hunks)
  • packages/trpc/.gitignore (1 hunks)
  • packages/trpc/README.md (1 hunks)
  • packages/trpc/package.json (1 hunks)
  • packages/trpc/src/to-orpc-router.test-d.ts (1 hunks)
  • packages/trpc/src/to-orpc-router.test.ts (1 hunks)
  • packages/trpc/src/to-orpc-router.ts (1 hunks)
  • packages/trpc/tests/shared.ts (1 hunks)
  • packages/trpc/tsconfig.json (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (4)
packages/trpc/src/to-orpc-router.test-d.ts (3)
packages/trpc/tests/shared.ts (3)
  • trpcRouter (14-65)
  • TRPCMeta (7-10)
  • TRPCContext (6-6)
packages/server/src/router.ts (2)
  • Router (12-17)
  • InferRouterInitialContext (21-23)
packages/server/src/procedure.ts (1)
  • Procedure (55-71)
packages/trpc/src/to-orpc-router.test.ts (6)
packages/trpc/tests/shared.ts (1)
  • trpcRouter (14-65)
packages/server/src/procedure.ts (1)
  • isProcedure (75-87)
packages/server/src/lazy.ts (1)
  • unlazy (42-44)
packages/contract/tests/shared.ts (2)
  • inputSchema (6-6)
  • outputSchema (8-8)
packages/shared/src/iterator.ts (1)
  • isAsyncIteratorObject (4-10)
packages/server/src/router-client.ts (1)
  • createRouterClient (27-69)
packages/trpc/tests/shared.ts (1)
packages/contract/tests/shared.ts (2)
  • inputSchema (6-6)
  • outputSchema (8-8)
packages/trpc/src/to-orpc-router.ts (4)
packages/server/src/context.ts (1)
  • Context (1-1)
packages/server/src/procedure.ts (2)
  • AnyProcedure (73-73)
  • Procedure (55-71)
packages/server/src/router.ts (1)
  • AnyRouter (19-19)
packages/shared/src/object.ts (1)
  • isTypescriptObject (44-46)
🪛 LanguageTool
packages/trpc/README.md

[misspelling] ~33-~33: Possible spelling mistakes found.
Context: ...y (React, Vue, Solid, Svelte, Angular), Pinia Colada, and more. - 🚀 Server Actions: Ful...

(EN_MULTITOKEN_SPELLING_TWO)


[style] ~51-~51: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... your API or implement API contract. - [@orpc/client](https://www.npmjs.com/package/@...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~52-~52: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... API on the client with type-safety. - [@orpc/openapi](https://www.npmjs.com/package/...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~53-~53: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...I specs and handle OpenAPI requests. - [@orpc/nest](https://www.npmjs.com/package/@or...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~54-~54: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... with NestJS. - [@orpc/react](https://www.npmjs.com/package/@o...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~55-~55: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...with React and React Server Actions. - [@orpc/tanstack-query](https://www.npmjs.com/p...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...stack.com/query/latest) integration. - [@orpc/vue-colada](https://www.npmjs.com/packa...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[misspelling] ~56-~56: Possible spelling mistakes found.
Context: ...ge/@orpc/vue-colada): Integration with Pinia Colada. - [@or...

(EN_MULTITOKEN_SPELLING_TWO)


[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ada](https://pinia-colada.esm.dev/). - [@orpc/hey-api](https://www.npmjs.com/package/...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~58-~58: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...I](https://heyapi.dev/) integration. - [@orpc/zod](https://www.npmjs.com/package/@orp...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~59-~59: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tps://zod.dev/) doesn't support yet. - [@orpc/valibot](https://www.npmjs.com/package/...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~60-~60: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...rom Valibot. - [@orpc/arktype](https://www.npmjs.com/package/...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🪛 markdownlint-cli2 (0.17.2)
packages/trpc/README.md

70-70: Images should have alternate text (alt text)
null

(MD045, no-alt-text)

🪛 GitHub Check: codecov/patch
packages/trpc/src/to-orpc-router.ts

[warning] 105-106: packages/trpc/src/to-orpc-router.ts#L105-L106
Added lines #L105 - L106 were not covered by tests

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: publish-commit
  • GitHub Check: lint
🔇 Additional comments (10)
packages/trpc/tsconfig.json (1)

1-15: Type-checking options inherited — confirm composite & declaration outputs are enabled

The file only sets extends, references, include, and exclude.
If the parent ../../tsconfig.lib.json does not enable compilerOptions.composite: true and output destinations (declaration, declarationMap, outDir), the build with tsc -b will fail to emit or reference artefacts for the packages you list under references.

Please double-check that the base config already contains:

{
  "compilerOptions": {
    "composite": true,
    "declaration": true,
    "declarationMap": true
  }
}

and that it places the emitted files outside src (otherwise they are picked up again by this project).

If the base config does include them, you’re good to go.
Otherwise add an override block here.

apps/content/.vitepress/config.ts (2)

158-163: Duplicated sidebar entry & cross-section link target

You add the new item under the regular docs sidebar:

{ text: 'tRPC', link: '/docs/openapi/integrations/trpc' },

The same link is also added in the OpenAPI sidebar (↓ line 225).
Showing the OpenAPI page inside the non-OpenAPI docs tree can be confusing and may create two active-match states.

Confirm this is intentional; otherwise point /docs/… to a dedicated intro page (or omit).


223-227: Side-by-side ordering looks good

The OpenAPI subsection gets the tRPC entry in the expected alphabetical position – no issues.

packages/trpc/README.md (1)

30-41: Minor spelling & repetition flagged by linter – low priority

LanguageTool warns about “Succesive sentences begin with the same word” and potential multi-token spelling issues.
Content is understandable, so feel free to ignore or polish later.

apps/content/docs/openapi/integrations/trpc.md (1)

41-49: Import alias may not match published API

Sample uses:

import {
  experimental_ORPCMeta as ORPCMeta,
  experimental_toORPCRouter as toORPCRouter
} from '@orpc/trpc'

Double-check that the package actually re-exports experimental_ORPCMeta (singular) and experimental_toORPCRouter.
If the public names are experimental_ORPCMetaBuilder / toORPCRouter (or already stable), the snippet will break copy-paste.

packages/trpc/package.json (1)

1-48: LGTM!

The package.json is well-structured with appropriate dependencies, export configuration, and build scripts.

packages/trpc/src/to-orpc-router.test-d.ts (1)

1-44: LGTM!

Comprehensive type-level tests that verify the correctness of the TRPC to ORPC router type transformation.

packages/trpc/src/to-orpc-router.test.ts (1)

1-76: LGTM!

Comprehensive runtime tests covering shape validation, schema handling, metadata preservation, procedure invocation, error mapping, and lazy loading.

packages/trpc/tests/shared.ts (1)

1-65: LGTM!

Well-designed test fixture that covers various TRPC router patterns including queries, subscriptions, nested routes, and lazy loading.

packages/trpc/src/to-orpc-router.ts (1)

96-106: ```shell
#!/bin/bash
set -e

Locate any test files covering toORPCRouter

rg -l "toORPCRouter" -g "*.test.ts" || echo "No toORPCRouter tests found"

Search within those tests for custom Error throws to cover non-TRPCError path

rg -n "new Error" -g "*.test.ts" || echo "No tests throwing generic Error found"


</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
packages/trpc/src/to-orpc-router.ts (2)

86-86: The route property assignment needs clarification.

As previously noted, assigning meta to the route property may not be the intended behavior.


102-107: Consider preserving the original error stack trace.

Including the original TRPCError as the cause would aid in debugging.

🧹 Nitpick comments (2)
packages/trpc/src/to-orpc-router.ts (2)

7-10: Document the purpose of the empty experimental_ORPCMeta interface.

The interface extends ORPC.Route but has no additional properties. Consider adding a comment explaining its purpose as a placeholder for future extensions or remove it if not needed.

+/**
+ * Metadata interface for ORPC routers converted from tRPC.
+ * Currently serves as a placeholder that extends ORPC.Route.
+ * Additional metadata properties can be added here in the future.
+ */
 export interface experimental_ORPCMeta extends ORPC.Route {
 
 }

45-45: Consider removing the as any type assertion for better type safety.

The type assertion could hide potential type mismatches. Consider ensuring the return type matches through proper typing or add a comment explaining why the assertion is necessary.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23532b3 and 4fa2e60.

📒 Files selected for processing (1)
  • packages/trpc/src/to-orpc-router.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/trpc/src/to-orpc-router.ts (4)
packages/server/src/context.ts (1)
  • Context (1-1)
packages/server/src/procedure.ts (2)
  • AnyProcedure (73-73)
  • Procedure (55-71)
packages/server/src/router.ts (1)
  • AnyRouter (19-19)
packages/shared/src/object.ts (1)
  • isTypescriptObject (44-46)
🪛 GitHub Check: codecov/patch
packages/trpc/src/to-orpc-router.ts

[warning] 110-111: packages/trpc/src/to-orpc-router.ts#L110-L111
Added lines #L110 - L111 were not covered by tests

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: publish-commit
  • GitHub Check: lint
🔇 Additional comments (3)
packages/trpc/src/to-orpc-router.ts (3)

48-61: LGTM!

The lazy router conversion correctly wraps tRPC lazy routers with ORPC's lazy loading mechanism.


116-142: LGTM!

The function correctly disables validation with proper documentation explaining the rationale. The proxy implementation safely overrides the validate method while preserving other properties.


110-111: ```shell
#!/bin/bash

Re-run with PCRE2 to search for generic throw statements excluding TRPCError

rg --pcre2 -A 10 'throw(?!.*TRPCError)' packages/trpc/src/to-orpc-router.test.ts packages/trpc/tests/

Fallback: look for any test referencing a generic Error

rg -n "new Error" -C3 packages/trpc/src/to-orpc-router.test.ts packages/trpc/tests/


</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant