Rename Deployment to Build

Perhaps (perhaps) this better conveys the fact that the build itself is a static
entity that doesn't and cannot change after deployment.
This commit is contained in:
Manav Rathi 2024-02-10 15:33:10 +05:30
parent 3ad29a504c
commit fc695eff75
3 changed files with 13 additions and 13 deletions

View file

@ -29,7 +29,7 @@
#
# 2. Sentry crash reporting etc is disabled
#
# See `isDevDeployment` for the exact rules for determining what counts as a
# See `isDevBuild` for the exact rules for determining what counts as a
# development build.
# The ente API endpoint

View file

@ -1,7 +1,7 @@
import {
getEndpoint,
getFamilyPortalURL,
isDevDeployment,
isDevBuild,
} from '@ente/shared/network/api';
import { getData, LS_KEYS } from '@ente/shared/storage/localStorage';
import localForage from '@ente/shared/storage/localForage';
@ -326,7 +326,7 @@ export async function getDisableCFUploadProxyFlag(): Promise<boolean> {
try {
const disableCFUploadProxy =
process.env.NEXT_PUBLIC_DISABLE_CF_UPLOAD_PROXY;
if (isDevDeployment() && typeof disableCFUploadProxy !== 'undefined') {
if (isDevBuild() && typeof disableCFUploadProxy !== 'undefined') {
return disableCFUploadProxy === 'true';
}
const featureFlags = (

View file

@ -1,6 +1,6 @@
export const getEndpoint = () => {
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
if (isDevDeployment() && endpoint) {
if (isDevBuild() && endpoint) {
return endpoint;
}
return 'https://api.ente.io';
@ -8,7 +8,7 @@ export const getEndpoint = () => {
export const getFileURL = (id: number) => {
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
if (isDevDeployment() && endpoint) {
if (isDevBuild() && endpoint) {
return `${endpoint}/files/download/${id}`;
}
return `https://files.ente.io/?fileID=${id}`;
@ -16,7 +16,7 @@ export const getFileURL = (id: number) => {
export const getPublicCollectionFileURL = (id: number) => {
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
if (isDevDeployment() && endpoint) {
if (isDevBuild() && endpoint) {
return `${endpoint}/public-collection/files/download/${id}`;
}
return `https://public-albums.ente.io/download/?fileID=${id}`;
@ -24,7 +24,7 @@ export const getPublicCollectionFileURL = (id: number) => {
export const getThumbnailURL = (id: number) => {
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
if (isDevDeployment() && endpoint) {
if (isDevBuild() && endpoint) {
return `${endpoint}/files/preview/${id}`;
}
return `https://thumbnails.ente.io/?fileID=${id}`;
@ -32,7 +32,7 @@ export const getThumbnailURL = (id: number) => {
export const getPublicCollectionThumbnailURL = (id: number) => {
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
if (isDevDeployment() && endpoint) {
if (isDevBuild() && endpoint) {
return `${endpoint}/public-collection/files/preview/${id}`;
}
return `https://public-albums.ente.io/preview/?fileID=${id}`;
@ -40,7 +40,7 @@ export const getPublicCollectionThumbnailURL = (id: number) => {
export const getUploadEndpoint = () => {
const endpoint = process.env.NEXT_PUBLIC_ENTE_UPLOAD_ENDPOINT;
if (isDevDeployment() && endpoint) {
if (isDevBuild() && endpoint) {
return endpoint;
}
return `https://uploader.ente.io`;
@ -48,7 +48,7 @@ export const getUploadEndpoint = () => {
export const getPaymentsURL = () => {
const paymentsURL = process.env.NEXT_PUBLIC_ENTE_PAYMENT_ENDPOINT;
if (isDevDeployment() && paymentsURL) {
if (isDevBuild() && paymentsURL) {
return paymentsURL;
}
return `https://payments.ente.io`;
@ -56,7 +56,7 @@ export const getPaymentsURL = () => {
export const getAlbumsURL = () => {
const albumsURL = process.env.NEXT_PUBLIC_ENTE_ALBUM_ENDPOINT;
if (isDevDeployment() && albumsURL) {
if (isDevBuild() && albumsURL) {
return albumsURL;
}
return `https://albums.ente.io`;
@ -66,7 +66,7 @@ export const getAlbumsURL = () => {
// create or manage family.
export const getFamilyPortalURL = () => {
const familyURL = process.env.NEXT_PUBLIC_ENTE_FAMILY_PORTAL_ENDPOINT;
if (isDevDeployment() && familyURL) {
if (isDevBuild() && familyURL) {
return familyURL;
}
return `https://family.ente.io`;
@ -83,6 +83,6 @@ export const getFamilyPortalURL = () => {
* automatically assigns development when running the `next dev` command,
* or production for all other commands.
*/
export const isDevDeployment = () => {
export const isDevBuild = () => {
return process.env.NODE_ENV === 'development';
};