-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): use shared linter config
Updated various files in the `docs` folder to correct inconsistent indentation, formatting, and quotes. This includes changes to `vercel.json`, `_meta.ts`, `introduction.md`, `tsconfig.json`, `analytics.tsx`, and `pnpm-lock.yaml` to ensure consistent coding standards and improved readability.
- Loading branch information
Showing
26 changed files
with
3,519 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
/* eslint-disable react-hooks/rules-of-hooks -- false positive, useMDXComponents/useTOC are not react hooks */ | ||
|
||
import { generateStaticParamsFor, importPage } from 'nextra/pages' | ||
import { generateStaticParamsFor, importPage } from "nextra/pages"; | ||
|
||
import { useMDXComponents } from "../../mdx-components"; | ||
|
||
export const generateStaticParams = generateStaticParamsFor('mdxPath') | ||
export const generateStaticParams = generateStaticParamsFor("mdxPath"); | ||
|
||
export async function generateMetadata(props) { | ||
const params = await props.params | ||
const { metadata } = await importPage(params.mdxPath) | ||
return metadata | ||
const params = await props.params; | ||
const { metadata } = await importPage(params.mdxPath); | ||
return metadata; | ||
} | ||
|
||
const Wrapper = useMDXComponents([]).wrapper | ||
const Wrapper = useMDXComponents([]).wrapper; | ||
|
||
export default async function Page(props) { | ||
const params = await props.params | ||
const result = await importPage(params.mdxPath) | ||
const { default: MDXContent, toc, metadata } = result | ||
return ( | ||
<Wrapper toc={toc} metadata={metadata}> | ||
<MDXContent {...props} params={params} /> | ||
</Wrapper> | ||
) | ||
const params = await props.params; | ||
const result = await importPage(params.mdxPath); | ||
const { default: MDXContent, toc, metadata } = result; | ||
return ( | ||
<Wrapper toc={toc} metadata={metadata}> | ||
<MDXContent {...props} params={params} /> | ||
</Wrapper> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
'use client'; | ||
"use client"; | ||
|
||
import { ReactNode, useEffect } from "react"; | ||
import { usePathname } from "next/navigation"; | ||
import { useEffect } from "react"; | ||
|
||
import type { ReactNode } from "react"; | ||
|
||
export default function Analytics({ children }: { children: ReactNode }) { | ||
const pathname = usePathname(); | ||
const pathname = usePathname(); | ||
|
||
useEffect(() => { | ||
const handleRouteChange = (url) => { | ||
gtag('event', 'page_view', { | ||
page_path: url, | ||
}); | ||
}; | ||
useEffect(() => { | ||
const handleRouteChange = (url) => { | ||
gtag("event", "page_view", { | ||
page_path: url, | ||
}); | ||
}; | ||
|
||
// Track the initial load | ||
handleRouteChange(pathname); | ||
// Track the initial load | ||
handleRouteChange(pathname); | ||
|
||
// Listen to changes in the pathname | ||
return () => handleRouteChange(pathname); | ||
}, [pathname]); | ||
// Listen to changes in the pathname | ||
return () => handleRouteChange(pathname); | ||
}, [pathname]); | ||
|
||
return children; | ||
return children; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,78 @@ | ||
import { Footer, Layout, Navbar } from "nextra-theme-docs"; | ||
import Script from "next/script"; | ||
import { getPageMap } from "nextra/page-map"; | ||
import { Footer, Layout, Navbar } from "nextra-theme-docs"; | ||
import "nextra-theme-docs/style.css"; | ||
import Script from "next/script"; | ||
|
||
import Analytics from "./analytics"; | ||
|
||
export const metadata = { | ||
title: { | ||
template: "%s – Prisma Client Go", | ||
default: "Prisma Client Go", | ||
}, | ||
metadataBase: new URL("https://goprisma.org"), | ||
description: "Prisma Client Go is an auto-generated and fully type-safe database client", | ||
applicationName: "Go Prisma", | ||
icons: [{ | ||
rel: "icon", | ||
url: "/icon.png", | ||
type: "image/png", | ||
}], | ||
title: { | ||
template: "%s – Prisma Client Go", | ||
default: "Prisma Client Go", | ||
}, | ||
metadataBase: new URL("https://goprisma.org"), | ||
description: | ||
"Prisma Client Go is an auto-generated and fully type-safe database client", | ||
applicationName: "Go Prisma", | ||
icons: [ | ||
{ | ||
rel: "icon", | ||
url: "/icon.png", | ||
type: "image/png", | ||
}, | ||
], | ||
}; | ||
|
||
export default async function RootLayout({ children }) { | ||
return ( | ||
<html lang="en" dir="ltr" suppressHydrationWarning> | ||
<head> | ||
<Script | ||
src="https://www.googletagmanager.com/gtag/js?id=G-SV698BGGW8" | ||
strategy="afterInteractive" | ||
/> | ||
<Script id="google-analytics" strategy="afterInteractive"> | ||
{` | ||
return ( | ||
<html lang="en" dir="ltr" suppressHydrationWarning> | ||
<head> | ||
<Script | ||
src="https://www.googletagmanager.com/gtag/js?id=G-SV698BGGW8" | ||
strategy="afterInteractive" | ||
/> | ||
<Script id="google-analytics" strategy="afterInteractive"> | ||
{` | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', 'G-SV698BGGW8'); | ||
`} | ||
</Script> | ||
</head> | ||
<body> | ||
<Analytics> | ||
<Layout | ||
footer={ | ||
<Footer> | ||
<span> | ||
All source code and content licensed under | ||
<a href="https://github.com/steebchen/prisma-client-go/blob/main/LICENSE" target="_blank"> | ||
Apache 2.0 | ||
</a> | ||
</span> | ||
</Footer> | ||
} | ||
navbar={ | ||
<Navbar | ||
logo={<div>Go Prisma</div>} | ||
chatLink="https://discord.gg/er3ZbmYHDk" | ||
projectLink="https://github.com/steebchen/prisma-client-go" | ||
/> | ||
} | ||
editLink="Edit this page on GitHub" | ||
docsRepositoryBase="https://github.com/steebchen/prisma-client-go/tree/main/docs" | ||
sidebar={{ defaultMenuCollapseLevel: 1 }} | ||
pageMap={await getPageMap()} | ||
> | ||
{children} | ||
</Layout> | ||
</Analytics> | ||
</body> | ||
</html> | ||
); | ||
</Script> | ||
</head> | ||
<body> | ||
<Analytics> | ||
<Layout | ||
footer={ | ||
<Footer> | ||
<span> | ||
All source code and content licensed under | ||
<a | ||
href="https://github.com/steebchen/prisma-client-go/blob/main/LICENSE" | ||
target="_blank" | ||
> | ||
Apache 2.0 | ||
</a> | ||
</span> | ||
</Footer> | ||
} | ||
navbar={ | ||
<Navbar | ||
logo={<div>Go Prisma</div>} | ||
chatLink="https://discord.gg/er3ZbmYHDk" | ||
projectLink="https://github.com/steebchen/prisma-client-go" | ||
/> | ||
} | ||
editLink="Edit this page on GitHub" | ||
docsRepositoryBase="https://github.com/steebchen/prisma-client-go/tree/main/docs" | ||
sidebar={{ defaultMenuCollapseLevel: 1 }} | ||
pageMap={await getPageMap()} | ||
> | ||
{children} | ||
</Layout> | ||
</Analytics> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
export default { | ||
"index": { | ||
"type": "page", | ||
"display": "hidden", | ||
"theme": { | ||
"layout": "full", | ||
}, | ||
}, | ||
"docs": { | ||
"type": "page", | ||
"title": "Documentation", | ||
// "display": "hidden", | ||
}, | ||
index: { | ||
type: "page", | ||
display: "hidden", | ||
theme: { | ||
layout: "full", | ||
}, | ||
}, | ||
docs: { | ||
type: "page", | ||
title: "Documentation", | ||
// "display": "hidden", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
export default { | ||
"index": "Home", | ||
"getting-started": "Getting Started", | ||
"walkthrough": "Walkthrough", | ||
"reference": "Reference", | ||
"help": "Help", | ||
"community": "Community", | ||
"README": { | ||
"display": "hidden" | ||
} | ||
} | ||
index: "Home", | ||
"getting-started": "Getting Started", | ||
walkthrough: "Walkthrough", | ||
reference: "Reference", | ||
help: "Help", | ||
community: "Community", | ||
README: { | ||
display: "hidden", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export default { | ||
"index": "", | ||
"quickstart": "", | ||
"advanced": "", | ||
"cli": "" | ||
} | ||
index: "", | ||
quickstart: "", | ||
advanced: "", | ||
cli: "", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.