From 5594e56f47a3ee3f8cf4401ab0be3a286f1f7aff Mon Sep 17 00:00:00 2001 From: Pouria Ezzati Date: Thu, 10 Nov 2022 19:21:44 +0330 Subject: [PATCH 01/11] chore: remove sentry --- client/helpers/analytics.ts | 15 -- client/pages/_app.tsx | 6 +- package-lock.json | 485 +++++++----------------------------- package.json | 3 - server/env.ts | 4 +- server/handlers/helpers.ts | 5 - server/server.ts | 13 - 7 files changed, 87 insertions(+), 444 deletions(-) diff --git a/client/helpers/analytics.ts b/client/helpers/analytics.ts index 7712624b7..c44cc2c3a 100644 --- a/client/helpers/analytics.ts +++ b/client/helpers/analytics.ts @@ -1,7 +1,5 @@ import getConfig from "next/config"; import ReactGA from "react-ga"; -import * as Sentry from '@sentry/react'; -import { Integrations } from '@sentry/apm'; const { publicRuntimeConfig } = getConfig(); @@ -14,19 +12,6 @@ export const logPageView = () => { ReactGA.pageview(window.location.pathname); }; -export const initSentry = () => { - if (publicRuntimeConfig.SENTRY_PUBLIC_DSN) { - Sentry.init({ - dsn: publicRuntimeConfig.SENTRY_PUBLIC_DSN, - environment: process.env.NODE_ENV, - integrations: [ - new Integrations.Tracing(), - ], - tracesSampleRate: 1.0, - }); - }; -}; - export const logEvent = (category = "", action = "") => { if (category && action) { ReactGA.event({ category, action }); diff --git a/client/pages/_app.tsx b/client/pages/_app.tsx index 59aa8e7cc..bdc39a634 100644 --- a/client/pages/_app.tsx +++ b/client/pages/_app.tsx @@ -7,17 +7,13 @@ import cookie from "js-cookie"; import Head from "next/head"; import React from "react"; -import { initGA, logPageView , initSentry } from "../helpers/analytics"; +import { initGA, logPageView } from "../helpers/analytics"; import { initializeStore } from "../store"; import { TokenPayload } from "../types"; const isProd = process.env.NODE_ENV === "production"; const { publicRuntimeConfig } = getConfig(); -if (isProd) { - initSentry(); -}; - // TODO: types class MyApp extends App { static async getInitialProps({ Component, ctx }: AppContext) { diff --git a/package-lock.json b/package-lock.json index a4b91206a..6dc7cde2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,6 @@ "version": "2.7.4", "license": "MIT", "dependencies": { - "@sentry/apm": "^5.21.1", - "@sentry/node": "^5.21.1", - "@sentry/react": "^5.21.1", "app-root-path": "^3.0.0", "axios": "^0.21.1", "babel-plugin-inline-react-svg": "^1.1.0", @@ -1813,18 +1810,6 @@ "node": ">= 6" } }, - "node_modules/@babel/node/node_modules/core-js": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz", - "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==", - "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", - "dev": true, - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, "node_modules/@babel/node/node_modules/regenerator-runtime": { "version": "0.13.3", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", @@ -5983,153 +5968,6 @@ "node": ">= 8" } }, - "node_modules/@sentry/apm": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/apm/-/apm-5.21.1.tgz", - "integrity": "sha512-mxMOCpeXULbQCC/f9SwPqW+g12mk3nWRNjeAUm5dyiKHY13agtQBSSYs4ROEH190YxmwTZr3vxhlR2jNSdSZcg==", - "deprecated": "Please migrate to @sentry/tracing; see: https://www.npmjs.com/package/@sentry/apm", - "dependencies": { - "@sentry/browser": "5.21.1", - "@sentry/hub": "5.21.1", - "@sentry/minimal": "5.21.1", - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/browser": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.21.1.tgz", - "integrity": "sha512-sUxsW545klZxJE4iBAYQ8SuVS85HTOGNmIIIZWFUogB5oW3O0L+nJluXEqf/pHU82LnjDIzqsWCYQ0cRUaeYow==", - "dependencies": { - "@sentry/core": "5.21.1", - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/core": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.21.1.tgz", - "integrity": "sha512-Luulwx3GLUiY0gmHOhU+4eSga28Ce8DwoBcRq9GkGuhPu9r80057d5urxrDLp/leIZBXVvpY7tvmSN/rMtvF9w==", - "dependencies": { - "@sentry/hub": "5.21.1", - "@sentry/minimal": "5.21.1", - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/hub": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.21.1.tgz", - "integrity": "sha512-x5i9Ggi5ZYMhBYL5kyTu2fUJ6owjKH2tgJL3UExoZdRyZkbLAFZb+DtfSnteWgQ6wriGfgPD3r/hAIEdaomk2A==", - "dependencies": { - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/minimal": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.21.1.tgz", - "integrity": "sha512-OBVPASZ+mcXMKajvJon9RjEZ+ny3+VGhOI66acoP1hmYxKvji1OC2bYEuP1r4qtHxWVLAdV7qFj3EQ9ckErZmQ==", - "dependencies": { - "@sentry/hub": "5.21.1", - "@sentry/types": "5.21.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/node": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.21.1.tgz", - "integrity": "sha512-+QLqGz6+/gtShv0F16nI2+AuVEDZG2k9L25BVCNoysYzH1J1/QIKHsl7YF2trDMlWM4T7cbu5Fh8AhK6an+5/g==", - "dependencies": { - "@sentry/apm": "5.21.1", - "@sentry/core": "5.21.1", - "@sentry/hub": "5.21.1", - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "cookie": "^0.4.1", - "https-proxy-agent": "^5.0.0", - "lru_map": "^0.3.3", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/node/node_modules/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/@sentry/react": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/react/-/react-5.21.1.tgz", - "integrity": "sha512-e60erzdQOwZ88+j6Hi1AnRlxex7ZmwQPGSoFjtihQJR3Xv9Esj5DBKVrWu6Z/QCDxTc8uaX08XjUyhse2YyutQ==", - "dependencies": { - "@sentry/browser": "5.21.1", - "@sentry/minimal": "5.21.1", - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "hoist-non-react-statics": "^3.3.2", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "react": "15.x || 16.x", - "react-dom": "15.x || 16.x" - } - }, - "node_modules/@sentry/react/node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/@sentry/types": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.21.1.tgz", - "integrity": "sha512-hFN4aDduMpjj6vZSIIp+9kSr8MglcKO/UmbuUXN6hKLewhxt+Zj2wjXN7ulSs5OK5mjXP9QLA5YJvVQsl2//qw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/utils": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.21.1.tgz", - "integrity": "sha512-p5vPuc7+GfOmW8CXxWd0samS77Q00YrN8q5TC/ztF8nBhEF18GiMeWAdQnlSwt3iWal3q3gSSrbF4c9guIugng==", - "dependencies": { - "@sentry/types": "5.21.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@sinonjs/commons": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.4.0.tgz", @@ -7816,26 +7654,6 @@ "node": ">=4.0.0" } }, - "node_modules/agent-base": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz", - "integrity": "sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", - "dependencies": { - "ms": "^2.1.1" - } - }, "node_modules/aggregate-error": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", @@ -9603,6 +9421,14 @@ "regenerator-runtime": "^0.10.5" } }, + "node_modules/babel-polyfill/node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true + }, "node_modules/babel-polyfill/node_modules/regenerator-runtime": { "version": "0.10.5", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", @@ -9714,6 +9540,14 @@ "source-map-support": "^0.4.15" } }, + "node_modules/babel-register/node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true + }, "node_modules/babel-register/node_modules/source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", @@ -9733,6 +9567,14 @@ "regenerator-runtime": "^0.11.0" } }, + "node_modules/babel-runtime/node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true + }, "node_modules/babel-runtime/node_modules/regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", @@ -9938,18 +9780,6 @@ "ajv": "4.11.8 - 6" } }, - "node_modules/better-ajv-errors/node_modules/core-js": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz", - "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==", - "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", - "dev": true, - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -11187,12 +11017,15 @@ } }, "node_modules/core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", - "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "version": "3.26.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.26.0.tgz", + "integrity": "sha512-+DkDrhoR4Y0PxDz6rurahuB+I45OsEUv8E1maPTB6OuHRohMMcznBq9TMpdpDMm/hUPob/mJJS3PqgbHpMTQgw==", "dev": true, - "hasInstallScript": true + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } }, "node_modules/core-js-compat": { "version": "3.6.4", @@ -15982,27 +15815,6 @@ "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" }, - "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", - "dependencies": { - "ms": "^2.1.1" - } - }, "node_modules/human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -20646,11 +20458,6 @@ "node": ">=0.10.0" } }, - "node_modules/lru_map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=" - }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -21182,6 +20989,17 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, + "node_modules/mobx": { + "version": "5.15.7", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.7.tgz", + "integrity": "sha512-wyM3FghTkhmC+hQjyPGGFdpehrcX1KOXsDuERhfK2YbJemkUhEB+6wzEN639T21onxlfYBmriA1PFnvxTUhcKw==", + "dev": true, + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mobx" + } + }, "node_modules/mobx-react": { "version": "6.1.4", "resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-6.1.4.tgz", @@ -23151,6 +22969,14 @@ "ajv": "4.11.8 - 6" } }, + "node_modules/oas-validator/node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true + }, "node_modules/oas-validator/node_modules/fast-deep-equal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", @@ -31897,12 +31723,6 @@ "integrity": "sha512-NIQrwvv9V39FHgGFm36+U9SMQzbiHvU79k+iADraJTpmrFFfx7Ds0IvDoAdZsDrknlkRk14OYoWXb57uTh7/sw==", "dev": true }, - "core-js": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz", - "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==", - "dev": true - }, "regenerator-runtime": { "version": "0.13.3", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", @@ -35509,122 +35329,6 @@ "fastq": "^1.6.0" } }, - "@sentry/apm": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/apm/-/apm-5.21.1.tgz", - "integrity": "sha512-mxMOCpeXULbQCC/f9SwPqW+g12mk3nWRNjeAUm5dyiKHY13agtQBSSYs4ROEH190YxmwTZr3vxhlR2jNSdSZcg==", - "requires": { - "@sentry/browser": "5.21.1", - "@sentry/hub": "5.21.1", - "@sentry/minimal": "5.21.1", - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "tslib": "^1.9.3" - } - }, - "@sentry/browser": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.21.1.tgz", - "integrity": "sha512-sUxsW545klZxJE4iBAYQ8SuVS85HTOGNmIIIZWFUogB5oW3O0L+nJluXEqf/pHU82LnjDIzqsWCYQ0cRUaeYow==", - "requires": { - "@sentry/core": "5.21.1", - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "tslib": "^1.9.3" - } - }, - "@sentry/core": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.21.1.tgz", - "integrity": "sha512-Luulwx3GLUiY0gmHOhU+4eSga28Ce8DwoBcRq9GkGuhPu9r80057d5urxrDLp/leIZBXVvpY7tvmSN/rMtvF9w==", - "requires": { - "@sentry/hub": "5.21.1", - "@sentry/minimal": "5.21.1", - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "tslib": "^1.9.3" - } - }, - "@sentry/hub": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.21.1.tgz", - "integrity": "sha512-x5i9Ggi5ZYMhBYL5kyTu2fUJ6owjKH2tgJL3UExoZdRyZkbLAFZb+DtfSnteWgQ6wriGfgPD3r/hAIEdaomk2A==", - "requires": { - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "tslib": "^1.9.3" - } - }, - "@sentry/minimal": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.21.1.tgz", - "integrity": "sha512-OBVPASZ+mcXMKajvJon9RjEZ+ny3+VGhOI66acoP1hmYxKvji1OC2bYEuP1r4qtHxWVLAdV7qFj3EQ9ckErZmQ==", - "requires": { - "@sentry/hub": "5.21.1", - "@sentry/types": "5.21.1", - "tslib": "^1.9.3" - } - }, - "@sentry/node": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.21.1.tgz", - "integrity": "sha512-+QLqGz6+/gtShv0F16nI2+AuVEDZG2k9L25BVCNoysYzH1J1/QIKHsl7YF2trDMlWM4T7cbu5Fh8AhK6an+5/g==", - "requires": { - "@sentry/apm": "5.21.1", - "@sentry/core": "5.21.1", - "@sentry/hub": "5.21.1", - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "cookie": "^0.4.1", - "https-proxy-agent": "^5.0.0", - "lru_map": "^0.3.3", - "tslib": "^1.9.3" - }, - "dependencies": { - "cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" - } - } - }, - "@sentry/react": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/react/-/react-5.21.1.tgz", - "integrity": "sha512-e60erzdQOwZ88+j6Hi1AnRlxex7ZmwQPGSoFjtihQJR3Xv9Esj5DBKVrWu6Z/QCDxTc8uaX08XjUyhse2YyutQ==", - "requires": { - "@sentry/browser": "5.21.1", - "@sentry/minimal": "5.21.1", - "@sentry/types": "5.21.1", - "@sentry/utils": "5.21.1", - "hoist-non-react-statics": "^3.3.2", - "tslib": "^1.9.3" - }, - "dependencies": { - "hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "requires": { - "react-is": "^16.7.0" - } - } - } - }, - "@sentry/types": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.21.1.tgz", - "integrity": "sha512-hFN4aDduMpjj6vZSIIp+9kSr8MglcKO/UmbuUXN6hKLewhxt+Zj2wjXN7ulSs5OK5mjXP9QLA5YJvVQsl2//qw==" - }, - "@sentry/utils": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.21.1.tgz", - "integrity": "sha512-p5vPuc7+GfOmW8CXxWd0samS77Q00YrN8q5TC/ztF8nBhEF18GiMeWAdQnlSwt3iWal3q3gSSrbF4c9guIugng==", - "requires": { - "@sentry/types": "5.21.1", - "tslib": "^1.9.3" - } - }, "@sinonjs/commons": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.4.0.tgz", @@ -37107,24 +36811,6 @@ } } }, - "agent-base": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz", - "integrity": "sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==", - "requires": { - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - } - } - }, "aggregate-error": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", @@ -38687,6 +38373,12 @@ "regenerator-runtime": "^0.10.5" }, "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + }, "regenerator-runtime": { "version": "0.10.5", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", @@ -38790,6 +38482,12 @@ "source-map-support": "^0.4.15" }, "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + }, "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", @@ -38811,6 +38509,12 @@ "regenerator-runtime": "^0.11.0" }, "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + }, "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", @@ -38992,14 +38696,6 @@ "json-to-ast": "^2.0.3", "jsonpointer": "^4.0.1", "leven": "^3.1.0" - }, - "dependencies": { - "core-js": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz", - "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==", - "dev": true - } } }, "big.js": { @@ -40046,9 +39742,9 @@ } }, "core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", + "version": "3.26.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.26.0.tgz", + "integrity": "sha512-+DkDrhoR4Y0PxDz6rurahuB+I45OsEUv8E1maPTB6OuHRohMMcznBq9TMpdpDMm/hUPob/mJJS3PqgbHpMTQgw==", "dev": true }, "core-js-compat": { @@ -43894,25 +43590,6 @@ "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" }, - "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "requires": { - "agent-base": "6", - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - } - } - }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -47428,11 +47105,6 @@ "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", "dev": true }, - "lru_map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=" - }, "lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -47863,6 +47535,13 @@ } } }, + "mobx": { + "version": "5.15.7", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.7.tgz", + "integrity": "sha512-wyM3FghTkhmC+hQjyPGGFdpehrcX1KOXsDuERhfK2YbJemkUhEB+6wzEN639T21onxlfYBmriA1PFnvxTUhcKw==", + "dev": true, + "peer": true + }, "mobx-react": { "version": "6.1.4", "resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-6.1.4.tgz", @@ -49597,6 +49276,12 @@ "leven": "^2.1.0" } }, + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + }, "fast-deep-equal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", diff --git a/package.json b/package.json index aa9cac903..95671e5b1 100644 --- a/package.json +++ b/package.json @@ -35,9 +35,6 @@ }, "homepage": "https://github.com/TheDevs-Network/kutt#readme", "dependencies": { - "@sentry/apm": "^5.21.1", - "@sentry/node": "^5.21.1", - "@sentry/react": "^5.21.1", "app-root-path": "^3.0.0", "axios": "^0.21.1", "babel-plugin-inline-react-svg": "^1.1.0", diff --git a/server/env.ts b/server/env.ts index 5b5a8ae09..90d0a6cc7 100644 --- a/server/env.ts +++ b/server/env.ts @@ -40,9 +40,7 @@ const env = cleanEnv(process.env, { MAIL_FROM: str({ default: "", example: "Kutt " }), MAIL_PASSWORD: str(), REPORT_EMAIL: str({ default: "" }), - CONTACT_EMAIL: str({ default: "" }), - SENTRY_PRIVATE_DSN: str({ default: "" }), - SENTRY_PUBLIC_DSN: str({ default: "" }) + CONTACT_EMAIL: str({ default: "" }) }); export default env; diff --git a/server/handlers/helpers.ts b/server/handlers/helpers.ts index 53ea668dc..ac407088c 100644 --- a/server/handlers/helpers.ts +++ b/server/handlers/helpers.ts @@ -1,6 +1,5 @@ import { Handler, ErrorRequestHandler } from "express"; import { validationResult } from "express-validator"; -import * as Sentry from "@sentry/node"; import signale from "signale"; import { CustomError } from "../utils"; @@ -24,10 +23,6 @@ export const error: ErrorRequestHandler = (error, req, res, next) => { return res.status(error.statusCode || 500).json({ error: error.message }); } - if (env.SENTRY_PRIVATE_DSN) { - Sentry.captureException(error); - } - return res.status(500).json({ error: "An error occurred." }); }; diff --git a/server/server.ts b/server/server.ts index da4617978..f381f1dc9 100644 --- a/server/server.ts +++ b/server/server.ts @@ -7,7 +7,6 @@ import express from "express"; import helmet from "helmet"; import morgan from "morgan"; import nextApp from "next"; -import * as Sentry from "@sentry/node"; import * as helpers from "./handlers/helpers"; import * as links from "./handlers/links"; @@ -30,18 +29,6 @@ app.prepare().then(async () => { if (env.isDev) { server.use(morgan("combined", { stream })); - } else if (env.SENTRY_PRIVATE_DSN) { - Sentry.init({ - dsn: env.SENTRY_PRIVATE_DSN, - environment: process.env.NODE_ENV - }); - - server.use( - Sentry.Handlers.requestHandler({ - ip: true, - user: ["id", "email"] - }) - ); } server.use(helmet()); From e255d50458935a3c8414f1ddd9b5519bc11da712 Mon Sep 17 00:00:00 2001 From: Pouria Ezzati Date: Thu, 10 Nov 2022 19:49:00 +0330 Subject: [PATCH 02/11] chore: remove babel and tests --- .babelrc | 10 ---- client/components/__tests__/footer.test.tsx | 52 ---------------- .../components/__tests__/shortener.test.tsx | 59 ------------------- jest.config.js | 13 ---- 4 files changed, 134 deletions(-) delete mode 100644 .babelrc delete mode 100644 client/components/__tests__/footer.test.tsx delete mode 100644 client/components/__tests__/shortener.test.tsx delete mode 100644 jest.config.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index b4f37e542..000000000 --- a/.babelrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": ["next/babel"], - "plugins": [ - [ - "styled-components", - { "ssr": true, "displayName": true, "preprocess": false } - ], - "inline-react-svg" - ] -} diff --git a/client/components/__tests__/footer.test.tsx b/client/components/__tests__/footer.test.tsx deleted file mode 100644 index 5bcbcf461..000000000 --- a/client/components/__tests__/footer.test.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from "react"; -import { render } from "@testing-library/react"; -import { StoreProvider } from "easy-peasy"; -import { initializeStore } from "../../store"; -import Footer from "../Footer"; -import getConfig from "next/config"; - -describe("