diff --git a/.oxfmtrc.json b/.oxfmtrc.json index 00eafc1c1b..d815659149 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -1,4 +1,4 @@ { "$schema": "./node_modules/oxfmt/configuration_schema.json", - "ignorePatterns": ["**/dist/**", "**/.next/**", "**/.source/**"] + "ignorePatterns": ["**/dist/**", "**/.next/**", "**/.source/**", "**/public/**", "**/*.mdx"] } diff --git a/.oxlintrc.json b/.oxlintrc.json index c6225a55df..a5cea25458 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -140,5 +140,5 @@ "builtin": true }, "globals": {}, - "ignorePatterns": ["**/dist/**", "**/.next/**", "**/.source/**", "**/node_modules/**"] + "ignorePatterns": ["**/dist/**", "**/.next/**", "**/.source/**", "**/node_modules/**", "**/public/**"] } diff --git a/apps/blog/next.config.mjs b/apps/blog/next.config.mjs index b09bf6f61e..04befc1642 100644 --- a/apps/blog/next.config.mjs +++ b/apps/blog/next.config.mjs @@ -194,9 +194,7 @@ const securityHeaders = [ }, ]; -const allowedDevOrigins = ( - process.env.ALLOWED_DEV_ORIGINS ?? "localhost,127.0.0.1,192.168.1.48" -) +const allowedDevOrigins = (process.env.ALLOWED_DEV_ORIGINS ?? "localhost,127.0.0.1,192.168.1.48") .split(",") .map((origin) => origin.trim()) .filter(Boolean); diff --git a/apps/blog/package.json b/apps/blog/package.json index bee104d494..d36f5f3e16 100644 --- a/apps/blog/package.json +++ b/apps/blog/package.json @@ -14,23 +14,23 @@ }, "dependencies": { "@base-ui/react": "catalog:", - "@mixedbread/sdk": "catalog:", + "@fumadocs/base-ui": "catalog:", "@fumadocs/cli": "catalog:", - "@prisma/eclipse": "workspace:^", + "@mixedbread/sdk": "catalog:", "@prisma-docs/ui": "workspace:*", + "@prisma/eclipse": "workspace:^", "cors": "^2.8.6", "fumadocs-core": "catalog:", "fumadocs-mdx": "catalog:", "fumadocs-openapi": "catalog:", "fumadocs-ui": "catalog:", - "@fumadocs/base-ui": "catalog:", "lucide-react": "catalog:", "next": "catalog:", "npm-to-yarn": "catalog:", + "posthog-js": "catalog:", "react": "catalog:", "react-dom": "catalog:", "react-tweet": "catalog:", - "posthog-js": "catalog:", "remark-directive": "catalog:", "zod": "catalog:" }, @@ -40,11 +40,11 @@ "@types/node": "catalog:", "@types/react": "catalog:", "@types/react-dom": "catalog:", + "babel-plugin-react-compiler": "catalog:", "next-validate-link": "catalog:", "postcss": "catalog:", "tailwindcss": "catalog:", "tsx": "catalog:", - "typescript": "catalog:", - "babel-plugin-react-compiler": "catalog:" + "typescript": "catalog:" } } diff --git a/apps/blog/scripts/lint.ts b/apps/blog/scripts/lint.ts index cf4dfb3d78..62fc9ac221 100644 --- a/apps/blog/scripts/lint.ts +++ b/apps/blog/scripts/lint.ts @@ -1,15 +1,10 @@ -import { - type FileObject, - printErrors, - scanURLs, - validateFiles, -} from 'next-validate-link'; -import type { InferPageType } from 'fumadocs-core/source'; +import { type FileObject, printErrors, scanURLs, validateFiles } from "next-validate-link"; +import type { InferPageType } from "fumadocs-core/source"; -import { register } from 'node:module'; -register('fumadocs-mdx/node/loader', import.meta.url); +import { register } from "node:module"; +register("fumadocs-mdx/node/loader", import.meta.url); -const { blog } = await import('@/lib/source'); +const { blog } = await import("@/lib/source"); const blogPages = blog.getPages().map((page) => { return { value: { slug: page.slugs }, @@ -17,12 +12,11 @@ const blogPages = blog.getPages().map((page) => { }; }); - async function checkLinks() { const scanned = await scanURLs({ - preset: 'next', + preset: "next", populate: { - '(blog)/[slug]': blogPages, + "(blog)/[slug]": blogPages, }, }); @@ -31,11 +25,11 @@ async function checkLinks() { scanned, markdown: { components: { - Card: { attributes: ['href'] }, - Cards: { attributes: ['href'] }, + Card: { attributes: ["href"] }, + Cards: { attributes: ["href"] }, }, }, - checkRelativePaths: 'as-url', + checkRelativePaths: "as-url", }), true, ); @@ -46,12 +40,12 @@ function getHeadings({ data }: InferPageType): string[] { } function getFiles() { - console.log("Validating Files") + console.log("Validating Files"); const blogPromises = blog.getPages().map( async (page): Promise => ({ - path: page.absolutePath ?? '', - content: await page.data.getText('raw'), + path: page.absolutePath ?? "", + content: await page.data.getText("raw"), url: page.url, data: page.data, }), diff --git a/apps/blog/source.config.ts b/apps/blog/source.config.ts index afc9a15bc5..0ba8a62bc4 100644 --- a/apps/blog/source.config.ts +++ b/apps/blog/source.config.ts @@ -1,14 +1,7 @@ import remarkDirective from "remark-directive"; -import { - remarkDirectiveAdmonition, - remarkMdxFiles, -} from "fumadocs-core/mdx-plugins"; +import { remarkDirectiveAdmonition, remarkMdxFiles } from "fumadocs-core/mdx-plugins"; import { remarkImage } from "fumadocs-core/mdx-plugins"; -import { - defineCollections, - defineConfig, - frontmatterSchema, -} from "fumadocs-mdx/config"; +import { defineCollections, defineConfig, frontmatterSchema } from "fumadocs-mdx/config"; import lastModified from "fumadocs-mdx/plugins/last-modified"; import { z } from "zod"; import convert from "npm-to-yarn"; @@ -67,9 +60,18 @@ export default defineConfig({ persist: { id: "package-manager" }, // Custom package managers to add --bun flag for bunx commands packageManagers: [ - { command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "npm"), name: "npm" }, - { command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "pnpm"), name: "pnpm" }, - { command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "yarn"), name: "yarn" }, + { + command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "npm"), + name: "npm", + }, + { + command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "pnpm"), + name: "pnpm", + }, + { + command: (cmd: string) => convert(cmd.replace(/^npm init -y$/, "npm init"), "yarn"), + name: "yarn", + }, { command: (cmd: string) => { const converted = convert(cmd.replace(/^npm init -y$/, "npm init"), "bun"); diff --git a/apps/blog/src/app/(blog)/[slug]/page.tsx b/apps/blog/src/app/(blog)/[slug]/page.tsx index a55038216e..fbcf806972 100644 --- a/apps/blog/src/app/(blog)/[slug]/page.tsx +++ b/apps/blog/src/app/(blog)/[slug]/page.tsx @@ -3,21 +3,13 @@ import { notFound } from "next/navigation"; import { getMDXComponents } from "@/mdx-components"; import { createRelativeLink } from "fumadocs-ui/mdx"; import { blog } from "@/lib/source"; -import { - Badge, - InlineTOC, - Separator, -} from "@prisma/eclipse"; +import { Badge, InlineTOC, Separator } from "@prisma/eclipse"; import { JsonLd } from "@prisma-docs/ui/components/json-ld"; import { FooterNewsletterForm } from "@prisma-docs/ui/components/newsletter"; import { BlogShare } from "@/components/BlogShare"; import { AuthorAvatarGroup } from "@/components/AuthorAvatarGroup"; -import { - getBaseUrl, - withBlogBasePath, - withBlogBasePathForImageSrc, -} from "@/lib/url"; +import { getBaseUrl, withBlogBasePath, withBlogBasePathForImageSrc } from "@/lib/url"; import Link from "next/link"; import type { Metadata } from "next"; @@ -83,19 +75,18 @@ function getBlogPostingJsonLd(page: ReturnType): BlogPostin const canonicalPath = withBlogBasePath(page.url); const canonicalUrl = toAbsoluteUrl(canonicalPath); const imagePath = page.data.metaImagePath ?? page.data.heroImagePath; - const imageUrl = imagePath - ? toAbsoluteUrl(withBlogBasePathForImageSrc(imagePath)) - : undefined; + const imageUrl = imagePath ? toAbsoluteUrl(withBlogBasePathForImageSrc(imagePath)) : undefined; const authorNames = Array.isArray(page.data.authors) ? page.data.authors - .filter((author): author is string => typeof author === "string") - .map((author) => author.trim()) - .filter(Boolean) + .filter((author): author is string => typeof author === "string") + .map((author) => author.trim()) + .filter(Boolean) : []; const datePublished = toIsoDate(page.data.date); - const dateModified = toIsoDate((page.data as { lastModified?: unknown }).lastModified) ?? datePublished; + const dateModified = + toIsoDate((page.data as { lastModified?: unknown }).lastModified) ?? datePublished; const jsonLd: BlogPostingSchema = { "@context": "https://schema.org", @@ -140,9 +131,7 @@ function getBlogPostingJsonLd(page: ReturnType): BlogPostin return jsonLd; } -export default async function Page(props: { - params: Promise<{ slug: string }>; -}) { +export default async function Page(props: { params: Promise<{ slug: string }> }) { const params = await props.params; const page = blog.getPage([params.slug]); @@ -159,10 +148,7 @@ export default async function Page(props: {
{/* Title + meta */}
- + ← Back to Blog

@@ -195,10 +181,8 @@ export default async function Page(props: { hover:bg-background-ppg/50 hover:border-stroke-ppg/50 hover:text-foreground-ppg" - /> - ))}

)} @@ -207,7 +191,6 @@ export default async function Page(props: { {/* Body */}
-

{page.data.excerpt}

- + {children}