create-stackkit-app 0.4.3 → 0.4.5
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 +1 -1
- package/bin/create-stackkit.js +10 -1
- package/dist/index.js +62 -3
- package/dist/lib/create-project.d.ts +20 -1
- package/dist/lib/create-project.js +193 -568
- package/dist/lib/utils/config-utils.d.ts +2 -0
- package/dist/lib/utils/config-utils.js +88 -0
- package/dist/lib/utils/file-utils.d.ts +8 -0
- package/dist/lib/utils/file-utils.js +75 -0
- package/dist/lib/utils/git-utils.d.ts +1 -0
- package/dist/lib/utils/git-utils.js +9 -0
- package/dist/lib/utils/js-conversion.d.ts +1 -0
- package/dist/lib/utils/js-conversion.js +244 -0
- package/dist/lib/utils/logger.d.ts +16 -0
- package/dist/lib/utils/logger.js +59 -0
- package/dist/lib/utils/module-utils.d.ts +2 -0
- package/dist/lib/utils/module-utils.js +461 -0
- package/dist/lib/utils/package-utils.d.ts +1 -0
- package/dist/lib/utils/package-utils.js +39 -0
- package/modules/auth/authjs/files/api/auth/[...nextauth]/route.ts +6 -0
- package/modules/auth/authjs/files/lib/auth-client.ts +11 -0
- package/modules/auth/authjs/files/lib/auth.ts +41 -0
- package/modules/auth/authjs/files/schemas/prisma-schema.prisma +45 -0
- package/modules/auth/authjs/module.json +95 -0
- package/modules/auth/better-auth/files/lib/auth-client.ts +7 -0
- package/modules/auth/better-auth/files/lib/auth.ts +75 -0
- package/modules/auth/better-auth/files/lib/email-service.ts +34 -0
- package/modules/auth/better-auth/files/lib/email-templates.ts +89 -0
- package/modules/auth/better-auth/files/schemas/prisma-schema.prisma +63 -0
- package/modules/auth/better-auth/module.json +191 -0
- package/modules/database/mongoose/files/lib/db.ts +68 -0
- package/modules/database/mongoose/files/models/User.ts +34 -0
- package/modules/database/mongoose/module.json +55 -0
- package/modules/database/prisma/files/lib/prisma.ts +4 -0
- package/modules/database/prisma/files/prisma/schema.prisma +8 -0
- package/modules/database/prisma/files/prisma.config.ts +12 -0
- package/modules/database/prisma/module.json +122 -0
- package/package.json +7 -3
- package/templates/express/.env.example +1 -10
- package/templates/express/package.json +15 -21
- package/templates/express/src/app.ts +9 -29
- package/templates/express/src/config/env.ts +3 -14
- package/templates/express/src/features/health/health.controller.ts +18 -0
- package/templates/express/src/features/health/health.route.ts +9 -0
- package/templates/express/src/features/health/health.service.ts +6 -0
- package/templates/express/src/middlewares/error.middleware.ts +2 -2
- package/templates/express/src/server.ts +1 -1
- package/templates/express/template.json +1 -5
- package/templates/express/tsconfig.json +0 -1
- package/templates/nextjs/lib/env.ts +8 -0
- package/templates/nextjs/package.json +7 -7
- package/templates/react-vite/.env.example +1 -2
- package/templates/react-vite/.prettierignore +4 -0
- package/templates/react-vite/.prettierrc +9 -0
- package/templates/react-vite/README.md +22 -0
- package/templates/react-vite/package.json +16 -16
- package/templates/react-vite/src/router.tsx +0 -12
- package/templates/react-vite/vite.config.ts +0 -6
- package/dist/lib/template-composer.d.ts +0 -16
- package/dist/lib/template-composer.js +0 -197
- package/modules/auth/better-auth-express/adapters/mongoose-mongodb.ts +0 -13
- package/modules/auth/better-auth-express/adapters/prisma-mongodb.ts +0 -15
- package/modules/auth/better-auth-express/adapters/prisma-postgresql.ts +0 -15
- package/modules/auth/better-auth-express/files/lib/auth.ts +0 -16
- package/modules/auth/better-auth-express/files/routes/auth.ts +0 -12
- package/modules/auth/better-auth-express/files/schemas/prisma-mongodb-schema.prisma +0 -72
- package/modules/auth/better-auth-express/files/schemas/prisma-postgresql-schema.prisma +0 -72
- package/modules/auth/better-auth-express/module.json +0 -61
- package/modules/auth/better-auth-nextjs/adapters/mongoose-mongodb.ts +0 -24
- package/modules/auth/better-auth-nextjs/adapters/prisma-mongodb.ts +0 -26
- package/modules/auth/better-auth-nextjs/adapters/prisma-postgresql.ts +0 -26
- package/modules/auth/better-auth-nextjs/files/lib/auth.ts +0 -26
- package/modules/auth/better-auth-nextjs/files/schemas/prisma-mongodb-schema.prisma +0 -72
- package/modules/auth/better-auth-nextjs/files/schemas/prisma-postgresql-schema.prisma +0 -72
- package/modules/auth/better-auth-nextjs/module.json +0 -62
- package/modules/auth/better-auth-react/files/lib/auth-client.ts +0 -9
- package/modules/auth/better-auth-react/module.json +0 -28
- package/modules/auth/clerk-express/files/lib/auth.ts +0 -7
- package/modules/auth/clerk-express/module.json +0 -34
- package/modules/auth/clerk-nextjs/files/lib/auth-provider.tsx +0 -5
- package/modules/auth/clerk-nextjs/files/middleware.ts +0 -9
- package/modules/auth/clerk-nextjs/module.json +0 -64
- package/modules/auth/clerk-react/files/lib/auth-provider.tsx +0 -15
- package/modules/auth/clerk-react/module.json +0 -28
- package/modules/database/mongoose-mongodb/files/lib/db.ts +0 -40
- package/modules/database/mongoose-mongodb/module.json +0 -55
- package/modules/database/prisma-mongodb/files/lib/db.ts +0 -9
- package/modules/database/prisma-mongodb/files/prisma/schema.prisma +0 -17
- package/modules/database/prisma-mongodb/module.json +0 -60
- package/modules/database/prisma-postgresql/files/lib/db.ts +0 -9
- package/modules/database/prisma-postgresql/files/prisma/schema.prisma +0 -17
- package/modules/database/prisma-postgresql/module.json +0 -60
- package/templates/react-vite/src/api/services/user.service.ts +0 -18
- package/templates/react-vite/src/pages/UserProfile.tsx +0 -40
- package/templates/react-vite/src/types/user.d.ts +0 -6
- /package/modules/auth/{better-auth-nextjs → better-auth}/files/api/auth/[...all]/route.ts +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "prisma-postgresql",
|
|
3
|
-
"displayName": "Prisma + PostgreSQL",
|
|
4
|
-
"description": "Prisma ORM with PostgreSQL database",
|
|
5
|
-
"category": "database",
|
|
6
|
-
"provider": "prisma",
|
|
7
|
-
"database": "postgresql",
|
|
8
|
-
"supportedFrameworks": ["nextjs", "express"],
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@prisma/client": "^6.1.0"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"prisma": "^6.1.0"
|
|
14
|
-
},
|
|
15
|
-
"envVars": [
|
|
16
|
-
{
|
|
17
|
-
"key": "DATABASE_URL",
|
|
18
|
-
"value": "postgresql://user:password@localhost:5432/mydb?schema=public",
|
|
19
|
-
"description": "PostgreSQL database connection URL",
|
|
20
|
-
"required": true
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"frameworkPatches": {
|
|
24
|
-
"express": {
|
|
25
|
-
"tsconfig.json": {
|
|
26
|
-
"merge": {
|
|
27
|
-
"compilerOptions": {
|
|
28
|
-
"paths": {
|
|
29
|
-
"@/*": ["./src/*"]
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"include": ["src/**/*"],
|
|
33
|
-
"exclude": ["node_modules", "dist", "prisma/migrations"]
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"nextjs": {
|
|
38
|
-
"tsconfig.json": {
|
|
39
|
-
"merge": {
|
|
40
|
-
"exclude": ["node_modules", ".next", "out", "prisma/migrations"]
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"patches": [
|
|
46
|
-
{
|
|
47
|
-
"type": "create-file",
|
|
48
|
-
"description": "Create Prisma schema",
|
|
49
|
-
"source": "files/prisma/schema.prisma",
|
|
50
|
-
"destination": "prisma/schema.prisma"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"type": "create-file",
|
|
54
|
-
"description": "Create Prisma client singleton",
|
|
55
|
-
"source": "files/lib/db.ts",
|
|
56
|
-
"destination": "{{lib}}/db.ts"
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
"postInstall": ["npx prisma generate"]
|
|
60
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import api from "../client";
|
|
2
|
-
|
|
3
|
-
export const userService = {
|
|
4
|
-
getUser: async (id: string): Promise<User> => {
|
|
5
|
-
const response = await api.get<ApiResponse<User>>(`/users/${id}`);
|
|
6
|
-
return response.data.data;
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
getCurrentUser: async (): Promise<User> => {
|
|
10
|
-
const response = await api.get<ApiResponse<User>>("/users/me");
|
|
11
|
-
return response.data.data;
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
updateUser: async (id: string, data: Partial<User>): Promise<User> => {
|
|
15
|
-
const response = await api.patch<ApiResponse<User>>(`/users/${id}`, data);
|
|
16
|
-
return response.data.data;
|
|
17
|
-
},
|
|
18
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useQuery } from "@tanstack/react-query";
|
|
2
|
-
import { useLoaderData, useParams } from "react-router";
|
|
3
|
-
import { userService } from "../api/services/user.service";
|
|
4
|
-
|
|
5
|
-
type User = { id?: string; name?: string; email?: string; avatar?: string; [key: string]: any };
|
|
6
|
-
|
|
7
|
-
export default function UserProfile() {
|
|
8
|
-
const loaderUser = useLoaderData() as User | undefined;
|
|
9
|
-
const { userId } = useParams();
|
|
10
|
-
|
|
11
|
-
const { data: user = loaderUser ?? {} } = useQuery({
|
|
12
|
-
queryKey: ["user", userId],
|
|
13
|
-
queryFn: async () => {
|
|
14
|
-
if (!userId) throw new Error("Missing user id");
|
|
15
|
-
return await userService.getUser(userId);
|
|
16
|
-
},
|
|
17
|
-
initialData: loaderUser,
|
|
18
|
-
staleTime: 1000 * 60,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div className="min-h-screen bg-black text-white flex items-center justify-center">
|
|
23
|
-
<div className="max-w-xl p-8 bg-zinc-900 rounded-md shadow">
|
|
24
|
-
<div className="flex items-center gap-4">
|
|
25
|
-
{user.avatar ? (
|
|
26
|
-
<img src={user.avatar} alt={user.name} className="w-16 h-16 rounded-full" />
|
|
27
|
-
) : (
|
|
28
|
-
<div className="w-16 h-16 rounded-full bg-zinc-700 flex items-center justify-center text-xl">
|
|
29
|
-
{user.name?.[0] ?? "U"}
|
|
30
|
-
</div>
|
|
31
|
-
)}
|
|
32
|
-
<div>
|
|
33
|
-
<h2 className="text-2xl font-semibold">{user.name}</h2>
|
|
34
|
-
<p className="text-sm text-zinc-400">{user.email}</p>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
File without changes
|