Merged in feat/sw-2867-move-user-router-to-trpc-package (pull request #2428)

Move user router to trpc package

* Move more schemas in hotel router

* Fix deps

* fix getNonContentstackUrls

* Fix import error

* Fix entry error handling

* Fix generateMetadata metrics

* Fix alertType enum

* Fix duplicated types

* lint:fix

* Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package

* Fix broken imports

* Move booking router to trpc package

* Move partners router to trpc package

* Move autocomplete router to trpc package

* Move booking router to trpc package

* Remove translations from My Pages navigation trpc procedure

* Move navigation router to trpc package

* Move user router to trpc package

* Merge branch 'master' into feat/sw-2862-move-booking-router-to-trpc-package

* Merge branch 'feat/sw-2862-move-booking-router-to-trpc-package' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'feat/sw-2865-move-navigation-router-to-trpc-package' into feat/sw-2867-move-user-router-to-trpc-package

* Merge branch 'master' into feat/sw-2867-move-user-router-to-trpc-package


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2025-06-27 07:07:49 +00:00
parent 00bcdaaa28
commit 01ca2b4897
49 changed files with 609 additions and 562 deletions

View File

@@ -1,13 +1,17 @@
import { createEnv } from "@t3-oss/env-nextjs"
import { z } from "zod"
import { isLangLive } from "../lib/DUPLICATED/isLangLive"
import type { Lang } from "@scandic-hotels/common/constants/language"
/*
* ⚠️ Remember to also add environment variables to the corresponding config in sites that uses this package. ⚠️
*/
const TWENTYFOUR_HOURS = 24 * 60 * 60
export const env = createEnv({
const _env = createEnv({
/**
* Due to t3-env only checking typeof window === "undefined"
* and Netlify running Deno, window is never "undefined"
@@ -49,6 +53,18 @@ export const env = createEnv({
.refine((s) => s === "true" || s === "false")
.transform((s) => s === "true")
.default("false"),
/**
* Include the languages that should be hidden for the next release
* Should be in the format of "en,da,de,fi,no,sv" or empty
*/
NEW_SITE_LIVE_FOR_LANGS: z
.string()
.regex(/^([a-z]{2},)*([a-z]{2}){0,1}$/)
.transform((val) => {
return val.split(",")
})
.default(""),
SALESFORCE_PREFERENCE_BASE_URL: z.string(),
},
emptyStringAsUndefined: true,
runtimeEnv: {
@@ -70,5 +86,12 @@ export const env = createEnv({
SENTRY_ENVIRONMENT: process.env.SENTRY_ENVIRONMENT,
PUBLIC_URL: process.env.NEXT_PUBLIC_PUBLIC_URL,
PRINT_QUERY: process.env.PRINT_QUERY,
NEW_SITE_LIVE_FOR_LANGS: process.env.NEXT_PUBLIC_NEW_SITE_LIVE_FOR_LANGS,
SALESFORCE_PREFERENCE_BASE_URL: process.env.SALESFORCE_PREFERENCE_BASE_URL,
},
})
export const env = {
..._env,
isLangLive: (lang: Lang) => isLangLive(lang, _env.NEW_SITE_LIVE_FOR_LANGS),
} as const