stackkit 0.1.3 → 0.1.4
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/README.md +4 -2
- package/dist/cli/add.d.ts +2 -1
- package/dist/cli/add.js +317 -105
- package/dist/cli/create.js +2 -3
- package/dist/cli/doctor.js +0 -4
- package/dist/index.js +23 -4
- package/dist/lib/conversion/js-conversion.js +1 -1
- package/dist/lib/discovery/module-discovery.d.ts +0 -1
- package/dist/lib/discovery/module-discovery.js +3 -3
- package/dist/lib/generation/code-generator.d.ts +14 -0
- package/dist/lib/generation/code-generator.js +55 -24
- package/dist/lib/generation/generator-utils.d.ts +11 -0
- package/dist/lib/generation/generator-utils.js +116 -0
- package/dist/lib/git-utils.js +20 -0
- package/dist/lib/project/detect.js +2 -4
- package/dist/types/index.d.ts +0 -10
- package/modules/auth/authjs/generator.json +10 -0
- package/modules/auth/authjs/module.json +0 -9
- package/modules/auth/better-auth/files/lib/auth.ts +7 -7
- package/modules/auth/better-auth/generator.json +12 -12
- package/modules/auth/better-auth/module.json +0 -24
- package/modules/database/mongoose/files/models/health.ts +34 -0
- package/modules/database/mongoose/generator.json +4 -4
- package/modules/database/mongoose/module.json +1 -2
- package/modules/database/prisma/files/lib/prisma.ts +2 -1
- package/modules/database/prisma/generator.json +33 -8
- package/modules/database/prisma/module.json +1 -4
- package/package.json +1 -1
- package/templates/express/tsconfig.json +2 -23
- package/dist/lib/database/database-config.d.ts +0 -6
- package/dist/lib/database/database-config.js +0 -9
- package/modules/database/mongoose/files/models/User.ts +0 -34
- /package/modules/database/mongoose/files/lib/{db.ts → mongoose.ts} +0 -0
|
@@ -16,14 +16,39 @@
|
|
|
16
16
|
{
|
|
17
17
|
"type": "create-file",
|
|
18
18
|
"source": "lib/prisma.ts",
|
|
19
|
-
"destination": "lib/prisma.ts"
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
"destination": "lib/prisma.ts"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "add-dependency",
|
|
23
|
+
"condition": { "prismaProvider": "postgresql" },
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@prisma/adapter-pg": "^5.0.0",
|
|
26
|
+
"pg": "^8.0.0"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "add-dependency",
|
|
31
|
+
"condition": { "prismaProvider": "mysql" },
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@prisma/adapter-mariadb": "^5.0.0",
|
|
34
|
+
"mysql2": "^3.0.0"
|
|
22
35
|
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "add-dependency",
|
|
39
|
+
"condition": { "prismaProvider": "sqlite" },
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@prisma/adapter-better-sqlite3": "^5.0.0",
|
|
42
|
+
"better-sqlite3": "^9.0.0"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "add-dependency",
|
|
47
|
+
"condition": { "prismaProvider": "mongodb" },
|
|
48
|
+
"dependencies": {}
|
|
23
49
|
}
|
|
24
50
|
],
|
|
25
51
|
"dependencies": {
|
|
26
|
-
"prisma": "^7.2.0",
|
|
27
52
|
"@prisma/client": "^7.2.0",
|
|
28
53
|
"dotenv": "^17.2.3"
|
|
29
54
|
},
|
|
@@ -31,11 +56,11 @@
|
|
|
31
56
|
"prisma": "^7.2.0"
|
|
32
57
|
},
|
|
33
58
|
"scripts": {
|
|
34
|
-
"db:generate": "prisma generate",
|
|
35
|
-
"db:push": "prisma db push",
|
|
59
|
+
"db:generate": "npx prisma generate",
|
|
60
|
+
"db:push": "npx prisma db push",
|
|
36
61
|
"db:seed": "tsx prisma/seed.ts",
|
|
37
|
-
"db:migrate": "prisma migrate dev",
|
|
38
|
-
"db:studio": "prisma studio"
|
|
62
|
+
"db:migrate": "npx prisma migrate dev",
|
|
63
|
+
"db:studio": "npx prisma studio"
|
|
39
64
|
},
|
|
40
65
|
"envVars": {
|
|
41
66
|
"DATABASE_URL": "postgresql://username:password@localhost:5432/database_name"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma",
|
|
3
3
|
"displayName": "Prisma",
|
|
4
|
-
"description": "Prisma ORM",
|
|
5
4
|
"category": "database",
|
|
6
5
|
"provider": "prisma",
|
|
7
6
|
"supportedFrameworks": ["nextjs", "express"],
|
|
@@ -11,7 +10,5 @@
|
|
|
11
10
|
"languages": ["typescript", "javascript"],
|
|
12
11
|
"packageManagers": ["npm", "yarn", "pnpm", "bun"]
|
|
13
12
|
},
|
|
14
|
-
"postInstall": [
|
|
15
|
-
"npx prisma generate"
|
|
16
|
-
]
|
|
13
|
+
"postInstall": ["npx prisma generate"]
|
|
17
14
|
}
|
package/package.json
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"outDir": "./dist",
|
|
4
3
|
"module": "ESNext",
|
|
5
4
|
"moduleResolution": "node",
|
|
6
5
|
"target": "ES2023",
|
|
7
|
-
"lib": ["ES2023"],
|
|
8
6
|
"strict": true,
|
|
9
7
|
"esModuleInterop": true,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"declaration": false,
|
|
16
|
-
"declarationMap": false,
|
|
17
|
-
"removeComments": false,
|
|
18
|
-
"noImplicitAny": true,
|
|
19
|
-
"noImplicitReturns": true,
|
|
20
|
-
"noImplicitThis": true,
|
|
21
|
-
"noUnusedLocals": true,
|
|
22
|
-
"noUnusedParameters": true,
|
|
23
|
-
"exactOptionalPropertyTypes": true,
|
|
24
|
-
"noEmitOnError": true,
|
|
25
|
-
"incremental": false,
|
|
26
|
-
"ignoreDeprecations": "5.0"
|
|
27
|
-
},
|
|
28
|
-
"include": ["src/**/*"],
|
|
29
|
-
"exclude": ["node_modules", "dist"]
|
|
30
|
-
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const DATABASE_CONNECTION_STRINGS: {
|
|
2
|
-
readonly postgresql: "postgresql://user:password@localhost:5432/mydb?schema=public";
|
|
3
|
-
readonly mongodb: "mongodb://localhost:27017/mydb";
|
|
4
|
-
readonly mysql: "mysql://user:password@localhost:3306/mydb";
|
|
5
|
-
readonly sqlite: "file:./dev.db";
|
|
6
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DATABASE_CONNECTION_STRINGS = void 0;
|
|
4
|
-
exports.DATABASE_CONNECTION_STRINGS = {
|
|
5
|
-
postgresql: "postgresql://user:password@localhost:5432/mydb?schema=public",
|
|
6
|
-
mongodb: "mongodb://localhost:27017/mydb",
|
|
7
|
-
mysql: "mysql://user:password@localhost:3306/mydb",
|
|
8
|
-
sqlite: "file:./dev.db",
|
|
9
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import mongoose, { Document, Schema } from "mongoose";
|
|
2
|
-
|
|
3
|
-
export interface IUser extends Document {
|
|
4
|
-
name: string;
|
|
5
|
-
email: string;
|
|
6
|
-
createdAt: Date;
|
|
7
|
-
updatedAt: Date;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const UserSchema: Schema = new Schema(
|
|
11
|
-
{
|
|
12
|
-
name: {
|
|
13
|
-
type: String,
|
|
14
|
-
required: true,
|
|
15
|
-
trim: true,
|
|
16
|
-
},
|
|
17
|
-
email: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true,
|
|
20
|
-
unique: true,
|
|
21
|
-
lowercase: true,
|
|
22
|
-
trim: true,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
timestamps: true,
|
|
27
|
-
},
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
// Add indexes for better performance
|
|
31
|
-
UserSchema.index({ email: 1 });
|
|
32
|
-
UserSchema.index({ createdAt: -1 });
|
|
33
|
-
|
|
34
|
-
export default mongoose.models.User || mongoose.model<IUser>("User", UserSchema);
|
|
File without changes
|