nextjs-hackathon-stack 0.1.6 → 0.1.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/dist/index.js +4 -1
- package/package.json +1 -1
- package/template/_gitignore +27 -0
- package/template/src/app/error.tsx +28 -0
- package/template/src/features/chat/components/chat-ui.tsx +1 -1
- /package/template/{.env.example → _env.example} +0 -0
- /package/template/src/{features/chat/api → app/api/chat}/route.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -64,7 +64,10 @@ function copyDir(src, dest, vars) {
|
|
|
64
64
|
mkdirSync(dest, { recursive: true });
|
|
65
65
|
for (const entry of readdirSync(src)) {
|
|
66
66
|
const srcPath = join(src, entry);
|
|
67
|
-
|
|
67
|
+
let destEntry = entry.endsWith(".tmpl") ? entry.slice(0, -5) : entry;
|
|
68
|
+
if (entry === "_gitignore" || entry === "_env.example") {
|
|
69
|
+
destEntry = "." + entry.slice(1);
|
|
70
|
+
}
|
|
68
71
|
const destPath = join(dest, destEntry);
|
|
69
72
|
const stat = statSync(srcPath);
|
|
70
73
|
if (stat.isDirectory()) {
|
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
.pnp
|
|
4
|
+
.pnp.js
|
|
5
|
+
|
|
6
|
+
# Next.js
|
|
7
|
+
.next/
|
|
8
|
+
out/
|
|
9
|
+
build/
|
|
10
|
+
|
|
11
|
+
# Env — NEVER commit real keys
|
|
12
|
+
.env.local
|
|
13
|
+
.env.*.local
|
|
14
|
+
# .env.example is committed intentionally
|
|
15
|
+
|
|
16
|
+
# Testing
|
|
17
|
+
coverage/
|
|
18
|
+
playwright-report/
|
|
19
|
+
test-results/
|
|
20
|
+
|
|
21
|
+
# Misc
|
|
22
|
+
.DS_Store
|
|
23
|
+
*.pem
|
|
24
|
+
npm-debug.log*
|
|
25
|
+
|
|
26
|
+
# Drizzle
|
|
27
|
+
drizzle/
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
|
|
5
|
+
export default function Error({
|
|
6
|
+
error,
|
|
7
|
+
reset,
|
|
8
|
+
}: {
|
|
9
|
+
error: Error & { digest?: string };
|
|
10
|
+
reset: () => void;
|
|
11
|
+
}) {
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
console.error(error);
|
|
14
|
+
}, [error]);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="flex min-h-screen flex-col items-center justify-center gap-4">
|
|
18
|
+
<h2 className="text-xl font-semibold">Something went wrong</h2>
|
|
19
|
+
<p className="text-muted-foreground text-sm">{error.message}</p>
|
|
20
|
+
<button
|
|
21
|
+
onClick={reset}
|
|
22
|
+
className="rounded bg-primary px-4 py-2 text-primary-foreground"
|
|
23
|
+
>
|
|
24
|
+
Try again
|
|
25
|
+
</button>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -4,7 +4,7 @@ import { useChat } from "@ai-sdk/react";
|
|
|
4
4
|
|
|
5
5
|
export function ChatUi() {
|
|
6
6
|
const { messages, input, handleInputChange, handleSubmit, status } = useChat({
|
|
7
|
-
api: "/
|
|
7
|
+
api: "/api/chat",
|
|
8
8
|
});
|
|
9
9
|
const isLoading = status === "streaming" || status === "submitted";
|
|
10
10
|
|
|
File without changes
|
|
File without changes
|