Compare commits
2 Commits
dac719efd2
...
production
| Author | SHA1 | Date | |
|---|---|---|---|
| f15957847c | |||
| 55fc63fed5 |
@@ -2,7 +2,7 @@
|
|||||||
* Centralized configuration management for the application.
|
* Centralized configuration management for the application.
|
||||||
* This file provides a type-safe way to access environment variables.
|
* This file provides a type-safe way to access environment variables.
|
||||||
*/
|
*/
|
||||||
import { envSchema, getRawEnv } from './env';
|
import { env, getRawEnv } from './env';
|
||||||
|
|
||||||
let memoizedConfig: ReturnType<typeof createConfig> | undefined;
|
let memoizedConfig: ReturnType<typeof createConfig> | undefined;
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ let memoizedConfig: ReturnType<typeof createConfig> | undefined;
|
|||||||
* Throws if validation fails.
|
* Throws if validation fails.
|
||||||
*/
|
*/
|
||||||
function createConfig() {
|
function createConfig() {
|
||||||
const env = envSchema.parse(getRawEnv()) as any;
|
const env = getRawEnv();
|
||||||
|
|
||||||
const target = env.NEXT_PUBLIC_TARGET || env.TARGET;
|
const target = env.NEXT_PUBLIC_TARGET || env.TARGET;
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,7 @@ import { validateMintelEnv, mintelEnvSchema } from '@mintel/next-utils';
|
|||||||
* - Logging
|
* - Logging
|
||||||
* - Analytics
|
* - Analytics
|
||||||
*/
|
*/
|
||||||
export const envSchema = z.object({
|
const envExtension = {
|
||||||
...mintelEnvSchema,
|
|
||||||
|
|
||||||
// Project specific overrides or additions
|
// Project specific overrides or additions
|
||||||
AUTH_COOKIE_NAME: z.string().default('klz_gatekeeper_session'),
|
AUTH_COOKIE_NAME: z.string().default('klz_gatekeeper_session'),
|
||||||
|
|
||||||
@@ -29,12 +27,12 @@ export const envSchema = z.object({
|
|||||||
|
|
||||||
INFRA_DIRECTUS_URL: z.string().url().optional(),
|
INFRA_DIRECTUS_URL: z.string().url().optional(),
|
||||||
INFRA_DIRECTUS_TOKEN: z.string().optional(),
|
INFRA_DIRECTUS_TOKEN: z.string().optional(),
|
||||||
});
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validated environment object.
|
* Validated environment object.
|
||||||
*/
|
*/
|
||||||
export const env = validateMintelEnv(envSchema.shape);
|
export const env = validateMintelEnv(envExtension);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For legacy compatibility with existing code.
|
* For legacy compatibility with existing code.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"@mintel/mail": "^1.6.0",
|
"@mintel/mail": "^1.6.0",
|
||||||
"@mintel/next-config": "^1.6.0",
|
"@mintel/next-config": "^1.6.0",
|
||||||
"@mintel/next-feedback": "^1.6.0",
|
"@mintel/next-feedback": "^1.6.0",
|
||||||
"@mintel/next-utils": "^1.6.0",
|
"@mintel/next-utils": "^1.7.8",
|
||||||
"@react-email/components": "^1.0.7",
|
"@react-email/components": "^1.0.7",
|
||||||
"@react-pdf/renderer": "^4.3.2",
|
"@react-pdf/renderer": "^4.3.2",
|
||||||
"@sentry/nextjs": "^10.38.0",
|
"@sentry/nextjs": "^10.38.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user