docs: update to next 15 + eslint 9 (#9839)

* update next

* updated react

* update eslint

* finish updating eslint

* fix content lint errors

* fix docs test

* fix vale action

* fix installation errors
This commit is contained in:
Shahed Nasser
2024-11-13 17:03:17 +02:00
committed by GitHub
parent 6f7467f071
commit 938f3bd934
143 changed files with 4193 additions and 3226 deletions
@@ -7,27 +7,26 @@ import { siteConfig } from "@/config/site"
import { Metadata } from "next"
interface DocPageProps {
params: {
params: Promise<{
slug: string[]
}
}>
}
async function getDocFromParams({ params }: DocPageProps) {
async function getDocFromParams(props: DocPageProps) {
const params = await props.params
const slug = params.slug?.join("/") || ""
const doc = allDocs.find((doc) => doc.slugAsParams === slug)
if (!doc) {
null
return
}
return doc
}
export async function generateMetadata({
params,
}: DocPageProps): Promise<Metadata> {
const doc = await getDocFromParams({ params })
export async function generateMetadata(props: DocPageProps): Promise<Metadata> {
const doc = await getDocFromParams(props)
if (!doc) {
return {}
@@ -44,16 +43,14 @@ export async function generateMetadata({
}
}
export async function generateStaticParams(): Promise<
DocPageProps["params"][]
> {
export async function generateStaticParams() {
return allDocs.map((doc) => ({
slug: doc.slugAsParams.split("/"),
}))
}
export default async function DocPage({ params }: DocPageProps) {
const doc = await getDocFromParams({ params })
export default async function DocPage(props: DocPageProps) {
const doc = await getDocFromParams(props)
if (!doc) {
notFound()
+4
View File
@@ -7,6 +7,7 @@ import {
ComputerDesktopSolid,
BuildingStorefront,
} from "@medusajs/icons"
import React from "react"
const H1 = MDXComponents.h1!
const P = MDXComponents.p!
@@ -18,8 +19,11 @@ export const metadata: Metadata = {
export default function NotFound() {
return (
<div>
{/* @ts-expect-error React v19 doesn't recognize these as elements. */}
<H1>Page Not Found</H1>
{/* @ts-expect-error React v19 doesn't recognize these as elements. */}
<P>The page you were looking for isn&apos;t available.</P>
{/* @ts-expect-error React v19 doesn't recognize these as elements. */}
<P>
If you think this is a mistake, please
<Link href="https://github.com/medusajs/medusa/issues/new?assignees=&labels=type%3A+docs&template=docs.yml">