Skip to content

Commit 8e65c8b

Browse files
committed
feat: initial commit
0 parents  commit 8e65c8b

File tree

10 files changed

+1311
-0
lines changed

10 files changed

+1311
-0
lines changed

.gitignore

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
.pnp
6+
.pnp.js
7+
8+
# testing
9+
coverage
10+
11+
# next.js
12+
.next/
13+
out/
14+
next-env.d.ts
15+
16+
# expo
17+
.expo/
18+
dist/
19+
expo-env.d.ts
20+
apps/expo/.gitignore
21+
22+
# production
23+
build
24+
25+
# misc
26+
.DS_Store
27+
*.pem
28+
29+
# debug
30+
npm-debug.log*
31+
yarn-debug.log*
32+
yarn-error.log*
33+
.pnpm-debug.log*
34+
35+
# local env files
36+
.env
37+
.env*.local
38+
39+
# vercel
40+
.vercel
41+
42+
# typescript
43+
*.tsbuildinfo
44+
45+
# turbo
46+
.turbo

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true

apps/express-api/package.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "@examples/express-server",
3+
"version": "10.40.0",
4+
"private": true,
5+
"dependencies": {
6+
"@trpc/client": "^10.40.0",
7+
"@trpc/server": "^10.40.0",
8+
"trpc-openapi": "^1.2.0",
9+
"zod": "^3.0.0"
10+
},
11+
"devDependencies": {
12+
"@types/express": "^4.17.17",
13+
"@types/node": "^18.16.16",
14+
"typescript": "^5.2.2",
15+
"vitest": "^0.34.6"
16+
}
17+
}

apps/express-api/src/openapi.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { generateOpenApiDocument } from "trpc-openapi";
2+
import { appRouter } from "./trpc";
3+
4+
export const openApiDocument = generateOpenApiDocument(appRouter, {
5+
title: "tRPC OpenAPI",
6+
version: "1.0.0",
7+
baseUrl: "http://localhost:3000",
8+
});

apps/express-api/src/trpc.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { initTRPC } from "@trpc/server";
2+
import type * as trpcExpress from "@trpc/server/adapters/express";
3+
4+
export interface Context
5+
extends Partial<trpcExpress.CreateExpressContextOptions> {}
6+
7+
export async function createTRPCContext(opts: Context): Promise<Context> {
8+
return opts;
9+
}
10+
11+
export const t = initTRPC.context<Context>().create();
12+
13+
export const appRouter = t.router({});
14+
15+
export const publicProcedure = t.procedure;

apps/express-api/tsconfig.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"compilerOptions": {
3+
"composite": false,
4+
"declaration": true,
5+
"declarationMap": true,
6+
"esModuleInterop": true,
7+
"forceConsistentCasingInFileNames": true,
8+
"inlineSources": false,
9+
"isolatedModules": true,
10+
"moduleResolution": "node",
11+
"noUnusedLocals": false,
12+
"noUnusedParameters": false,
13+
"preserveWatchOutput": true,
14+
"skipLibCheck": true,
15+
"strict": true,
16+
"strictNullChecks": true,
17+
"module": "ESNext",
18+
"target": "ESNext",
19+
"types": ["vitest/globals"]
20+
},
21+
"exclude": ["dist", "build", "node_modules"],
22+
"include": [
23+
"vitest.config.ts",
24+
"package.json",
25+
".eslintrc.js",
26+
"./**/*.ts",
27+
"./**/*.tsx"
28+
]
29+
}

package.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "create-t3-turbo",
3+
"private": true,
4+
"engines": {
5+
"node": ">=v18.18.0"
6+
},
7+
"packageManager": "[email protected]",
8+
"scripts": {
9+
},
10+
"dependencies": {
11+
"turbo": "^1.10.15",
12+
"typescript": "^5.2.2"
13+
}
14+
}

0 commit comments

Comments
 (0)