diff --git a/Frontend/.gitignore b/Frontend/.gitignore index 17b3024..d40e27a 100644 --- a/Frontend/.gitignore +++ b/Frontend/.gitignore @@ -4,4 +4,5 @@ node_modules .VSCodeCounter/ .next/ .env*.local -next-env.d.ts \ No newline at end of file +next-env.d.ts +.sentryclirc diff --git a/Frontend/bun.lockb b/Frontend/bun.lockb index c32607d..e61891c 100644 Binary files a/Frontend/bun.lockb and b/Frontend/bun.lockb differ diff --git a/Frontend/next.config.mjs b/Frontend/next.config.mjs index cc5a587..ba13b0f 100644 --- a/Frontend/next.config.mjs +++ b/Frontend/next.config.mjs @@ -1,26 +1,63 @@ +import {withSentryConfig} from "@sentry/nextjs"; import createMDX from '@next/mdx' /** @type {import('next').NextConfig} */ const nextConfig = { - pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"], - images: { - remotePatterns: [ - { - protocol: "https", - hostname: "api.restfulmc.cc", - }, - { - protocol: "https", - hostname: "flagcdn.com", - }, - ], - }, - experimental: { - mdxRs: true, - }, + pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"], + images: { + remotePatterns: [ + { + protocol: "https", + hostname: "api.restfulmc.cc", + }, + { + protocol: "https", + hostname: "flagcdn.com", + }, + ], + }, + experimental: { + mdxRs: true, + }, }; const withMDX = createMDX({}) // Merge MDX config with Next.js config -export default withMDX(nextConfig) \ No newline at end of file +export default withSentryConfig(withMDX(nextConfig), { +// For all available options, see: +// https://github.com/getsentry/sentry-webpack-plugin#options + +// Suppresses source map uploading logs during build +silent: true, +org: "restfulmc", +project: "frontend", +url: "https://sentry.rainnny.club/" +}, { +// For all available options, see: +// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ + +// Upload a larger set of source maps for prettier stack traces (increases build time) +widenClientFileUpload: true, + +// Transpiles SDK to be compatible with IE11 (increases bundle size) +transpileClientSDK: true, + +// Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. +// This can increase your server load as well as your hosting bill. +// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- +// side errors will fail. +// tunnelRoute: "/monitoring", + +// Hides source maps from generated client bundles +hideSourceMaps: true, + +// Automatically tree-shake Sentry logger statements to reduce bundle size +disableLogger: true, + +// Enables automatic instrumentation of Vercel Cron Monitors. +// See the following for more information: +// https://docs.sentry.io/product/crons/ +// https://vercel.com/docs/cron-jobs +automaticVercelMonitors: true, +}); \ No newline at end of file diff --git a/Frontend/package.json b/Frontend/package.json index 92358c5..3e062b5 100644 --- a/Frontend/package.json +++ b/Frontend/package.json @@ -33,6 +33,7 @@ "@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-tooltip": "^1.0.7", + "@sentry/nextjs": "7.105.0", "@types/mdx": "^2.0.13", "@types/react-syntax-highlighter": "^15.5.11", "class-variance-authority": "^0.7.0", diff --git a/Frontend/sentry.client.config.ts b/Frontend/sentry.client.config.ts new file mode 100644 index 0000000..68a29d2 --- /dev/null +++ b/Frontend/sentry.client.config.ts @@ -0,0 +1,30 @@ +// This file configures the initialization of Sentry on the client. +// The config you add here will be used whenever a users loads a page in their browser. +// https://docs.sentry.io/platforms/javascript/guides/nextjs/ + +import * as Sentry from "@sentry/nextjs"; + +Sentry.init({ + dsn: "https://0525d8dacaae432aaf967d2dd303dc35@sentry.rainnny.club/1", + + // Adjust this value in production, or use tracesSampler for greater control + tracesSampleRate: 1, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, + + replaysOnErrorSampleRate: 1.0, + + // This sets the sample rate to be 10%. You may want this to be 100% while + // in development and sample at a lower rate in production + replaysSessionSampleRate: 0.1, + + // You can remove this option if you're not planning to use the Sentry Session Replay feature: + integrations: [ + Sentry.replayIntegration({ + // Additional Replay configuration goes in here, for example: + maskAllText: true, + blockAllMedia: true, + }), + ], +}); diff --git a/Frontend/sentry.edge.config.ts b/Frontend/sentry.edge.config.ts new file mode 100644 index 0000000..14a5a01 --- /dev/null +++ b/Frontend/sentry.edge.config.ts @@ -0,0 +1,16 @@ +// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on). +// The config you add here will be used whenever one of the edge features is loaded. +// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. +// https://docs.sentry.io/platforms/javascript/guides/nextjs/ + +import * as Sentry from "@sentry/nextjs"; + +Sentry.init({ + dsn: "https://0525d8dacaae432aaf967d2dd303dc35@sentry.rainnny.club/1", + + // Adjust this value in production, or use tracesSampler for greater control + tracesSampleRate: 1, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, +}); diff --git a/Frontend/sentry.server.config.ts b/Frontend/sentry.server.config.ts new file mode 100644 index 0000000..3cacdf0 --- /dev/null +++ b/Frontend/sentry.server.config.ts @@ -0,0 +1,19 @@ +// This file configures the initialization of Sentry on the server. +// The config you add here will be used whenever the server handles a request. +// https://docs.sentry.io/platforms/javascript/guides/nextjs/ + +import * as Sentry from "@sentry/nextjs"; + +Sentry.init({ + dsn: "https://0525d8dacaae432aaf967d2dd303dc35@sentry.rainnny.club/1", + + // Adjust this value in production, or use tracesSampler for greater control + tracesSampleRate: 1, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, + + // uncomment the line below to enable Spotlight (https://spotlightjs.com) + // spotlight: process.env.NODE_ENV === 'development', + +});