Skip to content

Commit

Permalink
fix(cli): Only install @trpc/next when router style is page router (#…
Browse files Browse the repository at this point in the history
…1835)

Co-authored-by: juliusmarminge <[email protected]>
  • Loading branch information
Inshiku-Han and juliusmarminge committed Apr 22, 2024
1 parent 3257d0a commit f66e30a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thick-weeks-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": patch
---

Only install @trpc/next when router style is page router
7 changes: 6 additions & 1 deletion cli/src/installers/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const trpcInstaller: Installer = ({
"superjson",
"@trpc/server",
"@trpc/client",
"@trpc/next",
"@trpc/react-query",
],
devMode: false,
Expand Down Expand Up @@ -113,6 +112,12 @@ export const trpcInstaller: Installer = ({
]
);
} else {
addPackageDependency({
dependencies: ["@trpc/next"],
devMode: false,
projectDir,
});

const utilsSrc = path.join(extrasDir, "src/utils/api.ts");
const utilsDest = path.join(projectDir, "src/utils/api.ts");
copySrcDest.push([utilsSrc, utilsDest]);
Expand Down

0 comments on commit f66e30a

Please sign in to comment.