feat(sentry): remove sentry integration

This commit is contained in:
Amruth Pillai
2022-12-16 14:34:15 +01:00
parent 9af9a0284e
commit bf41aa9c6c
24 changed files with 1049 additions and 1538 deletions

3
client/.gitignore vendored
View File

@ -40,6 +40,3 @@ __ENV.js
# next-sitemap
sitemap*.xml
# sentry
.sentryclirc

View File

@ -21,14 +21,6 @@ COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=dependencies /app/schema/node_modules ./schema/node_modules
COPY --from=dependencies /app/client/node_modules ./client/node_modules
ARG TURBO_TEAM
ARG TURBO_TOKEN
ARG SENTRY_AUTH_TOKEN
ENV TURBO_TEAM $TURBO_TEAM
ENV TURBO_TOKEN $TURBO_TOKEN
ENV SENTRY_AUTH_TOKEN $SENTRY_AUTH_TOKEN
RUN pnpm run build --filter client
FROM base as production

View File

@ -1,6 +1,5 @@
const { version } = require('../package.json');
const { i18n } = require('./next-i18next.config');
const { withSentryConfig } = require('@sentry/nextjs');
/** @type {import('next').NextConfig} */
const nextConfig = {
@ -16,11 +15,6 @@ const nextConfig = {
domains: ['cdn.rxresu.me', 'www.gravatar.com'],
},
sentry: {
hideSourceMaps: true,
widenClientFileUpload: true,
},
// Hack to make Tailwind darkMode 'class' strategy with CSS Modules
// Ref: https://github.com/tailwindlabs/tailwindcss/issues/3258#issuecomment-968368156
webpack: (config) => {
@ -53,11 +47,4 @@ const nextConfig = {
},
};
/** @type {import('@sentry/nextjs').SentryWebpackPluginOptions} */
const sentryConfig = {
silent: true,
project: 'client',
dryRun: process.env.NODE_ENV !== 'production',
};
module.exports = withSentryConfig(nextConfig, sentryConfig);
module.exports = nextConfig;

View File

@ -13,44 +13,43 @@
"@emotion/css": "^11.10.5",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@hello-pangea/dnd": "^16.0.1",
"@hello-pangea/dnd": "^16.2.0",
"@hookform/resolvers": "2.9.10",
"@monaco-editor/react": "^4.4.6",
"@mui/icons-material": "^5.10.15",
"@mui/lab": "^5.0.0-alpha.109",
"@mui/material": "^5.10.15",
"@mui/system": "^5.10.15",
"@mui/x-date-pickers": "5.0.8",
"@next/env": "^13.0.5",
"@react-oauth/google": "^0.5.0",
"@reduxjs/toolkit": "^1.9.0",
"@sentry/nextjs": "^7.21.1",
"axios": "^1.2.0",
"@mui/icons-material": "^5.11.0",
"@mui/lab": "^5.0.0-alpha.112",
"@mui/material": "^5.11.0",
"@mui/system": "^5.11.0",
"@mui/x-date-pickers": "5.0.11",
"@next/env": "^13.0.7",
"@react-oauth/google": "^0.5.1",
"@reduxjs/toolkit": "^1.9.1",
"axios": "^1.2.1",
"clsx": "^1.2.1",
"dayjs": "^1.11.6",
"dayjs": "^1.11.7",
"downloadjs": "^1.4.7",
"joi": "^17.7.0",
"lodash": "^4.17.21",
"md5-hex": "^4.0.0",
"monaco-editor": "^0.34.1",
"nanoid": "^3.3.4",
"next": "13.0.5",
"next-i18next": "^13.0.0",
"next": "13.0.7",
"next-i18next": "^13.0.2",
"react": "^18.2.0",
"react-colorful": "^5.6.1",
"react-dnd": "16.0.1",
"react-dnd-html5-backend": "16.0.1",
"react-dom": "^18.2.0",
"react-hook-form": "^7.39.5",
"react-hook-form": "^7.40.0",
"react-hot-toast": "2.4.0",
"react-icons": "^4.6.0",
"react-markdown": "^8.0.3",
"react-icons": "^4.7.1",
"react-markdown": "^8.0.4",
"react-query": "^3.39.2",
"react-redux": "^8.0.5",
"react-zoom-pan-pinch": "^2.1.3",
"redux": "^4.2.0",
"redux-persist": "^6.0.0",
"redux-saga": "^1.2.1",
"redux-saga": "^1.2.2",
"redux-undo": "^1.0.1",
"remark-gfm": "^3.0.1",
"sharp": "^0.31.2",
@ -58,27 +57,27 @@
"webfontloader": "^1.6.28"
},
"devDependencies": {
"@babel/core": "^7.20.2",
"@babel/core": "^7.20.5",
"@reactive-resume/schema": "workspace:*",
"@tailwindcss/typography": "^0.5.8",
"@types/downloadjs": "^1.4.3",
"@types/lodash": "^4.14.190",
"@types/node": "^18.11.9",
"@types/react": "^18.0.25",
"@types/lodash": "^4.14.191",
"@types/node": "^18.11.15",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@types/react-redux": "^7.1.24",
"@types/tailwindcss": "^3.0.11",
"@types/uuid": "^8.3.4",
"@types/uuid": "^9.0.0",
"@types/webfontloader": "^1.6.35",
"autoprefixer": "^10.4.13",
"csstype": "^3.1.1",
"eslint-config-next": "^13.0.5",
"eslint-plugin-tailwindcss": "^3.7.0",
"eslint-config-next": "^13.0.7",
"eslint-plugin-tailwindcss": "^3.7.1",
"eslint-plugin-unused-imports": "^2.0.0",
"next-sitemap": "^3.1.32",
"postcss": "^8.4.19",
"sass": "^1.56.1",
"next-sitemap": "^3.1.42",
"postcss": "^8.4.20",
"sass": "^1.56.2",
"tailwindcss": "^3.2.4",
"typescript": "^4.9.3"
"typescript": "^4.9.4"
}
}

View File

@ -1,14 +0,0 @@
import * as Sentry from '@sentry/nextjs';
import type { NextPage } from 'next';
import type { ErrorProps } from 'next/error';
import NextErrorComponent from 'next/error';
const CustomErrorComponent: NextPage<ErrorProps> = (props) => <NextErrorComponent statusCode={props.statusCode} />;
CustomErrorComponent.getInitialProps = async (contextData) => {
await Sentry.captureUnderscoreErrorException(contextData);
return NextErrorComponent.getInitialProps(contextData);
};
export default CustomErrorComponent;

View File

@ -1,15 +0,0 @@
import env from '@beam-australia/react-env';
import * as Sentry from '@sentry/nextjs';
import packageJSON from '../package.json';
const SENTRY_DSN = env('CLIENT_SENTRY_DSN');
if (SENTRY_DSN) {
Sentry.init({
dsn: SENTRY_DSN,
tracesSampleRate: 1.0,
release: packageJSON.version,
enabled: process.env.NODE_ENV === 'production',
});
}

View File

@ -1,3 +0,0 @@
defaults.url=https://sentry.io/
defaults.org=reactive-resume
defaults.project=client

View File

@ -1,15 +0,0 @@
import env from '@beam-australia/react-env';
import * as Sentry from '@sentry/nextjs';
import packageJSON from '../package.json';
const SENTRY_DSN = env('CLIENT_SENTRY_DSN');
if (SENTRY_DSN) {
Sentry.init({
dsn: SENTRY_DSN,
tracesSampleRate: 1.0,
release: packageJSON.version,
enabled: process.env.NODE_ENV === 'production',
});
}

View File

@ -1,17 +0,0 @@
import * as Sentry from '@sentry/nextjs';
import { useEffect } from 'react';
import { useAppSelector } from '@/store/hooks';
const SentryWrapper: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => {
const user = useAppSelector((state) => state.auth.user);
useEffect(() => {
const sentryUser: Sentry.User | null = user && { ...user, id: user?.id.toString() };
Sentry.setUser(sentryUser);
}, [user]);
return <>{children}</>;
};
export default SentryWrapper;

View File

@ -1,15 +1,12 @@
import DateWrapper from './DateWrapper';
import FontWrapper from './FontWrapper';
import SentryWrapper from './SentryWrapper';
import ThemeWrapper from './ThemeWrapper';
const WrapperRegistry: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => (
<ThemeWrapper>
<FontWrapper>
<DateWrapper>
<SentryWrapper>
<>{children}</>
</SentryWrapper>
<>{children}</>
</DateWrapper>
</FontWrapper>
</ThemeWrapper>