Skip to content

Commit

Permalink
refactor: Update package.json to use [email protected] as the package manager
Browse files Browse the repository at this point in the history
  • Loading branch information
dvaJi committed Jul 19, 2024
1 parent b2abc2d commit e983f66
Show file tree
Hide file tree
Showing 9 changed files with 1,239 additions and 30 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ yarn-error.log*

target/

_content/tmp/*
_content/tmp/*
# Sentry Config File
.env.sentry-build-plugin
28 changes: 28 additions & 0 deletions app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"use client";

import NextError from "next/error";
import { useEffect } from "react";

import * as Sentry from "@sentry/nextjs";

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

return (
<html>
<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>
);
}
9 changes: 9 additions & 0 deletions instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
await import('./sentry.server.config');
}

if (process.env.NEXT_RUNTIME === 'edge') {
await import('./sentry.edge.config');
}
}
53 changes: 43 additions & 10 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,6 @@ const nextConfig = {
destination: "/weapon/splendor_of_tranquil_waters",
permanent: true,
},
{
source: "/ru/weapons",
destination: "/dmca",
permanent: false,
},
{
source: "/en/weapons",
destination: "/dmca",
permanent: false,
},
{
source: "/:lang/genshin/blog",
destination: "https://earlygg.com/guides/genshin-impact",
Expand Down Expand Up @@ -118,3 +108,46 @@ const nextConfig = {
};

module.exports = withAxiom(withBundleAnalyzer(nextConfig));


// Injected content via Sentry wizard below

const { withSentryConfig } = require("@sentry/nextjs");

module.exports = withSentryConfig(
module.exports,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

org: "francisco-vz",
project: "genshinbuilds",

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

// 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,

// 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. (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,
}
);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-tooltip": "^1.1.2",
"@sentry/nextjs": "8",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.13",
"@tanstack/react-table": "^8.19.3",
Expand Down
Loading

0 comments on commit e983f66

Please sign in to comment.