diff --git a/web/api/services/MapReport.ts b/web/api/services/MapReport.ts index e8eaf1b2..1f81f0ff 100644 --- a/web/api/services/MapReport.ts +++ b/web/api/services/MapReport.ts @@ -6,7 +6,7 @@ import { winRateAdjMergedMetric } from "~/lib/klicker.cubes" import { formatDistanceToNow, subWeeks, differenceInDays } from 'date-fns' import { FandomModeData } from "./FandomService" import { Locale, loadLocaleWithFallback, locales } from "~/locales" -import { config } from "~/config" +import { config } from "~/config/config" const comparingAccessoryQuery = (accessory: 'gears'|'gadgets'|'starpowers', slices: SliceValue) => { return { diff --git a/web/config.ts b/web/config/config.ts similarity index 100% rename from web/config.ts rename to web/config/config.ts diff --git a/web/manifest.ts b/web/config/manifest.ts similarity index 100% rename from web/manifest.ts rename to web/config/manifest.ts diff --git a/web/config/sentry.ts b/web/config/sentry.ts new file mode 100644 index 00000000..9427b30c --- /dev/null +++ b/web/config/sentry.ts @@ -0,0 +1,3 @@ +export const SENTRY_APPLICATION_KEY = 'brawltime' + +export const SENTRY_REPO = 'schneefux/brawltimeninja' diff --git a/web/locales/index.ts b/web/locales/index.ts index 4a88e1df..201419c6 100644 --- a/web/locales/index.ts +++ b/web/locales/index.ts @@ -1,4 +1,4 @@ -import { Config } from "~/config" +import { Config } from "~/config/config" import { Cache } from "~/lib/cache" const LOCALE_CACHE_MINUTES = 60 diff --git a/web/renderer/+onBeforeRender.ts b/web/renderer/+onBeforeRender.ts index 92d4f0b1..28c21bb2 100644 --- a/web/renderer/+onBeforeRender.ts +++ b/web/renderer/+onBeforeRender.ts @@ -2,7 +2,7 @@ import type { PageContext } from './types' import * as Sentry from '@sentry/vue' import { getTraduoraToken, TraduoraToken } from '~/locales' import { Dispatcher, Agent } from 'undici' -import { config, Config } from '~/config' +import { config, Config } from '~/config/config' export { onBeforeRender } diff --git a/web/renderer/router.ts b/web/renderer/router.ts index 06518a33..9d97e758 100644 --- a/web/renderer/router.ts +++ b/web/renderer/router.ts @@ -6,7 +6,7 @@ import routes from '~pages' import { AppI18n } from './app' import { PageContext } from './types' import { getPathWithLocale, getSelfOrigin } from '~/composables/compat' -import { Config } from '~/config' +import { Config } from '~/config/config' export { createRouter } diff --git a/web/renderer/sentry.ts b/web/renderer/sentry.ts index 052d1413..3754f107 100644 --- a/web/renderer/sentry.ts +++ b/web/renderer/sentry.ts @@ -7,6 +7,7 @@ import { reportingObserverIntegration, rewriteFramesIntegration, } from '@sentry/browser' +import { SENTRY_APPLICATION_KEY } from "~/config/sentry" export const SentryInjectionKey = Symbol('sentry') as InjectionKey @@ -31,18 +32,12 @@ export function initSentry(dsn: string, app: App, router?: Router) { maskAllInputs: false, blockAllMedia: false, }), + Sentry.thirdPartyErrorFilterIntegration({ + filterKeys: [SENTRY_APPLICATION_KEY], + behaviour: 'drop-error-if-exclusively-contains-third-party-frames', + }), ], ignoreErrors: [ - // ignore common errors triggered by ads - 'ReportingObserver [deprecation]', - '[GPT] ', - 'SYNC.JS', - 'ox_esp', - 'Tyche blocked', - 'fun-hooks: hooked function not ready', - 'The play() request was interrupted', - 'Geo location is undefined or empty', - '33Across Lexicon ID Mappings Provider: PID not found', // ignore errors that are not actionable 'Already on path:', 'Unable to preload CSS', diff --git a/web/renderer/types.ts b/web/renderer/types.ts index 635bba42..9a98b039 100644 --- a/web/renderer/types.ts +++ b/web/renderer/types.ts @@ -8,7 +8,7 @@ import * as SentryTypes from '@sentry/core' import type { PageContextBuiltInServer } from 'vike/types' import type { ComponentPublicInstance } from 'vue' import { LocaleIso } from '~/locales' -import { Config } from '~/config' +import { Config } from '~/config/config' type PageProps = Record diff --git a/web/vite.config.ts b/web/vite.config.ts index c9054c1a..e6cba1ce 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -10,7 +10,8 @@ import Pages from 'vite-plugin-pages' import { sentryVitePlugin } from '@sentry/vite-plugin' import { vavite } from 'vavite' import legacy from '@vitejs/plugin-legacy' -import manifest from './manifest' +import manifest from './config/manifest' +import { SENTRY_APPLICATION_KEY, SENTRY_REPO } from './config/sentry' const config: UserConfig = { buildSteps: [ @@ -57,11 +58,12 @@ const config: UserConfig = { ssr({ disableAutoFullBuild: true }), legacy(), process.env.VITE_GIT_REV != undefined ? sentryVitePlugin({ + applicationKey: SENTRY_APPLICATION_KEY, release: { name: `brawltimeninja@${process.env.VITE_GIT_REV}`, setCommits: { auto: false, - repo: 'schneefux/brawltimeninja', + repo: SENTRY_REPO, commit: process.env.VITE_GIT_REV, }, },