新增 @vercel/analytics 依赖并在布局中集成分析组件

This commit is contained in:
zihanjian
2025-05-26 00:35:26 +08:00
parent 4f287d3a22
commit 6b1638b24e
3 changed files with 42 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import { LanguageProvider } from "@/components/LanguageContext";
import { Analytics } from "@vercel/analytics/next";
const geistSans = localFont({
src: "./fonts/GeistVF.woff",
@@ -49,6 +50,7 @@ export default function RootLayout({
<LanguageProvider>
{children}
</LanguageProvider>
<Analytics />
<div className="pb-8"></div>
<footer className="w-full py-3 border-t bg-white/90 dark:bg-gray-900/80 dark:border-gray-800/50">
<div className="max-w-4xl mx-auto px-4">

39
package-lock.json generated
View File

@@ -9,6 +9,7 @@
"version": "0.1.0",
"dependencies": {
"@notionhq/client": "^2.3.0",
"@vercel/analytics": "^1.5.0",
"html-to-image": "^1.11.13",
"html2canvas": "^1.4.1",
"lucide-react": "^0.454.0",
@@ -1211,6 +1212,44 @@
"dev": true,
"license": "ISC"
},
"node_modules/@vercel/analytics": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-1.5.0.tgz",
"integrity": "sha512-MYsBzfPki4gthY5HnYN7jgInhAZ7Ac1cYDoRWFomwGHWEX7odTEzbtg9kf/QSo7XEsEAqlQugA6gJ2WS2DEa3g==",
"license": "MPL-2.0",
"peerDependencies": {
"@remix-run/react": "^2",
"@sveltejs/kit": "^1 || ^2",
"next": ">= 13",
"react": "^18 || ^19 || ^19.0.0-rc",
"svelte": ">= 4",
"vue": "^3",
"vue-router": "^4"
},
"peerDependenciesMeta": {
"@remix-run/react": {
"optional": true
},
"@sveltejs/kit": {
"optional": true
},
"next": {
"optional": true
},
"react": {
"optional": true
},
"svelte": {
"optional": true
},
"vue": {
"optional": true
},
"vue-router": {
"optional": true
}
}
},
"node_modules/acorn": {
"version": "8.14.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",

View File

@@ -10,6 +10,7 @@
},
"dependencies": {
"@notionhq/client": "^2.3.0",
"@vercel/analytics": "^1.5.0",
"html-to-image": "^1.11.13",
"html2canvas": "^1.4.1",
"lucide-react": "^0.454.0",