diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 518b514..399e7f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: with: node-version: '18.x' - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 name: Install pnpm with: version: 8 @@ -29,7 +29,7 @@ jobs: run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@v4 name: Setup pnpm cache with: path: ${{ env.STORE_PATH }} diff --git a/.gitignore b/.gitignore index 17d720e..a9cb1db 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,6 @@ node_modules vite.config.js.timestamp-* vite.config.ts.timestamp-* +.vercel +# Sentry Config File .sentryclirc - -.vercel \ No newline at end of file diff --git a/package.json b/package.json index 393a15d..cb52403 100644 --- a/package.json +++ b/package.json @@ -61,4 +61,4 @@ "@socket.tech/ll-core-v2": "^0.0.68" } } -} \ No newline at end of file +} diff --git a/src/hooks.client.ts b/src/hooks.client.ts new file mode 100644 index 0000000..0ccfa8a --- /dev/null +++ b/src/hooks.client.ts @@ -0,0 +1,25 @@ +import { handleErrorWithSentry, Replay } from '@sentry/sveltekit'; +import * as Sentry from '@sentry/sveltekit'; + +import { dev } from '$app/environment'; + +Sentry.init({ + dsn: 'https://15841eeeac40ad075e756df391e51793@o4506180497899520.ingest.sentry.io/4506180501241856', + tracesSampleRate: 1.0, + + // This sets the sample rate to be 10%. You may want this to be 100% while + // in development and sample at a lower rate in production + replaysSessionSampleRate: 0.1, + + // If the entire session is not sampled, use the below sample rate to sample + // sessions when an error occurs. + replaysOnErrorSampleRate: 1.0, + + // If you don't want to use Session Replay, just remove the line below: + integrations: [new Replay()], + + environment: dev ? 'development' : 'production' +}); + +// If you have a custom error handler, pass it to `handleErrorWithSentry` +export const handleError = handleErrorWithSentry(); diff --git a/src/hooks.server.ts b/src/hooks.server.ts new file mode 100644 index 0000000..815dd0c --- /dev/null +++ b/src/hooks.server.ts @@ -0,0 +1,17 @@ +import { handleErrorWithSentry, sentryHandle } from '@sentry/sveltekit'; +import * as Sentry from '@sentry/sveltekit'; +import { sequence } from '@sveltejs/kit/hooks'; + +import { dev } from '$app/environment'; + +Sentry.init({ + dsn: 'https://15841eeeac40ad075e756df391e51793@o4506180497899520.ingest.sentry.io/4506180501241856', + tracesSampleRate: 1.0, + environment: dev ? 'development' : 'production' +}); + +// If you have custom handlers, make sure to place them after `sentryHandle()` in the `sequence` function. +export const handle = sequence(sentryHandle()); + +// If you have a custom error handler, pass it to `handleErrorWithSentry` +export const handleError = handleErrorWithSentry(); diff --git a/src/lib/services/wallet.ts b/src/lib/services/wallet.ts index ec8f29f..3af5367 100644 --- a/src/lib/services/wallet.ts +++ b/src/lib/services/wallet.ts @@ -1,4 +1,3 @@ -// import { chains } from '$lib/consts/chains'; import { CHAIN_DETAILS } from '@squirrel-labs/peanut-sdk'; import { createWeb3Modal, defaultConfig } from '@web3modal/ethers5'; import { ethers } from 'ethers'; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index d76f799..e5ec0d5 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -11,6 +11,7 @@ Toast } from '@skeletonlabs/skeleton'; import { inject } from '@vercel/analytics'; + import { onMount } from 'svelte'; import { dev } from '$app/environment'; import Web3Modal from '$lib/components/Web3Modal.svelte'; @@ -20,7 +21,9 @@ inject({ mode: dev ? 'development' : 'production' }); initializeStores(); - initWeb3Modal(); + onMount(() => { + initWeb3Modal(); + }); // Floating UI for Popups storePopup.set({ computePosition, autoUpdate, flip, shift, offset, arrow }); diff --git a/vite.config.ts b/vite.config.ts index e83ce88..567bec7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,19 @@ +import { sentrySvelteKit } from '@sentry/sveltekit'; import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; import { purgeCss } from 'vite-plugin-tailwind-purgecss'; export default defineConfig({ - plugins: [sveltekit(), purgeCss()] + plugins: [ + sentrySvelteKit({ + autoUploadSourceMaps: false, + // sourceMapsUploadOptions: { + // org: 'zaibon', + // project: 'commitkudos', + // }, + adapter: 'vercel' + }), + sveltekit(), + purgeCss() + ] });