Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix build errors

Neeraj Gupta13f628aaaca0
diff --git a/apps/cast/next.config.js b/apps/cast/next.config.js
index 3d4340556e..d09487bad1 100644
--- a/apps/cast/next.config.js
+++ b/apps/cast/next.config.js
@@ -1,84 +1,3 @@
-const withBundleAnalyzer = require('@next/bundle-analyzer')({
- enabled: process.env.ANALYZE === 'true',
-});
+const nextConfigBase = require('@ente/shared/next/next.config.base.js');
-const { withSentryConfig } = require('@sentry/nextjs');
-const { PHASE_DEVELOPMENT_SERVER } = require('next/constants');
-
-const {
- getGitSha,
- convertToNextHeaderFormat,
- buildCSPHeader,
- WEB_SECURITY_HEADERS,
- CSP_DIRECTIVES,
- ALL_ROUTES,
- getIsSentryEnabled,
-} = require('./configUtil');
-
-const GIT_SHA = getGitSha();
-
-const IS_SENTRY_ENABLED = getIsSentryEnabled();
-
-module.exports = (phase) =>
- withSentryConfig(
- withBundleAnalyzer({
- sentry: {
- hideSourceMaps: false,
- widenClientFileUpload: true,
- },
- compiler: {
- emotion: {
- importMap: {
- '@mui/material': {
- styled: {
- canonicalImport: ['@emotion/styled', 'default'],
- styledBaseImport: ['@mui/material', 'styled'],
- },
- },
- '@mui/material/styles': {
- styled: {
- canonicalImport: ['@emotion/styled', 'default'],
- styledBaseImport: [
- '@mui/material/styles',
- 'styled',
- ],
- },
- },
- },
- },
- },
- transpilePackages: [
- '@mui/material',
- '@mui/system',
- '@mui/icons-material',
- ],
- env: {
- SENTRY_RELEASE: GIT_SHA,
- NEXT_PUBLIC_IS_TEST_APP: process.env.IS_TEST_RELEASE,
- },
-
- headers() {
- return [
- {
- // Apply these headers to all routes in your application....
- source: ALL_ROUTES,
- headers: convertToNextHeaderFormat({
- ...WEB_SECURITY_HEADERS,
- ...buildCSPHeader(CSP_DIRECTIVES),
- }),
- },
- ];
- },
- // https://dev.to/marcinwosinek/how-to-add-resolve-fallback-to-webpack-5-in-nextjs-10-i6j
- webpack: (config, { isServer }) => {
- if (!isServer) {
- config.resolve.fallback.fs = false;
- }
- return config;
- },
- }),
- {
- release: GIT_SHA,
- dryRun: phase === PHASE_DEVELOPMENT_SERVER || !IS_SENTRY_ENABLED,
- }
- );
+module.exports = nextConfigBase;
diff --git a/apps/cast/sentry.client.config.js b/apps/cast/sentry.client.config.js
index 2dc983f533..f07284c492 100644
--- a/apps/cast/sentry.client.config.js
+++ b/apps/cast/sentry.client.config.js
@@ -1,5 +1,2 @@
import { setupSentry } from '@ente/shared/sentry/config/sentry.config.base';
-
-const DEFAULT_SENTRY_DSN =
- 'https://[email protected]/2';
-setupSentry(DEFAULT_SENTRY_DSN);
+setupSentry('https://[email protected]/2');
diff --git a/apps/cast/src/constants/apps.ts b/apps/cast/src/constants/apps.ts
index 697de66868..5d54d176c9 100644
--- a/apps/cast/src/constants/apps.ts
+++ b/apps/cast/src/constants/apps.ts
@@ -1,4 +1,4 @@
-import { getAlbumsURL, getAuthURL } from '@ente/shared/network/api';
+import { getAlbumsURL } from '@ente/shared/network/api';
import { runningInBrowser } from '@ente/shared/platform';
import { PAGES } from 'constants/pages';
@@ -40,11 +40,8 @@ export const getAppNameAndTitle = () => {
}
const currentURL = new URL(window.location.href);
const albumsURL = new URL(getAlbumsURL());
- const authURL = new URL(getAuthURL());
if (currentURL.origin === albumsURL.origin) {
return { name: APPS.ALBUMS, title: 'ente Photos' };
- } else if (currentURL.origin === authURL.origin) {
- return { name: APPS.AUTH, title: 'ente Auth' };
} else {
return { name: APPS.PHOTOS, title: 'ente Photos' };
}