From 6b6bc5ed665d6345e0d35f0f595f5ff4484ea45a Mon Sep 17 00:00:00 2001 From: Alexander Lyon Date: Fri, 24 May 2024 07:34:40 +0100 Subject: [PATCH] disable turbo build --- site/bun.lockb | Bin 249200 -> 249260 bytes site/components/github-stars.tsx | 13 +++++++++---- site/next.config.mjs | 20 ++++++++++++++++++-- site/package.json | 5 +++-- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/site/bun.lockb b/site/bun.lockb index 0d3ef75095bc687d9d158ef506a2742c672261be..5df8fd567e59f98d59bf3bb3d4e63ea5ac7ede78 100755 GIT binary patch delta 59 zcmew`i+{~*{t13eGG`kDS_2qc1DLi3Fi$umToP0oT;l4IB5{_P0R&{uGEa98V^U>V OG$&`p^p6`DCjbC`*%a#l delta 29 lcmZ28oBzWs{t13e56(0Ov<5J?1~6?6V4iSh`p*rF69C1S4KDxy diff --git a/site/components/github-stars.tsx b/site/components/github-stars.tsx index 2ead856..85de76a 100644 --- a/site/components/github-stars.tsx +++ b/site/components/github-stars.tsx @@ -118,11 +118,16 @@ async function CommitAndStars({ url }: { url: string }) { next: { revalidate: 86400 }, }).then((res) => res.json()); const stars = response.stargazers_count; - const commits = await fetch(response.commits_url.replace("{/sha}", ""), { - next: { revalidate: 86400 }, - }).then((res) => res.json()); - const commit = commits[0] + let commits = undefined; + if (response.commits_url) { + const response2 = await fetch(response.commits_url?.replace("{/sha}", ""), { + next: { revalidate: 86400 }, + }); + commits = await response2.json(); + } + + const commit = commits?.[0] ? { sha: commits[0].sha, date: new Date(commits[0].commit.author.date), diff --git a/site/next.config.mjs b/site/next.config.mjs index a1c98b6..46dd051 100644 --- a/site/next.config.mjs +++ b/site/next.config.mjs @@ -4,6 +4,8 @@ import process from "node:process"; import { withAxiom } from "next-axiom"; import { bundledLanguages } from "shiki"; import { MapWebpackPlugin } from "fumadocs-mdx/config"; +import createMDX from "fumadocs-mdx/config"; +import codeImport from "remark-code-import"; const cwd = process.cwd(); const rootMapPath = ".map.ts"; @@ -12,6 +14,20 @@ const wit = JSON.parse(fs.readFileSync("wit.tmLanguage.json", "utf8")); const rootMapFile = path.resolve(cwd, rootMapPath); +const withMDX = createMDX({ + mdxOptions: { + remarkPlugins: [ + () => + codeImport({ + allowImportingFromOutside: true, + }), + ], + rehypeCodeOptions: { + langs: [...Object.keys(bundledLanguages), wit], + }, + }, +}); + // create the map file new MapWebpackPlugin({ rootMapFile }).create(); @@ -20,7 +36,7 @@ const config = { reactStrictMode: true, pageExtensions: ["ts", "tsx"], experimental: { - useLightningcss: true, + // useLightningcss: true, reactCompiler: true, // typedRoutes: true, // serverMinification: true, @@ -66,4 +82,4 @@ const config = { }, }; -export default withAxiom(config); +export default withAxiom(withMDX(config)); diff --git a/site/package.json b/site/package.json index 101a5a8..b753bc2 100644 --- a/site/package.json +++ b/site/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "scripts": { - "build": "TURBOPACK=1 TURBOPACK_BUILD=1 next build", + "build": "next build", "dev": "next dev --turbo", "start": "next start", "lint": "biome check .", @@ -50,5 +50,6 @@ "postcss": "^8.4.38", "tailwindcss": "^3.4.3", "typescript": "^5.4.5" - } + }, + "trustedDependencies": ["@biomejs/biome"] }