From 0cc11052d400b13f0be0acec095558492e56c083 Mon Sep 17 00:00:00 2001 From: Tim Cosgrove Date: Tue, 1 Oct 2024 14:13:00 -0700 Subject: [PATCH] Roll out debug code and remove feature flags from env files. (#765) --- docker-run.sh | 2 +- envs/.env.dev | 4 ++-- envs/.env.prod | 4 ---- envs/.env.staging | 3 +-- packages/env-loader/src/env-file.ts | 8 ++------ 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/docker-run.sh b/docker-run.sh index 1e12f44bc..b0ffe6b08 100644 --- a/docker-run.sh +++ b/docker-run.sh @@ -1,3 +1,3 @@ #!/bin/sh -ls -al envs + APP_ENV=$APP_ENV yarn build:preview && yarn start diff --git a/envs/.env.dev b/envs/.env.dev index 928e70742..e0e2f93ba 100644 --- a/envs/.env.dev +++ b/envs/.env.dev @@ -21,5 +21,5 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=N9BisSDKAwJENFQtQIEvXQ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-423 # Feature flags for enabling content types. These should only be added when you are preparing to go to prod and are testing on dev. -FEATURE_NEXT_BUILD_CONTENT_EVENT=true -FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true +# It is better to test these from the CMS backend for dev than here. + diff --git a/envs/.env.prod b/envs/.env.prod index a3d830ad8..03334a046 100644 --- a/envs/.env.prod +++ b/envs/.env.prod @@ -25,7 +25,3 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-1 # For example, never add and enable a variable like the following to this file: # FEATURE_NEXT_BUILD_CONTENT_EVENT=true # Again, do NOT add these here. - -# ... Except, prior to initial launch, we will need these here for prod testing. -FEATURE_NEXT_BUILD_CONTENT_EVENT=true -FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true diff --git a/envs/.env.staging b/envs/.env.staging index 7c6d796bd..4cbac0894 100644 --- a/envs/.env.staging +++ b/envs/.env.staging @@ -18,5 +18,4 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=inC4EKQce9vlWpRVcowiyQ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-661 # Feature flags for enabling content types. These should only be added when you are preparing to go to prod and are testing on staging. -FEATURE_NEXT_BUILD_CONTENT_EVENT=true -FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true +# It is better to test these from the CMS backend for staging than here. diff --git a/packages/env-loader/src/env-file.ts b/packages/env-loader/src/env-file.ts index 50e5f6689..9a80ddea3 100644 --- a/packages/env-loader/src/env-file.ts +++ b/packages/env-loader/src/env-file.ts @@ -5,21 +5,17 @@ import { EnvVars } from '.' const loadEnvVarsFromPath = (path: string): EnvVars => { const envVars = {} - // eslint-disable-next-line no-console - console.log(`trying to load vars from ${path}`) dotenvExpand.expand( dotenv.config({ - path: path, + path, override: true, processEnv: envVars, - debug: true, }) ) // eslint-disable-next-line no-console console.log(`Using environment variables from: ${path}`) - // eslint-disable-next-line no-console - console.log(envVars) + return envVars }