1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

build(deps): update Next.js to v15 and ESLint to v9

This commit is contained in:
2024-11-09 19:50:22 +01:00
parent 59153a7a69
commit 9e840b8dae
74 changed files with 3206 additions and 3749 deletions

View File

@ -4,19 +4,20 @@ import { notFound } from "next/navigation"
import { getBlogPostBySlug, getBlogPosts } from "@repo/blog"
import { BlogPostUI } from "@repo/blog/BlogPostUI"
import type { Locale } from "@repo/utils/constants"
import { unstable_setRequestLocale } from "next-intl/server"
import { setRequestLocale } from "next-intl/server"
interface BlogPostPageProps {
params: {
params: Promise<{
slug: string
locale: Locale
}
}>
}
export const generateMetadata = async (
props: BlogPostPageProps,
): Promise<Metadata> => {
const blogPost = await getBlogPostBySlug(props.params.slug)
const { slug } = await props.params
const blogPost = await getBlogPostBySlug(slug)
if (blogPost == null) {
return notFound()
}
@ -50,10 +51,11 @@ export const generateStaticParams = async (): Promise<
const BlogPostPage: React.FC<BlogPostPageProps> = async (props) => {
const { params } = props
const { locale, slug } = await params
// Enable static rendering
unstable_setRequestLocale(params.locale)
setRequestLocale(locale)
const blogPost = await getBlogPostBySlug(params.slug)
const blogPost = await getBlogPostBySlug(slug)
if (blogPost == null) {
return notFound()
}

View File

@ -1,6 +1,6 @@
import { getBlogPosts } from "@repo/blog"
import { BlogPosts } from "@repo/blog/BlogPosts"
import type { LocaleProps } from "@repo/i18n/config"
import type { LocaleProps } from "@repo/i18n/routing"
import { MainLayout } from "@repo/ui/Layout/MainLayout"
import {
Section,
@ -9,7 +9,7 @@ import {
} from "@repo/ui/Layout/Section"
import { LOCALE_DEFAULT } from "@repo/utils/constants"
import type { Metadata } from "next"
import { unstable_setRequestLocale } from "next-intl/server"
import { setRequestLocale } from "next-intl/server"
const title = "Blog | Théo LUDWIG"
const description =
@ -36,8 +36,9 @@ interface BlogPageProps extends LocaleProps {}
const BlogPage: React.FC<BlogPageProps> = async (props) => {
const { params } = props
const { locale } = await params
// Enable static rendering
unstable_setRequestLocale(params.locale)
setRequestLocale(locale)
const posts = await getBlogPosts()

View File

@ -1,18 +1,19 @@
import "@repo/config-tailwind/styles.css"
import type { LocaleProps } from "@repo/i18n/config"
import type { LocaleProps } from "@repo/i18n/routing"
import { Footer } from "@repo/ui/Layout/Footer"
import { Header } from "@repo/ui/Layout/Header"
import { ThemeProvider } from "@repo/ui/Layout/Header/SwitchTheme"
import { VERSION } from "@repo/utils/constants"
import { unstable_setRequestLocale } from "next-intl/server"
import { setRequestLocale } from "next-intl/server"
interface MainLayoutProps extends React.PropsWithChildren, LocaleProps {}
const MainLayout: React.FC<MainLayoutProps> = async (props) => {
const { children, params } = props
const { locale } = await params
// Enable static rendering
unstable_setRequestLocale(params.locale)
setRequestLocale(locale)
return (
<ThemeProvider>

View File

@ -1,4 +1,4 @@
import type { LocaleProps } from "@repo/i18n/config"
import type { LocaleProps } from "@repo/i18n/routing"
import { About } from "@repo/ui/Home/About"
import { Interests } from "@repo/ui/Home/Interests"
import { OpenSource } from "@repo/ui/Home/OpenSource"
@ -6,15 +6,16 @@ import { Portfolio } from "@repo/ui/Home/Portfolio"
import { Skills } from "@repo/ui/Home/Skills"
import { MainLayout } from "@repo/ui/Layout/MainLayout"
import { RevealFade } from "@repo/ui/Layout/Section"
import { unstable_setRequestLocale } from "next-intl/server"
import { setRequestLocale } from "next-intl/server"
interface HomePageProps extends LocaleProps {}
const HomePage: React.FC<HomePageProps> = (props) => {
const HomePage: React.FC<HomePageProps> = async (props) => {
const { params } = props
const { locale } = await params
// Enable static rendering
unstable_setRequestLocale(params.locale)
setRequestLocale(locale)
return (
<MainLayout>

View File

@ -1,7 +1,7 @@
import "@repo/config-tailwind/styles.css"
import type { LocaleProps } from "@repo/i18n/config"
import type { LocaleProps } from "@repo/i18n/routing"
import { ThemeProvider } from "@repo/ui/Layout/Header/SwitchTheme"
import { unstable_setRequestLocale } from "next-intl/server"
import { setRequestLocale } from "next-intl/server"
interface CurriculumVitaeLayoutProps
extends React.PropsWithChildren,
@ -12,8 +12,9 @@ const CurriculumVitaeLayout: React.FC<CurriculumVitaeLayoutProps> = async (
) => {
const { children, params } = props
const { locale } = await params
// Enable static rendering
unstable_setRequestLocale(params.locale)
setRequestLocale(locale)
return <ThemeProvider forcedTheme="light">{children}</ThemeProvider>
}

View File

@ -1,14 +1,15 @@
import type { LocaleProps } from "@repo/i18n/config"
import type { LocaleProps } from "@repo/i18n/routing"
import { CurriculumVitae } from "@repo/ui/CurriculumVitae"
import { unstable_setRequestLocale } from "next-intl/server"
import { setRequestLocale } from "next-intl/server"
interface CurriculumVitaeProps extends LocaleProps {}
const CurriculumVitaePage: React.FC<CurriculumVitaeProps> = (props) => {
const CurriculumVitaePage: React.FC<CurriculumVitaeProps> = async (props) => {
const { params } = props
const { locale } = await params
// Enable static rendering
unstable_setRequestLocale(params.locale)
setRequestLocale(locale)
return <CurriculumVitae />
}

View File

@ -1,5 +1,5 @@
import "@repo/config-tailwind/styles.css"
import type { LocaleProps } from "@repo/i18n/config"
import type { LocaleProps } from "@repo/i18n/routing"
import type { Locale } from "@repo/utils/constants"
import { LOCALES } from "@repo/utils/constants"
import type { Metadata } from "next"
@ -7,18 +7,19 @@ import { NextIntlClientProvider } from "next-intl"
import {
getMessages,
getTranslations,
unstable_setRequestLocale,
setRequestLocale,
} from "next-intl/server"
export const generateMetadata = async ({
params,
}: LocaleProps): Promise<Metadata> => {
const t = await getTranslations({ locale: params.locale })
const { locale } = await params
const t = await getTranslations({ locale })
const title = t("meta.title")
const description = `${title} - ${t("meta.description")}`
const image = "/images/logo.webp"
const url = new URL("https://theoludwig.fr")
const locale = LOCALES.join(", ")
const locales = LOCALES.join(", ")
return {
title,
@ -36,7 +37,7 @@ export const generateMetadata = async ({
height: 96,
},
],
locale,
locale: locales,
type: "website",
},
twitter: {
@ -61,13 +62,14 @@ interface LocaleLayoutProps extends React.PropsWithChildren, LocaleProps {}
const LocaleLayout: React.FC<LocaleLayoutProps> = async (props) => {
const { children, params } = props
const { locale } = await params
// Enable static rendering
unstable_setRequestLocale(params.locale)
setRequestLocale(locale)
const messages = await getMessages()
return (
<html lang={params.locale} suppressHydrationWarning>
<html lang={locale} suppressHydrationWarning>
<body>
<NextIntlClientProvider messages={messages}>
{children}