fix: site build/deploy blockers — local fonts, lint cleanup, Vercel compat
- Replace next/font/google with next/font/local to eliminate build-time dependency on fonts.googleapis.com (Inter + Geist self-hosted in repo) - Centralize font definitions in src/lib/fonts.ts, single entry point - Remove unused Geist import and AnimatePresence import (lint warnings) - Delete unused community/download placeholder pages (build errors) - Add outputFileTracingRoot for monorepo vendor chunk resolution - Make root prepare script CI-safe (husky graceful fallback) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
1359758fbf
commit
3b87e56134
10 files changed
+22
-77
No files matched your search
@@ -1,8 +1,13 @@
|
||||
import { createMDX } from 'fumadocs-mdx/next';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import path from 'node:path';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const config = {
|
||||
reactStrictMode: true,
|
||||
outputFileTracingRoot: path.resolve(__dirname, '../../'),
|
||||
};
|
||||
|
||||
const withMDX = createMDX();
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
import { siteConfig } from '@/lib/site.config';
|
||||
import { buttonVariants } from '@/components/ui/button-variants';
|
||||
|
||||
export default async function CommunityPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: string }>;
|
||||
}) {
|
||||
const { lang } = await params;
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col items-center justify-center p-8">
|
||||
<h1 className="text-3xl font-bold mb-4">
|
||||
{lang === 'zh' ? '社区' : 'Community'}
|
||||
</h1>
|
||||
<p className="text-muted-foreground mb-8 text-center max-w-md">
|
||||
{lang === 'zh'
|
||||
? '加入社区,获取帮助和分享经验'
|
||||
: 'Join the community, get help, and share your experience'}
|
||||
</p>
|
||||
<div className="flex gap-4">
|
||||
<a
|
||||
href={siteConfig.repo.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={buttonVariants({ variant: "outline" })}
|
||||
>
|
||||
GitHub
|
||||
</a>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import { siteConfig } from '@/lib/site.config';
|
||||
import { buttonVariants } from '@/components/ui/button-variants';
|
||||
|
||||
export default async function DownloadPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: string }>;
|
||||
}) {
|
||||
const { lang } = await params;
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col items-center justify-center p-8">
|
||||
<h1 className="text-3xl font-bold mb-4">
|
||||
{lang === 'zh' ? '下载 CodePilot' : 'Download CodePilot'}
|
||||
</h1>
|
||||
<p className="text-muted-foreground mb-8 text-center max-w-md">
|
||||
{lang === 'zh'
|
||||
? '从 GitHub Releases 下载最新版本'
|
||||
: 'Download the latest version from GitHub Releases'}
|
||||
</p>
|
||||
<a
|
||||
href={siteConfig.repo.releases}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={buttonVariants({ variant: "default" })}
|
||||
>
|
||||
{lang === 'zh' ? '前往 GitHub Releases' : 'Go to GitHub Releases'}
|
||||
</a>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -1,13 +1,7 @@
|
||||
import { RootProvider } from 'fumadocs-ui/provider/next';
|
||||
import { Inter } from 'next/font/google';
|
||||
import type { ReactNode } from 'react';
|
||||
import { i18n } from '@/lib/i18n';
|
||||
|
||||
const inter = Inter({
|
||||
subsets: ['latin'],
|
||||
variable: '--font-inter',
|
||||
display: 'swap',
|
||||
});
|
||||
import { inter, geist } from '@/lib/fonts';
|
||||
|
||||
export default async function LangLayout({
|
||||
params,
|
||||
@@ -19,7 +13,7 @@ export default async function LangLayout({
|
||||
const { lang } = await params;
|
||||
|
||||
return (
|
||||
<html lang={lang} className={inter.variable} suppressHydrationWarning>
|
||||
<html lang={lang} className={`${inter.variable} ${geist.variable}`} suppressHydrationWarning>
|
||||
<body className="font-sans">
|
||||
<RootProvider i18n={{
|
||||
locale: lang,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,9 +1,6 @@
|
||||
import './global.css';
|
||||
import type { ReactNode } from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import { Geist } from "next/font/google";
|
||||
|
||||
const geist = Geist({subsets:['latin'],variable:'--font-sans'});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
import { AnimatePresence, motion } from 'framer-motion';
|
||||
import { motion } from 'framer-motion';
|
||||
|
||||
interface WordItem {
|
||||
text: string;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import localFont from 'next/font/local';
|
||||
|
||||
export const inter = localFont({
|
||||
src: '../app/fonts/Inter-Variable.woff2',
|
||||
variable: '--font-inter',
|
||||
display: 'swap',
|
||||
});
|
||||
|
||||
export const geist = localFont({
|
||||
src: '../app/fonts/GeistVF.woff2',
|
||||
variable: '--font-sans',
|
||||
display: 'swap',
|
||||
});
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
"test:smoke": "npx playwright test --grep @smoke",
|
||||
"test:e2e": "npx playwright test",
|
||||
"test": "npm run typecheck && npm run test:unit",
|
||||
"prepare": "husky",
|
||||
"prepare": "node -e \"try{require('husky')()}catch(e){}\"",
|
||||
"electron:dev": "concurrently -k \"next dev\" \"wait-on http://localhost:3000 && electron .\"",
|
||||
"electron:build": "next build && node scripts/build-electron.mjs",
|
||||
"electron:pack": "npm run electron:build && electron-builder --config electron-builder.yml",
|
||||
|
||||
Reference in new issue
Block a user