File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 PLANETSCALE_SERVICE_TOKEN_NAME : ${{ secrets.PLANETSCALE_SERVICE_TOKEN_NAME }}
3737 PLANETSCALE_SERVICE_TOKEN : ${{ secrets.PLANETSCALE_SERVICE_TOKEN }}
3838 STRIPE_SECRET_KEY : ${{ github.ref_name == 'production' && secrets.STRIPE_SECRET_KEY_PROD || secrets.STRIPE_SECRET_KEY_DEV }}
39+ SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
40+ SENTRY_ORG : ${{ vars.SENTRY_ORG }}
41+ SENTRY_PROJECT : ${{ vars.SENTRY_PROJECT }}
42+ SENTRY_RELEASE : web@${{ github.sha }}
43+ VITE_SENTRY_DSN : ${{ secrets.SENTRY_DSN }}
44+ VITE_SENTRY_ENVIRONMENT : web-${{ github.ref_name }}
45+ VITE_SENTRY_RELEASE : web@${{ github.sha }}
Original file line number Diff line number Diff line change @@ -368,6 +368,13 @@ jobs:
368368 APPLE_API_ISSUER : ${{ secrets.APPLE_API_ISSUER }}
369369 APPLE_API_KEY : ${{ secrets.APPLE_API_KEY }}
370370 APPLE_API_KEY_PATH : ${{ runner.temp }}/apple-api-key.p8
371+ SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
372+ SENTRY_ORG : ${{ vars.SENTRY_ORG }}
373+ SENTRY_PROJECT : ${{ vars.SENTRY_PROJECT }}
374+ SENTRY_RELEASE : desktop@${{ needs.version.outputs.version }}
375+ VITE_SENTRY_DSN : ${{ secrets.SENTRY_DSN }}
376+ VITE_SENTRY_ENVIRONMENT : desktop-${{ github.ref_name }}
377+ VITE_SENTRY_RELEASE : desktop@${{ needs.version.outputs.version }}
371378
372379 - name : Verify signed Windows desktop artifacts
373380 if : runner.os == 'Windows'
Original file line number Diff line number Diff line change 7474 "@solidjs/meta" : " 0.29.4" ,
7575 "@solidjs/router" : " 0.15.4" ,
7676 "@solidjs/start" : " https://pkg.pr.new/@solidjs/start@dfb2020" ,
77+ "@sentry/solid" : " 10.36.0" ,
78+ "@sentry/vite-plugin" : " 4.6.0" ,
7779 "solid-js" : " 1.9.10" ,
7880 "vite-plugin-solid" : " 2.11.10" ,
7981 "@lydell/node-pty" : " 1.2.0-beta.10"
Original file line number Diff line number Diff line change 2727 "devDependencies" : {
2828 "@happy-dom/global-registrator" : " 20.0.11" ,
2929 "@playwright/test" : " catalog:" ,
30+ "@sentry/vite-plugin" : " catalog:" ,
3031 "@tailwindcss/vite" : " catalog:" ,
3132 "@tsconfig/bun" : " 1.0.9" ,
3233 "@types/bun" : " catalog:" ,
4041 },
4142 "dependencies" : {
4243 "@kobalte/core" : " catalog:" ,
44+ "@sentry/solid" : " catalog:" ,
4345 "@opencode-ai/sdk" : " workspace:*" ,
4446 "@opencode-ai/ui" : " workspace:*" ,
4547 "@opencode-ai/shared" : " workspace:*" ,
Original file line number Diff line number Diff line change 11import "@/index.css"
2+ import * as Sentry from "@sentry/solid"
23import { I18nProvider } from "@opencode-ai/ui/context"
34import { DialogProvider } from "@opencode-ai/ui/context/dialog"
45import { FileComponentProvider } from "@opencode-ai/ui/context/file"
@@ -140,7 +141,12 @@ export function AppBaseProviders(props: ParentProps<{ locale?: Locale }>) {
140141 >
141142 < LanguageProvider locale = { props . locale } >
142143 < UiI18nBridge >
143- < ErrorBoundary fallback = { ( error ) => < ErrorPage error = { error } /> } >
144+ < ErrorBoundary
145+ fallback = { ( error ) => {
146+ Sentry . captureException ( error )
147+ return < ErrorPage error = { error } />
148+ } }
149+ >
144150 < QueryProvider >
145151 < DialogProvider >
146152 < MarkedProvider >
Original file line number Diff line number Diff line change 11// @refresh reload
22
3+ import * as Sentry from "@sentry/solid"
34import { render } from "solid-js/web"
45import { AppBaseProviders , AppInterface } from "@/app"
56import { type Platform , PlatformProvider } from "@/context/platform"
@@ -125,6 +126,19 @@ const platform: Platform = {
125126 setDefaultServer : writeDefaultServerUrl ,
126127}
127128
129+ if ( ! import . meta. env . DEV && import . meta. env . VITE_SENTRY_DSN ) {
130+ Sentry . init ( {
131+ dsn : import . meta. env . VITE_SENTRY_DSN ,
132+ environment : import . meta. env . VITE_SENTRY_ENVIRONMENT ?? import . meta. env . MODE ,
133+ release : import . meta. env . VITE_SENTRY_RELEASE ?? `web@${ pkg . version } ` ,
134+ initialScope : {
135+ tags : {
136+ platform : "web" ,
137+ } ,
138+ } ,
139+ } )
140+ }
141+
128142if ( root instanceof HTMLElement ) {
129143 const server : ServerConnection . Http = { type : "http" , http : { url : getCurrentUrl ( ) } }
130144 render (
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ interface ImportMetaEnv {
44 readonly VITE_OPENCODE_SERVER_HOST : string
55 readonly VITE_OPENCODE_SERVER_PORT : string
66 readonly OPENCODE_CHANNEL ?: "dev" | "beta" | "prod"
7+
8+ readonly VITE_SENTRY_DSN ?: string
9+ readonly VITE_SENTRY_ENVIRONMENT ?: string
10+ readonly VITE_SENTRY_RELEASE ?: string
711}
812
913interface ImportMeta {
Original file line number Diff line number Diff line change 1+ import { sentryVitePlugin } from "@sentry/vite-plugin"
12import { defineConfig } from "vite"
23import desktopPlugin from "./vite"
34
5+ const sentry =
6+ process . env . SENTRY_AUTH_TOKEN && process . env . SENTRY_ORG && process . env . SENTRY_PROJECT
7+ ? sentryVitePlugin ( {
8+ authToken : process . env . SENTRY_AUTH_TOKEN ,
9+ org : process . env . SENTRY_ORG ,
10+ project : process . env . SENTRY_PROJECT ,
11+ telemetry : false ,
12+ release : {
13+ name : process . env . SENTRY_RELEASE ?? process . env . VITE_SENTRY_RELEASE ,
14+ } ,
15+ sourcemaps : {
16+ assets : "./dist/**" ,
17+ filesToDeleteAfterUpload : "./dist/**/*.map" ,
18+ } ,
19+ } )
20+ : false
21+
422export default defineConfig ( {
5- plugins : [ desktopPlugin ] as any ,
23+ plugins : [ desktopPlugin , sentry ] as any ,
624 server : {
725 host : "0.0.0.0" ,
826 allowedHosts : true ,
927 port : 3000 ,
1028 } ,
1129 build : {
1230 target : "esnext" ,
13- // sourcemap: true,
31+ sourcemap : true ,
1432 } ,
1533} )
Original file line number Diff line number Diff line change 1515 "dependencies" : {
1616 "@opencode-ai/app" : " workspace:*" ,
1717 "@opencode-ai/ui" : " workspace:*" ,
18+ "@sentry/solid" : " catalog:" ,
1819 "@solid-primitives/i18n" : " 2.2.1" ,
1920 "@solid-primitives/storage" : " catalog:" ,
2021 "@tauri-apps/api" : " ^2" ,
3536 },
3637 "devDependencies" : {
3738 "@actions/artifact" : " 4.0.0" ,
39+ "@sentry/vite-plugin" : " catalog:" ,
3840 "@tauri-apps/cli" : " ^2" ,
3941 "@types/bun" : " catalog:" ,
4042 "@typescript/native-preview" : " catalog:" ,
You can’t perform that action at this time.
0 commit comments