Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughGlobal path updates rename imports from router to routers across multiple playgrounds and docs. One Electron docs snippet removes an explicit router import while still referencing router. No logic or runtime changes are introduced; updates are limited to import paths and code-block captions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.38.6)playgrounds/electron/src/renderer/src/lib/orpc.ts[ ... [truncated 3947 characters] ... style": "secondary" Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing Touches
🧪 Generate unit tests
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. Comment |
There was a problem hiding this comment.
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 focuses on improving code consistency and clarity by standardizing the naming convention for router-related directories. The change involves renaming singular router directories to plural routers across the entire project, encompassing various playground environments and core documentation. This refactoring ensures a more intuitive and consistent file structure, making the codebase easier to navigate and understand for developers.
Highlights
- Directory Renaming: The primary change involves renaming all instances of the
routerdirectory toroutersacross the codebase, including documentation and various playground examples. This standardizes the naming convention to use plural forms for directories containing multiple related files. - Import Path Updates: All import statements referencing the old
routerdirectory have been updated to point to the newroutersdirectory, ensuring that all modules correctly resolve their dependencies after the directory rename. - Documentation Alignment: Documentation files, specifically
apps/content/docs/migrations/from-trpc.md, have been updated to reflect the newroutersdirectory naming in code examples, maintaining consistency between code and documentation.
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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
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
-
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Code Review
This pull request correctly renames the router directory to routers and updates most of the import paths accordingly. However, I've found an issue in one of the documentation files where an import was removed instead of being updated, which breaks the code example. I've left a specific comment with a suggestion to fix it. Otherwise, the changes look good.
More templates
@orpc/arktype
@orpc/client
@orpc/contract
@orpc/experimental-durable-event-iterator
@orpc/hey-api
@orpc/interop
@orpc/json-schema
@orpc/nest
@orpc/openapi
@orpc/openapi-client
@orpc/otel
@orpc/react
@orpc/react-query
@orpc/experimental-react-swr
@orpc/server
@orpc/shared
@orpc/solid-query
@orpc/standard-server
@orpc/standard-server-aws-lambda
@orpc/standard-server-fetch
@orpc/standard-server-node
@orpc/standard-server-peer
@orpc/svelte-query
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/vue-colada
@orpc/vue-query
@orpc/zod
commit: |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (6)
apps/content/docs/migrations/from-trpc.md (1)
242-256: Captions updated to routers/ — looks good. Verify related docs slug/link.
- The code-group captions now reference orpc/routers and trpc/routers correctly. LGTM.
- Nearby link still points to /docs/router; if the docs page slug also moved to /docs/routers, update the link (and possibly the anchor text) or ensure a redirect exists.
Proposed tweak if the slug changed:
- Learn more about oRPC [Router](/docs/router). + Learn more about oRPC [Routers](/docs/routers).Also applies to: 260-263
playgrounds/astro/src/lib/orpc.ts (1)
1-1: Prefer deriving the router type from its value export
Replace the type import with a type alias and update the client signature accordingly:-import type { router } from '../routers' +type AppRouter = typeof import('../routers').router-export const client: RouterClient<typeof router> = createORPCClient(link) +export const client: RouterClient<AppRouter> = createORPCClient(link)playgrounds/electron/src/renderer/src/lib/orpc.ts (1)
1-1: Derive router type from runtime export to reduce couplingReplace the named type import with a derived type:
-import type { router } from '../../../main/routers' +type AppRouter = typeof import('../../../main/routers').routerThen update the client declaration:
export const client: RouterClient<AppRouter> = createORPCClient(link)playgrounds/svelte-kit/src/lib/orpc.ts (1)
2-2: Use a type alias to deriverouterfrom the module import instead of a type-only import--- playgrounds/svelte-kit/src/lib/orpc.ts -import type { router } from '../routers' +type AppRouter = typeof import('../routers').router -export const client: RouterClient<typeof router> = createORPCClient(rpcLink) +export const client: RouterClient<AppRouter> = createORPCClient(rpcLink)playgrounds/next/src/lib/orpc.ts (1)
1-1: Optional: avoid type-only named import; use typeof import to decouple from named export.This removes the need for a type-only import and is resilient to re-exports.
-import type { router } from '@/routers' +type RouterDef = typeof import('@/routers').router @@ declare global { - var $client: RouterClient<typeof router> | undefined + var $client: RouterClient<RouterDef> | undefined } @@ -export const client: RouterClient<typeof router> = globalThis.$client ?? createORPCClient(link) +export const client: RouterClient<RouterDef> = globalThis.$client ?? createORPCClient(link)playgrounds/solid-start/src/lib/orpc.ts (1)
6-6: Optional: mirror the Next.js tweak—replace type import with typeof import.Keeps types local and avoids coupling to a named export.
-import type { router } from '~/routers' +type RouterDef = typeof import('~/routers').router @@ declare global { - var $client: RouterClient<typeof router> | undefined + var $client: RouterClient<RouterDef> | undefined } @@ -export const client: RouterClient<typeof router> = globalThis.$client ?? createORPCClient(link) +export const client: RouterClient<RouterDef> = globalThis.$client ?? createORPCClient(link)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (32)
apps/content/docs/adapters/electron.md(0 hunks)apps/content/docs/migrations/from-trpc.md(1 hunks)playgrounds/astro/src/lib/orpc.ts(1 hunks)playgrounds/astro/src/pages/api/[...rest].ts(1 hunks)playgrounds/astro/src/pages/rpc/[...rest].ts(1 hunks)playgrounds/browser-extension/entrypoints/background/index.ts(1 hunks)playgrounds/browser-extension/entrypoints/popup/lib/orpc.ts(1 hunks)playgrounds/bun-websocket-otel/src/index.tsx(1 hunks)playgrounds/bun-websocket-otel/src/lib/orpc.ts(1 hunks)playgrounds/cloudflare-worker/src/lib/orpc.ts(1 hunks)playgrounds/cloudflare-worker/worker/index.ts(1 hunks)playgrounds/contract-first/src/main.ts(1 hunks)playgrounds/electron/src/main/index.ts(1 hunks)playgrounds/electron/src/renderer/src/lib/orpc.ts(1 hunks)playgrounds/next/src/app/api/[[...rest]]/route.ts(1 hunks)playgrounds/next/src/app/rpc/[[...rest]]/route.ts(1 hunks)playgrounds/next/src/lib/orpc.server.ts(1 hunks)playgrounds/next/src/lib/orpc.ts(1 hunks)playgrounds/nuxt/plugins/orpc.client.ts(1 hunks)playgrounds/nuxt/plugins/orpc.server.ts(1 hunks)playgrounds/nuxt/server/routes/api/[...].ts(1 hunks)playgrounds/nuxt/server/routes/rpc/[...].ts(1 hunks)playgrounds/solid-start/src/lib/orpc.server.ts(1 hunks)playgrounds/solid-start/src/lib/orpc.ts(1 hunks)playgrounds/solid-start/src/routes/api/[...rest].ts(1 hunks)playgrounds/solid-start/src/routes/rpc/[...rest].ts(1 hunks)playgrounds/svelte-kit/src/lib/orpc.ts(1 hunks)playgrounds/svelte-kit/src/routes/api/[...rest]/+server.ts(1 hunks)playgrounds/svelte-kit/src/routes/rpc/[...rest]/+server.ts(1 hunks)playgrounds/tanstack-start/src/lib/orpc.ts(1 hunks)playgrounds/tanstack-start/src/routes/api/$.ts(1 hunks)playgrounds/tanstack-start/src/routes/api/rpc.$.ts(1 hunks)
💤 Files with no reviewable changes (1)
- apps/content/docs/adapters/electron.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: publish-commit
- GitHub Check: lint
🔇 Additional comments (23)
playgrounds/contract-first/src/main.ts (1)
7-7: Verify routers module presence and export
The script didn’t locateplaygrounds/contract-first/src/routers—ensure the file exists and exports a namedrouter. If it only has a default export, update the import to:import router from './routers'playgrounds/astro/src/pages/api/[...rest].ts (1)
7-7: Import path switch to ../../routers is correct.Matches the repo-wide rename; no runtime behavior change.
playgrounds/bun-websocket-otel/src/lib/orpc.ts (1)
2-2: Type-only import moved to ../routers — good call.Keeps it type-only to avoid bundling the value at runtime.
playgrounds/nuxt/plugins/orpc.client.ts (1)
2-2: Type import path updated to ~/server/routers — looks good.No runtime impact; aligns with the rename.
playgrounds/svelte-kit/src/routes/api/[...rest]/+server.ts (1)
2-2: Router import updated to ../../../routers — OK.Consistent with the rest of the PR.
playgrounds/bun-websocket-otel/src/index.tsx (1)
5-5: Router import updated to ./routers — OK.No other changes; handler wiring remains the same.
playgrounds/astro/src/pages/rpc/[...rest].ts (1)
6-6: No lingering/routerimports found
All matches for./routerare valid references within their respective packages (e.g. packages/server, packages/contract, playgrounds/tanstack-start) and not the renamedroutersfolder in the Astro playground. No further changes required.playgrounds/electron/src/main/index.ts (1)
5-5: Import source switched to ./routers — looks good.Assuming playgrounds/electron/src/main/routers.ts exports named router.
playgrounds/browser-extension/entrypoints/background/index.ts (1)
2-2:routerimport validatedModule
playgrounds/browser-extension/entrypoints/background/routers/index.tsexists and exports a namedrouter; no leftoverfrom './router'imports found.playgrounds/svelte-kit/src/routes/rpc/[...rest]/+server.ts (1)
2-2: LGTM: import path aligned to routers.No functional changes; handler wiring remains intact.
playgrounds/nuxt/plugins/orpc.server.ts (1)
2-2: Approved: Namedrouterexport confirmed.
The fileplaygrounds/nuxt/server/routers/index.tsexportsrouteras expected.playgrounds/solid-start/src/routes/rpc/[...rest].ts (1)
3-3: LGTM: import path updated to '~/routers'.No behavior change; handler setup remains consistent.
playgrounds/tanstack-start/src/lib/orpc.ts (1)
1-1: LGTM: import path updated to '~/routers'. Verify no remaining singularrouterimports underplaygrounds/tanstack-start/srcand confirm eachroutersdirectory exports a namedrouter.playgrounds/nuxt/server/routes/api/[...].ts (1)
5-5: LGTM: import now targets '~/server/routers'.Consistent with the rename; OpenAPIHandler wiring remains intact.
playgrounds/cloudflare-worker/worker/index.ts (1)
7-7: LGTM: switched to './routers'.Handlers still receive the same router; no runtime impact.
playgrounds/solid-start/src/routes/api/[...rest].ts (1)
3-3: LGTM: path updated to '~/routers'.SolidStart OpenAPI handler remains unchanged otherwise.
playgrounds/next/src/app/rpc/[[...rest]]/route.ts (1)
1-1: LGTM: '@/routers' import.Batch RPC handler continues to use the same router symbol.
playgrounds/next/src/app/api/[[...rest]]/route.ts (1)
1-1: LGTM: '@/routers' import.OpenAPI handler config unchanged; only the module path moved.
playgrounds/next/src/lib/orpc.server.ts (1)
3-3: Approve import path update All imports have been updated to@/routersand no residual@/routerreferences remain.playgrounds/tanstack-start/src/routes/api/rpc.$.ts (1)
5-5: LGTM: import now targets~/routersMatches the rest of the migration;
RPCHandlerusage unchanged.playgrounds/solid-start/src/lib/orpc.server.ts (1)
3-3: LGTM: server-side import moved to~/routersPattern matches the SSR setup; no behavior change.
playgrounds/nuxt/server/routes/rpc/[...].ts (1)
3-3: LGTM: router import updated to~/server/routers
RPCHandlerwiring and error interceptor unchanged; Nitro globals still fine.playgrounds/tanstack-start/src/routes/api/$.ts (1)
7-7: LGTM: OpenAPI handler now points at~/routersNo API surface changes; plugins and schemas untouched.
router -> routers folderrouter -> routers folder name
Summary by CodeRabbit