From 81dcc4d9f92821801a7ec0cc06961e663087c7f7 Mon Sep 17 00:00:00 2001 From: Francisco Date: Sun, 25 Jun 2023 11:17:01 +0200 Subject: [PATCH 1/3] fix vercel build --- packages/bridge-ui-v2/src/libs/wagmi/watcher.ts | 4 ++-- packages/bridge-ui-v2/src/routes/+layout.svelte | 5 +++++ packages/bridge-ui-v2/src/routes/+layout.ts | 9 --------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/bridge-ui-v2/src/libs/wagmi/watcher.ts b/packages/bridge-ui-v2/src/libs/wagmi/watcher.ts index a9149be9cd6..67db9112773 100644 --- a/packages/bridge-ui-v2/src/libs/wagmi/watcher.ts +++ b/packages/bridge-ui-v2/src/libs/wagmi/watcher.ts @@ -1,8 +1,8 @@ -import { watchAccount, watchNetwork, watchPublicClient, watchWalletClient } from '@wagmi/core'; +import { watchAccount, watchNetwork/*, watchPublicClient, watchWalletClient*/ } from '@wagmi/core'; import { getLogger } from '$libs/util/logger'; -const log = getLogger('wagmi/watcher'); +const log = getLogger('wagmi:watcher'); let isWatching = false; let unWatchNetwork: () => void; diff --git a/packages/bridge-ui-v2/src/routes/+layout.svelte b/packages/bridge-ui-v2/src/routes/+layout.svelte index 8d65d94a27f..b45ebc5fa2c 100644 --- a/packages/bridge-ui-v2/src/routes/+layout.svelte +++ b/packages/bridge-ui-v2/src/routes/+layout.svelte @@ -3,6 +3,11 @@ import Header from '$components/Header'; import SideNavigation from '$components/SideNavigation'; + import { startWatching, stopWatching } from '$libs/wagmi'; + import { onDestroy, onMount } from 'svelte'; + + onMount(startWatching) + onDestroy(stopWatching) diff --git a/packages/bridge-ui-v2/src/routes/+layout.ts b/packages/bridge-ui-v2/src/routes/+layout.ts index 92d449c4cde..17153886b0a 100644 --- a/packages/bridge-ui-v2/src/routes/+layout.ts +++ b/packages/bridge-ui-v2/src/routes/+layout.ts @@ -1,13 +1,4 @@ -/** - * Entry point - */ - -import { startWatching } from '$libs/wagmi'; - // When setting this to false your entire app will only be rendered on the client, // which essentially means you turn your app into an SPA. // See https://kit.svelte.dev/docs/page-options#ssr export const ssr = false; - -// Start watching for network and account changes -startWatching(); From 77fe8403e7467ef32993fd21f919d9e1b8fc466b Mon Sep 17 00:00:00 2001 From: Francisco Date: Sun, 25 Jun 2023 11:19:44 +0200 Subject: [PATCH 2/3] fix lint --- packages/bridge-ui-v2/src/libs/wagmi/watcher.ts | 2 +- packages/bridge-ui-v2/src/routes/+layout.svelte | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/bridge-ui-v2/src/libs/wagmi/watcher.ts b/packages/bridge-ui-v2/src/libs/wagmi/watcher.ts index 67db9112773..16fa32acfd4 100644 --- a/packages/bridge-ui-v2/src/libs/wagmi/watcher.ts +++ b/packages/bridge-ui-v2/src/libs/wagmi/watcher.ts @@ -1,4 +1,4 @@ -import { watchAccount, watchNetwork/*, watchPublicClient, watchWalletClient*/ } from '@wagmi/core'; +import { watchAccount, watchNetwork /*, watchPublicClient, watchWalletClient*/ } from '@wagmi/core'; import { getLogger } from '$libs/util/logger'; diff --git a/packages/bridge-ui-v2/src/routes/+layout.svelte b/packages/bridge-ui-v2/src/routes/+layout.svelte index b45ebc5fa2c..b18ed3d420e 100644 --- a/packages/bridge-ui-v2/src/routes/+layout.svelte +++ b/packages/bridge-ui-v2/src/routes/+layout.svelte @@ -1,13 +1,14 @@ From 6997c99e07b61c3918e75c14fa363b2f97e97d19 Mon Sep 17 00:00:00 2001 From: Francisco Date: Sun, 25 Jun 2023 11:37:09 +0200 Subject: [PATCH 3/3] add source map --- packages/bridge-ui-v2/vite.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/bridge-ui-v2/vite.config.ts b/packages/bridge-ui-v2/vite.config.ts index 83e51c7015b..808b49b4332 100644 --- a/packages/bridge-ui-v2/vite.config.ts +++ b/packages/bridge-ui-v2/vite.config.ts @@ -3,6 +3,9 @@ import tsconfigPaths from 'vite-tsconfig-paths'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + build: { + sourcemap: true, + }, plugins: [ sveltekit(),