From 9088552bfb21f0085ac8d6d47ac370729244a41a Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Tue, 21 Jan 2025 09:48:49 +0100 Subject: [PATCH] enable source map upload for companion app --- .github/workflows/app-preview.yaml | 2 + deployables/app/package.json | 1 + deployables/app/vite.config.ts | 14 +++- pnpm-lock.yaml | 104 +++++++++++++++++++++++++++-- 4 files changed, 113 insertions(+), 8 deletions(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index 9da150e5..28b81236 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -26,6 +26,8 @@ jobs: - run: pnpm install --prefer-offline - run: pnpm build + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: Deploy id: deploy diff --git a/deployables/app/package.json b/deployables/app/package.json index 69090c0d..192e8104 100644 --- a/deployables/app/package.json +++ b/deployables/app/package.json @@ -43,6 +43,7 @@ "@hiogawa/vite-node-miniflare": "0.1.1", "@playwright/test": "^1.48.1", "@react-router/dev": "^7.1.1", + "@sentry/vite-plugin": "^3.0.0", "@testing-library/jest-dom": "^6.4.6", "@testing-library/react": "^16.0.1", "@testing-library/user-event": "14.6.0", diff --git a/deployables/app/vite.config.ts b/deployables/app/vite.config.ts index 3cff78d5..4e99edc3 100644 --- a/deployables/app/vite.config.ts +++ b/deployables/app/vite.config.ts @@ -1,5 +1,6 @@ import { reactRouter } from '@react-router/dev/vite' import { cloudflareDevProxy } from '@react-router/dev/vite/cloudflare' +import { sentryVitePlugin } from '@sentry/vite-plugin' import autoprefixer from 'autoprefixer' import tailwindcss from 'tailwindcss' import { defineConfig } from 'vite' @@ -12,6 +13,7 @@ export default defineConfig(({ isSsrBuild }) => ({ input: './workers/app.ts', } : undefined, + sourcemap: true, }, server: { port: 3040, @@ -26,7 +28,6 @@ export default defineConfig(({ isSsrBuild }) => ({ }, ssr: { target: 'webworker', - // noExternal: true, resolve: { conditions: ['workerd', 'browser'], }, @@ -42,5 +43,14 @@ export default defineConfig(({ isSsrBuild }) => ({ }, noExternal: ['@gnosis.pm/zodiac', 'evm-proxy-detection'], }, - plugins: [cloudflareDevProxy(), reactRouter(), tsconfigPaths()], + plugins: [ + cloudflareDevProxy(), + reactRouter(), + tsconfigPaths(), + sentryVitePlugin({ + authToken: process.env.SENTRY_AUTH_TOKEN, + org: 'gnosis-guild', + project: 'pilot-companion-app', + }), + ], })) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7faba64a..1dd42a78 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -148,7 +148,7 @@ importers: devDependencies: '@cloudflare/workers-types': specifier: 4.20250109.0 - version: 4.20250121.0 + version: 4.20250109.0 '@depay/web3-mock': specifier: ^14.19.1 version: 14.19.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -160,7 +160,10 @@ importers: version: 1.49.1 '@react-router/dev': specifier: ^7.1.1 - version: 7.1.3(@react-router/serve@7.1.3(react-router@7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3))(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(react-router@7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(sass@1.82.0)(stylus@0.62.0)(typescript@5.7.3)(vite@6.0.10(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0))(wrangler@3.103.2(@cloudflare/workers-types@4.20250121.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10))(yaml@2.7.0) + version: 7.1.3(@react-router/serve@7.1.3(react-router@7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3))(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(react-router@7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(sass@1.82.0)(stylus@0.62.0)(typescript@5.7.3)(vite@6.0.10(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0))(wrangler@3.103.2(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10))(yaml@2.7.0) + '@sentry/vite-plugin': + specifier: ^3.0.0 + version: 3.0.0 '@testing-library/jest-dom': specifier: ^6.4.6 version: 6.6.3 @@ -223,7 +226,7 @@ importers: version: 2.1.8(@types/node@22.10.7)(happy-dom@16.7.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0) wrangler: specifier: ^3.87.0 - version: 3.103.2(@cloudflare/workers-types@4.20250121.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10) + version: 3.103.2(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10) deployables/example-app: dependencies: @@ -1189,6 +1192,9 @@ packages: cpu: [x64] os: [win32] + '@cloudflare/workers-types@4.20250109.0': + resolution: {integrity: sha512-Y1zgSaEOOevl9ORpzgMcm4j535p3nK2lrblHHvYM2yxR50SBKGh+wvkRFAIxWRfjUGZEU+Fp6923EGioDBbobA==} + '@cloudflare/workers-types@4.20250121.0': resolution: {integrity: sha512-2bBosmudcwvUOKzuCL/Jum18LDh3QoU0QnTNMXIgcVwuq3LaNzyZnOW14bFXPhLU/84ZjNO3zO5R/U11Zgag2Q==} @@ -3033,6 +3039,10 @@ packages: peerDependencies: react: ^16.14.0 || 17.x || 18.x || 19.x + '@sentry/vite-plugin@3.0.0': + resolution: {integrity: sha512-E2elyHjP3Wqnk2uXr9C17jHRQBKX8jEOpzOnEOiXYDI2FBfehs9ttj9yX1I7H8ofCiqO2EsTu5r2a0C26ZWi+w==} + engines: {node: '>= 14'} + '@shazow/whatsabi@0.19.0': resolution: {integrity: sha512-18LfRRaTrn58mFUgCFvShiYqVuiDkx8TJWHzVcpaQu5O8+H8u9Pe+I3xlZeUTrGq6XQepPF7C8Uf9Sv7o26j0Q==} peerDependencies: @@ -8662,6 +8672,8 @@ snapshots: '@cloudflare/workerd-windows-64@1.20241230.0': optional: true + '@cloudflare/workers-types@4.20250109.0': {} + '@cloudflare/workers-types@4.20250121.0': {} '@coinbase/wallet-sdk@3.9.3': @@ -10205,6 +10217,59 @@ snapshots: clsx: 2.1.1 react: 19.0.0 + '@react-router/dev@7.1.3(@react-router/serve@7.1.3(react-router@7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3))(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(react-router@7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(sass@1.82.0)(stylus@0.62.0)(typescript@5.7.3)(vite@6.0.10(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0))(wrangler@3.103.2(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10))(yaml@2.7.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/generator': 7.26.5 + '@babel/parser': 7.26.5 + '@babel/plugin-syntax-decorators': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.0) + '@babel/preset-typescript': 7.26.0(@babel/core@7.26.0) + '@babel/traverse': 7.26.5 + '@babel/types': 7.26.5 + '@npmcli/package-json': 4.0.1 + '@react-router/node': 7.1.3(react-router@7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3) + arg: 5.0.2 + babel-dead-code-elimination: 1.0.8 + chokidar: 4.0.3 + dedent: 1.5.3(babel-plugin-macros@3.1.0) + es-module-lexer: 1.6.0 + exit-hook: 2.2.1 + fs-extra: 10.1.0 + gunzip-maybe: 1.4.2 + jsesc: 3.0.2 + lodash: 4.17.21 + pathe: 1.1.2 + picocolors: 1.1.1 + picomatch: 2.3.1 + prettier: 2.8.8 + react-refresh: 0.14.2 + react-router: 7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + semver: 7.6.3 + set-cookie-parser: 2.7.1 + valibot: 0.41.0(typescript@5.7.3) + vite: 6.0.10(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0) + vite-node: 3.0.0-beta.2(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0) + optionalDependencies: + '@react-router/serve': 7.1.3(react-router@7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3) + typescript: 5.7.3 + wrangler: 3.103.2(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - bluebird + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + '@react-router/dev@7.1.3(@react-router/serve@7.1.3(react-router@7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3))(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(react-router@7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(sass@1.82.0)(stylus@0.62.0)(typescript@5.7.3)(vite@6.0.10(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0))(wrangler@3.103.2(@cloudflare/workers-types@4.20250121.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10))(yaml@2.7.0)': dependencies: '@babel/core': 7.26.0 @@ -10743,6 +10808,14 @@ snapshots: hoist-non-react-statics: 3.3.2 react: 19.0.0 + '@sentry/vite-plugin@3.0.0': + dependencies: + '@sentry/bundler-plugin-core': 3.0.0 + unplugin: 1.0.1 + transitivePeerDependencies: + - encoding + - supports-color + '@shazow/whatsabi@0.19.0(@noble/hashes@1.7.1)(typescript@5.7.3)(zod@3.24.1)': dependencies: '@noble/hashes': 1.7.1 @@ -14298,7 +14371,7 @@ snapshots: isomorphic-timers-promises@1.0.1: {} - isows@1.0.6(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)): + isows@1.0.6(ws@8.18.0): dependencies: ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -17111,7 +17184,7 @@ snapshots: '@scure/bip32': 1.6.0 '@scure/bip39': 1.5.0 abitype: 1.0.7(typescript@5.7.3)(zod@3.24.1) - isows: 1.0.6(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + isows: 1.0.6(ws@8.18.0) ox: 0.6.5(typescript@5.7.3)(zod@3.24.1) ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) optionalDependencies: @@ -17128,7 +17201,7 @@ snapshots: '@scure/bip32': 1.6.0 '@scure/bip39': 1.5.0 abitype: 1.0.7(typescript@5.7.3)(zod@3.24.1) - isows: 1.0.6(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + isows: 1.0.6(ws@8.18.0) ox: 0.6.0(typescript@5.7.3)(zod@3.24.1) webauthn-p256: 0.0.10 ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -17427,6 +17500,25 @@ snapshots: '@cloudflare/workerd-linux-arm64': 1.20241230.0 '@cloudflare/workerd-windows-64': 1.20241230.0 + wrangler@3.103.2(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@cloudflare/kv-asset-handler': 0.3.4 + '@esbuild-plugins/node-globals-polyfill': 0.2.3(esbuild@0.17.19) + '@esbuild-plugins/node-modules-polyfill': 0.2.2(esbuild@0.17.19) + blake3-wasm: 2.1.5 + esbuild: 0.17.19 + miniflare: 3.20241230.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + path-to-regexp: 6.3.0 + unenv: unenv-nightly@2.0.0-20250109-100802-88ad671 + workerd: 1.20241230.0 + optionalDependencies: + '@cloudflare/workers-types': 4.20250109.0 + fsevents: 2.3.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + wrangler@3.103.2(@cloudflare/workers-types@4.20250121.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10): dependencies: '@cloudflare/kv-asset-handler': 0.3.4