Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
OrJDev committed Nov 16, 2022
1 parent 64e7f8e commit 94055e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ npm create jd-app@latest

#### /env

The env file isn't being used in any addon currently, might be used in the future. It adds nice type safety check and zod validation to your env, so it is recommended to use it in your code (can be used to store JWT secrets, etc).
It adds nice type safety check and zod validation to your env (both client and server), so it is recommended to use it in your code (can be used to store JWT secrets, etc).

- /env/client - Client side env - `imort.meta.env`
- /env/server - Server side env - `process.env`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-jd-app",
"version": "1.0.81",
"version": "1.0.82",
"main": "dist/index.js",
"scripts": {
"test": "ts-node -r tsconfig-paths/register src",
Expand Down
8 changes: 5 additions & 3 deletions src/installers/Prisma/files/client.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PrismaClient } from "@prisma/client";
import env from "~/env/server";
import { serverEnv } from "~/env/server";

declare global {
// eslint-disable-next-line no-var
Expand All @@ -10,9 +10,11 @@ export const prisma =
global.prisma ||
new PrismaClient({
log:
env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"],
serverEnv.NODE_ENV === "development"
? ["query", "error", "warn"]
: ["error"],
});

if (env.NODE_ENV !== "production") {
if (serverEnv.NODE_ENV !== "production") {
global.prisma = prisma;
}

0 comments on commit 94055e7

Please sign in to comment.