Skip to content

Commit 1ae7ad9

Browse files
committed
testing things out
1 parent e109191 commit 1ae7ad9

File tree

18 files changed

+2820
-1502
lines changed

18 files changed

+2820
-1502
lines changed

.react-router/types/+future.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Generated by React Router
2+
3+
import "react-router";
4+
5+
declare module "react-router" {
6+
interface Future {
7+
unstable_middleware: false
8+
}
9+
}

.react-router/types/+routes.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Generated by React Router
2+
3+
import "react-router"
4+
5+
declare module "react-router" {
6+
interface Register {
7+
pages: Pages
8+
routeFiles: RouteFiles
9+
}
10+
}
11+
12+
type Pages = {
13+
"/": {
14+
params: {};
15+
};
16+
"/community": {
17+
params: {};
18+
};
19+
};
20+
21+
type RouteFiles = {
22+
"root.jsx": {
23+
id: "root";
24+
page: "/" | "/community";
25+
};
26+
"./routes/home.jsx": {
27+
id: "routes/home";
28+
page: "/";
29+
};
30+
"./routes/community/overview.mdx": {
31+
id: "routes/community/overview";
32+
page: "/community";
33+
};
34+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Generated by React Router
2+
3+
declare module "virtual:react-router/server-build" {
4+
import { ServerBuild } from "react-router";
5+
export const assets: ServerBuild["assets"];
6+
export const assetsBuildDirectory: ServerBuild["assetsBuildDirectory"];
7+
export const basename: ServerBuild["basename"];
8+
export const entry: ServerBuild["entry"];
9+
export const future: ServerBuild["future"];
10+
export const isSpaMode: ServerBuild["isSpaMode"];
11+
export const prerender: ServerBuild["prerender"];
12+
export const publicPath: ServerBuild["publicPath"];
13+
export const routeDiscovery: ServerBuild["routeDiscovery"];
14+
export const routes: ServerBuild["routes"];
15+
export const ssr: ServerBuild["ssr"];
16+
export const unstable_getCriticalCss: ServerBuild["unstable_getCriticalCss"];
17+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Generated by React Router
2+
3+
import type { GetInfo, GetAnnotations } from "react-router/internal";
4+
5+
type Module = typeof import("../root.js")
6+
7+
type Info = GetInfo<{
8+
file: "root.jsx",
9+
module: Module
10+
}>
11+
12+
type Matches = [{
13+
id: "root";
14+
module: typeof import("../root.js");
15+
}];
16+
17+
type Annotations = GetAnnotations<Info & { module: Module, matches: Matches }>;
18+
19+
export namespace Route {
20+
// links
21+
export type LinkDescriptors = Annotations["LinkDescriptors"];
22+
export type LinksFunction = Annotations["LinksFunction"];
23+
24+
// meta
25+
export type MetaArgs = Annotations["MetaArgs"];
26+
export type MetaDescriptors = Annotations["MetaDescriptors"];
27+
export type MetaFunction = Annotations["MetaFunction"];
28+
29+
// headers
30+
export type HeadersArgs = Annotations["HeadersArgs"];
31+
export type HeadersFunction = Annotations["HeadersFunction"];
32+
33+
// unstable_middleware
34+
export type unstable_MiddlewareFunction = Annotations["unstable_MiddlewareFunction"];
35+
36+
// unstable_clientMiddleware
37+
export type unstable_ClientMiddlewareFunction = Annotations["unstable_ClientMiddlewareFunction"];
38+
39+
// loader
40+
export type LoaderArgs = Annotations["LoaderArgs"];
41+
42+
// clientLoader
43+
export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
44+
45+
// action
46+
export type ActionArgs = Annotations["ActionArgs"];
47+
48+
// clientAction
49+
export type ClientActionArgs = Annotations["ClientActionArgs"];
50+
51+
// HydrateFallback
52+
export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
53+
54+
// Component
55+
export type ComponentProps = Annotations["ComponentProps"];
56+
57+
// ErrorBoundary
58+
export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
59+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Generated by React Router
2+
3+
import type { GetInfo, GetAnnotations } from "react-router/internal";
4+
5+
type Module = typeof import("../home.js")
6+
7+
type Info = GetInfo<{
8+
file: "./routes/home.jsx",
9+
module: Module
10+
}>
11+
12+
type Matches = [{
13+
id: "root";
14+
module: typeof import("../../root.js");
15+
}, {
16+
id: "routes/home";
17+
module: typeof import("../home.js");
18+
}];
19+
20+
type Annotations = GetAnnotations<Info & { module: Module, matches: Matches }>;
21+
22+
export namespace Route {
23+
// links
24+
export type LinkDescriptors = Annotations["LinkDescriptors"];
25+
export type LinksFunction = Annotations["LinksFunction"];
26+
27+
// meta
28+
export type MetaArgs = Annotations["MetaArgs"];
29+
export type MetaDescriptors = Annotations["MetaDescriptors"];
30+
export type MetaFunction = Annotations["MetaFunction"];
31+
32+
// headers
33+
export type HeadersArgs = Annotations["HeadersArgs"];
34+
export type HeadersFunction = Annotations["HeadersFunction"];
35+
36+
// unstable_middleware
37+
export type unstable_MiddlewareFunction = Annotations["unstable_MiddlewareFunction"];
38+
39+
// unstable_clientMiddleware
40+
export type unstable_ClientMiddlewareFunction = Annotations["unstable_ClientMiddlewareFunction"];
41+
42+
// loader
43+
export type LoaderArgs = Annotations["LoaderArgs"];
44+
45+
// clientLoader
46+
export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
47+
48+
// action
49+
export type ActionArgs = Annotations["ActionArgs"];
50+
51+
// clientAction
52+
export type ClientActionArgs = Annotations["ClientActionArgs"];
53+
54+
// HydrateFallback
55+
export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
56+
57+
// Component
58+
export type ComponentProps = Annotations["ComponentProps"];
59+
60+
// ErrorBoundary
61+
export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
62+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Generated by React Router
2+
3+
import type { GetInfo, GetAnnotations } from "react-router/internal";
4+
5+
type Module = typeof import("../overview.mdx")
6+
7+
type Info = GetInfo<{
8+
file: "./routes/community/overview.mdx",
9+
module: Module
10+
}>
11+
12+
type Matches = [{
13+
id: "root";
14+
module: typeof import("../../../root.js");
15+
}, {
16+
id: "routes/community/overview";
17+
module: typeof import("../overview.mdx");
18+
}];
19+
20+
type Annotations = GetAnnotations<Info & { module: Module, matches: Matches }>;
21+
22+
export namespace Route {
23+
// links
24+
export type LinkDescriptors = Annotations["LinkDescriptors"];
25+
export type LinksFunction = Annotations["LinksFunction"];
26+
27+
// meta
28+
export type MetaArgs = Annotations["MetaArgs"];
29+
export type MetaDescriptors = Annotations["MetaDescriptors"];
30+
export type MetaFunction = Annotations["MetaFunction"];
31+
32+
// headers
33+
export type HeadersArgs = Annotations["HeadersArgs"];
34+
export type HeadersFunction = Annotations["HeadersFunction"];
35+
36+
// unstable_middleware
37+
export type unstable_MiddlewareFunction = Annotations["unstable_MiddlewareFunction"];
38+
39+
// unstable_clientMiddleware
40+
export type unstable_ClientMiddlewareFunction = Annotations["unstable_ClientMiddlewareFunction"];
41+
42+
// loader
43+
export type LoaderArgs = Annotations["LoaderArgs"];
44+
45+
// clientLoader
46+
export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
47+
48+
// action
49+
export type ActionArgs = Annotations["ActionArgs"];
50+
51+
// clientAction
52+
export type ClientActionArgs = Annotations["ClientActionArgs"];
53+
54+
// HydrateFallback
55+
export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
56+
57+
// Component
58+
export type ComponentProps = Annotations["ComponentProps"];
59+
60+
// ErrorBoundary
61+
export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
62+
}

app/app.css

Whitespace-only changes.

app/root.jsx

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import {
2+
isRouteErrorResponse,
3+
Links,
4+
Meta,
5+
Outlet,
6+
Scripts,
7+
ScrollRestoration,
8+
} from "react-router";
9+
10+
11+
import "./app.css";
12+
13+
export const links = () => [
14+
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
15+
{
16+
rel: "preconnect",
17+
href: "https://fonts.gstatic.com",
18+
crossOrigin: "anonymous",
19+
},
20+
{
21+
rel: "stylesheet",
22+
href: "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",
23+
},
24+
];
25+
26+
export function Layout({ children }) {
27+
return (
28+
<html lang="en">
29+
<head>
30+
<meta charSet="utf-8" />
31+
<meta name="viewport" content="width=device-width, initial-scale=1" />
32+
<Meta />
33+
<Links />
34+
</head>
35+
<body>
36+
{children}
37+
<ScrollRestoration />
38+
<Scripts />
39+
</body>
40+
</html>
41+
);
42+
}
43+
44+
export default function App() {
45+
return <Outlet />;
46+
}
47+
48+
export function ErrorBoundary({ error }) {
49+
let message = "Oops!";
50+
let details = "An unexpected error occurred.";
51+
let stack;
52+
53+
if (isRouteErrorResponse(error)) {
54+
message = error.status === 404 ? "404" : "Error";
55+
details =
56+
error.status === 404
57+
? "The requested page could not be found."
58+
: error.statusText || details;
59+
} else if (import.meta.env.DEV && error && error instanceof Error) {
60+
details = error.message;
61+
stack = error.stack;
62+
}
63+
64+
return (
65+
<main className="pt-16 p-4 container mx-auto">
66+
<h1>{message}</h1>
67+
<p>{details}</p>
68+
{stack && (
69+
<pre className="w-full p-4 overflow-x-auto">
70+
<code>{stack}</code>
71+
</pre>
72+
)}
73+
</main>
74+
);
75+
}

app/routes.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {
2+
route,
3+
index,
4+
layout,
5+
prefix,
6+
} from "@react-router/dev/routes";
7+
8+
export default [
9+
index("./routes/home.jsx"),
10+
// route("about", "./about.tsx"),
11+
12+
// layout("./auth/layout.tsx", [
13+
// route("login", "./auth/login.tsx"),
14+
// route("register", "./auth/register.tsx"),
15+
// ]),
16+
17+
...prefix("community", [
18+
index("./routes/community/overview.mdx"),
19+
// route(":city", "./concerts/city.tsx"),
20+
// route("trending", "./concerts/trending.tsx"),
21+
]),
22+
]
File renamed without changes.

0 commit comments

Comments
 (0)