Skip to content

Commit

Permalink
chore: correctly set sentry version
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdvlpr committed Dec 6, 2024
1 parent aa5ab16 commit e4d75f8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 33 deletions.
45 changes: 19 additions & 26 deletions quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const { mergeConfig } = require('vite'); // use mergeConfig helper to avoid over

const { repository, version } = require('./package.json');

const SENTRY_ORG = 'jw-projects';
const SENTRY_PROJECT = 'mmm-v2';
const SENTRY_VERSION = `meeting-media-manager@${version}`;

module.exports = configure(function (ctx) {
return {
// https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
Expand All @@ -34,25 +38,18 @@ module.exports = configure(function (ctx) {
},
extendViteConf(viteConf) {
viteConf.optimizeDeps = mergeConfig(viteConf, {
esbuildOptions: {
define: {
global: 'window',
},
},
esbuildOptions: { define: { global: 'window' } },
});
if (ctx.prod && !ctx.debug) {
viteConf.build = mergeConfig(viteConf.build, {
sourcemap: true,
});
if (ctx.prod && !ctx.debug && process.env.SENTRY_AUTH_TOKEN) {
if (!viteConf.build) viteConf.build = {};
viteConf.build.sourcemap = true;
if (!viteConf.plugins) viteConf.plugins = [];
viteConf.plugins.push(
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'jw-projects',
project: 'mmm-v2',
release: {
name: version,
},
org: SENTRY_ORG,
project: SENTRY_PROJECT,
release: { name: SENTRY_VERSION },
telemetry: false,
}),
);
Expand Down Expand Up @@ -137,34 +134,30 @@ module.exports = configure(function (ctx) {
},
bundler: 'builder', // 'packager' or 'builder'
extendElectronMainConf: (esbuildConf) => {
if (ctx.prod && !ctx.debug) {
if (ctx.prod && !ctx.debug && process.env.SENTRY_AUTH_TOKEN) {
esbuildConf.sourcemap = true;
if (!esbuildConf.plugins) esbuildConf.plugins = [];
esbuildConf.plugins.push(
sentryEsbuildPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'jw-projects',
project: 'mmm-v2',
release: {
name: version,
},
org: SENTRY_ORG,
project: SENTRY_PROJECT,
release: { name: SENTRY_VERSION },
telemetry: false,
}),
);
}
},
extendElectronPreloadConf: (esbuildConf) => {
if (ctx.prod && !ctx.debug) {
if (ctx.prod && !ctx.debug && process.env.SENTRY_AUTH_TOKEN) {
esbuildConf.sourcemap = true;
if (!esbuildConf.plugins) esbuildConf.plugins = [];
esbuildConf.plugins.push(
sentryEsbuildPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'jw-projects',
project: 'mmm-v2',
release: {
name: version,
},
org: SENTRY_ORG,
project: SENTRY_PROJECT,
release: { name: SENTRY_VERSION },
telemetry: false,
}),
);
Expand Down
6 changes: 3 additions & 3 deletions src-electron/electron-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
type MenuItemConstructorOptions,
shell,
} from 'electron';
import { SENTRY_DSN } from 'src/constants/sentry';
import { join } from 'upath';

import { PLATFORM } from './constants';
Expand Down Expand Up @@ -45,10 +46,9 @@ if (process.env.PORTABLE_EXECUTABLE_DIR) {
}

initSentry({
debug: true,
dsn: 'https://[email protected]/4507449197920256',
dsn: SENTRY_DSN,
environment: process.env.NODE_ENV,
release: version,
release: `meeting-media-manager@${version}`,
tracesSampleRate: 1.0,
});

Expand Down
9 changes: 5 additions & 4 deletions src/boot/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,32 @@ import {
} from '@sentry/vue';
import { boot } from 'quasar/wrappers';
import { IS_DEV } from 'src/constants/general';
import { SENTRY_DSN } from 'src/constants/sentry';
import { errorCatcher } from 'src/helpers/error-catcher';

import { version } from '../../package.json';

export default boot(({ app, router }) => {
try {
if (!IS_DEV)
if (!IS_DEV) {
init(
{
// @ts-expect-error: app does not exist on Sentry renderer, but it does on Sentry vue
app,
debug: true,
dsn: 'https://[email protected]/4507449197920256',
dsn: SENTRY_DSN,
integrations: [
vueIntegration({ app }),
browserTracingIntegration({ router }),
replayIntegration(),
],
release: version,
release: `meeting-media-manager@${version}`,
replaysOnErrorSampleRate: 1.0,
replaysSessionSampleRate: 0,
tracesSampleRate: 1.0,
},
initVue,
);
}
} catch (error) {
errorCatcher(error);
}
Expand Down
2 changes: 2 additions & 0 deletions src/constants/sentry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const SENTRY_DSN =
'https://[email protected]/4507449197920256';

0 comments on commit e4d75f8

Please sign in to comment.