better-ts-stack 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/dist/args.js +6 -0
- package/dist/builder/moduleSelector.js +6 -1
- package/dist/builder/readmeGenerator.js +6 -0
- package/dist/builder/templateContext.js +1 -0
- package/dist/prompts/stack.js +7 -0
- package/dist/types/index.js +2 -0
- package/dist/ui/messages.js +2 -0
- package/package.json +71 -71
- package/templates/backend/express/.prettierignore +52 -52
- package/templates/backend/express/.prettierrc +16 -16
- package/templates/backend/express/gitignore +3 -1
- package/templates/backend/express/tsconfig.eslint.json +9 -9
- package/templates/backend/nestjs/.prettierignore +52 -52
- package/templates/backend/nestjs/gitignore +3 -1
- package/templates/backend/nestjs/tsconfig.eslint.json +9 -9
- package/templates/frontend/nextjs/app/globals.css +89 -89
- package/templates/frontend/nextjs/app/layout.tsx +34 -34
- package/templates/frontend/nextjs/components/ui/button.tsx +51 -51
- package/templates/frontend/nextjs/components/ui/card.tsx +60 -60
- package/templates/frontend/nextjs/components/ui/field.tsx +67 -67
- package/templates/frontend/nextjs/components/ui/input.tsx +18 -18
- package/templates/frontend/nextjs/config.json +35 -35
- package/templates/frontend/nextjs/eslint.config.mjs +11 -11
- package/templates/frontend/nextjs/next.config.ts.hbs +12 -12
- package/templates/frontend/nextjs/postcss.config.mjs +7 -7
- package/templates/frontend/nextjs/public/file.svg +1 -1
- package/templates/frontend/nextjs/public/globe.svg +1 -1
- package/templates/frontend/nextjs/public/window.svg +1 -1
- package/templates/frontend/tanstack/components.json +18 -18
- package/templates/frontend/tanstack/eslint.config.mjs +23 -23
- package/templates/frontend/tanstack/gitignore +39 -39
- package/templates/frontend/tanstack/public/favicon.svg +7 -7
- package/templates/frontend/tanstack/src/components/ui/button.tsx +51 -51
- package/templates/frontend/tanstack/src/components/ui/card.tsx +60 -60
- package/templates/frontend/tanstack/src/components/ui/field.tsx +67 -67
- package/templates/frontend/tanstack/src/components/ui/input.tsx +18 -18
- package/templates/frontend/tanstack/src/lib/utils.ts +6 -6
- package/templates/frontend/tanstack/src/router.tsx +31 -31
- package/templates/frontend/tanstack/src/routes/__root.tsx +69 -69
- package/templates/frontend/tanstack/tsconfig.json +22 -22
- package/templates/modules/agents/AGENTS.md.hbs +237 -0
- package/templates/modules/agents/CLAUDE.md +1 -0
- package/templates/modules/agents/config.json +10 -0
- package/templates/modules/auth/express/src/lib/jwt.ts.hbs +27 -27
- package/templates/modules/auth/nextjs/app/api/auth/[...all]/route.ts +4 -4
- package/templates/modules/auth/nextjs/config.json +18 -18
- package/templates/modules/auth/nextjs/lib/auth-client.ts +3 -3
- package/templates/modules/auth/tanstack/config.json +18 -18
- package/templates/modules/auth/tanstack/src/lib/auth-client.ts +2 -2
- package/templates/modules/auth/tanstack/src/lib/auth-functions.ts +8 -8
- package/templates/modules/auth/tanstack/src/lib/auth.ts.hbs +37 -37
- package/templates/modules/auth/tanstack/src/routes/api/auth/$.ts +15 -15
- package/templates/modules/auth/tanstack/src/routes/dashboard.tsx +110 -110
- package/templates/modules/auth/tanstack/src/routes/sign-in.tsx +36 -36
- package/templates/modules/auth/tanstack/src/routes/sign-up.tsx +36 -36
- package/templates/modules/docker/.dockerignore +2 -0
- package/templates/modules/docker/config.json +15 -15
- package/templates/modules/drizzle/express/config.json +26 -26
- package/templates/modules/drizzle/nestjs/config.json +26 -26
- package/templates/modules/drizzle/nextjs/config.json +26 -26
- package/templates/modules/drizzle/nextjs/drizzle.config.ts +13 -13
- package/templates/modules/drizzle/tanstack/config.json +26 -26
- package/templates/modules/drizzle/tanstack/drizzle.config.ts +12 -12
- package/templates/modules/drizzle/tanstack/src/lib/db.ts +13 -13
- package/templates/modules/mongoose/express/config.json +15 -15
- package/templates/modules/mongoose/express/src/lib/db.ts +43 -43
- package/templates/modules/mongoose/express/src/models/User.ts +48 -48
- package/templates/modules/mongoose/nestjs/config.json +15 -15
- package/templates/modules/mongoose/nextjs/config.json +15 -15
- package/templates/modules/mongoose/nextjs/models/User.ts +48 -48
- package/templates/modules/mongoose/tanstack/config.json +16 -16
- package/templates/modules/mongoose/tanstack/src/models/User.ts +48 -48
- package/templates/modules/prisma/express/config.json +27 -27
- package/templates/modules/prisma/express/prisma/schema.prisma +23 -23
- package/templates/modules/prisma/nestjs/config.json +27 -27
- package/templates/modules/prisma/nextjs/config.json +28 -28
- package/templates/modules/prisma/nextjs/lib/prisma.ts +18 -18
- package/templates/modules/prisma/nextjs/prisma.config.ts +14 -14
- package/templates/modules/prisma/tanstack/config.json +28 -28
- package/templates/modules/prisma/tanstack/prisma/schema.prisma.hbs +91 -91
- package/templates/modules/prisma/tanstack/prisma.config.ts +14 -14
- package/templates/modules/prisma/tanstack/src/lib/prisma.ts +17 -17
- package/templates/modules/vscode/.vscode/extensions.json.hbs +29 -0
- package/templates/modules/vscode/.vscode/settings.json.hbs +22 -0
- package/templates/modules/vscode/config.json +10 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "mongoose",
|
|
3
|
-
"name": "Mongoose (MongoDB)",
|
|
4
|
-
"description": "MongoDB database integration for Next.js using Mongoose ODM",
|
|
5
|
-
"type": "database",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"mongoose": "^9.11.4",
|
|
8
|
-
"mongodb": "^7.8.0"
|
|
9
|
-
},
|
|
10
|
-
"devDependencies": {},
|
|
11
|
-
"scripts": {},
|
|
12
|
-
"envVars": {
|
|
13
|
-
"MONGODB_URI": "mongodb://localhost:27017/myapp"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "mongoose",
|
|
3
|
+
"name": "Mongoose (MongoDB)",
|
|
4
|
+
"description": "MongoDB database integration for Next.js using Mongoose ODM",
|
|
5
|
+
"type": "database",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"mongoose": "^9.11.4",
|
|
8
|
+
"mongodb": "^7.8.0"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {},
|
|
11
|
+
"scripts": {},
|
|
12
|
+
"envVars": {
|
|
13
|
+
"MONGODB_URI": "mongodb://localhost:27017/myapp"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import mongoose, { type Model, Schema } from "mongoose";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* User document interface
|
|
5
|
-
*/
|
|
6
|
-
export interface IUser {
|
|
7
|
-
email: string;
|
|
8
|
-
name?: string | null;
|
|
9
|
-
password: string;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
updatedAt: Date;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* User schema definition
|
|
16
|
-
*/
|
|
17
|
-
const userSchema = new Schema<IUser>(
|
|
18
|
-
{
|
|
19
|
-
email: {
|
|
20
|
-
type: String,
|
|
21
|
-
required: true,
|
|
22
|
-
unique: true,
|
|
23
|
-
lowercase: true,
|
|
24
|
-
trim: true,
|
|
25
|
-
},
|
|
26
|
-
name: {
|
|
27
|
-
type: String,
|
|
28
|
-
trim: true,
|
|
29
|
-
},
|
|
30
|
-
password: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: true,
|
|
33
|
-
minlength: 6,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
timestamps: true,
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* User model
|
|
43
|
-
*/
|
|
44
|
-
const User =
|
|
45
|
-
(mongoose.models.User as Model<IUser> | undefined) ??
|
|
46
|
-
mongoose.model<IUser>("User", userSchema);
|
|
47
|
-
|
|
48
|
-
export default User;
|
|
1
|
+
import mongoose, { type Model, Schema } from "mongoose";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* User document interface
|
|
5
|
+
*/
|
|
6
|
+
export interface IUser {
|
|
7
|
+
email: string;
|
|
8
|
+
name?: string | null;
|
|
9
|
+
password: string;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* User schema definition
|
|
16
|
+
*/
|
|
17
|
+
const userSchema = new Schema<IUser>(
|
|
18
|
+
{
|
|
19
|
+
email: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
unique: true,
|
|
23
|
+
lowercase: true,
|
|
24
|
+
trim: true,
|
|
25
|
+
},
|
|
26
|
+
name: {
|
|
27
|
+
type: String,
|
|
28
|
+
trim: true,
|
|
29
|
+
},
|
|
30
|
+
password: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true,
|
|
33
|
+
minlength: 6,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
timestamps: true,
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* User model
|
|
43
|
+
*/
|
|
44
|
+
const User =
|
|
45
|
+
(mongoose.models.User as Model<IUser> | undefined) ??
|
|
46
|
+
mongoose.model<IUser>("User", userSchema);
|
|
47
|
+
|
|
48
|
+
export default User;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "mongoose",
|
|
3
|
-
"name": "Mongoose (MongoDB)",
|
|
4
|
-
"description": "MongoDB database integration for TanStack Start using Mongoose ODM",
|
|
5
|
-
"type": "database",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"mongoose": "^9.11.4",
|
|
8
|
-
"mongodb": "^7.8.0",
|
|
9
|
-
"dotenv": "^17.4.2"
|
|
10
|
-
},
|
|
11
|
-
"devDependencies": {},
|
|
12
|
-
"scripts": {},
|
|
13
|
-
"envVars": {
|
|
14
|
-
"MONGODB_URI": "mongodb://localhost:27017/myapp"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "mongoose",
|
|
3
|
+
"name": "Mongoose (MongoDB)",
|
|
4
|
+
"description": "MongoDB database integration for TanStack Start using Mongoose ODM",
|
|
5
|
+
"type": "database",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"mongoose": "^9.11.4",
|
|
8
|
+
"mongodb": "^7.8.0",
|
|
9
|
+
"dotenv": "^17.4.2"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {},
|
|
12
|
+
"scripts": {},
|
|
13
|
+
"envVars": {
|
|
14
|
+
"MONGODB_URI": "mongodb://localhost:27017/myapp"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import mongoose, { type Model, Schema } from "mongoose";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* User document interface
|
|
5
|
-
*/
|
|
6
|
-
export interface IUser {
|
|
7
|
-
email: string;
|
|
8
|
-
name?: string | null;
|
|
9
|
-
password: string;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
updatedAt: Date;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* User schema definition
|
|
16
|
-
*/
|
|
17
|
-
const userSchema = new Schema<IUser>(
|
|
18
|
-
{
|
|
19
|
-
email: {
|
|
20
|
-
type: String,
|
|
21
|
-
required: true,
|
|
22
|
-
unique: true,
|
|
23
|
-
lowercase: true,
|
|
24
|
-
trim: true,
|
|
25
|
-
},
|
|
26
|
-
name: {
|
|
27
|
-
type: String,
|
|
28
|
-
trim: true,
|
|
29
|
-
},
|
|
30
|
-
password: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: true,
|
|
33
|
-
minlength: 6,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
timestamps: true,
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* User model
|
|
43
|
-
*/
|
|
44
|
-
const User =
|
|
45
|
-
(mongoose.models.User as Model<IUser> | undefined) ??
|
|
46
|
-
mongoose.model<IUser>("User", userSchema);
|
|
47
|
-
|
|
48
|
-
export default User;
|
|
1
|
+
import mongoose, { type Model, Schema } from "mongoose";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* User document interface
|
|
5
|
+
*/
|
|
6
|
+
export interface IUser {
|
|
7
|
+
email: string;
|
|
8
|
+
name?: string | null;
|
|
9
|
+
password: string;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* User schema definition
|
|
16
|
+
*/
|
|
17
|
+
const userSchema = new Schema<IUser>(
|
|
18
|
+
{
|
|
19
|
+
email: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
unique: true,
|
|
23
|
+
lowercase: true,
|
|
24
|
+
trim: true,
|
|
25
|
+
},
|
|
26
|
+
name: {
|
|
27
|
+
type: String,
|
|
28
|
+
trim: true,
|
|
29
|
+
},
|
|
30
|
+
password: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true,
|
|
33
|
+
minlength: 6,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
timestamps: true,
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* User model
|
|
43
|
+
*/
|
|
44
|
+
const User =
|
|
45
|
+
(mongoose.models.User as Model<IUser> | undefined) ??
|
|
46
|
+
mongoose.model<IUser>("User", userSchema);
|
|
47
|
+
|
|
48
|
+
export default User;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "prisma",
|
|
3
|
-
"name": "Prisma ORM",
|
|
4
|
-
"description": "Prisma ORM with PostgreSQL database support",
|
|
5
|
-
"type": "database",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@prisma/adapter-pg": "^7.10.1",
|
|
8
|
-
"@prisma/client": "^7.10.1"
|
|
9
|
-
},
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"prisma": "^7.10.1"
|
|
12
|
-
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"prisma:generate": "prisma generate",
|
|
15
|
-
"prisma:migrate": "prisma migrate dev",
|
|
16
|
-
"prisma:studio": "prisma studio",
|
|
17
|
-
"pretype:check": "prisma generate",
|
|
18
|
-
"prebuild": "prisma generate"
|
|
19
|
-
},
|
|
20
|
-
"envVars": {
|
|
21
|
-
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
|
|
22
|
-
},
|
|
23
|
-
"overrides": {
|
|
24
|
-
"deepmerge-ts": "^8.0.2",
|
|
25
|
-
"mysql2": "^3.24.6"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "prisma",
|
|
3
|
+
"name": "Prisma ORM",
|
|
4
|
+
"description": "Prisma ORM with PostgreSQL database support",
|
|
5
|
+
"type": "database",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@prisma/adapter-pg": "^7.10.1",
|
|
8
|
+
"@prisma/client": "^7.10.1"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"prisma": "^7.10.1"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"prisma:generate": "prisma generate",
|
|
15
|
+
"prisma:migrate": "prisma migrate dev",
|
|
16
|
+
"prisma:studio": "prisma studio",
|
|
17
|
+
"pretype:check": "prisma generate",
|
|
18
|
+
"prebuild": "prisma generate"
|
|
19
|
+
},
|
|
20
|
+
"envVars": {
|
|
21
|
+
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
|
|
22
|
+
},
|
|
23
|
+
"overrides": {
|
|
24
|
+
"deepmerge-ts": "^8.0.2",
|
|
25
|
+
"mysql2": "^3.24.6"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
// Prisma schema file
|
|
2
|
-
// Learn more: https://pris.ly/d/prisma-schema
|
|
3
|
-
|
|
4
|
-
generator client {
|
|
1
|
+
// Prisma schema file
|
|
2
|
+
// Learn more: https://pris.ly/d/prisma-schema
|
|
3
|
+
|
|
4
|
+
generator client {
|
|
5
5
|
provider = "prisma-client"
|
|
6
|
-
moduleFormat = "cjs"
|
|
7
|
-
output = "../src/generated/prisma"
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
datasource db {
|
|
11
|
-
provider = "postgresql"
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Sample User model
|
|
15
|
-
model User {
|
|
16
|
-
id String @id @default(uuid())
|
|
17
|
-
email String @unique
|
|
18
|
-
name String?
|
|
19
|
-
password String
|
|
20
|
-
createdAt DateTime @default(now())
|
|
21
|
-
updatedAt DateTime @updatedAt
|
|
22
|
-
|
|
23
|
-
@@map("users")
|
|
24
|
-
}
|
|
6
|
+
moduleFormat = "cjs"
|
|
7
|
+
output = "../src/generated/prisma"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
datasource db {
|
|
11
|
+
provider = "postgresql"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Sample User model
|
|
15
|
+
model User {
|
|
16
|
+
id String @id @default(uuid())
|
|
17
|
+
email String @unique
|
|
18
|
+
name String?
|
|
19
|
+
password String
|
|
20
|
+
createdAt DateTime @default(now())
|
|
21
|
+
updatedAt DateTime @updatedAt
|
|
22
|
+
|
|
23
|
+
@@map("users")
|
|
24
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "prisma",
|
|
3
|
-
"name": "Prisma ORM",
|
|
4
|
-
"description": "Prisma ORM for NestJS with PostgreSQL",
|
|
5
|
-
"type": "database",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@prisma/adapter-pg": "^7.10.1",
|
|
8
|
-
"@prisma/client": "^7.10.1"
|
|
9
|
-
},
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"prisma": "^7.10.1"
|
|
12
|
-
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"prisma:generate": "prisma generate",
|
|
15
|
-
"prisma:migrate": "prisma migrate dev",
|
|
16
|
-
"prisma:studio": "prisma studio",
|
|
17
|
-
"pretype:check": "prisma generate",
|
|
18
|
-
"prebuild": "prisma generate"
|
|
19
|
-
},
|
|
20
|
-
"envVars": {
|
|
21
|
-
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
|
|
22
|
-
},
|
|
23
|
-
"overrides": {
|
|
24
|
-
"deepmerge-ts": "^8.0.2",
|
|
25
|
-
"mysql2": "^3.24.6"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "prisma",
|
|
3
|
+
"name": "Prisma ORM",
|
|
4
|
+
"description": "Prisma ORM for NestJS with PostgreSQL",
|
|
5
|
+
"type": "database",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@prisma/adapter-pg": "^7.10.1",
|
|
8
|
+
"@prisma/client": "^7.10.1"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"prisma": "^7.10.1"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"prisma:generate": "prisma generate",
|
|
15
|
+
"prisma:migrate": "prisma migrate dev",
|
|
16
|
+
"prisma:studio": "prisma studio",
|
|
17
|
+
"pretype:check": "prisma generate",
|
|
18
|
+
"prebuild": "prisma generate"
|
|
19
|
+
},
|
|
20
|
+
"envVars": {
|
|
21
|
+
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
|
|
22
|
+
},
|
|
23
|
+
"overrides": {
|
|
24
|
+
"deepmerge-ts": "^8.0.2",
|
|
25
|
+
"mysql2": "^3.24.6"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "prisma",
|
|
3
|
-
"name": "Prisma ORM",
|
|
4
|
-
"description": "Prisma ORM for Next.js with PostgreSQL",
|
|
5
|
-
"type": "database",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@prisma/client": "^7.10.1",
|
|
8
|
-
"@prisma/adapter-pg": "^7.10.1"
|
|
9
|
-
},
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"prisma": "^7.10.1",
|
|
12
|
-
"dotenv": "^17.4.2"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"prisma:generate": "prisma generate",
|
|
16
|
-
"prisma:migrate": "prisma migrate dev",
|
|
17
|
-
"prisma:studio": "prisma studio",
|
|
18
|
-
"pretype:check": "prisma generate",
|
|
19
|
-
"prebuild": "prisma generate"
|
|
20
|
-
},
|
|
21
|
-
"envVars": {
|
|
22
|
-
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
|
|
23
|
-
},
|
|
24
|
-
"overrides": {
|
|
25
|
-
"deepmerge-ts": "^8.0.2",
|
|
26
|
-
"mysql2": "^3.24.6"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "prisma",
|
|
3
|
+
"name": "Prisma ORM",
|
|
4
|
+
"description": "Prisma ORM for Next.js with PostgreSQL",
|
|
5
|
+
"type": "database",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@prisma/client": "^7.10.1",
|
|
8
|
+
"@prisma/adapter-pg": "^7.10.1"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"prisma": "^7.10.1",
|
|
12
|
+
"dotenv": "^17.4.2"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"prisma:generate": "prisma generate",
|
|
16
|
+
"prisma:migrate": "prisma migrate dev",
|
|
17
|
+
"prisma:studio": "prisma studio",
|
|
18
|
+
"pretype:check": "prisma generate",
|
|
19
|
+
"prebuild": "prisma generate"
|
|
20
|
+
},
|
|
21
|
+
"envVars": {
|
|
22
|
+
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
|
|
23
|
+
},
|
|
24
|
+
"overrides": {
|
|
25
|
+
"deepmerge-ts": "^8.0.2",
|
|
26
|
+
"mysql2": "^3.24.6"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { PrismaPg } from "@prisma/adapter-pg";
|
|
2
|
-
|
|
3
|
-
import { PrismaClient } from "../generated/client";
|
|
4
|
-
|
|
5
|
-
const globalForPrisma = global as unknown as {
|
|
6
|
-
prisma: PrismaClient;
|
|
7
|
-
};
|
|
8
|
-
const adapter = new PrismaPg({
|
|
9
|
-
connectionString: process.env.DATABASE_URL,
|
|
10
|
-
});
|
|
11
|
-
const prisma =
|
|
12
|
-
globalForPrisma.prisma ||
|
|
13
|
-
new PrismaClient({
|
|
14
|
-
adapter,
|
|
15
|
-
});
|
|
16
|
-
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
|
|
17
|
-
|
|
18
|
-
export default prisma;
|
|
1
|
+
import { PrismaPg } from "@prisma/adapter-pg";
|
|
2
|
+
|
|
3
|
+
import { PrismaClient } from "../generated/client";
|
|
4
|
+
|
|
5
|
+
const globalForPrisma = global as unknown as {
|
|
6
|
+
prisma: PrismaClient;
|
|
7
|
+
};
|
|
8
|
+
const adapter = new PrismaPg({
|
|
9
|
+
connectionString: process.env.DATABASE_URL,
|
|
10
|
+
});
|
|
11
|
+
const prisma =
|
|
12
|
+
globalForPrisma.prisma ||
|
|
13
|
+
new PrismaClient({
|
|
14
|
+
adapter,
|
|
15
|
+
});
|
|
16
|
+
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
|
|
17
|
+
|
|
18
|
+
export default prisma;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "dotenv/config";
|
|
2
|
-
import { defineConfig } from "prisma/config";
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
schema: "prisma/schema.prisma",
|
|
6
|
-
migrations: {
|
|
7
|
-
path: "prisma/migrations",
|
|
8
|
-
},
|
|
9
|
-
datasource: {
|
|
10
|
-
// prisma generate needs no URL, so a build without .env (CI, a host) works.
|
|
11
|
-
// Commands that connect report the empty URL
|
|
12
|
-
url: process.env.DATABASE_URL ?? "",
|
|
13
|
-
},
|
|
14
|
-
});
|
|
1
|
+
import "dotenv/config";
|
|
2
|
+
import { defineConfig } from "prisma/config";
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
schema: "prisma/schema.prisma",
|
|
6
|
+
migrations: {
|
|
7
|
+
path: "prisma/migrations",
|
|
8
|
+
},
|
|
9
|
+
datasource: {
|
|
10
|
+
// prisma generate needs no URL, so a build without .env (CI, a host) works.
|
|
11
|
+
// Commands that connect report the empty URL
|
|
12
|
+
url: process.env.DATABASE_URL ?? "",
|
|
13
|
+
},
|
|
14
|
+
});
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "prisma",
|
|
3
|
-
"name": "Prisma ORM",
|
|
4
|
-
"description": "Prisma ORM for TanStack Start with PostgreSQL",
|
|
5
|
-
"type": "database",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@prisma/client": "^7.10.1",
|
|
8
|
-
"@prisma/adapter-pg": "^7.10.1"
|
|
9
|
-
},
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"prisma": "^7.10.1",
|
|
12
|
-
"dotenv": "^17.4.2"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"prisma:generate": "prisma generate",
|
|
16
|
-
"prisma:migrate": "prisma migrate dev",
|
|
17
|
-
"prisma:studio": "prisma studio",
|
|
18
|
-
"pretype:check": "prisma generate",
|
|
19
|
-
"prebuild": "prisma generate"
|
|
20
|
-
},
|
|
21
|
-
"envVars": {
|
|
22
|
-
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
|
|
23
|
-
},
|
|
24
|
-
"overrides": {
|
|
25
|
-
"deepmerge-ts": "^8.0.2",
|
|
26
|
-
"mysql2": "^3.24.6"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "prisma",
|
|
3
|
+
"name": "Prisma ORM",
|
|
4
|
+
"description": "Prisma ORM for TanStack Start with PostgreSQL",
|
|
5
|
+
"type": "database",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@prisma/client": "^7.10.1",
|
|
8
|
+
"@prisma/adapter-pg": "^7.10.1"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"prisma": "^7.10.1",
|
|
12
|
+
"dotenv": "^17.4.2"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"prisma:generate": "prisma generate",
|
|
16
|
+
"prisma:migrate": "prisma migrate dev",
|
|
17
|
+
"prisma:studio": "prisma studio",
|
|
18
|
+
"pretype:check": "prisma generate",
|
|
19
|
+
"prebuild": "prisma generate"
|
|
20
|
+
},
|
|
21
|
+
"envVars": {
|
|
22
|
+
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
|
|
23
|
+
},
|
|
24
|
+
"overrides": {
|
|
25
|
+
"deepmerge-ts": "^8.0.2",
|
|
26
|
+
"mysql2": "^3.24.6"
|
|
27
|
+
}
|
|
28
|
+
}
|