add analytics

This commit is contained in:
Ishaan Dey 2024-05-09 00:56:30 -07:00
parent ccc14f3c97
commit 32a8413ca1
4 changed files with 39 additions and 12 deletions

View File

@ -68,8 +68,6 @@ const processFiles = async (paths: string[], id: string) => {
}) })
) )
console.log("root", root)
return { return {
files: root.children, files: root.children,
fileData, fileData,

View File

@ -1,20 +1,21 @@
import type { Metadata } from "next" import type { Metadata } from "next";
import { GeistSans } from "geist/font/sans" import { GeistSans } from "geist/font/sans";
import { GeistMono } from "geist/font/mono" import { GeistMono } from "geist/font/mono";
import "./globals.css" import "./globals.css";
import { ThemeProvider } from "@/components/layout/themeProvider" import { ThemeProvider } from "@/components/layout/themeProvider";
import { ClerkProvider } from "@clerk/nextjs" import { ClerkProvider } from "@clerk/nextjs";
import { Toaster } from "@/components/ui/sonner" import { Toaster } from "@/components/ui/sonner";
import { Analytics } from "@vercel/analytics/react";
export const metadata: Metadata = { export const metadata: Metadata = {
title: "Sandbox", title: "Sandbox",
description: "A collaborative, AI-powered, auto-scaling code sandbox", description: "A collaborative, AI-powered, auto-scaling code sandbox",
} };
export default function RootLayout({ export default function RootLayout({
children, children,
}: Readonly<{ }: Readonly<{
children: React.ReactNode children: React.ReactNode;
}>) { }>) {
return ( return (
<ClerkProvider> <ClerkProvider>
@ -27,10 +28,11 @@ export default function RootLayout({
disableTransitionOnChange disableTransitionOnChange
> >
{children} {children}
<Analytics />
<Toaster position="bottom-left" richColors /> <Toaster position="bottom-left" richColors />
</ThemeProvider> </ThemeProvider>
</body> </body>
</html> </html>
</ClerkProvider> </ClerkProvider>
) );
} }

View File

@ -26,6 +26,7 @@
"@radix-ui/react-select": "^2.0.0", "@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3", "@radix-ui/react-switch": "^1.0.3",
"@vercel/analytics": "^1.2.2",
"@xterm/addon-fit": "^0.10.0", "@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0", "@xterm/xterm": "^5.5.0",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",
@ -1644,6 +1645,26 @@
"@types/send": "*" "@types/send": "*"
} }
}, },
"node_modules/@vercel/analytics": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-1.2.2.tgz",
"integrity": "sha512-X0rctVWkQV1e5Y300ehVNqpOfSOufo7ieA5PIdna8yX/U7Vjz0GFsGf4qvAhxV02uQ2CVt7GYcrFfddXXK2Y4A==",
"dependencies": {
"server-only": "^0.0.1"
},
"peerDependencies": {
"next": ">= 13",
"react": "^18 || ^19"
},
"peerDependenciesMeta": {
"next": {
"optional": true
},
"react": {
"optional": true
}
}
},
"node_modules/@xterm/addon-fit": { "node_modules/@xterm/addon-fit": {
"version": "0.10.0", "version": "0.10.0",
"resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.10.0.tgz", "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.10.0.tgz",
@ -3253,6 +3274,11 @@
"loose-envify": "^1.1.0" "loose-envify": "^1.1.0"
} }
}, },
"node_modules/server-only": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/server-only/-/server-only-0.0.1.tgz",
"integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA=="
},
"node_modules/shebang-command": { "node_modules/shebang-command": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",

View File

@ -27,6 +27,7 @@
"@radix-ui/react-select": "^2.0.0", "@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3", "@radix-ui/react-switch": "^1.0.3",
"@vercel/analytics": "^1.2.2",
"@xterm/addon-fit": "^0.10.0", "@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0", "@xterm/xterm": "^5.5.0",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",