Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/content/docs/adapters/electron.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Listen for a port sent from the renderer, then upgrade it:

```ts
import { RPCHandler } from '@orpc/server/message-port'
import { router } from './router'

const handler = new RPCHandler(router)

Expand Down
4 changes: 2 additions & 2 deletions apps/content/docs/migrations/from-trpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ The main router structure is similar between tRPC and oRPC, except in oRPC you d

::: code-group

```ts [orpc/router/index.ts]
```ts [orpc/routers/index.ts]
import { planetRouter } from './planet'

export const appRouter = {
planet: planetRouter,
}
```

```ts [trpc/router/index.ts]
```ts [trpc/routers/index.ts]
import { planetRouter } from './planet'

export const appRouter = createTRPCRouter({
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/astro/src/lib/orpc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { router } from '../router'
import type { router } from '../routers'
import type { RouterClient } from '@orpc/server'
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/fetch'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/astro/src/pages/api/[...rest].ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { onError } from '@orpc/server'
import { ZodToJsonSchemaConverter } from '@orpc/zod/zod4'
import { experimental_SmartCoercionPlugin as SmartCoercionPlugin } from '@orpc/json-schema'
import { OpenAPIReferencePlugin } from '@orpc/openapi/plugins'
import { router } from '../../router'
import { router } from '../../routers'
import type { APIRoute } from 'astro'
import { NewUserSchema, UserSchema } from '../../schemas/user'
import { CredentialSchema, TokenSchema } from '../../schemas/auth'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/astro/src/pages/rpc/[...rest].ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { APIRoute } from 'astro'
import { onError } from '@orpc/server'
import { BatchHandlerPlugin } from '@orpc/server/plugins'
import { RPCHandler } from '@orpc/server/fetch'
import { router } from '../../router'
import { router } from '../../routers'

const handler = new RPCHandler(router, {
interceptors: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RPCHandler } from '@orpc/server/message-port'
import { router } from './router'
import { router } from './routers'

const handler = new RPCHandler(router)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { router } from '../.../../../background/router'
import type { router } from '../.../../../background/routers'
import type { RouterClient } from '@orpc/server'
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/message-port'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/bun-websocket-otel/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import './instrumentation'

import { serve } from 'bun'
import index from './index.html'
import { router } from './router'
import { router } from './routers'
import { RPCHandler } from '@orpc/server/bun-ws'
import { OTEL_TRACE_EXPORTER_URL } from './consts'
import { trace } from '@opentelemetry/api'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/bun-websocket-otel/src/lib/orpc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RouterClient } from '@orpc/server'
import type { router } from '../router'
import type { router } from '../routers'
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/websocket'
import { createTanstackQueryUtils } from '@orpc/tanstack-query'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/cloudflare-worker/src/lib/orpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { RPCLink } from '@orpc/client/fetch'
import { DurableEventIteratorLinkPlugin } from '@orpc/experimental-durable-event-iterator/client'
import type { RouterClient } from '@orpc/server'
import { createTanstackQueryUtils } from '@orpc/tanstack-query'
import type { router } from '../../worker/router'
import type { router } from '../../worker/routers'

const link = new RPCLink({
url: `${window.location.origin}/rpc`,
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/cloudflare-worker/worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { OpenAPIReferencePlugin } from '@orpc/openapi/plugins'
import { experimental_SmartCoercionPlugin as SmartCoercionPlugin } from '@orpc/json-schema'
import { upgradeDurableEventIteratorRequest } from '@orpc/experimental-durable-event-iterator/durable-object'
import { BatchHandlerPlugin } from '@orpc/server/plugins'
import { router } from './router'
import { router } from './routers'
import { onError } from '@orpc/client'
import { ZodToJsonSchemaConverter } from '@orpc/zod/zod4'
import { NewUserSchema, UserSchema } from './schemas/user'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/contract-first/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { onError } from '@orpc/server'
import { RPCHandler } from '@orpc/server/node'
import { ZodToJsonSchemaConverter } from '@orpc/zod/zod4'
import { experimental_SmartCoercionPlugin as SmartCoercionPlugin } from '@orpc/json-schema'
import { router } from './router'
import { router } from './routers'
import { OpenAPIReferencePlugin } from '@orpc/openapi/plugins'
import './polyfill'
import { NewUserSchema, UserSchema } from './schemas/user'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/electron/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { app, BrowserWindow, ipcMain, shell } from 'electron'
import { join } from 'node:path'
import { electronApp, is, optimizer } from '@electron-toolkit/utils'
import { RPCHandler } from '@orpc/server/message-port'
import { router } from './router'
import { router } from './routers'

function createWindow(): void {
// Create the browser window.
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/electron/src/renderer/src/lib/orpc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { router } from '../../../main/router'
import type { router } from '../../../main/routers'
import type { RouterClient } from '@orpc/server'
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/message-port'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/next/src/app/api/[[...rest]]/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { router } from '@/router'
import { router } from '@/routers'
import { OpenAPIHandler } from '@orpc/openapi/fetch'
import { onError } from '@orpc/server'
import { ZodToJsonSchemaConverter } from '@orpc/zod/zod4'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/next/src/app/rpc/[[...rest]]/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { router } from '@/router'
import { router } from '@/routers'
import { onError } from '@orpc/server'
import { BatchHandlerPlugin } from '@orpc/server/plugins'
import { RPCHandler } from '@orpc/server/fetch'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/next/src/lib/orpc.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'server-only'

import { router } from '@/router'
import { router } from '@/routers'
import { createRouterClient } from '@orpc/server'
import { headers } from 'next/headers'

Expand Down
2 changes: 1 addition & 1 deletion playgrounds/next/src/lib/orpc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { router } from '@/router'
import type { router } from '@/routers'
import type { RouterClient } from '@orpc/server'
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/fetch'
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion playgrounds/nuxt/plugins/orpc.client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RouterClient } from '@orpc/server'
import type { router } from '~/server/router'
import type { router } from '~/server/routers'
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/fetch'
import { createTanstackQueryUtils } from '@orpc/tanstack-query'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/nuxt/plugins/orpc.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createRouterClient } from '@orpc/server'
import { router } from '~/server/router'
import { router } from '~/server/routers'
import { createTanstackQueryUtils } from '@orpc/tanstack-query'

/**
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/nuxt/server/routes/api/[...].ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { OpenAPIHandler } from '@orpc/openapi/node'
import { onError } from '@orpc/server'
import { ZodToJsonSchemaConverter } from '@orpc/zod/zod4'
import { experimental_SmartCoercionPlugin as SmartCoercionPlugin } from '@orpc/json-schema'
import { router } from '~/server/router'
import { router } from '~/server/routers'
import { OpenAPIReferencePlugin } from '@orpc/openapi/plugins'
import { NewUserSchema, UserSchema } from '~/server/schemas/user'
import { CredentialSchema, TokenSchema } from '~/server/schemas/auth'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/nuxt/server/routes/rpc/[...].ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { onError } from '@orpc/server'
import { RPCHandler } from '@orpc/server/node'
import { router } from '~/server/router'
import { router } from '~/server/routers'

const rpcHandler = new RPCHandler(router, {
interceptors: [
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/solid-start/src/lib/orpc.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createRouterClient } from '@orpc/server'
import { getRequestEvent } from 'solid-js/web'
import { router } from '~/router'
import { router } from '~/routers'

if (typeof window !== 'undefined') {
throw new Error('This file should not be imported in the browser')
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/solid-start/src/lib/orpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if (typeof window === 'undefined') {
}

import type { RouterClient } from '@orpc/server'
import type { router } from '~/router'
import type { router } from '~/routers'
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/fetch'
import { createTanstackQueryUtils } from '@orpc/tanstack-query'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/solid-start/src/routes/api/[...rest].ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { APIEvent } from '@solidjs/start/server'
import { OpenAPIHandler } from '@orpc/openapi/fetch'
import { router } from '~/router'
import { router } from '~/routers'
import { ZodToJsonSchemaConverter } from '@orpc/zod/zod4'
import { experimental_SmartCoercionPlugin as SmartCoercionPlugin } from '@orpc/json-schema'
import { onError } from '@orpc/server'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/solid-start/src/routes/rpc/[...rest].ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { APIEvent } from '@solidjs/start/server'
import { RPCHandler } from '@orpc/server/fetch'
import { router } from '~/router'
import { router } from '~/routers'
import { onError } from '@orpc/server'
import '~/polyfill'

Expand Down
2 changes: 1 addition & 1 deletion playgrounds/svelte-kit/src/lib/orpc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RouterClient } from '@orpc/server'
import type { router } from '../router'
import type { router } from '../routers'
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/fetch'
import { createTanstackQueryUtils } from '@orpc/tanstack-query'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/svelte-kit/src/routes/api/[...rest]/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAPIHandler } from '@orpc/openapi/fetch'
import { router } from '../../../router'
import { router } from '../../../routers'
import { onError } from '@orpc/server'
import type { RequestHandler } from '@sveltejs/kit'
import { ZodToJsonSchemaConverter } from '@orpc/zod/zod4'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/svelte-kit/src/routes/rpc/[...rest]/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RPCHandler } from '@orpc/server/fetch'
import { router } from '../../../router'
import { router } from '../../../routers'
import { onError } from '@orpc/server'
import type { RequestHandler } from '@sveltejs/kit'
import '../../../polyfill'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/tanstack-start/src/lib/orpc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { router } from '~/router/index'
import { router } from '~/routers'
import { createRouterClient } from '@orpc/server'
import type { RouterClient } from '@orpc/server'
import { createORPCClient } from '@orpc/client'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/tanstack-start/src/routes/api/$.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { OpenAPIHandler } from '@orpc/openapi/fetch'
import { ZodToJsonSchemaConverter } from '@orpc/zod/zod4'
import { experimental_SmartCoercionPlugin as SmartCoercionPlugin } from '@orpc/json-schema'
import { createServerFileRoute } from '@tanstack/react-start/server'
import { router } from '~/router/index'
import { router } from '~/routers'
import { onError } from '@orpc/server'
import { OpenAPIReferencePlugin } from '@orpc/openapi/plugins'
import { NewUserSchema, UserSchema } from '~/schemas/user'
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/tanstack-start/src/routes/api/rpc.$.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import '~/polyfill'

import { RPCHandler } from '@orpc/server/fetch'
import { createServerFileRoute } from '@tanstack/react-start/server'
import { router } from '~/router/index'
import { router } from '~/routers'

const handler = new RPCHandler(router)

Expand Down
Loading