Skip to content

Commit 8854cbf

Browse files
committed
focus on electron
1 parent 32b97f7 commit 8854cbf

6 files changed

Lines changed: 26 additions & 43 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ jobs:
3838
STRIPE_SECRET_KEY: ${{ github.ref_name == 'production' && secrets.STRIPE_SECRET_KEY_PROD || secrets.STRIPE_SECRET_KEY_DEV }}
3939
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
4040
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
41-
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
41+
SENTRY_PROJECT: ${{ vars.WEB_SENTRY_PROJECT }}
4242
SENTRY_RELEASE: web@${{ github.sha }}
43-
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
44-
VITE_SENTRY_ENVIRONMENT: web-${{ github.ref_name }}
43+
VITE_SENTRY_DSN: ${{ secrets.WEB_SENTRY_DSN }}
4544
VITE_SENTRY_RELEASE: web@${{ github.sha }}

.github/workflows/publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,6 @@ 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 }}
378371

379372
- name: Verify signed Windows desktop artifacts
380373
if: runner.os == 'Windows'
@@ -497,6 +490,13 @@ jobs:
497490
working-directory: packages/desktop-electron
498491
env:
499492
OPENCODE_CHANNEL: ${{ (github.ref_name == 'beta' && 'beta') || 'prod' }}
493+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
494+
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
495+
SENTRY_PROJECT: ${{ vars.WEB_SENTRY_PROJECT }}
496+
SENTRY_RELEASE: desktop@${{ needs.version.outputs.version }}
497+
VITE_SENTRY_DSN: ${{ secrets.WEB_SENTRY_DSN }}
498+
VITE_SENTRY_ENVIRONMENT: ${{ (github.ref_name == 'beta' && 'beta') || 'production' }}
499+
VITE_SENTRY_RELEASE: desktop@${{ needs.version.outputs.version }}
500500

501501
- name: Package and publish
502502
if: needs.version.outputs.release

packages/app/src/entry.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const platform: Platform = {
126126
setDefaultServer: writeDefaultServerUrl,
127127
}
128128

129-
if (!import.meta.env.DEV && import.meta.env.VITE_SENTRY_DSN) {
129+
if (import.meta.env.VITE_SENTRY_DSN) {
130130
Sentry.init({
131131
dsn: import.meta.env.VITE_SENTRY_DSN,
132132
environment: import.meta.env.VITE_SENTRY_ENVIRONMENT ?? import.meta.env.MODE,
@@ -136,6 +136,12 @@ if (!import.meta.env.DEV && import.meta.env.VITE_SENTRY_DSN) {
136136
platform: "web",
137137
},
138138
},
139+
integrations: (integrations) => {
140+
return integrations.filter(
141+
(i) =>
142+
i.name !== "Breadcrumbs" && !(import.meta.env.OPENCODE_CHANNEL === "prod" && i.name === "GlobalHandlers"),
143+
)
144+
},
139145
})
140146
}
141147

packages/desktop-electron/src/renderer/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
3131
throw new Error(t("error.dev.rootNotFound"))
3232
}
3333

34-
if (!import.meta.env.DEV && import.meta.env.VITE_SENTRY_DSN) {
34+
if (import.meta.env.VITE_SENTRY_DSN) {
3535
Sentry.init({
3636
dsn: import.meta.env.VITE_SENTRY_DSN,
3737
environment: import.meta.env.VITE_SENTRY_ENVIRONMENT ?? import.meta.env.MODE,
@@ -41,6 +41,12 @@ if (!import.meta.env.DEV && import.meta.env.VITE_SENTRY_DSN) {
4141
platform: "desktop-electron",
4242
},
4343
},
44+
integrations: (integrations) => {
45+
return integrations.filter(
46+
(i) =>
47+
i.name !== "Breadcrumbs" && !(import.meta.env.OPENCODE_CHANNEL === "prod" && i.name === "GlobalHandlers"),
48+
)
49+
},
4450
})
4551
}
4652

@@ -326,6 +332,8 @@ render(() => {
326332
}
327333
})
328334

335+
throw new Error("Test2")
336+
329337
return null
330338
}
331339

packages/desktop/src/index.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,6 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
4343
throw new Error(t("error.dev.rootNotFound"))
4444
}
4545

46-
if (!import.meta.env.DEV && import.meta.env.VITE_SENTRY_DSN) {
47-
Sentry.init({
48-
dsn: import.meta.env.VITE_SENTRY_DSN,
49-
environment: import.meta.env.VITE_SENTRY_ENVIRONMENT ?? import.meta.env.MODE,
50-
release: import.meta.env.VITE_SENTRY_RELEASE ?? `desktop-tauri@${pkg.version}`,
51-
initialScope: {
52-
tags: {
53-
platform: "desktop-tauri",
54-
},
55-
},
56-
})
57-
}
58-
5946
void initI18n()
6047

6148
let update: Update | null = null

packages/desktop/vite.config.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
1-
import { sentryVitePlugin } from "@sentry/vite-plugin"
21
import { defineConfig } from "vite"
32
import appPlugin from "@opencode-ai/app/vite"
43

54
const host = process.env.TAURI_DEV_HOST
6-
const sentry =
7-
process.env.SENTRY_AUTH_TOKEN && process.env.SENTRY_ORG && process.env.SENTRY_PROJECT
8-
? sentryVitePlugin({
9-
authToken: process.env.SENTRY_AUTH_TOKEN,
10-
org: process.env.SENTRY_ORG,
11-
project: process.env.SENTRY_PROJECT,
12-
telemetry: false,
13-
release: {
14-
name: process.env.SENTRY_RELEASE ?? process.env.VITE_SENTRY_RELEASE,
15-
},
16-
sourcemaps: {
17-
assets: "./dist/**",
18-
filesToDeleteAfterUpload: "./dist/**/*.map",
19-
},
20-
})
21-
: false
225

236
// https://vite.dev/config/
247
export default defineConfig({
25-
plugins: [appPlugin, sentry],
8+
plugins: [appPlugin],
269
publicDir: "../app/public",
2710
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
2811
//

0 commit comments

Comments
 (0)