Skip to content

Commit

Permalink
auto session deletion, other changes:
Browse files Browse the repository at this point in the history
* use onClick and also show errors in session creation
* make api routes less lame
* add loading UI
* remove background, go plain
* nicer console logs
and other changes that I do not remember at the time of writing this commit
  • Loading branch information
IncognitoTGT committed May 3, 2024
1 parent 6313f7d commit ee7702e
Show file tree
Hide file tree
Showing 29 changed files with 513 additions and 377 deletions.
5 changes: 0 additions & 5 deletions config.json

This file was deleted.

10 changes: 7 additions & 3 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import { verifyPatch } from "next-ws/server/index.js";

verifyPatch();
import { execSync } from "node:child_process";
await import("next-ws/server/index.js").then((m) => m.verifyPatch());
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
Expand All @@ -14,8 +13,13 @@ const nextConfig = {
},
],
},
env: {
GIT_COMMIT: execSync("git rev-parse HEAD").toString().trim(),
BUILD_DATE: Date.now().toString(),
},
experimental: {
typedRoutes: true,
instrumentationHook: true,
serverActions: {
allowedOrigins: ["localhost:3000", "*.use.devtunnels.ms"],
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stardust",
"version": "0.1.0",
"version": "0.5.0-alpha",
"private": true,
"type": "module",
"scripts": {
Expand Down Expand Up @@ -39,7 +39,7 @@
"dotenv": "^16.4.5",
"drizzle-orm": "^0.30.4",
"lucide-react": "^0.358.0",
"next": "14.2.2",
"next": "14.2.3",
"next-auth": "4.24.7",
"next-themes": "^0.3.0",
"next-ws": "^1.0.1",
Expand Down
80 changes: 40 additions & 40 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 0 additions & 25 deletions src/actions/client-session.ts

This file was deleted.

11 changes: 4 additions & 7 deletions src/app/(main)/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import { Button } from "@/components/ui/button";
import { Sparkles } from "lucide-react";
// biome-ignore lint: lint/suspicious/noShadowRestrictedNames
export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
export default function ErrorPage({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
return (
<div className="flex h-full flex-col items-center justify-center backdrop-blur-sm backdrop-brightness-75">
<div className="flex h-full flex-col items-center justify-center">
<div className="flex h-[32rem] w-96 flex-col items-center justify-center gap-4">
<div className="mb-4 flex items-center justify-center text-left text-2xl font-bold">
<Sparkles />
Expand All @@ -14,16 +13,14 @@ export default function Error({ error, reset }: { error: Error & { digest?: stri
<p className="text-center text-6xl font-bold text-primary">Error</p>
<div className="flex flex-col items-center justify-center gap-4">
<p className="text-center">Stardust has encountered an error</p>
<p className="text-center">Digest: {error.digest ?? "null"}</p>
<p className="text-center">Digest: {error.digest ?? "none"}</p>
{error.message ? (
<code className="text-center text-lg font-bold text-destructive">{error.message}</code>
) : null}
<Button className="text-center" onClick={reset}>
Reset
</Button>
<p className="text-xs text-muted-foreground">
More details are in the {typeof window === "undefined" ? "server logs" : "browser console"}
</p>
<p className="text-xs text-muted-foreground">More details are in the logs</p>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit ee7702e

Please sign in to comment.