Skip to content

Commit 6a488fd

Browse files
committed
remove trpc v9
1 parent 94055e7 commit 6a488fd

File tree

29 files changed

+13
-188
lines changed

29 files changed

+13
-188
lines changed

README.MD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,7 @@ The server folder is where you put all of your server side code (anything that w
4848

4949
- /server/trpc - tRPC server side code: routers, context, utils, etc.
5050
- /server/db - `client.ts` = Where the prisma client is being created.
51+
52+
### T3 Relation
53+
54+
I really like the T3 stack, however I prefer using Solid more than React, now that Solid Start is in beta I thought it would be a great idea to integrate some of the t3 features into create-jd-app.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-jd-app",
3-
"version": "1.0.82",
3+
"version": "1.0.83",
44
"main": "dist/index.js",
55
"scripts": {
66
"test": "ts-node -r tsconfig-paths/register src",

src/helpers/installer.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,7 @@ import ora from "ora";
22
import path from "path";
33
import fs from "fs-extra";
44
import inquirer from "inquirer";
5-
import {
6-
IInstaller,
7-
IPkg,
8-
ICtx,
9-
IEnv,
10-
IAppCtx,
11-
ITRPCVersion,
12-
IConfig,
13-
} from "~types";
5+
import { IInstaller, IPkg, ICtx, IEnv, IAppCtx, IConfig } from "~types";
146
import { execFiles } from "~utils/files";
157
import { execa, formatError, getUserPackageManager } from "~utils/helpers";
168
import { vercelPackages, vercelEnv } from "~vercel";
@@ -199,22 +191,8 @@ export async function getCtxWithInstallers(
199191
)} ${chalk.red("script")}`
200192
);
201193
}
202-
let trpcVersion: ITRPCVersion | undefined;
203-
if (pkgs.includes("tRPC")) {
204-
trpcVersion = (
205-
await inquirer.prompt<{
206-
trpcVersion: ITRPCVersion;
207-
}>({
208-
name: "trpcVersion",
209-
message: "Please select a version of tRPC",
210-
type: "list",
211-
choices: ["V10", "V9"],
212-
})
213-
).trpcVersion;
214-
}
215194
return {
216195
...ctx,
217196
installers: pkgs,
218-
trpcVersion,
219197
};
220198
}

src/helpers/utils/getIndexPage.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ export default Home;
3838
export default getIndexPage;
3939

4040
const getRes = (ctx: ICtx, shouldUsePrisma: boolean, useTRPC: boolean) => {
41-
const res =
42-
ctx.trpcVersion === "V10"
43-
? `trpc.hello.useQuery(() => ({ name: "from tRPC" }));`
44-
: `trpc.createQuery(() => ["example.hello", { name: "from tRPC" }]);`;
41+
const res = `trpc.hello.useQuery(() => ({ name: "from tRPC" }));`;
4542
return shouldUsePrisma
4643
? `\n const [res] = createResource(() =>
4744
fetch("/api/notes").then((res) => res.json())

src/installers/Upstash Ratelimit/files/V9.txt

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/installers/Upstash Ratelimit/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const config: IInstaller = (ctx) => ({
1717
files: [
1818
ctx.installers.includes("tRPC")
1919
? {
20-
path: `${__dirname}/files/${ctx.trpcVersion}.txt`,
20+
path: `${__dirname}/files/trpcUtils.txt`,
2121
to: `${ctx.userDir}/src/server/trpc/utils.ts`,
2222
}
2323
: {

src/installers/tRPC/files/utils-V9.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/installers/tRPC/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ const config: IInstaller = (ctx) => ({
44
name: "tRPC",
55
files: [
66
{
7-
path: `${__dirname}/files/utils-${ctx.trpcVersion}.txt`,
7+
path: `${__dirname}/files/utils.txt`,
88
to: `${ctx.userDir}/src/utils/trpc.ts`,
99
},
1010
{
1111
path: `${__dirname}/files/entryClient.txt`,
1212
to: `${ctx.userDir}/src/entry-client.tsx`,
1313
},
1414
{
15-
path: `${ctx.templateDir}/trpc/${ctx.trpcVersion}/server${
15+
path: `${ctx.templateDir}/trpc/inner/server${
1616
ctx.installers.includes("Prisma") ? "-prisma" : ""
1717
}`,
1818
to: `${ctx.userDir}/src/server/trpc`,
@@ -25,12 +25,12 @@ const config: IInstaller = (ctx) => ({
2525
pkgs: {
2626
// i don't want to use @next because its not an offical trpc package and i need to update it manually every realase
2727
"@trpc/client": {
28-
customVersion: ctx.trpcVersion === "V9" ? "9.27.2" : "10.0.0-rc.2",
28+
customVersion: "10.0.0-rc.2",
2929
},
3030
"@trpc/server": {
31-
customVersion: ctx.trpcVersion === "V9" ? "9.27.2" : "10.0.0-rc.2",
31+
customVersion: "10.0.0-rc.2",
3232
},
33-
"solid-trpc": ctx.trpcVersion === "V9" ? {} : { customVersion: "next" },
33+
"solid-trpc": { customVersion: "next" },
3434
"solid-start-trpc": {},
3535
"@tanstack/solid-query": {},
3636
},

src/types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ export type IPromiseOrType<T> = Promise<T> | T;
1111

1212
export type ICtxWith<T> = IAppCtx & T;
1313

14-
export type ITRPCVersion = "V10" | "V9";
15-
1614
export type ICtx = ICtxWith<{
1715
installers: string[];
18-
trpcVersion?: ITRPCVersion;
1916
}>;
2017

2118
export type IConfig = {

template/trpc/V9/server-prisma/context.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

template/trpc/V9/server-prisma/router/_app.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

template/trpc/V9/server-prisma/router/example.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

template/trpc/V9/server-prisma/router/notes.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

template/trpc/V9/server-prisma/utils.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

template/trpc/V9/server/context.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

template/trpc/V9/server/router/_app.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

template/trpc/V9/server/router/example.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

template/trpc/V9/server/utils.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)