Merged in feat/common-package (pull request #2333)

feat: Add common package

* Add isEdge, safeTry and dataCache to new common package

* Add eslint and move prettier config

* Fix yarn lock

* Clean up tests

* Add lint-staged config to common

* Add missing dependencies


Approved-by: Joakim Jäderberg
This commit is contained in:
Anton Gunnarsson
2025-06-11 13:08:39 +00:00
parent 40d1b67a6f
commit 048a477e52
65 changed files with 939 additions and 182 deletions

View File

@@ -2,11 +2,12 @@ import { revalidateTag } from "next/cache"
import { headers } from "next/headers"
import { z } from "zod"
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import { Lang } from "@/constants/languages"
import { env } from "@/env/server"
import { badRequest, internalServerError, notFound } from "@/server/errors/next"
import { getCacheClient } from "@/services/dataCache"
import { generateHotelUrlTag } from "@/utils/generateTag"
import type { NextRequest } from "next/server"

View File

@@ -2,11 +2,12 @@ import { revalidateTag } from "next/cache"
import { headers } from "next/headers"
import { z } from "zod"
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import { Lang } from "@/constants/languages"
import { env } from "@/env/server"
import { badRequest, internalServerError, notFound } from "@/server/errors/next"
import { getCacheClient } from "@/services/dataCache"
import { generateLoyaltyConfigTag } from "@/utils/generateTag"
import type { NextRequest } from "next/server"

View File

@@ -1,10 +1,11 @@
import { revalidateTag } from "next/cache"
import { headers } from "next/headers"
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import { env } from "@/env/server"
import { badRequest, internalServerError } from "@/server/errors/next"
import { getCacheClient } from "@/services/dataCache"
import { generateTag } from "@/utils/generateTag"
import type { Lang } from "@/constants/languages"

View File

@@ -2,6 +2,8 @@ import { revalidateTag } from "next/cache"
import { headers } from "next/headers"
import { z } from "zod"
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import { Lang } from "@/constants/languages"
import { env } from "@/env/server"
import { badRequest, internalServerError } from "@/server/errors/next"
@@ -10,7 +12,6 @@ import { languageSwitcherAffix } from "@/server/routers/contentstack/languageSwi
import { affix as metadataAffix } from "@/server/routers/contentstack/metadata/utils"
import { affix as pageSettingsAffix } from "@/server/routers/contentstack/pageSettings/utils"
import { getCacheClient } from "@/services/dataCache"
import {
generateRefsResponseTag,
generateRefTag,