better-ts-stack 0.1.0 → 1.0.8
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 +12 -6
- package/dist/builder/configGenerator.d.ts.map +1 -1
- package/dist/builder/configGenerator.js +26 -23
- package/dist/builder/configGenerator.js.map +1 -1
- package/dist/builder/dependencyInstaller.d.ts.map +1 -1
- package/dist/builder/dependencyInstaller.js +1 -10
- package/dist/builder/dependencyInstaller.js.map +1 -1
- package/dist/builder/index.d.ts.map +1 -1
- package/dist/builder/index.js +3 -7
- package/dist/builder/index.js.map +1 -1
- package/dist/builder/templateContext.d.ts +1 -1
- package/dist/builder/templateContext.d.ts.map +1 -1
- package/dist/builder/templateContext.js +0 -2
- package/dist/builder/templateContext.js.map +1 -1
- package/dist/modules/registry.d.ts.map +1 -1
- package/dist/modules/registry.js +2 -5
- package/dist/modules/registry.js.map +1 -1
- package/dist/output/nextSteps.d.ts.map +1 -1
- package/dist/output/nextSteps.js +7 -34
- package/dist/output/nextSteps.js.map +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +3 -14
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/stack.d.ts +3 -0
- package/dist/prompts/stack.d.ts.map +1 -0
- package/dist/prompts/stack.js +72 -0
- package/dist/prompts/stack.js.map +1 -0
- package/dist/types/index.d.ts +4 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -9
- package/dist/types/index.js.map +1 -1
- package/dist/validators/index.d.ts +1 -1
- package/dist/validators/index.d.ts.map +1 -1
- package/dist/validators/index.js +1 -1
- package/package.json +12 -12
- package/templates/backend/express/config.json +44 -42
- package/templates/backend/express/eslint.config.mjs +40 -31
- package/templates/backend/express/src/index.ts +61 -46
- package/templates/backend/express/src/routes/health.ts +12 -12
- package/templates/backend/express/tsconfig.json +25 -23
- package/templates/frontend/nextjs/app/globals.css +89 -99
- package/templates/frontend/nextjs/app/page.tsx.hbs +9 -10
- package/templates/frontend/nextjs/config.json +33 -27
- package/templates/frontend/nextjs/eslint.config.mjs +11 -11
- package/templates/frontend/nextjs/proxy.ts.hbs +9 -8
- package/templates/frontend/nextjs/tsconfig.json +34 -21
- package/templates/modules/auth/express/config.json +26 -1
- package/templates/modules/auth/express/src/routes/auth.ts.hbs +1 -1
- package/templates/modules/auth/express/src/services/userStore.ts.hbs +95 -107
- package/templates/modules/auth/nextjs/config.json +6 -6
- package/templates/modules/auth/nextjs/lib/auth.ts.hbs +34 -32
- package/templates/modules/docker/.dockerignore +14 -13
- package/templates/modules/docker/Dockerfile.hbs +80 -70
- package/templates/modules/docker/config.json +19 -16
- package/templates/modules/docker/docker-compose.yml.hbs +9 -9
- package/templates/modules/drizzle/express/config.json +27 -0
- package/templates/modules/drizzle/express/drizzle.config.ts +13 -0
- package/templates/modules/drizzle/express/src/lib/db.ts +13 -0
- package/templates/modules/drizzle/express/src/lib/schema.ts +10 -0
- package/templates/modules/drizzle/nextjs/config.json +27 -19
- package/templates/modules/drizzle/nextjs/lib/db.ts +3 -1
- package/templates/modules/drizzle/nextjs/lib/schema.ts.hbs +84 -84
- package/templates/modules/mongoose/config.json +16 -16
- package/templates/modules/mongoose/src/lib/db.ts.hbs +0 -13
- package/templates/modules/mongoose/src/models/User.ts +48 -47
- package/templates/modules/prisma/express/config.json +27 -21
- package/templates/modules/prisma/express/prisma/schema.prisma +3 -2
- package/templates/modules/prisma/express/prisma.config.ts +12 -13
- package/templates/modules/prisma/express/src/lib/prisma.ts +24 -37
- package/templates/modules/prisma/nextjs/config.json +28 -23
- package/templates/modules/prisma/nextjs/prisma/schema.prisma.hbs +91 -90
- package/dist/prompts/backend/index.d.ts +0 -3
- package/dist/prompts/backend/index.d.ts.map +0 -1
- package/dist/prompts/backend/index.js +0 -128
- package/dist/prompts/backend/index.js.map +0 -1
- package/dist/prompts/frontend/index.d.ts +0 -3
- package/dist/prompts/frontend/index.d.ts.map +0 -1
- package/dist/prompts/frontend/index.js +0 -111
- package/dist/prompts/frontend/index.js.map +0 -1
|
@@ -1,99 +1,89 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
2
|
-
|
|
3
|
-
:root {
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--card
|
|
8
|
-
--
|
|
9
|
-
--popover
|
|
10
|
-
--
|
|
11
|
-
--primary
|
|
12
|
-
--
|
|
13
|
-
--secondary
|
|
14
|
-
--
|
|
15
|
-
--muted
|
|
16
|
-
--
|
|
17
|
-
--accent
|
|
18
|
-
--
|
|
19
|
-
--destructive
|
|
20
|
-
--border: oklch(0.
|
|
21
|
-
--input: oklch(0.
|
|
22
|
-
--ring: oklch(0.
|
|
23
|
-
--
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
--
|
|
28
|
-
--
|
|
29
|
-
--
|
|
30
|
-
--
|
|
31
|
-
--
|
|
32
|
-
--
|
|
33
|
-
--
|
|
34
|
-
--
|
|
35
|
-
--
|
|
36
|
-
--
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
--
|
|
41
|
-
--
|
|
42
|
-
--
|
|
43
|
-
--
|
|
44
|
-
--
|
|
45
|
-
--
|
|
46
|
-
--
|
|
47
|
-
--
|
|
48
|
-
--
|
|
49
|
-
--
|
|
50
|
-
--
|
|
51
|
-
--
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
background: var(--
|
|
88
|
-
color: var(--foreground);
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
a {
|
|
93
|
-
text-underline-offset: 0.2rem;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
::selection {
|
|
97
|
-
background: color-mix(in oklab, var(--accent) 65%, white);
|
|
98
|
-
color: var(--foreground);
|
|
99
|
-
}
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--radius: 0.65rem;
|
|
5
|
+
--background: oklch(1 0 0);
|
|
6
|
+
--foreground: oklch(0.145 0 0);
|
|
7
|
+
--card: oklch(1 0 0);
|
|
8
|
+
--card-foreground: oklch(0.145 0 0);
|
|
9
|
+
--popover: oklch(1 0 0);
|
|
10
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
11
|
+
--primary: oklch(0.205 0 0);
|
|
12
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
13
|
+
--secondary: oklch(0.97 0 0);
|
|
14
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
15
|
+
--muted: oklch(0.97 0 0);
|
|
16
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
17
|
+
--accent: oklch(0.97 0 0);
|
|
18
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
19
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
20
|
+
--border: oklch(0.922 0 0);
|
|
21
|
+
--input: oklch(0.922 0 0);
|
|
22
|
+
--ring: oklch(0.708 0 0);
|
|
23
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
24
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
25
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
26
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
27
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
28
|
+
--radius: 0.625rem;
|
|
29
|
+
--sidebar: oklch(0.985 0 0);
|
|
30
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
31
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
32
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
33
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
34
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
35
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
36
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dark {
|
|
40
|
+
--background: oklch(0.145 0 0);
|
|
41
|
+
--foreground: oklch(0.985 0 0);
|
|
42
|
+
--card: oklch(0.205 0 0);
|
|
43
|
+
--card-foreground: oklch(0.985 0 0);
|
|
44
|
+
--popover: oklch(0.205 0 0);
|
|
45
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
46
|
+
--primary: oklch(0.922 0 0);
|
|
47
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
48
|
+
--secondary: oklch(0.269 0 0);
|
|
49
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
50
|
+
--muted: oklch(0.269 0 0);
|
|
51
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
52
|
+
--accent: oklch(0.269 0 0);
|
|
53
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
54
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
55
|
+
--border: oklch(1 0 0 / 10%);
|
|
56
|
+
--input: oklch(1 0 0 / 15%);
|
|
57
|
+
--ring: oklch(0.556 0 0);
|
|
58
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
59
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
60
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
61
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
62
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
63
|
+
--sidebar: oklch(0.205 0 0);
|
|
64
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
65
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
66
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
67
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
68
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
69
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
70
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
71
|
+
}
|
|
72
|
+
* {
|
|
73
|
+
border-color: var(--border);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
body {
|
|
77
|
+
background: var(--background);
|
|
78
|
+
color: var(--foreground);
|
|
79
|
+
font-family: var(--font-geist-sans), sans-serif;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
a {
|
|
83
|
+
text-underline-offset: 0.2rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
::selection {
|
|
87
|
+
background: color-mix(in oklab, var(--accent) 65%, white);
|
|
88
|
+
color: var(--foreground);
|
|
89
|
+
}
|
|
@@ -17,19 +17,18 @@ const featureList = [
|
|
|
17
17
|
|
|
18
18
|
export default function Home() {
|
|
19
19
|
return (
|
|
20
|
-
<main className="
|
|
21
|
-
<div className="
|
|
22
|
-
<div className="relative mx-auto flex min-h-screen max-w-6xl flex-col justify-center gap-12 px-6 py-16 sm:px-10 lg:px-12">
|
|
20
|
+
<main className="min-h-screen bg-background text-foreground">
|
|
21
|
+
<div className="mx-auto flex min-h-screen max-w-6xl flex-col justify-center gap-12 px-6 py-16 sm:px-10 lg:px-12">
|
|
23
22
|
<section className="grid gap-10 lg:grid-cols-[1.2fr_0.8fr] lg:items-center">
|
|
24
23
|
<div className="space-y-6">
|
|
25
|
-
<span className="inline-flex w-fit items-center rounded-full border border-
|
|
24
|
+
<span className="inline-flex w-fit items-center rounded-full border border-border bg-card px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground shadow-sm">
|
|
26
25
|
Created with better-ts-stack
|
|
27
26
|
</span>
|
|
28
27
|
<div className="space-y-4">
|
|
29
|
-
<h1 className="max-w-3xl text-4xl font-semibold tracking-tight
|
|
28
|
+
<h1 className="max-w-3xl text-4xl font-semibold tracking-tight sm:text-5xl">
|
|
30
29
|
Ship your stack faster with a polished TypeScript foundation.
|
|
31
30
|
</h1>
|
|
32
|
-
<p className="max-w-2xl text-base leading-7 text-
|
|
31
|
+
<p className="max-w-2xl text-base leading-7 text-muted-foreground sm:text-lg">
|
|
33
32
|
Your project already includes the core app shell, database wiring,
|
|
34
33
|
and a shadcn-compatible UI foundation so you can keep building
|
|
35
34
|
instead of setting up boilerplate.
|
|
@@ -72,20 +71,20 @@ export default function Home() {
|
|
|
72
71
|
</div>
|
|
73
72
|
</div>
|
|
74
73
|
|
|
75
|
-
<Card className="border-
|
|
74
|
+
<Card className="border-border bg-card shadow-sm">
|
|
76
75
|
<CardHeader>
|
|
77
76
|
<CardTitle>Included in this starter</CardTitle>
|
|
78
77
|
</CardHeader>
|
|
79
78
|
<CardContent className="space-y-4">
|
|
80
|
-
<ul className="space-y-3 text-sm text-
|
|
79
|
+
<ul className="space-y-3 text-sm text-muted-foreground">
|
|
81
80
|
{featureList.map((feature) => (
|
|
82
81
|
<li key={feature} className="flex items-center gap-3">
|
|
83
|
-
<span className="size-2 rounded-full bg-
|
|
82
|
+
<span className="size-2 rounded-full bg-primary" />
|
|
84
83
|
<span>{feature}</span>
|
|
85
84
|
</li>
|
|
86
85
|
))}
|
|
87
86
|
</ul>
|
|
88
|
-
<div className="rounded-2xl border border-
|
|
87
|
+
<div className="rounded-2xl border border-border bg-muted px-4 py-3 text-sm text-muted-foreground">
|
|
89
88
|
Start editing <code className="font-mono">app/page.tsx</code> and
|
|
90
89
|
shape the project around your product instead of setup chores.
|
|
91
90
|
</div>
|
|
@@ -1,33 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "nextjs",
|
|
3
|
-
"name": "Next.js",
|
|
4
|
-
"description": "Next.js 16 App Router with TypeScript and Tailwind CSS",
|
|
5
|
-
"type": "base",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "next dev",
|
|
8
|
-
"build": "next build",
|
|
9
|
-
"start": "next start",
|
|
10
|
-
"lint": "eslint"
|
|
11
|
-
|
|
1
|
+
{
|
|
2
|
+
"id": "nextjs",
|
|
3
|
+
"name": "Next.js",
|
|
4
|
+
"description": "Next.js 16 App Router with TypeScript and Tailwind CSS",
|
|
5
|
+
"type": "base",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "next dev",
|
|
8
|
+
"build": "next build",
|
|
9
|
+
"start": "next start",
|
|
10
|
+
"lint": "eslint",
|
|
11
|
+
"type:check": "tsc --noEmit"
|
|
12
|
+
},
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"class-variance-authority": "^0.7.1",
|
|
14
15
|
"clsx": "^2.1.1",
|
|
15
|
-
"lucide-react": "^
|
|
16
|
-
"next": "^16.
|
|
17
|
-
"react": "19.2.
|
|
18
|
-
"react-dom": "19.2.
|
|
19
|
-
"tailwind-merge": "^3.
|
|
16
|
+
"lucide-react": "^1.41.0",
|
|
17
|
+
"next": "^16.3.4",
|
|
18
|
+
"react": "^19.2.8",
|
|
19
|
+
"react-dom": "^19.2.8",
|
|
20
|
+
"tailwind-merge": "^3.6.0",
|
|
21
|
+
"@radix-ui/react-slot": "^1.3.3"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
25
|
+
"@types/node": "^24.13.3",
|
|
26
|
+
"@types/react": "^19.2.18",
|
|
27
|
+
"@types/react-dom": "^19.2.7",
|
|
28
|
+
"eslint": "^10.10.0",
|
|
29
|
+
"eslint-config-next": "^16.3.4",
|
|
30
|
+
"tailwindcss": "^4.3.3",
|
|
31
|
+
"typescript": "^6.0.3",
|
|
32
|
+
"@eslint/compat": "^2.1.1"
|
|
33
|
+
},
|
|
34
|
+
"envVars": {
|
|
35
|
+
"NODE_ENV": "development",
|
|
36
|
+
"PORT": "3000"
|
|
20
37
|
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@tailwindcss/postcss": "^4",
|
|
23
|
-
"@types/node": "^20",
|
|
24
|
-
"@types/react": "^19",
|
|
25
|
-
"@types/react-dom": "^19",
|
|
26
|
-
"eslint": "^9",
|
|
27
|
-
"eslint-config-next": "16.1.6",
|
|
28
|
-
"tailwindcss": "^4",
|
|
29
|
-
"typescript": "^5"
|
|
30
|
-
},
|
|
31
|
-
"envVars": { "NODE_ENV": "development", "PORT": "3000" },
|
|
32
38
|
"templateFiles": ["app/page.tsx.hbs", "proxy.ts.hbs"]
|
|
33
39
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
...nextTs,
|
|
8
|
-
globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
|
|
9
|
-
]);
|
|
10
|
-
|
|
11
|
-
export default eslintConfig;
|
|
1
|
+
import { fixupConfigRules } from "@eslint/compat";
|
|
2
|
+
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
3
|
+
import nextTs from "eslint-config-next/typescript";
|
|
4
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
5
|
+
|
|
6
|
+
const eslintConfig = defineConfig([
|
|
7
|
+
...fixupConfigRules([...nextVitals, ...nextTs]),
|
|
8
|
+
globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
export default eslintConfig;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { NextResponse
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
2
|
|
|
3
3
|
{{#if useAuth}}
|
|
4
|
+
import type { NextRequest } from "next/server";
|
|
4
5
|
import { getSessionCookie } from "better-auth/cookies";
|
|
5
6
|
|
|
6
|
-
export
|
|
7
|
+
export function proxy(request: NextRequest) {
|
|
7
8
|
const sessionCookie = getSessionCookie(request);
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
if (!sessionCookie) {
|
|
10
11
|
return NextResponse.redirect(new URL("/sign-in", request.url));
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
return NextResponse.next();
|
|
14
|
-
}
|
|
15
|
-
|
|
13
|
+
|
|
14
|
+
return NextResponse.next();
|
|
15
|
+
}
|
|
16
|
+
|
|
16
17
|
export const config = {
|
|
17
18
|
matcher: ["/dashboard/:path*"],
|
|
18
19
|
};
|
|
19
20
|
{{else}}
|
|
20
|
-
export function proxy(
|
|
21
|
+
export function proxy() {
|
|
21
22
|
return NextResponse.next();
|
|
22
23
|
}
|
|
23
24
|
{{/if}}
|
|
@@ -1,21 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2017",
|
|
4
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"module": "esnext",
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"jsx": "react-jsx",
|
|
15
|
-
"incremental": true,
|
|
16
|
-
"plugins": [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"plugins": [
|
|
17
|
+
{
|
|
18
|
+
"name": "next"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"paths": {
|
|
22
|
+
"@/*": ["./*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": [
|
|
26
|
+
"next-env.d.ts",
|
|
27
|
+
"**/*.ts",
|
|
28
|
+
"**/*.tsx",
|
|
29
|
+
".next/types/**/*.ts",
|
|
30
|
+
".next/dev/types/**/*.ts",
|
|
31
|
+
"**/*.mts"
|
|
32
|
+
],
|
|
33
|
+
"exclude": ["node_modules"]
|
|
34
|
+
}
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"id": "auth",
|
|
3
|
+
"name": "JWT Auth",
|
|
4
|
+
"description": "JWT authentication with bcrypt password hashing",
|
|
5
|
+
"type": "feature",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"bcrypt": "^6.0.0",
|
|
8
|
+
"jsonwebtoken": "^9.0.3"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@types/bcrypt": "^6.0.0",
|
|
12
|
+
"@types/jsonwebtoken": "^9.0.10"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {},
|
|
15
|
+
"envVars": {
|
|
16
|
+
"JWT_SECRET": "please-change-me",
|
|
17
|
+
"JWT_EXPIRES_IN": "1h"
|
|
18
|
+
},
|
|
19
|
+
"templateFiles": [
|
|
20
|
+
"src/lib/jwt.ts.hbs",
|
|
21
|
+
"src/middleware/requireAuth.ts.hbs",
|
|
22
|
+
"src/services/userStore.ts.hbs",
|
|
23
|
+
"src/routes/auth.ts.hbs",
|
|
24
|
+
"src/controllers/authController.ts.hbs"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -2,7 +2,7 @@ import { Request, Response, NextFunction, Router } from 'express';
|
|
|
2
2
|
import { login, me, register } from '../controllers/authController';
|
|
3
3
|
import { requireAuth } from '../middleware/requireAuth';
|
|
4
4
|
|
|
5
|
-
const router = Router();
|
|
5
|
+
const router: Router = Router();
|
|
6
6
|
|
|
7
7
|
function asyncHandler(
|
|
8
8
|
fn: (req: Request, res: Response, next: NextFunction) => Promise<void>
|