stackkit 0.2.7 → 0.2.9

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.
Files changed (61) hide show
  1. package/README.md +91 -12
  2. package/dist/lib/fs/files.js +1 -1
  3. package/dist/lib/generation/code-generator.d.ts +2 -7
  4. package/dist/lib/generation/code-generator.js +120 -56
  5. package/dist/lib/utils/fs-helpers.d.ts +1 -1
  6. package/modules/auth/authjs/generator.json +16 -16
  7. package/modules/auth/better-auth/files/express/middlewares/authorize.ts +121 -41
  8. package/modules/auth/better-auth/files/express/modules/auth/auth.controller.ts +257 -0
  9. package/modules/auth/better-auth/files/express/modules/auth/auth.interface.ts +23 -0
  10. package/modules/auth/better-auth/files/express/modules/auth/auth.route.ts +22 -0
  11. package/modules/auth/better-auth/files/express/modules/auth/auth.service.ts +403 -0
  12. package/modules/auth/better-auth/files/express/templates/google-redirect.ejs +91 -0
  13. package/modules/auth/better-auth/files/express/templates/otp.ejs +87 -0
  14. package/modules/auth/better-auth/files/express/types/express.d.ts +6 -8
  15. package/modules/auth/better-auth/files/express/utils/cookie.ts +19 -0
  16. package/modules/auth/better-auth/files/express/utils/jwt.ts +34 -0
  17. package/modules/auth/better-auth/files/express/utils/token.ts +66 -0
  18. package/modules/auth/better-auth/files/nextjs/api/auth/[...all]/route.ts +1 -1
  19. package/modules/auth/better-auth/files/nextjs/lib/auth/auth-guards.ts +11 -1
  20. package/modules/auth/better-auth/files/nextjs/templates/email-otp.tsx +74 -0
  21. package/modules/auth/better-auth/files/shared/config/env.ts +113 -0
  22. package/modules/auth/better-auth/files/shared/lib/auth-client.ts +1 -1
  23. package/modules/auth/better-auth/files/shared/lib/auth.ts +151 -62
  24. package/modules/auth/better-auth/files/shared/prisma/schema.prisma +22 -11
  25. package/modules/auth/better-auth/files/shared/utils/email.ts +71 -0
  26. package/modules/auth/better-auth/generator.json +159 -81
  27. package/modules/database/mongoose/generator.json +18 -18
  28. package/modules/database/prisma/generator.json +44 -44
  29. package/package.json +1 -1
  30. package/templates/express/env.example +2 -2
  31. package/templates/express/eslint.config.mjs +7 -0
  32. package/templates/express/node_modules/.bin/acorn +17 -0
  33. package/templates/express/node_modules/.bin/eslint +17 -0
  34. package/templates/express/node_modules/.bin/tsc +17 -0
  35. package/templates/express/node_modules/.bin/tsserver +17 -0
  36. package/templates/express/node_modules/.bin/tsx +17 -0
  37. package/templates/express/package.json +12 -6
  38. package/templates/express/src/app.ts +15 -7
  39. package/templates/express/src/config/cors.ts +8 -7
  40. package/templates/express/src/config/env.ts +26 -5
  41. package/templates/express/src/config/logger.ts +2 -2
  42. package/templates/express/src/config/rate-limit.ts +2 -2
  43. package/templates/express/src/modules/health/health.controller.ts +13 -11
  44. package/templates/express/src/routes/index.ts +1 -6
  45. package/templates/express/src/server.ts +12 -12
  46. package/templates/express/src/shared/errors/app-error.ts +16 -0
  47. package/templates/express/src/shared/middlewares/error.middleware.ts +154 -12
  48. package/templates/express/src/shared/middlewares/not-found.middleware.ts +2 -1
  49. package/templates/express/src/shared/utils/catch-async.ts +11 -0
  50. package/templates/express/src/shared/utils/pagination.ts +6 -1
  51. package/templates/express/src/shared/utils/send-response.ts +25 -0
  52. package/templates/nextjs/lib/env.ts +19 -8
  53. package/modules/auth/better-auth/files/shared/lib/email/email-service.ts +0 -33
  54. package/modules/auth/better-auth/files/shared/lib/email/email-templates.ts +0 -89
  55. package/templates/express/eslint.config.cjs +0 -42
  56. package/templates/express/src/config/helmet.ts +0 -5
  57. package/templates/express/src/modules/health/health.service.ts +0 -6
  58. package/templates/express/src/shared/errors/error-codes.ts +0 -9
  59. package/templates/express/src/shared/logger/logger.ts +0 -20
  60. package/templates/express/src/shared/utils/async-handler.ts +0 -9
  61. package/templates/express/src/shared/utils/response.ts +0 -9
@@ -6,56 +6,26 @@
6
6
  {
7
7
  "type": "create-file",
8
8
  "source": "shared/lib/auth.ts",
9
- "destination": "server/auth/auth.ts",
10
- "condition": { "framework": ["nextjs"] }
11
- },
12
- {
13
- "type": "create-file",
14
- "source": "shared/lib/auth.ts",
15
- "destination": "src/modules/auth/auth.ts",
9
+ "destination": "src/lib/auth.ts",
16
10
  "condition": { "framework": ["express"] }
17
11
  },
18
12
  {
19
13
  "type": "create-file",
20
- "source": "shared/lib/email/email-service.ts",
21
- "destination": "server/service/email/email-service.ts",
22
- "condition": { "framework": ["nextjs"] }
23
- },
24
- {
25
- "type": "create-file",
26
- "source": "shared/lib/email/email-service.ts",
27
- "destination": "src/shared/email/email-service.ts",
28
- "condition": { "framework": ["express"] }
29
- },
30
- {
31
- "type": "create-file",
32
- "source": "shared/lib/email/email-templates.ts",
33
- "destination": "server/service/email/email-templates.ts",
34
- "condition": { "framework": ["nextjs"] }
35
- },
36
- {
37
- "type": "create-file",
38
- "source": "shared/lib/email/email-templates.ts",
39
- "destination": "src/shared/email/email-templates.ts",
40
- "condition": { "framework": ["express"] }
41
- },
42
- {
43
- "type": "create-file",
44
- "source": "nextjs/api/auth/[...all]/route.ts",
45
- "destination": "app/api/auth/[...all]/route.ts",
46
- "condition": { "framework": "nextjs" }
14
+ "source": "express/types/express.d.ts",
15
+ "destination": "src/types/express.d.ts",
16
+ "condition": { "framework": "express" }
47
17
  },
48
18
  {
49
19
  "type": "create-file",
50
- "source": "nextjs/proxy.ts",
51
- "destination": "proxy.ts",
52
- "condition": { "framework": "nextjs" }
20
+ "source": "shared/config/env.ts",
21
+ "destination": "src/config/env.ts",
22
+ "condition": { "framework": "express" }
53
23
  },
54
24
  {
55
25
  "type": "create-file",
56
- "source": "nextjs/lib/auth/auth-guards.ts",
57
- "destination": "server/auth/guards.ts",
58
- "condition": { "framework": "nextjs" }
26
+ "source": "express/modules/auth/*",
27
+ "destination": "src/modules/auth/*",
28
+ "condition": { "framework": "express" }
59
29
  },
60
30
  {
61
31
  "type": "create-file",
@@ -65,99 +35,207 @@
65
35
  },
66
36
  {
67
37
  "type": "create-file",
68
- "source": "express/types/express.d.ts",
69
- "destination": "src/types/express.d.ts",
38
+ "source": "express/templates/*",
39
+ "destination": "src/templates/*",
70
40
  "condition": { "framework": "express" }
71
41
  },
72
42
  {
73
43
  "type": "create-file",
74
- "source": "shared/lib/auth-client.ts",
75
- "destination": "lib/auth/auth-client.ts",
76
- "condition": { "framework": ["nextjs"] }
44
+ "source": "express/utils/*",
45
+ "destination": "src/shared/utils/*",
46
+ "condition": { "framework": "express" }
77
47
  },
78
48
  {
79
49
  "type": "create-file",
80
- "source": "shared/lib/auth-client.ts",
81
- "destination": "src/shared/lib/auth-client.ts",
82
- "condition": { "framework": ["react"] }
50
+ "source": "shared/utils/email.ts",
51
+ "destination": "src/shared/utils/email.ts",
52
+ "condition": { "framework": "express" }
83
53
  },
84
54
  {
85
55
  "type": "patch-file",
86
- "destination": "prisma/schema.prisma",
87
- "condition": { "database": "prisma" },
56
+ "destination": "src/app.ts",
57
+ "condition": { "framework": "express" },
88
58
  "operations": [
89
59
  {
90
- "type": "add-to-bottom",
91
- "source": "shared/prisma/schema.prisma"
60
+ "type": "add-import",
61
+ "imports": [
62
+ "import { auth } from \"./lib/auth\";",
63
+ "import { toNodeHandler } from \"better-auth/node\";",
64
+ "import path from \"path\";"
65
+ ]
66
+ },
67
+ {
68
+ "type": "add-code",
69
+ "after": "// API routes",
70
+ "code": ["app.use(\"/api/auth\", toNodeHandler(auth));"]
71
+ },
72
+ {
73
+ "type": "add-code",
74
+ "after": "app.set(\"query parser\", (str: string) => qs.parse(str));",
75
+ "code": [
76
+ "app.set(\"view engine\", \"ejs\");",
77
+ "app.set(\"views\", path.resolve(process.cwd(), `src/templates`));"
78
+ ]
92
79
  }
93
80
  ]
94
81
  },
95
82
  {
96
83
  "type": "patch-file",
97
- "destination": "src/server.ts",
84
+ "destination": "src/routes/index.ts",
98
85
  "condition": { "framework": "express" },
99
86
  "operations": [
100
87
  {
101
88
  "type": "add-import",
102
- "imports": ["import { setupAuth } from \"./modules/auth/auth\";"]
89
+ "imports": ["import { authRoutes } from \"../modules/auth/auth.route\";"]
103
90
  },
104
91
  {
105
92
  "type": "add-code",
106
- "before": "const port = env.port;",
107
- "code": "await setupAuth();"
93
+ "after": "router.use(\"/health\", healthRoutes);",
94
+ "code": ["router.use(\"/auth\", authRoutes);"]
108
95
  }
109
96
  ]
110
97
  },
111
98
  {
112
99
  "type": "patch-file",
113
- "destination": "src/app.ts",
114
- "condition": { "framework": "express" },
100
+ "destination": "src/server.ts",
101
+ "condition": { "framework": "express", "database": "mongoose" },
115
102
  "operations": [
116
103
  {
117
104
  "type": "add-import",
118
- "imports": ["import { auth } from \"./modules/auth/auth\";",
119
- "import { toNodeHandler } from \"better-auth/node\";"]
105
+ "imports": ["import { setupAuth } from \"./modules/auth/auth\";"]
120
106
  },
121
107
  {
122
108
  "type": "add-code",
123
- "after": "// API routes",
124
- "code": [
125
- "app.all(\"/api/auth/*splat\", (req: Request, res: Response) => {",
126
- " if (!auth) {",
127
- " return res.status(503).json({ success: false, message: \"Auth not ready\" });",
128
- " }",
129
- " return toNodeHandler(auth)(req, res);",
130
- "});"
131
- ]
109
+ "before": "app.listen(envVars.PORT, () => {",
110
+ "code": "await setupAuth();"
132
111
  }
133
112
  ]
134
113
  },
135
114
  {
136
115
  "type": "add-dependency",
137
- "condition": { "framework": ["nextjs", "express"] },
116
+ "condition": { "framework": "express" },
138
117
  "dependencies": {
139
- "nodemailer": "^7.0.12"
118
+ "ejs": "^4.0.1",
119
+ "jsonwebtoken": "^9.0.3"
140
120
  },
141
121
  "devDependencies": {
142
- "@types/nodemailer": "^7.0.5"
122
+ "@types/ejs": "^3.1.5",
123
+ "@types/jsonwebtoken": "^9.0.10"
143
124
  }
144
125
  },
145
126
  {
146
127
  "type": "add-env",
128
+ "condition": { "framework": "express" },
147
129
  "envVars": {
148
- "BETTER_AUTH_SECRET": "",
149
- "BETTER_AUTH_URL": "http://localhost:3000",
150
- "EMAIL_HOST": "smtp.gmail.com",
151
- "EMAIL_PORT": "587",
152
- "EMAIL_USER": "",
153
- "EMAIL_PASS": "",
154
- "EMAIL_FROM": "noreply@yourapp.com"
130
+ "BETTER_AUTH_URL": "http://localhost:3000/api/auth",
131
+ "BETTER_AUTH_SECRET": "your_better_auth_secret",
132
+ "BETTER_AUTH_SESSION_TOKEN_EXPIRES_IN": "1d",
133
+ "BETTER_AUTH_SESSION_TOKEN_UPDATE_AGE": "1d",
134
+ "ACCESS_TOKEN_SECRET": "your_access_token_secret",
135
+ "ACCESS_TOKEN_EXPIRES_IN": "1d",
136
+ "REFRESH_TOKEN_SECRET": "your_refresh_token_secret",
137
+ "REFRESH_TOKEN_EXPIRES_IN": "7d",
138
+ "GOOGLE_CALLBACK_URL": "http://localhost:5000/api/auth/callback/google",
139
+ "EMAIL_SENDER_SMTP_USER": "your_email@gmail.com",
140
+ "EMAIL_SENDER_SMTP_PASS": "your_email_password",
141
+ "EMAIL_SENDER_SMTP_HOST": "smtp.gmail.com",
142
+ "EMAIL_SENDER_SMTP_PORT": "465",
143
+ "EMAIL_SENDER_SMTP_FROM": "your_email@gmail.com",
144
+ "SUPER_ADMIN_EMAIL": "your_email@gmail.com",
145
+ "SUPER_ADMIN_PASSWORD": "your_super_admin_password"
146
+ }
147
+ },
148
+ {
149
+ "type": "create-file",
150
+ "source": "shared/lib/auth.ts",
151
+ "destination": "server/auth/auth.ts",
152
+ "condition": { "framework": "nextjs" }
153
+ },
154
+ {
155
+ "type": "create-file",
156
+ "source": "nextjs/api/auth/[...all]/route.ts",
157
+ "destination": "app/api/auth/[...all]/route.ts",
158
+ "condition": { "framework": "nextjs" }
159
+ },
160
+ {
161
+ "type": "create-file",
162
+ "source": "nextjs/lib/auth/auth-guards.ts",
163
+ "destination": "server/auth/guards.ts",
164
+ "condition": { "framework": "nextjs" }
165
+ },
166
+ {
167
+ "type": "create-file",
168
+ "source": "nextjs/proxy.ts",
169
+ "destination": "proxy.ts",
170
+ "condition": { "framework": "nextjs" }
171
+ },
172
+ {
173
+ "type": "create-file",
174
+ "source": "shared/lib/auth-client.ts",
175
+ "destination": "lib/auth/auth-client.ts",
176
+ "condition": { "framework": ["nextjs"] }
177
+ },
178
+ {
179
+ "type": "create-file",
180
+ "source": "shared/utils/email.ts",
181
+ "destination": "lib/utils/email.ts",
182
+ "condition": { "framework": "nextjs" }
183
+ },
184
+ {
185
+ "type": "create-file",
186
+ "source": "nextjs/templates/email-otp.tsx",
187
+ "destination": "lib/email/otp-template.tsx",
188
+ "condition": { "framework": "nextjs" }
189
+ },
190
+ {
191
+ "type": "create-file",
192
+ "source": "shared/config/env.ts",
193
+ "destination": "lib/env.ts",
194
+ "condition": { "framework": "nextjs" }
195
+ },
196
+ {
197
+ "type": "add-env",
198
+ "condition": { "framework": "nextjs" },
199
+ "envVars": {
200
+ "NEXT_PUBLIC_APP_URL": "http://localhost:3000",
201
+ "NEXT_PUBLIC_FRONTEND_URL": "http://localhost:3000",
202
+ "NEXT_PUBLIC_BETTER_AUTH_URL": "http://localhost:3000/api/auth",
203
+ "BETTER_AUTH_SECRET": "your_better_auth_secret",
204
+ "GOOGLE_CLIENT_ID": "your_google_client_id",
205
+ "GOOGLE_CLIENT_SECRET": "your_google_client_secret",
206
+ "NEXT_PUBLIC_GOOGLE_CALLBACK_URL": "http://localhost:3000/api/auth/callback/google",
207
+ "EMAIL_SENDER_SMTP_USER": "your_email@gmail.com",
208
+ "EMAIL_SENDER_SMTP_PASS": "your_email_password",
209
+ "EMAIL_SENDER_SMTP_HOST": "smtp.gmail.com",
210
+ "EMAIL_SENDER_SMTP_PORT": "465",
211
+ "EMAIL_SENDER_SMTP_FROM": "your_email@gmail.com"
212
+ }
213
+ },
214
+ {
215
+ "type": "create-file",
216
+ "source": "shared/lib/auth-client.ts",
217
+ "destination": "src/shared/lib/auth-client.ts",
218
+ "condition": { "framework": "react" }
219
+ },
220
+ {
221
+ "type": "patch-file",
222
+ "destination": "prisma/schema.prisma",
223
+ "condition": { "database": "prisma" },
224
+ "operations": [
225
+ {
226
+ "type": "add-to-bottom",
227
+ "source": "shared/prisma/schema.prisma"
155
228
  }
156
- },
229
+ ]
230
+ },
157
231
  {
158
232
  "type": "add-dependency",
159
233
  "dependencies": {
160
- "better-auth": "^1.4.12"
234
+ "better-auth": "^1.4.12",
235
+ "nodemailer": "^7.0.12"
236
+ },
237
+ "devDependencies": {
238
+ "@types/nodemailer": "^7.0.5"
161
239
  }
162
240
  }
163
241
  ]
@@ -3,12 +3,6 @@
3
3
  "type": "database",
4
4
  "priority": 5,
5
5
  "operations": [
6
- {
7
- "type": "create-file",
8
- "source": "lib/mongoose.ts",
9
- "destination": "server/database/mongoose.ts",
10
- "condition": { "framework": ["nextjs"] }
11
- },
12
6
  {
13
7
  "type": "create-file",
14
8
  "source": "lib/mongoose.ts",
@@ -21,12 +15,6 @@
21
15
  "destination": "src/modules/health/health.model.ts",
22
16
  "condition": { "framework": ["express"] }
23
17
  },
24
- {
25
- "type": "create-file",
26
- "source": "models/health.ts",
27
- "destination": "server/database/models/health.model.ts",
28
- "condition": { "framework": ["nextjs"] }
29
- },
30
18
  {
31
19
  "type": "patch-file",
32
20
  "destination": "src/server.ts",
@@ -34,26 +22,38 @@
34
22
  "operations": [
35
23
  {
36
24
  "type": "add-import",
37
- "imports": ["import { mongoose } from \"../lib/mongoose\";"]
25
+ "imports": ["import { mongoose } from \"./database/mongoose\";"]
38
26
  },
39
27
  {
40
28
  "type": "add-code",
41
- "after": "async function startServer() {",
29
+ "after": "try {",
42
30
  "code": "await mongoose();"
43
31
  }
44
32
  ]
45
33
  },
46
34
  {
47
- "type": "add-env",
48
- "envVars": {
49
- "MONGODB_URI": "mongodb://localhost:27017/database_name"
50
- }
35
+ "type": "create-file",
36
+ "source": "lib/mongoose.ts",
37
+ "destination": "server/database/mongoose.ts",
38
+ "condition": { "framework": ["nextjs"] }
39
+ },
40
+ {
41
+ "type": "create-file",
42
+ "source": "models/health.ts",
43
+ "destination": "server/database/models/health.model.ts",
44
+ "condition": { "framework": ["nextjs"] }
51
45
  },
52
46
  {
53
47
  "type": "add-dependency",
54
48
  "dependencies": {
55
49
  "mongoose": "^8.8.0"
56
50
  }
51
+ },
52
+ {
53
+ "type": "add-env",
54
+ "envVars": {
55
+ "DATABASE_URL": "mongodb://localhost:27017/database_name"
56
+ }
57
57
  }
58
58
  ]
59
59
  }
@@ -16,51 +16,88 @@
16
16
  {
17
17
  "type": "create-file",
18
18
  "source": "lib/prisma.ts",
19
- "destination": "server/database/prisma.ts",
20
- "condition": { "framework": ["nextjs"] }
19
+ "destination": "src/database/prisma.ts",
20
+ "condition": { "framework": ["express"] }
21
21
  },
22
22
  {
23
23
  "type": "create-file",
24
24
  "source": "lib/prisma.ts",
25
- "destination": "src/database/prisma.ts",
26
- "condition": { "framework": ["express"] }
25
+ "destination": "server/database/prisma.ts",
26
+ "condition": { "framework": ["nextjs"] }
27
+ },
28
+ {
29
+ "type": "add-dependency",
30
+ "dependencies": {
31
+ "dotenv": "^17.2.3"
32
+ }
33
+ },
34
+ {
35
+ "type": "add-script",
36
+ "scripts": {
37
+ "db:generate": "npx prisma generate",
38
+ "db:push": "npx prisma db push",
39
+ "db:seed": "tsx prisma/seed.ts",
40
+ "db:migrate": "npx prisma migrate dev",
41
+ "db:studio": "npx prisma studio"
42
+ }
27
43
  },
28
44
  {
29
45
  "type": "add-dependency",
30
46
  "condition": { "prismaProvider": "postgresql" },
31
47
  "dependencies": {
32
- "@prisma/adapter-pg": "^7.0.0",
33
48
  "@prisma/client": "^7.2.0",
49
+ "@prisma/adapter-pg": "^7.0.0",
34
50
  "pg": "^8.0.0"
35
51
  },
36
52
  "devDependencies": {
37
53
  "prisma": "^7.2.0"
38
54
  }
39
55
  },
56
+ {
57
+ "type": "add-env",
58
+ "condition": { "prismaProvider": "postgresql" },
59
+ "envVars": {
60
+ "DATABASE_URL": "postgresql://username:password@localhost:5432/database_name"
61
+ }
62
+ },
40
63
  {
41
64
  "type": "add-dependency",
42
65
  "condition": { "prismaProvider": "mysql" },
43
66
  "dependencies": {
44
- "@prisma/adapter-mariadb": "^7.0.0",
45
67
  "@prisma/client": "^7.2.0",
68
+ "@prisma/adapter-mariadb": "^7.0.0",
46
69
  "mysql2": "^3.0.0"
47
70
  },
48
71
  "devDependencies": {
49
72
  "prisma": "^7.2.0"
50
73
  }
51
74
  },
75
+ {
76
+ "type": "add-env",
77
+ "condition": { "prismaProvider": "mysql" },
78
+ "envVars": {
79
+ "DATABASE_URL": "mysql://username:password@localhost:3306/database_name"
80
+ }
81
+ },
52
82
  {
53
83
  "type": "add-dependency",
54
84
  "condition": { "prismaProvider": "sqlite" },
55
85
  "dependencies": {
56
- "@prisma/adapter-better-sqlite3": "^7.0.0",
57
86
  "@prisma/client": "^7.2.0",
87
+ "@prisma/adapter-better-sqlite3": "^7.0.0",
58
88
  "better-sqlite3": "^9.0.0"
59
89
  },
60
90
  "devDependencies": {
61
91
  "prisma": "^7.2.0"
62
92
  }
63
93
  },
94
+ {
95
+ "type": "add-env",
96
+ "condition": { "prismaProvider": "sqlite" },
97
+ "envVars": {
98
+ "DATABASE_URL": "file:./dev.db"
99
+ }
100
+ },
64
101
  {
65
102
  "type": "add-dependency",
66
103
  "condition": { "prismaProvider": "mongodb" },
@@ -71,49 +108,12 @@
71
108
  "prisma": "^6.19.0"
72
109
  }
73
110
  },
74
- {
75
- "type": "add-env",
76
- "condition": { "prismaProvider": "postgresql" },
77
- "envVars": {
78
- "DATABASE_URL": "postgresql://username:password@localhost:5432/database_name"
79
- }
80
- },
81
- {
82
- "type": "add-env",
83
- "condition": { "prismaProvider": "mysql" },
84
- "envVars": {
85
- "DATABASE_URL": "mysql://username:password@localhost:3306/database_name"
86
- }
87
- },
88
- {
89
- "type": "add-env",
90
- "condition": { "prismaProvider": "sqlite" },
91
- "envVars": {
92
- "DATABASE_URL": "file:./dev.db"
93
- }
94
- },
95
111
  {
96
112
  "type": "add-env",
97
113
  "condition": { "prismaProvider": "mongodb" },
98
114
  "envVars": {
99
115
  "DATABASE_URL": "mongodb://localhost:27017/database_name"
100
116
  }
101
- },
102
- {
103
- "type": "add-dependency",
104
- "dependencies": {
105
- "dotenv": "^17.2.3"
106
- }
107
- },
108
- {
109
- "type": "add-script",
110
- "scripts": {
111
- "db:generate": "npx prisma generate",
112
- "db:push": "npx prisma db push",
113
- "db:seed": "tsx prisma/seed.ts",
114
- "db:migrate": "npx prisma migrate dev",
115
- "db:studio": "npx prisma studio"
116
- }
117
117
  }
118
118
  ]
119
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stackkit",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Production-ready CLI to create and extend JavaScript or TypeScript apps with modular stacks.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1,3 +1,3 @@
1
- PORT=3000
1
+ PORT=5000
2
2
  NODE_ENV=development
3
- CORS_ORIGIN="http://localhost:3000"
3
+ FRONTEND_URL=http://localhost:3000
@@ -0,0 +1,7 @@
1
+ // @ts-check
2
+
3
+ import eslint from "@eslint/js";
4
+ import { defineConfig } from "eslint/config";
5
+ import tseslint from "typescript-eslint";
6
+
7
+ export default defineConfig(eslint.configs.recommended, tseslint.configs.recommended);
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/bin/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/acorn@8.15.0/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/bin/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/acorn@8.15.0/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/bin/acorn" "$@"
15
+ else
16
+ exec node "$basedir/../../../../node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/bin/acorn" "$@"
17
+ fi
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/eslint@9.39.2/node_modules/eslint/bin/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/eslint@9.39.2/node_modules/eslint/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/eslint@9.39.2/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/eslint@9.39.2/node_modules/eslint/bin/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/eslint@9.39.2/node_modules/eslint/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/eslint@9.39.2/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/eslint@9.39.2/node_modules/eslint/bin/eslint.js" "$@"
15
+ else
16
+ exec node "$basedir/../../../../node_modules/.pnpm/eslint@9.39.2/node_modules/eslint/bin/eslint.js" "$@"
17
+ fi
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsc" "$@"
15
+ else
16
+ exec node "$basedir/../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsc" "$@"
17
+ fi
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsserver" "$@"
15
+ else
16
+ exec node "$basedir/../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsserver" "$@"
17
+ fi
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/tsx@4.21.0/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/tsx@4.21.0/node_modules:/home/tariqul/Projects/open-source/stackkit/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" "$@"
15
+ else
16
+ exec node "$basedir/../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" "$@"
17
+ fi