chore: standardize
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 9s
Build & Deploy / 🧪 QA (push) Failing after 1m29s
Build & Deploy / 🏗️ Build (push) Failing after 9m23s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 9s
Build & Deploy / 🧪 QA (push) Failing after 1m29s
Build & Deploy / 🏗️ Build (push) Failing after 9m23s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -1,30 +1,37 @@
|
||||
import { z } from "zod";
|
||||
import { validateMintelEnv, mintelEnvSchema } from "@mintel/next-utils";
|
||||
import {
|
||||
validateMintelEnv,
|
||||
mintelEnvSchema,
|
||||
withMintelRefinements,
|
||||
} from "@mintel/next-utils";
|
||||
|
||||
const envExtension = {
|
||||
AUTH_COOKIE_NAME: z.string().default("mintel_gatekeeper_session"),
|
||||
|
||||
// Analytics
|
||||
UMAMI_WEBSITE_ID: z.string().optional(),
|
||||
NEXT_PUBLIC_UMAMI_WEBSITE_ID: z.string().optional(),
|
||||
UMAMI_API_ENDPOINT: z.string().url().optional(),
|
||||
|
||||
// Features
|
||||
SHOW_BLOG: z
|
||||
.string()
|
||||
.transform((v) => v === "true")
|
||||
.default("false"),
|
||||
};
|
||||
|
||||
/**
|
||||
* Environment variable schema for the main website.
|
||||
* Extends the default Mintel environment schema.
|
||||
*/
|
||||
export const envSchema = z.object({
|
||||
...mintelEnvSchema,
|
||||
|
||||
// Project specific overrides or additions
|
||||
AUTH_COOKIE_NAME: z.string().default("mintel_gatekeeper_session"),
|
||||
|
||||
// Analytics provider toggle
|
||||
NEXT_PUBLIC_ANALYTICS_PROVIDER: z
|
||||
.enum(["plausible", "umami"])
|
||||
.default("plausible"),
|
||||
|
||||
// Plausible specifics (to be standardized later if needed)
|
||||
NEXT_PUBLIC_PLAUSIBLE_DOMAIN: z.string().default("mintel.me"),
|
||||
NEXT_PUBLIC_PLAUSIBLE_SCRIPT_URL: z.string().url().optional(),
|
||||
});
|
||||
export const envSchema = withMintelRefinements(
|
||||
z.object(mintelEnvSchema).extend(envExtension),
|
||||
);
|
||||
|
||||
/**
|
||||
* Validated environment object.
|
||||
*/
|
||||
export const env = validateMintelEnv(envSchema.shape);
|
||||
export const env = validateMintelEnv(envExtension);
|
||||
|
||||
/**
|
||||
* For legacy compatibility with existing code.
|
||||
|
||||
Reference in New Issue
Block a user