mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-21 16:01:35 +08:00
build: remove sentry integration
This commit is contained in:
parent
7a7b24fe2f
commit
25b1e309ed
3
.gitignore
vendored
3
.gitignore
vendored
@ -51,6 +51,3 @@ local
|
|||||||
coverage
|
coverage
|
||||||
.vitest-cache
|
.vitest-cache
|
||||||
vitest.config.*.timestamp-*
|
vitest.config.*.timestamp-*
|
||||||
|
|
||||||
# Sentry Config File
|
|
||||||
.env.sentry-build-plugin
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import { sentryVitePlugin } from '@sentry/vite-plugin'
|
|
||||||
import react from '@vitejs/plugin-react-swc'
|
import react from '@vitejs/plugin-react-swc'
|
||||||
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
@ -65,11 +64,6 @@ export default defineConfig({
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
sentryVitePlugin({
|
|
||||||
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
||||||
org: 'cherry-ai',
|
|
||||||
project: 'cherry-studio'
|
|
||||||
}),
|
|
||||||
...visualizerPlugin('renderer')
|
...visualizerPlugin('renderer')
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
@ -72,7 +72,6 @@
|
|||||||
"@langchain/community": "^0.3.36",
|
"@langchain/community": "^0.3.36",
|
||||||
"@mozilla/readability": "^0.6.0",
|
"@mozilla/readability": "^0.6.0",
|
||||||
"@notionhq/client": "^2.2.15",
|
"@notionhq/client": "^2.2.15",
|
||||||
"@sentry/electron": "^6.5.0",
|
|
||||||
"@strongtz/win32-arm64-msvc": "^0.4.7",
|
"@strongtz/win32-arm64-msvc": "^0.4.7",
|
||||||
"@tryfabric/martian": "^1.2.4",
|
"@tryfabric/martian": "^1.2.4",
|
||||||
"@types/react-infinite-scroll-component": "^5.0.0",
|
"@types/react-infinite-scroll-component": "^5.0.0",
|
||||||
@ -127,8 +126,6 @@
|
|||||||
"@modelcontextprotocol/sdk": "^1.9.0",
|
"@modelcontextprotocol/sdk": "^1.9.0",
|
||||||
"@notionhq/client": "^2.2.15",
|
"@notionhq/client": "^2.2.15",
|
||||||
"@reduxjs/toolkit": "^2.2.5",
|
"@reduxjs/toolkit": "^2.2.5",
|
||||||
"@sentry/react": "^9.13.0",
|
|
||||||
"@sentry/vite-plugin": "^3.3.1",
|
|
||||||
"@swc/plugin-styled-components": "^7.1.3",
|
"@swc/plugin-styled-components": "^7.1.3",
|
||||||
"@tavily/core": "patch:@tavily/core@npm%3A0.3.1#~/.yarn/patches/@tavily-core-npm-0.3.1-fe69bf2bea.patch",
|
"@tavily/core": "patch:@tavily/core@npm%3A0.3.1#~/.yarn/patches/@tavily-core-npm-0.3.1-fe69bf2bea.patch",
|
||||||
"@tryfabric/martian": "^1.2.4",
|
"@tryfabric/martian": "^1.2.4",
|
||||||
|
|||||||
@ -160,7 +160,4 @@ export enum IpcChannel {
|
|||||||
SearchWindow_Open = 'search-window:open',
|
SearchWindow_Open = 'search-window:open',
|
||||||
SearchWindow_Close = 'search-window:close',
|
SearchWindow_Close = 'search-window:close',
|
||||||
SearchWindow_OpenUrl = 'search-window:open-url',
|
SearchWindow_OpenUrl = 'search-window:open-url',
|
||||||
|
|
||||||
// sentry
|
|
||||||
Sentry_Init = 'sentry:init'
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import { app, ipcMain } from 'electron'
|
|||||||
import installExtension, { REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } from 'electron-devtools-installer'
|
import installExtension, { REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } from 'electron-devtools-installer'
|
||||||
import Logger from 'electron-log'
|
import Logger from 'electron-log'
|
||||||
|
|
||||||
import { initSentry } from './integration/sentry'
|
|
||||||
import { registerIpc } from './ipc'
|
import { registerIpc } from './ipc'
|
||||||
import { configManager } from './services/ConfigManager'
|
import { configManager } from './services/ConfigManager'
|
||||||
import mcpService from './services/MCPService'
|
import mcpService from './services/MCPService'
|
||||||
@ -112,4 +111,3 @@ if (!app.requestSingleInstanceLock()) {
|
|||||||
// code. You can also put them in separate files and require them here.
|
// code. You can also put them in separate files and require them here.
|
||||||
}
|
}
|
||||||
|
|
||||||
initSentry()
|
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
import { configManager } from '@main/services/ConfigManager'
|
|
||||||
import * as Sentry from '@sentry/electron/main'
|
|
||||||
import { app } from 'electron'
|
|
||||||
|
|
||||||
export function initSentry() {
|
|
||||||
if (configManager.getEnableDataCollection()) {
|
|
||||||
Sentry.init({
|
|
||||||
dsn: 'https://194ceab3bd44e686bd3ebda9de3c20fd@o4509184559218688.ingest.us.sentry.io/4509184569442304',
|
|
||||||
environment: app.isPackaged ? 'production' : 'development'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -9,7 +9,6 @@ import { BrowserWindow, ipcMain, session, shell } from 'electron'
|
|||||||
import log from 'electron-log'
|
import log from 'electron-log'
|
||||||
|
|
||||||
import { titleBarOverlayDark, titleBarOverlayLight } from './config'
|
import { titleBarOverlayDark, titleBarOverlayLight } from './config'
|
||||||
import { initSentry } from './integration/sentry'
|
|
||||||
import AppUpdater from './services/AppUpdater'
|
import AppUpdater from './services/AppUpdater'
|
||||||
import BackupManager from './services/BackupManager'
|
import BackupManager from './services/BackupManager'
|
||||||
import { configManager } from './services/ConfigManager'
|
import { configManager } from './services/ConfigManager'
|
||||||
@ -343,7 +342,4 @@ export function registerIpc(mainWindow: BrowserWindow, app: Electron.App) {
|
|||||||
ipcMain.handle(IpcChannel.SearchWindow_OpenUrl, async (_, uid: string, url: string) => {
|
ipcMain.handle(IpcChannel.SearchWindow_OpenUrl, async (_, uid: string, url: string) => {
|
||||||
return await searchService.openUrlInSearchWindow(uid, url)
|
return await searchService.openUrlInSearchWindow(uid, url)
|
||||||
})
|
})
|
||||||
|
|
||||||
// sentry
|
|
||||||
ipcMain.handle(IpcChannel.Sentry_Init, () => initSentry())
|
|
||||||
}
|
}
|
||||||
|
|||||||
3
src/preload/index.d.ts
vendored
3
src/preload/index.d.ts
vendored
@ -33,9 +33,6 @@ declare global {
|
|||||||
setAutoUpdate: (isActive: boolean) => void
|
setAutoUpdate: (isActive: boolean) => void
|
||||||
reload: () => void
|
reload: () => void
|
||||||
clearCache: () => Promise<{ success: boolean; error?: string }>
|
clearCache: () => Promise<{ success: boolean; error?: string }>
|
||||||
sentry: {
|
|
||||||
init: () => Promise<void>
|
|
||||||
}
|
|
||||||
system: {
|
system: {
|
||||||
getDeviceType: () => Promise<'mac' | 'windows' | 'linux'>
|
getDeviceType: () => Promise<'mac' | 'windows' | 'linux'>
|
||||||
getHostname: () => Promise<string>
|
getHostname: () => Promise<string>
|
||||||
|
|||||||
@ -23,9 +23,6 @@ const api = {
|
|||||||
setAutoUpdate: (isActive: boolean) => ipcRenderer.invoke(IpcChannel.App_SetAutoUpdate, isActive),
|
setAutoUpdate: (isActive: boolean) => ipcRenderer.invoke(IpcChannel.App_SetAutoUpdate, isActive),
|
||||||
openWebsite: (url: string) => ipcRenderer.invoke(IpcChannel.Open_Website, url),
|
openWebsite: (url: string) => ipcRenderer.invoke(IpcChannel.Open_Website, url),
|
||||||
clearCache: () => ipcRenderer.invoke(IpcChannel.App_ClearCache),
|
clearCache: () => ipcRenderer.invoke(IpcChannel.App_ClearCache),
|
||||||
sentry: {
|
|
||||||
init: () => ipcRenderer.invoke(IpcChannel.Sentry_Init)
|
|
||||||
},
|
|
||||||
system: {
|
system: {
|
||||||
getDeviceType: () => ipcRenderer.invoke(IpcChannel.System_GetDeviceType),
|
getDeviceType: () => ipcRenderer.invoke(IpcChannel.System_GetDeviceType),
|
||||||
getHostname: () => ipcRenderer.invoke(IpcChannel.System_GetHostname)
|
getHostname: () => ipcRenderer.invoke(IpcChannel.System_GetHostname)
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import { isLocalAi } from '@renderer/config/env'
|
|||||||
import { useTheme } from '@renderer/context/ThemeProvider'
|
import { useTheme } from '@renderer/context/ThemeProvider'
|
||||||
import db from '@renderer/databases'
|
import db from '@renderer/databases'
|
||||||
import i18n from '@renderer/i18n'
|
import i18n from '@renderer/i18n'
|
||||||
import { initSentry } from '@renderer/init'
|
|
||||||
import { useAppDispatch } from '@renderer/store'
|
import { useAppDispatch } from '@renderer/store'
|
||||||
import { setAvatar, setFilesPath, setResourcesPath, setUpdateState } from '@renderer/store/runtime'
|
import { setAvatar, setFilesPath, setResourcesPath, setUpdateState } from '@renderer/store/runtime'
|
||||||
import { delay, runAsyncFunction } from '@renderer/utils'
|
import { delay, runAsyncFunction } from '@renderer/utils'
|
||||||
@ -106,6 +105,6 @@ export function useAppInit() {
|
|||||||
}, [customCss])
|
}, [customCss])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
enableDataCollection && initSentry()
|
// TODO: init data collection
|
||||||
}, [enableDataCollection])
|
}, [enableDataCollection])
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
import KeyvStorage from '@kangfenmao/keyv-storage'
|
import KeyvStorage from '@kangfenmao/keyv-storage'
|
||||||
import * as Sentry from '@sentry/electron/renderer'
|
|
||||||
import { init as reactInit } from '@sentry/react'
|
|
||||||
|
|
||||||
import { startAutoSync } from './services/BackupService'
|
import { startAutoSync } from './services/BackupService'
|
||||||
import { startNutstoreAutoSync } from './services/NutstoreService'
|
import { startNutstoreAutoSync } from './services/NutstoreService'
|
||||||
@ -31,17 +29,6 @@ function initAutoSync() {
|
|||||||
}, 8000)
|
}, 8000)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initSentry() {
|
|
||||||
Sentry.init(
|
|
||||||
{
|
|
||||||
sendDefaultPii: true,
|
|
||||||
tracesSampleRate: 1.0,
|
|
||||||
integrations: [Sentry.browserTracingIntegration()]
|
|
||||||
},
|
|
||||||
reactInit as any
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
initSpinner()
|
initSpinner()
|
||||||
initKeyv()
|
initKeyv()
|
||||||
initAutoSync()
|
initAutoSync()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user