create-stackkit-app 0.4.2 → 0.4.3
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 -0
- package/bin/create-stackkit.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/create-project.js +329 -143
- package/dist/lib/template-composer.js +21 -21
- package/modules/auth/better-auth-express/adapters/mongoose-mongodb.ts +3 -3
- package/modules/auth/better-auth-express/adapters/prisma-mongodb.ts +4 -4
- package/modules/auth/better-auth-express/adapters/prisma-postgresql.ts +4 -4
- package/modules/auth/better-auth-express/files/lib/auth.ts +1 -1
- package/modules/auth/better-auth-express/files/routes/auth.ts +3 -3
- package/modules/auth/better-auth-nextjs/adapters/mongoose-mongodb.ts +3 -3
- package/modules/auth/better-auth-nextjs/adapters/prisma-mongodb.ts +4 -4
- package/modules/auth/better-auth-nextjs/adapters/prisma-postgresql.ts +4 -4
- package/modules/auth/better-auth-nextjs/files/api/auth/[...all]/route.ts +2 -3
- package/modules/auth/better-auth-nextjs/files/lib/auth.ts +4 -4
- package/modules/auth/better-auth-react/files/lib/auth-client.ts +2 -2
- package/modules/auth/clerk-express/files/lib/auth.ts +1 -1
- package/modules/auth/clerk-nextjs/files/lib/auth-provider.tsx +1 -1
- package/modules/auth/clerk-nextjs/files/middleware.ts +3 -3
- package/modules/auth/clerk-react/files/lib/auth-provider.tsx +2 -2
- package/modules/database/mongoose-mongodb/files/lib/db.ts +3 -3
- package/modules/database/prisma-mongodb/files/lib/db.ts +2 -2
- package/modules/database/prisma-postgresql/files/lib/db.ts +2 -2
- package/package.json +8 -3
- package/templates/express/package.json +1 -0
- package/templates/express/src/app.ts +17 -15
- package/templates/express/src/config/env.ts +8 -8
- package/templates/express/src/middlewares/error.middleware.ts +3 -3
- package/templates/express/src/server.ts +2 -2
- package/templates/express/template.json +38 -1
- package/templates/express/tsconfig.json +17 -0
- package/templates/nextjs/app/layout.tsx +1 -5
- package/templates/nextjs/app/page.tsx +26 -34
- package/templates/nextjs/package.json +2 -1
- package/templates/nextjs/template.json +13 -1
- package/templates/react-vite/eslint.config.js +9 -9
- package/templates/react-vite/package.json +1 -2
- package/templates/react-vite/src/api/client.ts +16 -16
- package/templates/react-vite/src/api/services/user.service.ts +2 -10
- package/templates/react-vite/src/components/ErrorBoundary.tsx +4 -4
- package/templates/react-vite/src/components/Layout.tsx +1 -1
- package/templates/react-vite/src/components/Loading.tsx +1 -1
- package/templates/react-vite/src/components/SEO.tsx +5 -5
- package/templates/react-vite/src/config/constants.ts +3 -3
- package/templates/react-vite/src/hooks/index.ts +5 -5
- package/templates/react-vite/src/lib/queryClient.ts +2 -2
- package/templates/react-vite/src/main.tsx +12 -12
- package/templates/react-vite/src/pages/About.tsx +6 -2
- package/templates/react-vite/src/pages/Home.tsx +8 -4
- package/templates/react-vite/src/pages/NotFound.tsx +2 -2
- package/templates/react-vite/src/pages/UserProfile.tsx +6 -6
- package/templates/react-vite/src/router.tsx +13 -13
- package/templates/react-vite/src/types/{api.ts → api.d.ts} +6 -6
- package/templates/react-vite/src/types/user.d.ts +6 -0
- package/templates/react-vite/src/utils/helpers.ts +11 -11
- package/templates/react-vite/src/utils/storage.ts +4 -4
- package/templates/react-vite/template.json +26 -0
- package/templates/react-vite/tsconfig.json +1 -4
- package/templates/react-vite/vite.config.ts +5 -5
|
@@ -4,7 +4,7 @@ export const storage = {
|
|
|
4
4
|
const item = localStorage.getItem(key);
|
|
5
5
|
return item ? JSON.parse(item) : (defaultValue ?? null);
|
|
6
6
|
} catch (error) {
|
|
7
|
-
console.error(
|
|
7
|
+
console.error("Error reading from localStorage:", error);
|
|
8
8
|
return defaultValue ?? null;
|
|
9
9
|
}
|
|
10
10
|
},
|
|
@@ -13,7 +13,7 @@ export const storage = {
|
|
|
13
13
|
try {
|
|
14
14
|
localStorage.setItem(key, JSON.stringify(value));
|
|
15
15
|
} catch (error) {
|
|
16
|
-
console.error(
|
|
16
|
+
console.error("Error writing to localStorage:", error);
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ export const storage = {
|
|
|
21
21
|
try {
|
|
22
22
|
localStorage.removeItem(key);
|
|
23
23
|
} catch (error) {
|
|
24
|
-
console.error(
|
|
24
|
+
console.error("Error removing from localStorage:", error);
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ export const storage = {
|
|
|
29
29
|
try {
|
|
30
30
|
localStorage.clear();
|
|
31
31
|
} catch (error) {
|
|
32
|
-
console.error(
|
|
32
|
+
console.error("Error clearing localStorage:", error);
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
};
|
|
@@ -16,5 +16,31 @@
|
|
|
16
16
|
"tsconfig.app.json",
|
|
17
17
|
"tsconfig.node.json",
|
|
18
18
|
"vite.config.ts"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "vite",
|
|
22
|
+
"build": "tsc -b && vite build",
|
|
23
|
+
"lint": "eslint .",
|
|
24
|
+
"lint:fix": "eslint . --fix",
|
|
25
|
+
"preview": "vite preview"
|
|
26
|
+
},
|
|
27
|
+
"jsScripts": {
|
|
28
|
+
"dev": "vite",
|
|
29
|
+
"build": "vite build",
|
|
30
|
+
"lint": "eslint .",
|
|
31
|
+
"lint:fix": "eslint . --fix",
|
|
32
|
+
"preview": "vite preview"
|
|
33
|
+
},
|
|
34
|
+
"fileReplacements": [
|
|
35
|
+
{
|
|
36
|
+
"file": "index.html",
|
|
37
|
+
"from": "/src/main.tsx",
|
|
38
|
+
"to": "/src/main.jsx"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"file": "vite.config.ts",
|
|
42
|
+
"from": "main.tsx",
|
|
43
|
+
"to": "main.jsx"
|
|
44
|
+
}
|
|
19
45
|
]
|
|
20
46
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import tailwindcss from
|
|
2
|
-
import react from
|
|
3
|
-
import path from
|
|
4
|
-
import { defineConfig } from
|
|
1
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { defineConfig } from "vite";
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|
|
7
7
|
plugins: [react(), tailwindcss()],
|
|
8
8
|
resolve: {
|
|
9
9
|
alias: {
|
|
10
|
-
|
|
10
|
+
"@": path.resolve(__dirname, "./src"),
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
});
|