feat: 服务器迁移后的全量演进(依赖升级/安全审计/设计统一/截图/SEO 底座化)

在原仓库历史之上同步本服务器上的全部演进:

- 迁移至新服务器并重建 PG 数据库 + ddnc 开发域名绑定
- 全部依赖升级至最新(Next 16.3.5 / React 19.3 / better-auth 1.7.5 / Drizzle 0.45 / TS 7),
  overrides 消除已知 CVE,安全审计 19 项发现全部修复闭环
- 设计统一:各站宽度 token(--container + site-container)、classic hero 重设计、
  头部换行修复、页面过渡与 View Transitions
- 截图功能:api.adx9.com 截图服务接入(ow=800 本地化 webp、cf=1、去重/限流/占位图)
- SEO 底座化:canonical/hreflang/sitemap/JSON-LD/robots 全部收进 core,新站自动继承
- 加载体验:五站五形态路由骨架(data-theme 切换、shimmer 微光、延迟淡入)+
  过滤 useTransition 交叉淡入淡出(card-enter 错峰入场)
- 构建:experimental.cpus 限流防 PG 连接打满;清理死组件链
This commit is contained in:
bigcode
2026-09-15 18:19:53 +08:00
parent 0eed5183b2
commit 05440ffb5b
144 changed files with 3055 additions and 12937 deletions
+31 -12
View File
@@ -4,9 +4,7 @@
import fs from "node:fs";
import path from "node:path";
import rehypePrism from "@mapbox/rehype-prism";
import nextMDX from "@next/mdx";
import remarkGfm from "remark-gfm";
import createNextIntlPlugin from "next-intl/plugin";
@@ -24,27 +22,48 @@ export function createSiteConfig({
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
poweredByHeader: false,
transpilePackages: ["@aidir/core"],
// 静态生成 worker 上限:每个 worker 各持 DB 连接池,并发过高会把
// PostgreSQL 的 max_connections 打满("sorry, too many clients already")
experimental: {
cpus: 8,
},
// 安全响应头:防点击劫持 / MIME 嗅探 / 引用泄漏,权限收敛
async headers() {
return [
{
source: "/(.*)",
headers: [
{ key: "X-Frame-Options", value: "SAMEORIGIN" },
{ key: "X-Content-Type-Options", value: "nosniff" },
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
{
key: "Permissions-Policy",
value:
"camera=(), microphone=(), geolocation=(), interest-cohort=()",
},
],
},
];
},
images: {
// 工具 logo 指向各官网 favicon,域名不可枚举,放开 https 通配
remotePatterns: [{ protocol: "https", hostname: "**" }],
},
pageExtensions: ["ts", "tsx", "mdx"],
turbopack: {
rules: {
"*.mdx": {
loaders: ["@mdx-js/loader"],
as: "*.js",
},
},
},
};
const withMDX = nextMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypePrism],
// Turbopack 要求 loader options 可序列化:插件用模块路径字符串,
// 由 @next/mdx 16 的 loader 在构建时动态 import(@mdx-js/loader 支持)
remarkPlugins: ["remark-gfm"],
rehypePlugins: ["@mapbox/rehype-prism"],
},
});