diff --git a/package-lock.json b/package-lock.json index b848f75..2e50baf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2258,6 +2258,106 @@ "node": ">=6.9.0" } }, + "node_modules/@bugsnag/browser": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.25.0.tgz", + "integrity": "sha512-PzzWy5d9Ly1CU1KkxTB6ZaOw/dO+CYSfVtqxVJccy832e6+7rW/dvSw5Jy7rsNhgcKSKjZq86LtNkPSvritOLA==", + "dependencies": { + "@bugsnag/core": "^7.25.0" + } + }, + "node_modules/@bugsnag/browser-performance": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@bugsnag/browser-performance/-/browser-performance-2.7.0.tgz", + "integrity": "sha512-ZG88l7HB0iFvbhiDchbPvOrBs1hbiZIVbRFsfZm0VYBfnBXhUg4bXuTTwd1RHqZvfDI67XYYSR801GQbhWkgTA==", + "dependencies": { + "@bugsnag/core-performance": "^2.7.0", + "@bugsnag/cuid": "^3.1.1", + "@bugsnag/delivery-fetch-performance": "^2.7.0", + "@bugsnag/request-tracker-performance": "^2.7.0" + } + }, + "node_modules/@bugsnag/core": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.25.0.tgz", + "integrity": "sha512-JZLak1b5BVzy77CPcklViZrppac/pE07L3uSDmfSvFYSCGReXkik2txOgV05VlF9EDe36dtUAIIV7iAPDfFpQQ==", + "dependencies": { + "@bugsnag/cuid": "^3.0.0", + "@bugsnag/safe-json-stringify": "^6.0.0", + "error-stack-parser": "^2.0.3", + "iserror": "0.0.2", + "stack-generator": "^2.0.3" + } + }, + "node_modules/@bugsnag/core-performance": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@bugsnag/core-performance/-/core-performance-2.7.0.tgz", + "integrity": "sha512-sd51eVbOL+98P8csH8ftqEFyTNAQ86PJp3ohRw+ZhfrJ2jqkRgjEkPEJ9oeSUCbm/O8RWi/qmgCBksw1uqSiqg==", + "dependencies": { + "@bugsnag/cuid": "^3.1.1" + } + }, + "node_modules/@bugsnag/cuid": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.1.1.tgz", + "integrity": "sha512-d2z4b0rEo3chI07FNN1Xds8v25CNeekecU6FC/2Fs9MxY2EipkZTThVcV2YinMn8dvRUlViKOyC50evoUxg8tw==" + }, + "node_modules/@bugsnag/delivery-fetch-performance": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@bugsnag/delivery-fetch-performance/-/delivery-fetch-performance-2.7.0.tgz", + "integrity": "sha512-RN2uqtrXB1v5NeJmsyX318rKg3vPA9S9C/Ezs/ZN7EUi5PG/3KqSk3qfnGHhUdCJbSgC3Ar7o4J39Jq0z04v9w==", + "dependencies": { + "@bugsnag/core-performance": "^2.7.0" + } + }, + "node_modules/@bugsnag/js": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.25.0.tgz", + "integrity": "sha512-d8n8SyKdRUz8jMacRW1j/Sj/ckhKbIEp49+Dacp3CS8afRgfMZ//NXhUFFXITsDP5cXouaejR9fx4XVapYXNgg==", + "dependencies": { + "@bugsnag/browser": "^7.25.0", + "@bugsnag/node": "^7.25.0" + } + }, + "node_modules/@bugsnag/node": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.25.0.tgz", + "integrity": "sha512-KlxBaJ8EREEsfKInybAjTO9LmdDXV3cUH5+XNXyqUZrcRVuPOu4j4xvljh+n24ifok/wbFZTKVXUzrN4iKIeIA==", + "dependencies": { + "@bugsnag/core": "^7.25.0", + "byline": "^5.0.0", + "error-stack-parser": "^2.0.2", + "iserror": "^0.0.2", + "pump": "^3.0.0", + "stack-generator": "^2.0.3" + } + }, + "node_modules/@bugsnag/plugin-react": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/plugin-react/-/plugin-react-7.25.0.tgz", + "integrity": "sha512-evlH2Aai7vBQsTNt1sP0Pq7uwCdaQR6DOwrZmfA6W6h0eJzTDdlq1jl94NbfHTIMM62zGcDx6ZT/1Q87utnvtA==", + "peerDependencies": { + "@bugsnag/core": "^7.0.0" + }, + "peerDependenciesMeta": { + "@bugsnag/core": { + "optional": true + } + } + }, + "node_modules/@bugsnag/request-tracker-performance": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@bugsnag/request-tracker-performance/-/request-tracker-performance-2.7.0.tgz", + "integrity": "sha512-f9sdbQr8ZpsbdPokR11gWMnItNbfMTpsADDXtP0PwOrncW28/5eCvW4BW7KTX3IdUFPvy8/RhFS0C1SUfMsdhQ==", + "dependencies": { + "@bugsnag/core-performance": "^2.7.0" + } + }, + "node_modules/@bugsnag/safe-json-stringify": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz", + "integrity": "sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA==" + }, "node_modules/@colors/colors": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", @@ -7598,6 +7698,14 @@ "node": ">=10.16.0" } }, + "node_modules/byline": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", + "integrity": "sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -8440,6 +8548,14 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "dependencies": { + "stackframe": "^1.3.4" + } + }, "node_modules/es-abstract": { "version": "1.22.4", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.4.tgz", @@ -10749,6 +10865,11 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, + "node_modules/iserror": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/iserror/-/iserror-0.0.2.tgz", + "integrity": "sha512-oKGGrFVaWwETimP3SiWwjDeY27ovZoyZPHtxblC4hCq9fXxed/jasx+ATWFFjCVSRZng8VTMsN1nDnGo6zMBSw==" + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -12499,6 +12620,15 @@ "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", "dev": true }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -13685,6 +13815,14 @@ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==" }, + "node_modules/stack-generator": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz", + "integrity": "sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==", + "dependencies": { + "stackframe": "^1.3.4" + } + }, "node_modules/stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", @@ -13693,6 +13831,11 @@ "node": "*" } }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==" + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -16091,6 +16234,9 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@bugsnag/browser-performance": "^2.7.0", + "@bugsnag/js": "^7.25.0", + "@bugsnag/plugin-react": "^7.25.0", "@fortawesome/fontawesome-svg-core": "^6.5.1", "@fortawesome/free-brands-svg-icons": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.1", diff --git a/packages/client/package.json b/packages/client/package.json index dba4e41..4c45fac 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -17,6 +17,9 @@ "extends": "react-app" }, "dependencies": { + "@bugsnag/browser-performance": "^2.7.0", + "@bugsnag/js": "^7.25.0", + "@bugsnag/plugin-react": "^7.25.0", "@fortawesome/fontawesome-svg-core": "^6.5.1", "@fortawesome/free-brands-svg-icons": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.1", diff --git a/packages/client/src/index.tsx b/packages/client/src/index.tsx index e240992..bf6cc34 100644 --- a/packages/client/src/index.tsx +++ b/packages/client/src/index.tsx @@ -3,11 +3,29 @@ import { createRoot } from "react-dom/client"; import { NextUIProvider } from "@nextui-org/react"; import App from "./components/App"; +import Bugsnag from "@bugsnag/js"; +import BugsnagPluginReact from "@bugsnag/plugin-react"; +import BugsnagPerformance from "@bugsnag/browser-performance"; + +let ErrorBoundary: any = <>; + +if (import.meta.env.VITE_BUGSNAG_KEY) { + Bugsnag.start({ + apiKey: import.meta.env.VITE_BUGSNAG_KEY, + plugins: [new BugsnagPluginReact()], + }); + BugsnagPerformance.start({ apiKey: import.meta.env.VITE_BUGSNAG_KEY }); + + ErrorBoundary = Bugsnag.getPlugin("react")!.createErrorBoundary(React); +} + const root = createRoot(document.getElementById("root")!); root.render( - - - + + + + + ); diff --git a/packages/client/src/vite-env.d.ts b/packages/client/src/vite-env.d.ts index ff03115..b59534e 100644 --- a/packages/client/src/vite-env.d.ts +++ b/packages/client/src/vite-env.d.ts @@ -2,6 +2,7 @@ interface ImportMetaEnv { readonly VITE_INCLUDE_EVENT_INFO: boolean; + readonly VITE_BUGSNAG_KEY?: string; } interface ImportMeta { diff --git a/packages/client/vite.config.js b/packages/client/vite.config.js index 74a3d2c..a793441 100644 --- a/packages/client/vite.config.js +++ b/packages/client/vite.config.js @@ -13,6 +13,7 @@ export default defineConfig({ build: { outDir: "../dist", emptyOutDir: true, + sourcemap: true, }, plugins: [ react({