create-stackforge 0.1.0 → 0.1.2
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/dist/cli.js +111 -14
- package/dist/cli.js.map +1 -1
- package/package.json +5 -2
- package/templates/auth/better-auth-client.js +7 -0
- package/templates/auth/better-auth-client.ts +7 -0
- package/templates/auth/better-auth-protected-page.jsx +12 -0
- package/templates/auth/better-auth-protected-page.tsx +12 -0
- package/templates/auth/better-auth-route.js +4 -0
- package/templates/auth/better-auth-route.ts +4 -0
- package/templates/auth/better-auth-server.js +9 -0
- package/templates/auth/better-auth-server.ts +9 -0
- package/templates/auth/better-auth-signin.jsx +25 -0
- package/templates/auth/better-auth-signin.tsx +25 -0
- package/templates/auth/better-auth.README.md +10 -0
- package/templates/shared/_gitignore +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-stackforge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "The universal full-stack boilerplate generator. Scaffold production-ready apps with Next.js/Vite, 8 UI libraries, 6 databases, 4 ORMs, 3 auth providers, REST/tRPC/GraphQL, and AI agent integrations.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Lakshay Kapoor",
|
|
@@ -109,6 +109,9 @@
|
|
|
109
109
|
"test:integration": "node --test --import tsx tests/integration/**/*.test.ts",
|
|
110
110
|
"test:e2e": "node --test --import tsx tests/e2e/**/*.test.ts",
|
|
111
111
|
"test:all": "node --test --import tsx tests/**/*.test.ts",
|
|
112
|
-
"clean:tests": "tsx scripts/clean-test-artifacts.ts"
|
|
112
|
+
"clean:tests": "tsx scripts/clean-test-artifacts.ts",
|
|
113
|
+
"update:versions": "tsx scripts/update-versions.ts",
|
|
114
|
+
"update:versions:major": "tsx scripts/update-versions.ts --major",
|
|
115
|
+
"update:versions:dry": "tsx scripts/update-versions.ts --dry-run"
|
|
113
116
|
}
|
|
114
117
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { auth } from '../../../auth/auth';
|
|
2
|
+
import { headers } from 'next/headers';
|
|
3
|
+
|
|
4
|
+
export default async function ProtectedPage() {
|
|
5
|
+
const session = await auth.api.getSession({ headers: headers() });
|
|
6
|
+
return (
|
|
7
|
+
<div>
|
|
8
|
+
<h1>Protected</h1>
|
|
9
|
+
<pre>{JSON.stringify(session, null, 2)}</pre>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { auth } from '../../../auth/auth';
|
|
2
|
+
import { headers } from 'next/headers';
|
|
3
|
+
|
|
4
|
+
export default async function ProtectedPage() {
|
|
5
|
+
const session = await auth.api.getSession({ headers: headers() });
|
|
6
|
+
return (
|
|
7
|
+
<div>
|
|
8
|
+
<h1>Protected</h1>
|
|
9
|
+
<pre>{JSON.stringify(session, null, 2)}</pre>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { signIn } from '../../src/lib/auth-client';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
|
|
6
|
+
export default function SignInPage() {
|
|
7
|
+
const [email, setEmail] = useState('');
|
|
8
|
+
const [password, setPassword] = useState('');
|
|
9
|
+
|
|
10
|
+
async function handleSubmit(e) {
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
await signIn.email({ email, password });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<main>
|
|
17
|
+
<h1>Sign In</h1>
|
|
18
|
+
<form onSubmit={handleSubmit}>
|
|
19
|
+
<input type="email" placeholder="Email" value={email} onChange={(e) => setEmail(e.target.value)} />
|
|
20
|
+
<input type="password" placeholder="Password" value={password} onChange={(e) => setPassword(e.target.value)} />
|
|
21
|
+
<button type="submit">Sign In</button>
|
|
22
|
+
</form>
|
|
23
|
+
</main>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { signIn } from '../../src/lib/auth-client';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
|
|
6
|
+
export default function SignInPage() {
|
|
7
|
+
const [email, setEmail] = useState('');
|
|
8
|
+
const [password, setPassword] = useState('');
|
|
9
|
+
|
|
10
|
+
async function handleSubmit(e: React.FormEvent) {
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
await signIn.email({ email, password });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<main>
|
|
17
|
+
<h1>Sign In</h1>
|
|
18
|
+
<form onSubmit={handleSubmit}>
|
|
19
|
+
<input type="email" placeholder="Email" value={email} onChange={(e) => setEmail(e.target.value)} />
|
|
20
|
+
<input type="password" placeholder="Password" value={password} onChange={(e) => setPassword(e.target.value)} />
|
|
21
|
+
<button type="submit">Sign In</button>
|
|
22
|
+
</form>
|
|
23
|
+
</main>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Better Auth
|
|
2
|
+
|
|
3
|
+
Files:
|
|
4
|
+
- `auth/auth.*` Better Auth server configuration
|
|
5
|
+
- `src/lib/auth-client.*` client-side auth helper
|
|
6
|
+
|
|
7
|
+
Next steps:
|
|
8
|
+
- Configure providers in `auth/auth.*`
|
|
9
|
+
- Set `BETTER_AUTH_SECRET` and `BETTER_AUTH_URL` in `.env`
|
|
10
|
+
- See https://www.better-auth.com/docs for full documentation
|