mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix orpc templates (#302)
This commit is contained in:
@@ -14,18 +14,18 @@
|
||||
"@radix-ui/react-label": "^2.1.2",
|
||||
"@radix-ui/react-slot": "^1.1.2",
|
||||
"@tanstack/react-form": "^1.0.5",
|
||||
"@tailwindcss/vite": "^4.0.6",
|
||||
"@tanstack/react-query": "^5.71.10",
|
||||
"@tanstack/react-router": "^1.114.3",
|
||||
"@tanstack/react-router-with-query": "^1.114.3",
|
||||
"@tanstack/react-start": "^1.114.3",
|
||||
"@tanstack/router-plugin": "^1.114.3",
|
||||
"@tailwindcss/vite": "^4.1.8",
|
||||
"@tanstack/react-query": "^5.80.5",
|
||||
"@tanstack/react-router": "^1.120.15",
|
||||
"@tanstack/react-router-with-query": "^1.120.15",
|
||||
"@tanstack/react-start": "^1.120.15",
|
||||
"@tanstack/router-plugin": "^1.120.15",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"lucide-react": "^0.473.0",
|
||||
"next-themes": "^0.4.6",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"sonner": "^2.0.3",
|
||||
"tailwindcss": "^4.1.3",
|
||||
"tailwind-merge": "^2.6.0",
|
||||
@@ -35,15 +35,15 @@
|
||||
"zod": "^3.25.16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tanstack/react-router-devtools": "^1.114.3",
|
||||
"@tanstack/react-router-devtools": "^1.120.15",
|
||||
"@testing-library/dom": "^10.4.0",
|
||||
"@testing-library/react": "^16.2.0",
|
||||
"@types/react": "^19.0.8",
|
||||
"@types/react-dom": "^19.0.3",
|
||||
"@types/react": "^19.1.6",
|
||||
"@types/react-dom": "^19.1.6",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"jsdom": "^26.0.0",
|
||||
"typescript": "^5.7.2",
|
||||
"vite": "^6.1.0",
|
||||
"vite": "^6.3.5",
|
||||
"web-vitals": "^4.2.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ import { toast } from "sonner";
|
||||
import type { AppRouter } from "../../server/src/routers";
|
||||
import { TRPCProvider } from "./utils/trpc";
|
||||
{{else if (eq api "orpc")}}
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { orpc, ORPCContext, queryClient as orpcQueryClient } from "./utils/orpc";
|
||||
import { QueryClientProvider } from "@tanstack/react-query";
|
||||
import { orpc, queryClient } from "./utils/orpc";
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
@@ -99,7 +99,6 @@ const trpc = createTRPCOptionsProxy({
|
||||
queryClient: queryClient,
|
||||
});
|
||||
{{else if (eq api "orpc")}}
|
||||
const queryClient = orpcQueryClient;
|
||||
{{/if}}
|
||||
|
||||
export const createRouter = () => {
|
||||
@@ -127,9 +126,7 @@ export const createRouter = () => {
|
||||
{{else if (eq api "orpc")}}
|
||||
Wrap: ({ children }) => (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<ORPCContext.Provider value={orpc}>
|
||||
{children}
|
||||
</ORPCContext.Provider>
|
||||
{children}
|
||||
</QueryClientProvider>
|
||||
),
|
||||
{{else}}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useQuery } from "@tanstack/react-query";
|
||||
import { useTRPC } from "@/utils/trpc";
|
||||
{{/if}}
|
||||
{{#if (eq api "orpc")}}
|
||||
import { useORPC } from "@/utils/orpc";
|
||||
import { orpc } from "@/utils/orpc";
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
@@ -40,7 +40,6 @@ function HomeComponent() {
|
||||
const trpc = useTRPC();
|
||||
const healthCheck = useQuery(trpc.healthCheck.queryOptions());
|
||||
{{else if (eq api "orpc")}}
|
||||
const orpc = useORPC();
|
||||
const healthCheck = useQuery(orpc.healthCheck.queryOptions());
|
||||
{{/if}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user