- Move ref assignments from render to useEffect (useViewportCommentRead, useViewportObserver) - Copy ref.current to local variable for effect cleanup closure - Add eslint-disable for intentional ref-as-cache pattern (useStableTeamMentionMeta) - Fix !== always-true comparison between undefined and null (store) - Add missing return types (sentry, composerDraftStorage) - Remove unused import isLeadAgentType (memberHelpers) - Suppress naming-convention warning for Vite-injected __APP_VERSION__
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
/**
|
|
* Shared Sentry configuration constants.
|
|
*
|
|
* Used by both main and renderer process init modules.
|
|
* Does NOT resolve DSN — each process does that with its own env access
|
|
* (main: process.env, renderer: import.meta.env).
|
|
*/
|
|
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention -- Vite `define` injects this global
|
|
declare const __APP_VERSION__: string;
|
|
|
|
/** Release identifier injected at build time via Vite `define`. */
|
|
export const SENTRY_RELEASE =
|
|
typeof __APP_VERSION__ === 'string' ? `claude-agent-teams-ui@${__APP_VERSION__}` : undefined;
|
|
|
|
/** Environment derived from Node/Vite mode. */
|
|
export const SENTRY_ENVIRONMENT =
|
|
process.env.NODE_ENV === 'production' ? 'production' : 'development';
|
|
|
|
/** Performance trace sample rate (production: 10%, dev: 100%). */
|
|
export const TRACES_SAMPLE_RATE = process.env.NODE_ENV === 'production' ? 0.1 : 1.0;
|
|
|
|
/** Validate that a string looks like a Sentry DSN. */
|
|
export function isValidDsn(dsn: string | undefined): dsn is string {
|
|
return typeof dsn === 'string' && dsn.length > 0 && dsn.startsWith('https://');
|
|
}
|