update orpc tanstack query integration (#299)

This commit is contained in:
Aman Varshney
2025-06-05 07:36:27 +05:30
committed by GitHub
parent 19f6a2ba6f
commit 1485809ad7
32 changed files with 85 additions and 110 deletions

View File

@@ -87,12 +87,9 @@ export const dependencyVersionMap = {
"@prisma/extension-accelerate": "^1.3.0",
"@orpc/server": "^1.2.0",
"@orpc/client": "^1.2.0",
"@orpc/react-query": "^1.2.0",
"@orpc/solid-query": "^1.2.0",
"@orpc/vue-query": "^1.2.0",
"@orpc/svelte-query": "^1.2.0",
"@orpc/server": "^1.4.1",
"@orpc/client": "^1.4.1",
"@orpc/tanstack-query": "^1.4.1",
"@trpc/tanstack-react-query": "^11.0.0",
"@trpc/server": "^11.0.0",

View File

@@ -54,7 +54,11 @@ export async function setupApi(config: ProjectConfig): Promise<void> {
if (hasReactWeb) {
if (api === "orpc") {
await addPackageDependency({
dependencies: ["@orpc/react-query", "@orpc/client", "@orpc/server"],
dependencies: [
"@orpc/tanstack-query",
"@orpc/client",
"@orpc/server",
],
projectDir: webDir,
});
} else if (api === "trpc") {
@@ -70,7 +74,11 @@ export async function setupApi(config: ProjectConfig): Promise<void> {
} else if (hasNuxtWeb) {
if (api === "orpc") {
await addPackageDependency({
dependencies: ["@orpc/vue-query", "@orpc/client", "@orpc/server"],
dependencies: [
"@orpc/tanstack-query",
"@orpc/client",
"@orpc/server",
],
projectDir: webDir,
});
}
@@ -78,7 +86,7 @@ export async function setupApi(config: ProjectConfig): Promise<void> {
if (api === "orpc") {
await addPackageDependency({
dependencies: [
"@orpc/svelte-query",
"@orpc/tanstack-query",
"@orpc/client",
"@orpc/server",
"@tanstack/svelte-query",
@@ -90,7 +98,7 @@ export async function setupApi(config: ProjectConfig): Promise<void> {
if (api === "orpc") {
await addPackageDependency({
dependencies: [
"@orpc/solid-query",
"@orpc/tanstack-query",
"@orpc/client",
"@orpc/server",
"@tanstack/solid-query",
@@ -113,7 +121,11 @@ export async function setupApi(config: ProjectConfig): Promise<void> {
});
} else if (api === "orpc") {
await addPackageDependency({
dependencies: ["@orpc/react-query", "@orpc/client", "@orpc/server"],
dependencies: [
"@orpc/tanstack-query",
"@orpc/client",
"@orpc/server",
],
projectDir: nativeDir,
});
}

View File

@@ -30,7 +30,8 @@ export function processAndValidateFlags(
if (options.api === "none") {
if (
options.examples &&
!(options.examples.length === 1 && options.examples[0] === "none")
!(options.examples.length === 1 && options.examples[0] === "none") &&
options.backend !== "convex"
) {
consola.fatal(
"Cannot use '--examples' when '--api' is set to 'none'. Please remove the --examples flag or choose an API type.",