diff --git a/package-lock.json b/package-lock.json index 34eb261..5bca888 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,8 @@ "@electron/asar": "^3.2.4", "@headlessui/react": "^1.7.14", "@heroicons/react": "^2.0.17", + "@sentry/electron": "^4.6.0", + "@sentry/react": "^7.56.0", "electron-squirrel-startup": "^1.0.0", "mkdirp": "^3.0.1", "mt-files-downloader": "github:FaisalUmair/mt-files-downloader-wrapper", @@ -2595,6 +2597,246 @@ "node": ">=14" } }, + "node_modules/@sentry-internal/tracing": { + "version": "7.50.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.50.0.tgz", + "integrity": "sha512-4TQ4vN0aMBWsUXfJWk2xbe4x7fKfwCXgXKTtHC/ocwwKM+0EefV5Iw9YFG8IrIQN4vMtuRzktqcs9q0/Sbv7tg==", + "dependencies": { + "@sentry/core": "7.50.0", + "@sentry/types": "7.50.0", + "@sentry/utils": "7.50.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry-internal/tracing/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@sentry/browser": { + "version": "7.50.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.50.0.tgz", + "integrity": "sha512-a+UYbP89+SAvW47/p9wxEi9eWlyp/SkYl52OCdZNXnplQY4kQIOVyiaIs5nnCxIxZgXKrhAX4eo1E9ykleFuNQ==", + "dependencies": { + "@sentry-internal/tracing": "7.50.0", + "@sentry/core": "7.50.0", + "@sentry/replay": "7.50.0", + "@sentry/types": "7.50.0", + "@sentry/utils": "7.50.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/browser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@sentry/core": { + "version": "7.50.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.50.0.tgz", + "integrity": "sha512-6oD1a3fYs4aiNK7tuJSd88LHjYJAetd7ZK/AfJniU7zWKj4jxIYfO8nhm0qdnhEDs81RcweVDmPhWm3Kwrzzsg==", + "dependencies": { + "@sentry/types": "7.50.0", + "@sentry/utils": "7.50.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/core/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@sentry/electron": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sentry/electron/-/electron-4.6.0.tgz", + "integrity": "sha512-P7TV3vlQj8HuhePJAqPvAUKdC/W+Zee0oD28QXPVnDH5gd7bZLudxCd4scMsKlNDAPa5KwlUr+ymVCKveq6OEw==", + "dependencies": { + "@sentry/browser": "7.50.0", + "@sentry/core": "7.50.0", + "@sentry/node": "7.50.0", + "@sentry/types": "7.50.0", + "@sentry/utils": "7.50.0", + "deepmerge": "4.3.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@sentry/node": { + "version": "7.50.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.50.0.tgz", + "integrity": "sha512-11UJBKoQFMp7f8sbzeO2gENsKIUkVCNBTzuPRib7l2K1HMjSfacXmwwma7ZEs0mc3ofIZ1UYuyONAXmI1lK9cQ==", + "dependencies": { + "@sentry-internal/tracing": "7.50.0", + "@sentry/core": "7.50.0", + "@sentry/types": "7.50.0", + "@sentry/utils": "7.50.0", + "cookie": "^0.4.1", + "https-proxy-agent": "^5.0.0", + "lru_map": "^0.3.3", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/node/node_modules/cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@sentry/node/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@sentry/react": { + "version": "7.56.0", + "resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.56.0.tgz", + "integrity": "sha512-dRnkZwspef5aEHV/eiLS/mhomFCXItylU8s78fzAn5QMTDGHmu5Pnhl5dxh/zbPUcdXqFA6GwJVucV4gzsNEJw==", + "dependencies": { + "@sentry/browser": "7.56.0", + "@sentry/types": "7.56.0", + "@sentry/utils": "7.56.0", + "hoist-non-react-statics": "^3.3.2", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=8" + }, + "peerDependencies": { + "react": "15.x || 16.x || 17.x || 18.x" + } + }, + "node_modules/@sentry/react/node_modules/@sentry-internal/tracing": { + "version": "7.56.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.56.0.tgz", + "integrity": "sha512-OKI4Pz/O13gng8hT9rNc+gRV3+P7nnk1HnHlV8fgaQydS6DsRxoDL1sHa42tZGbh7K9jqNAP3TC6VjBOsr2tXA==", + "dependencies": { + "@sentry/core": "7.56.0", + "@sentry/types": "7.56.0", + "@sentry/utils": "7.56.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/react/node_modules/@sentry/browser": { + "version": "7.56.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.56.0.tgz", + "integrity": "sha512-qpyyw+NM/psbNAYMlTCCdWwxHHcogppEQ+Q40jGE4sKP2VRIjjyteJkUcaEMoGpbJXx9puzTWbpzqlQ8r15Now==", + "dependencies": { + "@sentry-internal/tracing": "7.56.0", + "@sentry/core": "7.56.0", + "@sentry/replay": "7.56.0", + "@sentry/types": "7.56.0", + "@sentry/utils": "7.56.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/react/node_modules/@sentry/core": { + "version": "7.56.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.56.0.tgz", + "integrity": "sha512-Nuyyfh09Yz27kPo74fXHlrdmZeK6zrlJVtxQ6LkwuoaTBcNcesNXVaOtr6gjvUGUmsfriVPP3Jero5LXufV7GQ==", + "dependencies": { + "@sentry/types": "7.56.0", + "@sentry/utils": "7.56.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/react/node_modules/@sentry/replay": { + "version": "7.56.0", + "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.56.0.tgz", + "integrity": "sha512-bvjiJK1+SM/paLapuL+nEJ8CIF1bJqi0nnFyxUIi2L5L6yb2uMwfyT3IQ+kz0cXJsLdb3HN4WMphVjyiU9pFdg==", + "dependencies": { + "@sentry/core": "7.56.0", + "@sentry/types": "7.56.0", + "@sentry/utils": "7.56.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@sentry/react/node_modules/@sentry/types": { + "version": "7.56.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.56.0.tgz", + "integrity": "sha512-5WjhVOQm75ItOytOx2jTx+5yw8/qJ316+g1Di8dS9+kgIi1zniqdMcX00C2yYe3FMUgFB49PegCUYulm9Evapw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/react/node_modules/@sentry/utils": { + "version": "7.56.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.56.0.tgz", + "integrity": "sha512-wgeX7bufxc//TjjSIE+gCMm8hVId7Jzvc+f441bYrWnNZBuzPIDW2BummCcPrKzSYe5GeYZDTZGV8YZGMLGBjw==", + "dependencies": { + "@sentry/types": "7.56.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/react/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@sentry/replay": { + "version": "7.50.0", + "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.50.0.tgz", + "integrity": "sha512-EYRk+DTZ5luwfkiCaDpBC3YBKIEdkReTUNZtWDVUytSVjsCnttkAipx/y6bxy3HN+rSXungMd3XKQT5RNMRUNA==", + "dependencies": { + "@sentry/core": "7.50.0", + "@sentry/types": "7.50.0", + "@sentry/utils": "7.50.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@sentry/types": { + "version": "7.50.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.50.0.tgz", + "integrity": "sha512-Zo9vyI98QNeYT0K0y57Rb4JRWDaPEgmp+QkQ4CRQZFUTWetO5fvPZ4Gb/R7TW16LajuHZlbJBHmvmNj2pkL2kw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/utils": { + "version": "7.50.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.50.0.tgz", + "integrity": "sha512-iyPwwC6fwJsiPhH27ZbIiSsY5RaccHBqADS2zEjgKYhmP4P9WGgHRDrvLEnkOjqQyKNb6c0yfmv83n0uxYnolw==", + "dependencies": { + "@sentry/types": "7.50.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/utils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, "node_modules/@sindresorhus/is": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", @@ -4805,6 +5047,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/deepmerge": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.0.tgz", + "integrity": "sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/default-gateway": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", @@ -6929,6 +7179,14 @@ "he": "bin/he" } }, + "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/homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -8203,6 +8461,11 @@ "node": ">=8" } }, + "node_modules/lru_map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==" + }, "node_modules/lru-cache": { "version": "7.18.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", @@ -10010,6 +10273,11 @@ "react": "^18.2.0" } }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, "node_modules/react-router": { "version": "6.10.0", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.10.0.tgz", diff --git a/package.json b/package.json index e2ff763..d499e7d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "udeler-pro", "productName": "udeler-pro", - "version": "2.0.0", + "version": "1.0.0", "description": "Udemy desktop client to download courses", "main": ".webpack/main", "scripts": { @@ -50,6 +50,8 @@ "@electron/asar": "^3.2.4", "@headlessui/react": "^1.7.14", "@heroicons/react": "^2.0.17", + "@sentry/electron": "^4.6.0", + "@sentry/react": "^7.56.0", "electron-squirrel-startup": "^1.0.0", "mkdirp": "^3.0.1", "mt-files-downloader": "github:FaisalUmair/mt-files-downloader-wrapper", diff --git a/src/app.jsx b/src/app.jsx index 0cb7173..e38b68c 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -16,6 +16,12 @@ const { getRxStorageIpcRenderer } = require("rxdb/plugins/electron"); const { ipcRenderer } = require("electron"); +import * as Sentry from "@sentry/react"; + +function FallbackComponent() { + return
An error has ocurred :
; +} + const App = () => { const [token, setToken] = React.useState(""); const [url, setURL] = React.useState(""); @@ -39,22 +45,24 @@ const App = () => { return ( <> - {db && ( - - - - - - } /> - } /> - - - - - - )} + + {db && ( + + + + + + } /> + } /> + + + + + + )} + ); }; diff --git a/src/main.js b/src/main.js index f2bf4ef..03641a1 100644 --- a/src/main.js +++ b/src/main.js @@ -10,6 +10,12 @@ const { dialog } = require("electron"); import { join } from "path"; const { homedir } = require("os"); +import * as Sentry from "@sentry/electron"; + +Sentry.init({ + dsn: "https://6665e2d7b9174976b95b33e4ab69c2a2@o4505397808660480.ingest.sentry.io/4505397811740672", +}); + // Handle creating/removing shortcuts on Windows when installing/uninstalling. if (require("electron-squirrel-startup")) { app.quit(); diff --git a/webpack.renderer.config.js b/webpack.renderer.config.js index 24045e2..2191e23 100644 --- a/webpack.renderer.config.js +++ b/webpack.renderer.config.js @@ -18,4 +18,7 @@ module.exports = { extensions: [".js", ".jsx"], }, target: "electron-renderer", + externals: { + electron: "commonjs electron", + }, };