Skip to content

Commit

Permalink
chore: prepared prisma client
Browse files Browse the repository at this point in the history
  • Loading branch information
hmbanan666 committed Aug 22, 2024
1 parent a64381d commit 51d8446
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/website/src/server/api/auth/me.get.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default defineEventHandler((event) => {
const { public: publicEnv } = useRuntimeConfig();

const jwt = getCookie(event, publicEnv.cookieKey)
if (!jwt) {
throw createError({
Expand All @@ -14,4 +14,4 @@ export default defineEventHandler((event) => {
twitchId: '12345',
userName: 'testuser',
}
});
});
5 changes: 5 additions & 0 deletions apps/website/src/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"compilerOptions": {
"paths": {
"@chat-game/prisma-client": ["../../../../libs/prisma-client/src/index.ts"]
}
},
"extends": "../../.nuxt/tsconfig.server.json"
}
18 changes: 18 additions & 0 deletions libs/prisma-client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
8 changes: 8 additions & 0 deletions libs/prisma-client/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "prisma-client",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/prisma-client/src",
"projectType": "library",
"tags": [],
"targets": {}
}
1 change: 1 addition & 0 deletions libs/prisma-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/prisma-client';
3 changes: 3 additions & 0 deletions libs/prisma-client/src/lib/prisma-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PrismaClient } from '@prisma/client'

export const db = new PrismaClient()
19 changes: 19 additions & 0 deletions libs/prisma-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}
10 changes: 10 additions & 0 deletions libs/prisma-client/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"]
}
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"skipDefaultLibCheck": true,
"baseUrl": ".",
"paths": {
"@chat-game/prisma-client": ["libs/prisma-client/src/index.ts"],
"@chat-game/prisma-schema": ["libs/prisma-schema/src/index.ts"]
}
},
Expand Down

0 comments on commit 51d8446

Please sign in to comment.