From ffa4253ba1d85cab97317da2380ef1f363d741ba Mon Sep 17 00:00:00 2001 From: Francisco Ramos Date: Mon, 12 Jun 2023 12:36:58 +0200 Subject: [PATCH] feat(bridge-ui): sentry integration (#13943) --- packages/bridge-ui/.default.env | 2 + packages/bridge-ui/package.json | 2 + packages/bridge-ui/src/app.ts | 3 + .../src/components/AddressDropdown.svelte | 3 + .../components/BridgeForm/BridgeForm.svelte | 5 +- .../BridgeForm/ProcessingFee.svelte | 2 + .../components/BridgeForm/SelectChain.svelte | 3 + .../src/components/ChainDropdown.svelte | 3 + .../src/components/ConnectWallet.svelte | 6 + .../src/components/Faucet/Faucet.svelte | 5 +- .../Transactions/Transaction.svelte | 3 + .../src/constants/__mocks__/envVars.ts | 2 + packages/bridge-ui/src/constants/envVars.ts | 2 + packages/bridge-ui/src/sentry.ts | 41 + packages/bridge-ui/src/signer/subscriber.ts | 2 + packages/bridge-ui/src/vite-env.d.ts | 1 + packages/bridge-ui/svelte.config.cjs | 21 +- pnpm-lock.yaml | 1626 ++++++++++++++++- 18 files changed, 1643 insertions(+), 89 deletions(-) create mode 100644 packages/bridge-ui/src/sentry.ts diff --git a/packages/bridge-ui/.default.env b/packages/bridge-ui/.default.env index ad04319c53f..f4b02398ab7 100644 --- a/packages/bridge-ui/.default.env +++ b/packages/bridge-ui/.default.env @@ -24,3 +24,5 @@ VITE_L2_BRIDGE_ADDRESS="" VITE_L1_SIGNAL_SERVICE_ADDRESS="" VITE_L2_SIGNAL_SERVICE_ADDRESS="" + +VITE_SENTRY_DSN="" diff --git a/packages/bridge-ui/package.json b/packages/bridge-ui/package.json index 127d7439922..385604ca8f3 100644 --- a/packages/bridge-ui/package.json +++ b/packages/bridge-ui/package.json @@ -20,6 +20,7 @@ }, "devDependencies": { "@babel/preset-env": "^7.16.0", + "@sentry/vite-plugin": "^2.2.1", "@sveltejs/vite-plugin-svelte": "^1.0.1", "@tsconfig/svelte": "^3.0.0", "@types/debug": "^4.1.7", @@ -70,6 +71,7 @@ "@coinbase/wallet-sdk": "^3.6.3", "@ethersproject/experimental": "^5.7.0", "@lottiefiles/svelte-lottie-player": "^0.2.0", + "@sentry/svelte": "^7.54.0", "@sveltestack/svelte-query": "^1.6.0", "@wagmi/connectors": "^0.1.1", "@wagmi/core": "^0.8.0", diff --git a/packages/bridge-ui/src/app.ts b/packages/bridge-ui/src/app.ts index 0532d66bc88..9d2ca7c43f8 100644 --- a/packages/bridge-ui/src/app.ts +++ b/packages/bridge-ui/src/app.ts @@ -3,8 +3,11 @@ import './styles/app.css'; import { Buffer } from 'buffer'; import App from './App.svelte'; +import { SENTRY_DSN } from './constants/envVars'; import { setupI18n } from './i18n'; +import { setupSentry } from './sentry'; +setupSentry(SENTRY_DSN); setupI18n({ withLocale: 'en' }); const app = new App({ diff --git a/packages/bridge-ui/src/components/AddressDropdown.svelte b/packages/bridge-ui/src/components/AddressDropdown.svelte index b84717c4aa2..3b8643114c4 100644 --- a/packages/bridge-ui/src/components/AddressDropdown.svelte +++ b/packages/bridge-ui/src/components/AddressDropdown.svelte @@ -1,4 +1,5 @@