Skip to content

Commit fefa878

Browse files
v6:docs: Fix error routes & increase bump version
2 parents 2ab3c56 + 74e3565 commit fefa878

File tree

10 files changed

+623
-385
lines changed

10 files changed

+623
-385
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/sequelize-guard-docs/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
"fumadocs-mdx": "^14.0.4",
1414
"fumadocs-ui": "^16.2.0",
1515
"lucide-react": "^0.555.0",
16-
"next": "16.0.1",
17-
"react": "^19.2.0",
18-
"react-dom": "^19.2.0"
16+
"next": "16.0.8",
17+
"react": "^19.2.1",
18+
"react-dom": "^19.2.1"
1919
},
2020
"devDependencies": {
2121
"@tailwindcss/postcss": "^4",
2222
"@types/mdx": "^2.0.13",
2323
"@types/node": "^24.10.1",
24-
"@types/react": "^19.2.0",
25-
"@types/react-dom": "^19.2.0",
24+
"@types/react": "^19",
25+
"@types/react-dom": "^19",
2626
"baseline-browser-mapping": "^2.8.32",
2727
"eslint": "^9.39.1",
2828
"eslint-config-next": "16.0.5",

apps/sequelize-guard-docs/src/app/_global-error/page.tsx

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
'use client';
2+
3+
import { useEffect } from 'react';
4+
import { AlertCircle, Home, RefreshCw } from 'lucide-react';
5+
6+
export default function Error({
7+
error,
8+
reset,
9+
}: {
10+
error: Error & { digest?: string };
11+
reset: () => void;
12+
}) {
13+
useEffect(() => {
14+
// Log the error to an error reporting service
15+
console.error('Error boundary caught:', error);
16+
}, [error]);
17+
18+
return (
19+
<div className="flex flex-col items-center justify-center min-h-screen px-4 text-center">
20+
<div className="max-w-md space-y-6">
21+
{/* Icon */}
22+
<div className="flex justify-center">
23+
<div className="rounded-full bg-red-100 dark:bg-red-900/20 p-6">
24+
<AlertCircle className="h-16 w-16 text-red-600 dark:text-red-400" />
25+
</div>
26+
</div>
27+
28+
{/* Error Message */}
29+
<div>
30+
<h1 className="text-4xl font-bold text-fd-foreground">
31+
Oops! Something went wrong
32+
</h1>
33+
<p className="mt-2 text-lg text-fd-muted-foreground">
34+
We encountered an unexpected error while loading this page.
35+
</p>
36+
</div>
37+
38+
{/* Error Details (in development) */}
39+
{process.env.NODE_ENV === 'development' && error.message && (
40+
<div className="text-left bg-fd-muted p-4 rounded-lg max-w-full overflow-auto">
41+
<p className="text-sm font-mono text-fd-foreground break-all">
42+
{error.message}
43+
</p>
44+
{error.digest && (
45+
<p className="text-xs text-fd-muted-foreground mt-2">
46+
Error ID: {error.digest}
47+
</p>
48+
)}
49+
</div>
50+
)}
51+
52+
{/* Actions */}
53+
<div className="flex flex-col sm:flex-row gap-3 justify-center pt-4">
54+
<button
55+
onClick={() => reset()}
56+
className="inline-flex items-center justify-center gap-2 rounded-lg bg-fd-primary px-6 py-3 text-sm font-medium text-fd-primary-foreground transition-colors hover:bg-fd-primary/90"
57+
>
58+
<RefreshCw className="h-4 w-4" />
59+
Try Again
60+
</button>
61+
<a
62+
href="/"
63+
className="inline-flex items-center justify-center gap-2 rounded-lg border border-fd-border px-6 py-3 text-sm font-medium text-fd-foreground transition-colors hover:bg-fd-accent"
64+
>
65+
<Home className="h-4 w-4" />
66+
Go Home
67+
</a>
68+
</div>
69+
70+
{/* Help Text */}
71+
<div className="pt-8 border-t border-fd-border">
72+
<p className="text-sm text-fd-muted-foreground">
73+
If this problem persists, please{' '}
74+
<a
75+
href="https://github.com/lotivo/sequelize-guard/issues"
76+
className="text-fd-primary hover:underline"
77+
target="_blank"
78+
rel="noopener noreferrer"
79+
>
80+
report an issue on GitHub
81+
</a>
82+
.
83+
</p>
84+
</div>
85+
</div>
86+
</div>
87+
);
88+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
'use client'; // Must be a Client Component
2+
3+
import { useEffect } from 'react';
4+
import { AlertTriangle } from 'lucide-react';
5+
6+
export default function GlobalError({
7+
error,
8+
reset,
9+
}: {
10+
error: Error & { digest?: string };
11+
reset: () => void;
12+
}) {
13+
// Log the error for debugging purposes
14+
useEffect(() => {
15+
console.error('Global Error:', error);
16+
}, [error]);
17+
18+
return (
19+
// Must include <html> and <body>
20+
<html>
21+
<body>
22+
<div className="flex flex-col items-center justify-center min-h-screen px-4 text-center bg-background">
23+
<div className="max-w-md space-y-6">
24+
{/* Icon */}
25+
<div className="flex justify-center">
26+
<div className="rounded-full bg-red-100 dark:bg-red-900/20 p-6">
27+
<AlertTriangle className="h-16 w-16 text-red-600 dark:text-red-400" />
28+
</div>
29+
</div>
30+
31+
{/* Error Message */}
32+
<div>
33+
<h1 className="text-4xl font-bold text-foreground">
34+
Something went wrong!
35+
</h1>
36+
<p className="mt-2 text-lg text-muted-foreground">
37+
An unexpected error occurred in the application.
38+
</p>
39+
</div>
40+
41+
{/* Error Details (in development) */}
42+
{process.env.NODE_ENV === 'development' && (
43+
<div className="text-left bg-muted p-4 rounded-lg max-w-full overflow-auto">
44+
<p className="text-sm font-mono text-foreground break-all">
45+
{error.message}
46+
</p>
47+
{error.digest && (
48+
<p className="text-xs text-muted-foreground mt-2">
49+
Error ID: {error.digest}
50+
</p>
51+
)}
52+
</div>
53+
)}
54+
55+
{/* Actions */}
56+
<div className="flex flex-col sm:flex-row gap-3 justify-center pt-4">
57+
<button
58+
onClick={() => reset()}
59+
className="inline-flex items-center justify-center gap-2 rounded-lg bg-primary px-6 py-3 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90"
60+
>
61+
Try Again
62+
</button>
63+
<a
64+
href="/"
65+
className="inline-flex items-center justify-center gap-2 rounded-lg border border-border px-6 py-3 text-sm font-medium text-foreground transition-colors hover:bg-accent"
66+
>
67+
Go Home
68+
</a>
69+
</div>
70+
71+
{/* Help Text */}
72+
<p className="text-sm text-muted-foreground pt-4">
73+
If this problem persists, please contact support or{' '}
74+
<a
75+
href="https://github.com/lotivo/sequelize-guard/issues"
76+
className="text-primary hover:underline"
77+
target="_blank"
78+
rel="noopener noreferrer"
79+
>
80+
report an issue
81+
</a>
82+
.
83+
</p>
84+
</div>
85+
</div>
86+
</body>
87+
</html>
88+
);
89+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import Link from 'next/link';
2+
import { FileQuestion, Home, Search } from 'lucide-react';
3+
4+
export default function NotFound() {
5+
return (
6+
<div className="flex flex-col items-center justify-center min-h-screen px-4 text-center">
7+
<div className="max-w-md space-y-6">
8+
{/* Icon */}
9+
<div className="flex justify-center">
10+
<div className="rounded-full bg-fd-primary/10 p-6">
11+
<FileQuestion className="h-16 w-16 text-fd-primary" />
12+
</div>
13+
</div>
14+
15+
{/* Error Code */}
16+
<div>
17+
<h1 className="text-6xl font-bold text-fd-foreground">404</h1>
18+
<p className="mt-2 text-xl font-semibold text-fd-foreground">
19+
Page Not Found
20+
</p>
21+
</div>
22+
23+
{/* Description */}
24+
<p className="text-fd-muted-foreground">
25+
The page you're looking for doesn't exist or has been moved.
26+
</p>
27+
28+
{/* Actions */}
29+
<div className="flex flex-col sm:flex-row gap-3 justify-center pt-4">
30+
<Link
31+
href="/"
32+
className="inline-flex items-center justify-center gap-2 rounded-lg bg-fd-primary px-6 py-3 text-sm font-medium text-fd-primary-foreground transition-colors hover:bg-fd-primary/90"
33+
>
34+
<Home className="h-4 w-4" />
35+
Go Home
36+
</Link>
37+
<Link
38+
href="/docs"
39+
className="inline-flex items-center justify-center gap-2 rounded-lg border border-fd-border px-6 py-3 text-sm font-medium text-fd-foreground transition-colors hover:bg-fd-accent"
40+
>
41+
<Search className="h-4 w-4" />
42+
Browse Docs
43+
</Link>
44+
</div>
45+
46+
{/* Helpful Links */}
47+
<div className="pt-8 border-t border-fd-border">
48+
<p className="text-sm text-fd-muted-foreground mb-3">
49+
Looking for something specific?
50+
</p>
51+
<div className="flex flex-wrap gap-2 justify-center text-sm">
52+
<Link
53+
href="/docs"
54+
className="text-fd-primary hover:underline"
55+
>
56+
Documentation
57+
</Link>
58+
<span className="text-fd-muted-foreground"></span>
59+
<Link
60+
href="/docs/guide/getting-started"
61+
className="text-fd-primary hover:underline"
62+
>
63+
Getting Started
64+
</Link>
65+
<span className="text-fd-muted-foreground"></span>
66+
<Link
67+
href="https://github.com/lotivo/sequelize-guard"
68+
className="text-fd-primary hover:underline"
69+
target="_blank"
70+
rel="noopener noreferrer"
71+
>
72+
GitHub
73+
</Link>
74+
</div>
75+
</div>
76+
</div>
77+
</div>
78+
);
79+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.css' {
2+
const content: string;
3+
export default content;
4+
}

apps/sequelize-guard-docs/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"compilerOptions": {
3-
"baseUrl": ".",
4-
"ignoreDeprecations": "6.0",
3+
"rootDir": ".",
54

65
"target": "ES2017",
76
"lib": ["dom", "dom.iterable", "esnext"],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"@typescript-eslint/parser": "^8.46.4",
5252
"@vitest/coverage-v8": "4.0.9",
5353
"@vitest/ui": "^4.0.9",
54+
"baseline-browser-mapping": "^2.8.32",
5455
"esdoc": "^1.1.0",
5556
"esdoc-standard-plugin": "^1.0.0",
5657
"eslint": "^9.39.1",

0 commit comments

Comments
 (0)