From 1a2e9105936450766d44f69667df22526622f7cf Mon Sep 17 00:00:00 2001 From: white-duke Date: Tue, 21 May 2024 15:28:33 +0200 Subject: [PATCH] add analitycs --- package.json | 5 +++-- pnpm-lock.yaml | 22 ++++++++++++++++++++++ src/index.tsx | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 88755af..d55795b 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "type": "module", "scripts": { "build": "vite build", - "predeploy" : "npm run build", - "deploy" : "gh-pages -d build", + "predeploy": "npm run build", + "deploy": "gh-pages -d build", "dev": "vite --host", "lint": "eslint .", "prepare": "husky", @@ -24,6 +24,7 @@ "@milkdown/preset-gfm": "^7.3.6", "@milkdown/react": "^7.3.6", "@rooks/use-raf": "^4.11.2", + "@vercel/analytics": "^1.2.2", "date-fns": "^3.6.0", "dotenv": "^16.4.5", "env": "^0.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 058839f..3bd2f07 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,6 +26,9 @@ dependencies: '@rooks/use-raf': specifier: ^4.11.2 version: 4.11.2 + '@vercel/analytics': + specifier: ^1.2.2 + version: 1.2.2(react@18.3.1) date-fns: specifier: ^3.6.0 version: 3.6.0 @@ -1739,6 +1742,21 @@ packages: - rollup dev: true + /@vercel/analytics@1.2.2(react@18.3.1): + resolution: {integrity: sha512-X0rctVWkQV1e5Y300ehVNqpOfSOufo7ieA5PIdna8yX/U7Vjz0GFsGf4qvAhxV02uQ2CVt7GYcrFfddXXK2Y4A==} + peerDependencies: + next: '>= 13' + react: ^18 || ^19 + peerDependenciesMeta: + next: + optional: true + react: + optional: true + dependencies: + react: 18.3.1 + server-only: 0.0.1 + dev: false + /@vitejs/plugin-react@4.2.1(vite@5.2.10): resolution: {integrity: sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==} engines: {node: ^14.18.0 || >=16.0.0} @@ -5333,6 +5351,10 @@ packages: lru-cache: 6.0.0 dev: true + /server-only@0.0.1: + resolution: {integrity: sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==} + dev: false + /set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} diff --git a/src/index.tsx b/src/index.tsx index 7d56951..ff986ae 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,5 +1,6 @@ import React from "react"; import { createRoot } from "react-dom/client"; +import { Analytics } from "@vercel/analytics/react" import Desktop from "~/pages/Desktop"; import Login from "~/pages/Login"; @@ -69,5 +70,6 @@ const root = createRoot(rootElement); root.render( + );