Skip to content

Commit

Permalink
chore(docs): use shared linter config
Browse files Browse the repository at this point in the history
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
steebchen committed Jan 17, 2025
1 parent 90061c5 commit c61ce4b
Show file tree
Hide file tree
Showing 26 changed files with 3,519 additions and 376 deletions.
29 changes: 15 additions & 14 deletions docs/app/[[...mdxPath]]/page.tsx
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>
);
}
32 changes: 17 additions & 15 deletions docs/app/analytics.tsx
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;
}
119 changes: 63 additions & 56 deletions docs/app/layout.tsx
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&nbsp;
<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&nbsp;
<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>
);
}
24 changes: 12 additions & 12 deletions docs/content/_meta.ts
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",
},
};
20 changes: 10 additions & 10 deletions docs/content/docs/_meta.ts
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",
},
};
16 changes: 8 additions & 8 deletions docs/content/docs/community.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Cards } from 'nextra/components'
import { Cards } from "nextra/components";

# Prisma Client Go Community

Expand All @@ -8,11 +8,11 @@ I always look into bug reports, and try my best to fix these.
I host a free discord server for the Go client community. It is a place for deeper discussions, direct communication with me and plenty of other smart people working in the Go ecosystem.

<Cards>
<Cards.Card
href="https://discord.gg/er3ZbmYHDk"
target="_blank"
icon={''}
title={'Join the Discord Server'}
arrow={true}
/>
<Cards.Card
href="https://discord.gg/er3ZbmYHDk"
target="_blank"
icon={""}
title={"Join the Discord Server"}
arrow={true}
/>
</Cards>
10 changes: 5 additions & 5 deletions docs/content/docs/getting-started/_meta.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
"index": "",
"quickstart": "",
"advanced": "",
"cli": ""
}
index: "",
quickstart: "",
advanced: "",
cli: "",
};
44 changes: 22 additions & 22 deletions docs/content/docs/help.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Cards } from 'nextra/components'
import { Cards } from "nextra/components";

# Help

Expand All @@ -10,29 +10,29 @@ For general questions about Prisma, please refer to the [Prisma documentation](h

I also host a private [Go client community](community) where you can ask questions and get help.

<br/>
<br />

<Cards className="flex flex-wrap">
<Cards.Card
href="https://github.com/steebchen/prisma-client-go/issues"
target="_blank"
icon={''}
title={'GitHub issue tracker'}
arrow={true}
/>
<Cards.Card
href="community"
icon={''}
title={'Go client Community'}
arrow={true}
/>
<Cards.Card
href="https://www.prisma.io/docs/"
target="_blank"
icon={''}
title={'Prisma Core docs'}
arrow={true}
/>
<Cards.Card
href="https://github.com/steebchen/prisma-client-go/issues"
target="_blank"
icon={""}
title={"GitHub issue tracker"}
arrow={true}
/>
<Cards.Card
href="community"
icon={""}
title={"Go client Community"}
arrow={true}
/>
<Cards.Card
href="https://www.prisma.io/docs/"
target="_blank"
icon={""}
title={"Prisma Core docs"}
arrow={true}
/>
</Cards>

## Contributing
Expand Down
Loading

0 comments on commit c61ce4b

Please sign in to comment.