Forráskód Böngészése

move sentry constants to constants/sentry

Abhinav 3 éve
szülő
commit
fbf6476d70
4 módosított fájl, 14 hozzáadás és 10 törlés
  1. 0 8
      configUtil.js
  2. 1 1
      sentry.client.config.js
  3. 1 1
      sentry.server.config.js
  4. 12 0
      src/constants/sentry/index.ts

+ 0 - 8
configUtil.js

@@ -51,14 +51,6 @@ module.exports = {
             encoding: 'utf8',
         }),
 
-    getSentryDSN: () =>
-        process.env.NEXT_PUBLIC_SENTRY_DSN ??
-        'https://860186db60c54c7fbacfe255124958e8@errors.ente.io/4',
-
-    getSentryENV: () => process.env.NEXT_PUBLIC_SENTRY_ENV ?? 'development',
-
-    getSentryRelease: () => process.env.SENTRY_RELEASE,
-
     isSentryEnabled: () =>
         process.env.SENTRY_ENABLED ??
         (process.env.NEXT_PUBLIC_SENTRY_ENV ?? 'development') !== 'development',

+ 1 - 1
sentry.client.config.js

@@ -6,7 +6,7 @@ import {
     getSentryENV,
     getSentryRelease,
     isSentryEnabled,
-} from './configUtil';
+} from 'constants/sentry';
 
 const SENTRY_DSN = getSentryDSN();
 const SENTRY_ENV = getSentryENV();

+ 1 - 1
sentry.server.config.js

@@ -4,7 +4,7 @@ import {
     getSentryENV,
     getSentryRelease,
     isSentryEnabled,
-} from './configUtil';
+} from 'constants/sentry';
 
 const SENTRY_DSN = getSentryDSN();
 const SENTRY_ENV = getSentryENV();

+ 12 - 0
src/constants/sentry/index.ts

@@ -0,0 +1,12 @@
+export const getSentryDSN = () =>
+    process.env.NEXT_PUBLIC_SENTRY_DSN ??
+    'https://860186db60c54c7fbacfe255124958e8@errors.ente.io/4';
+
+export const getSentryENV = () =>
+    process.env.NEXT_PUBLIC_SENTRY_ENV ?? 'development';
+
+export const getSentryRelease = () => process.env.SENTRY_RELEASE;
+
+export const isSentryEnabled = () =>
+    process.env.SENTRY_ENABLED ??
+    (process.env.NEXT_PUBLIC_SENTRY_ENV ?? 'development') !== 'development';