Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-alpine
FROM node:24-alpine

# Install system dependencies (only what's absolutely necessary)
RUN apk add \
Expand Down
2 changes: 0 additions & 2 deletions apps/admin/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export const Config = {
API_BASE_URL: "https://api.reflectionsprojections.org",
// API_BASE_URL: "http://localhost:3000",
EVENT_TYPES: [
"SPEAKER",
"CORPORATE",
Expand Down
1 change: 1 addition & 0 deletions apps/admin/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineConfig({
port: 3002
},
plugins: [react()],
envPrefix: ["VITE_", "ENV"],
envDir: resolve(__dirname, "../.."),
Comment on lines +11 to 12
resolve: {
alias: {
Expand Down
1 change: 1 addition & 0 deletions apps/dashboard/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineConfig({
port: 3006
},
plugins: [react(), svgr()],
envPrefix: ["VITE_", "ENV"],
envDir: resolve(__dirname, "../.."),
resolve: {
alias: {
Expand Down
1 change: 1 addition & 0 deletions apps/hype/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineConfig({
port: 3004
},
plugins: [react()],
envPrefix: ["VITE_", "ENV"],
envDir: resolve(__dirname, "../.."),
resolve: {
alias: {
Expand Down
1 change: 1 addition & 0 deletions apps/info/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineConfig({
port: 3003
},
plugins: [react()],
envPrefix: ["VITE_", "ENV"],
envDir: resolve(__dirname, "../.."),
resolve: {
alias: {
Expand Down
1 change: 1 addition & 0 deletions apps/site/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineConfig({
port: 3001
},
plugins: [react()],
envPrefix: ["VITE_", "ENV"],
envDir: resolve(__dirname, "../.."),
resolve: {
alias: {
Expand Down
1 change: 0 additions & 1 deletion apps/sponsor/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const Config = {
MAX_DROPDOWN_OPTIONS: 1000,
API_BASE_URL: "https://api.reflectionsprojections.org",
RESUME_BOOK_URL: "https://sponsor.reflectionsprojections.org",
STAFF_UIDs: [
"194cd6b5-1edf-47ff-b078-998290637fd8",
Expand Down
1 change: 1 addition & 0 deletions apps/sponsor/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineConfig({
port: 3005
},
plugins: [react()],
envPrefix: ["VITE_", "ENV"],
envDir: resolve(__dirname, "../.."),
resolve: {
alias: {
Expand Down
1 change: 1 addition & 0 deletions apps/template/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { resolve } from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
envPrefix: ["VITE_", "ENV"],
envDir: resolve(__dirname, "../.."),
resolve: {
alias: {
Expand Down
10 changes: 7 additions & 3 deletions shared/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as yup from "yup";

interface ImportMetaEnv {
ENV?: "PRODUCTION" | "DEVELOPMENT" | "TESTING";
VITE_ENV?: "PRODUCTION" | "DEVELOPMENT" | "TESTING";
VITE_GOOGLE_OAUTH_CLIENT_ID?: string;
}
Expand All @@ -14,6 +15,7 @@ declare global {
// Validation using zup

const envSchema = yup.object({
ENV: yup.string().oneOf(["PRODUCTION", "DEVELOPMENT", "TESTING"]).optional(),
VITE_ENV: yup
.string()
.oneOf(["PRODUCTION", "DEVELOPMENT", "TESTING"])
Expand All @@ -23,9 +25,11 @@ const envSchema = yup.object({

const env = envSchema.validateSync(import.meta.env, { abortEarly: false });

const isDefined = env.VITE_ENV !== undefined;
const resolvedEnv = env.ENV || env.VITE_ENV;

const isProduction = env.VITE_ENV === "PRODUCTION";
const isDefined = resolvedEnv !== undefined;

const isProduction = resolvedEnv === "PRODUCTION";

const IS_DEV = isDefined && !isProduction;

Comment on lines +31 to 35
Expand All @@ -38,7 +42,7 @@ const WS_BASE_URL = IS_DEV
: "wss://api.reflectionsprojections.org";

const Config = {
ENV: env.VITE_ENV,
ENV: resolvedEnv,
API_BASE_URL,
WS_BASE_URL,
EVENT_TYPES: [
Expand Down
Loading