-
-
- {page.meta?.title || page.frontMatter?.title || page.name}
-
-
-
- {page.frontMatter?.description}{" "}
-
-
- {more + " →"}
-
-
-
- {page.frontMatter?.date ? (
-
- {page.frontMatter.date}
-
- ) : null}
-
- );
- });
-}
diff --git a/components/blog-index.tsx b/components/blog-index.tsx
new file mode 100644
index 00000000..1fac467c
--- /dev/null
+++ b/components/blog-index.tsx
@@ -0,0 +1,39 @@
+import type { FrontMatter, Page } from "nextra";
+import { getPagesUnderRoute } from "nextra/context";
+import Link from "next/link";
+
+export default function BlogIndex({ more = "Read more" }: { more?: string }) {
+ return getPagesUnderRoute("/blog").map(
+ (page: Page & { frontMatter?: FrontMatter }) => {
+ return (
+
+
+
+ {page.meta?.title || page.frontMatter?.title || page.name}
+
+
+
+ {page.frontMatter?.description}{" "}
+
+
+ {more + " →"}
+
+
+
+ {page.frontMatter?.date ? (
+
+ {page.frontMatter.date}
+
+ ) : null}
+
+ );
+ }
+ );
+}
diff --git a/components/diagrams/cache.js b/components/diagrams/cache.tsx
similarity index 95%
rename from components/diagrams/cache.js
rename to components/diagrams/cache.tsx
index e0c0e350..6400e2c8 100644
--- a/components/diagrams/cache.js
+++ b/components/diagrams/cache.tsx
@@ -1,7 +1,7 @@
import useLocalesMap from "../use-locales-map";
import { diagramCachePathsMap } from "../../translations/svgs";
-export const Cache = () => {
+export const Cache: React.FC = () => {
const paths = useLocalesMap(diagramCachePathsMap);
return (
diff --git a/components/diagrams/infinite.js b/components/diagrams/infinite.tsx
similarity index 96%
rename from components/diagrams/infinite.js
rename to components/diagrams/infinite.tsx
index 45d04a11..55c38976 100644
--- a/components/diagrams/infinite.js
+++ b/components/diagrams/infinite.tsx
@@ -1,7 +1,7 @@
import useLocalesMap from "../use-locales-map";
import { diagramInfinitePathMap } from "../../translations/svgs";
-export const Infinite = () => {
+export const Infinite: React.FC = () => {
const path = useLocalesMap(diagramInfinitePathMap);
return (
diff --git a/components/diagrams/pagination.js b/components/diagrams/pagination.tsx
similarity index 98%
rename from components/diagrams/pagination.js
rename to components/diagrams/pagination.tsx
index 3b9725ea..5028dae5 100644
--- a/components/diagrams/pagination.js
+++ b/components/diagrams/pagination.tsx
@@ -1,7 +1,7 @@
import useLocalesMap from "../use-locales-map";
import { diagramPaginationPathsMap } from "../../translations/svgs";
-export const Pagination = () => {
+export const Pagination: React.FC = () => {
const paths = useLocalesMap(diagramPaginationPathsMap);
return (
diff --git a/components/diagrams/welcome.js b/components/diagrams/welcome.tsx
similarity index 96%
rename from components/diagrams/welcome.js
rename to components/diagrams/welcome.tsx
index 4cc177d5..56a71625 100644
--- a/components/diagrams/welcome.js
+++ b/components/diagrams/welcome.tsx
@@ -1,7 +1,7 @@
import useLocalesMap from "../use-locales-map";
import { diagramWelcomePathMap } from "../../translations/svgs";
-export const Welcome = () => {
+export const Welcome: React.FC = () => {
const path = useLocalesMap(diagramWelcomePathMap);
return (
diff --git a/components/features.js b/components/features.tsx
similarity index 62%
rename from components/features.js
rename to components/features.tsx
index c86b6d00..8b1bd491 100644
--- a/components/features.js
+++ b/components/features.tsx
@@ -1,18 +1,18 @@
import { useId } from "react";
import styles from "./features.module.css";
import useLocalesMap from "./use-locales-map";
-import { featuresMap, titleMap } from "../translations/text";
+import { type FeatureKey, featuresMap, titleMap } from "../translations/text";
-import BackendAgnosticIcon from "../components/icons/backend-agnostic";
-import LightweightIcon from "../components/icons/lightweight";
-import PaginationIcon from "../components/icons/pagination";
-import RealtimeIcon from "../components/icons/realtime";
-import RemoteLocalIcon from "../components/icons/remote-local";
-import RenderingStrategiesIcon from "../components/icons/rendering-strategies";
-import SuspenseIcon from "../components/icons/suspense";
-import TypeScriptIcon from "../components/icons/typescript";
+import BackendAgnosticIcon from "./icons/backend-agnostic";
+import LightweightIcon from "./icons/lightweight";
+import PaginationIcon from "./icons/pagination";
+import RealtimeIcon from "./icons/realtime";
+import RemoteLocalIcon from "./icons/remote-local";
+import RenderingStrategiesIcon from "./icons/rendering-strategies";
+import SuspenseIcon from "./icons/suspense";
+import TypeScriptIcon from "./icons/typescript";
-export function Feature({ text, icon }) {
+export function Feature({ text, icon }: { text: string; icon: JSX.Element }) {
return (
{icon}
@@ -21,8 +21,10 @@ export function Feature({ text, icon }) {
);
}
-/** @type {{ key: string; icon: React.FC }[]} */
-const FEATURES_LIST = [
+const FEATURES_LIST: {
+ key: FeatureKey;
+ icon: JSX.Element;
+}[] = [
{ key: "lightweight", icon:
},
{ key: "realtime", icon:
},
{ key: "suspense", icon:
},
diff --git a/components/icons/backend-agnostic.js b/components/icons/backend-agnostic.tsx
similarity index 83%
rename from components/icons/backend-agnostic.js
rename to components/icons/backend-agnostic.tsx
index 588819de..2708cee9 100644
--- a/components/icons/backend-agnostic.js
+++ b/components/icons/backend-agnostic.tsx
@@ -1,4 +1,6 @@
-export default function BackendAgnosticIcon() {
+export default function BackendAgnosticIcon(
+ props: React.SVGProps
+) {
return (
);
-};
+}
diff --git a/jsconfig.json b/jsconfig.json
deleted file mode 100644
index b639b0f8..00000000
--- a/jsconfig.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compilerOptions": {
- "baseUrl": "."
- }
-}
\ No newline at end of file
diff --git a/middleware.js b/middleware.ts
similarity index 100%
rename from middleware.js
rename to middleware.ts
diff --git a/next-env.d.ts b/next-env.d.ts
new file mode 100644
index 00000000..4f11a03d
--- /dev/null
+++ b/next-env.d.ts
@@ -0,0 +1,5 @@
+///