Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 64 additions & 64 deletions apps/web/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,95 +6,95 @@ import type { NextConfig } from "next";
* Includes all top-level app routes, API routes, and Next.js internals.
*/
const KNOWN_ROUTES = [
"api",
"dashboard",
"debug",
"extension",
"issues",
"notifications",
"orgs",
"prompt",
"repos",
"search",
"trending",
"users",
"_next",
"api",
"dashboard",
"debug",
"extension",
"issues",
"notifications",
"orgs",
"prompt",
"repos",
"search",
"trending",
"users",
"_next",
];

const nextConfig: NextConfig = {
devIndicators: false,
serverExternalPackages: ["@prisma/client"],
experimental: {
staleTimes: {
dynamic: 300,
static: 180,
},
},
images: {
...(process.env.NODE_ENV === "development" && {
dangerouslyAllowLocalIP: true,
}),
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
],
devIndicators: false,
serverExternalPackages: ["@prisma/client"],
experimental: {
staleTimes: {
dynamic: 300,
static: 180,
},
},
images: {
...(process.env.NODE_ENV === "development" && {
dangerouslyAllowLocalIP: true,
}),
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
],
},
async rewrites() {
return {
beforeFiles: [
// Rewrite /:owner/:repo(/:path*) → /repos/:owner/:repo(/:path*)
// Only when the first segment is NOT a known app route.
// The negative lookahead excludes all known routes so only
// owner/repo patterns get rewritten.
{
source: `/:owner((?!${KNOWN_ROUTES.join("|")})\\w[\\w.\\-]*)/:repo/:path*`,
destination: "/repos/:owner/:repo/:path*",
},
async rewrites() {
return {
beforeFiles: [
// Rewrite /:owner/:repo(/:path*) → /repos/:owner/:repo(/:path*)
// Only when the first segment is NOT a known app route.
// The negative lookahead excludes all known routes so only
// owner/repo patterns get rewritten.
{
source: `/:owner((?!${KNOWN_ROUTES.join("|")})\\w[\\w.\\-]*)/:repo/:path*`,
destination: "/repos/:owner/:repo/:path*",
},
{
source: `/:owner((?!${KNOWN_ROUTES.join("|")})\\w[\\w.\\-]*)/:repo`,
destination: "/repos/:owner/:repo",
},
],
};
{
source: `/:owner((?!${KNOWN_ROUTES.join("|")})\\w[\\w.\\-]*)/:repo`,
destination: "/repos/:owner/:repo",
},
],
};
},
};

export default withSentryConfig(nextConfig, {
// For all available options, see:
// For all available options, see:
// https://www.npmjs.com/package/@sentry/webpack-plugin#options

org: "test-better-hub",

project: "javascript-nextjs",
project: "javascript-nextjs",

// Only print logs for uploading source maps in CI
// Only print logs for uploading source maps in CI
silent: !process.env.CI,

// For all available options, see:
// 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,

// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// 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",

webpack: {
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
webpack: {
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,

// Tree-shaking options for reducing bundle size
treeshake: {
// Automatically tree-shake Sentry logger statements to reduce bundle size
removeDebugLogging: true,
},
// Tree-shaking options for reducing bundle size
treeshake: {
// Automatically tree-shake Sentry logger statements to reduce bundle size
removeDebugLogging: true,
},
},
});
16 changes: 8 additions & 8 deletions apps/web/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: "https://114070ea926c98bd5598a842edccea54@o4510948477370368.ingest.us.sentry.io/4510948478287872",
dsn: "https://114070ea926c98bd5598a842edccea54@o4510948477370368.ingest.us.sentry.io/4510948478287872",

// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,

// Enable logs to be sent to Sentry
enableLogs: true,
// Enable logs to be sent to Sentry
enableLogs: true,

// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#sendDefaultPii
sendDefaultPii: true,
// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#sendDefaultPii
sendDefaultPii: true,
});
16 changes: 8 additions & 8 deletions apps/web/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: "https://114070ea926c98bd5598a842edccea54@o4510948477370368.ingest.us.sentry.io/4510948478287872",
dsn: "https://114070ea926c98bd5598a842edccea54@o4510948477370368.ingest.us.sentry.io/4510948478287872",

// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,

// Enable logs to be sent to Sentry
enableLogs: true,
// Enable logs to be sent to Sentry
enableLogs: true,

// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#sendDefaultPii
sendDefaultPii: true,
// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#sendDefaultPii
sendDefaultPii: true,
});
28 changes: 12 additions & 16 deletions apps/web/src/app/global-error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,20 @@ import * as Sentry from "@sentry/nextjs";
import NextError from "next/error";
import { useEffect } from "react";

export default function GlobalError({
error,
}: {
error: Error & { digest?: string };
}) {
useEffect(() => {
Sentry.captureException(error);
}, [error]);
export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
useEffect(() => {
Sentry.captureException(error);
}, [error]);

return (
<html lang="en">
<body>
{/* `NextError` is the default Next.js error page component. Its type
return (
<html lang="en">
<body>
{/* `NextError` is the default Next.js error page component. Its type
definition requires a `statusCode` prop. However, since the App Router
does not expose status codes for errors, we simply pass 0 to render a
generic error message. */}
<NextError statusCode={0} />
</body>
</html>
);
<NextError statusCode={0} />
</body>
</html>
);
}
2 changes: 1 addition & 1 deletion apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function RootLayout({
/>
</head>
<body
className={`${geistSans.variable} ${geistMono.variable} ${jetbrainsMono.variable} antialiased`}
className={`${geistSans.variable} ${geistMono.variable} ${jetbrainsMono.variable} antialiased bg-background text-foreground`}
suppressHydrationWarning
>
<QueryProvider>
Expand Down
Loading