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,11 @@ import { cookies } from "next/headers"
import { redirect } from "next/navigation"
import { z } from "zod"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { env } from "@/env/server"
import { serverClient } from "@/lib/trpc/server"
import { safeTry } from "@/utils/safeTry"
import { SAS_TOKEN_STORAGE_KEY, stateSchema } from "../sasUtils"
import type { NextRequest } from "next/server"

View File

@@ -2,11 +2,12 @@ import { cookies } from "next/headers"
import { redirect } from "next/navigation"
import { z } from "zod"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { myPages } from "@/constants/routes/myPages"
import { serverClient } from "@/lib/trpc/server"
import { getIntl } from "@/i18n"
import { safeTry } from "@/utils/safeTry"
import { SAS_TOKEN_STORAGE_KEY, SAS_TRANSFER_POINT_KEY } from "../sasUtils"
import OneTimePasswordForm, {

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,

View File

@@ -1,6 +1,8 @@
import { notFound } from "next/navigation"
import { Suspense } from "react"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import {
getHotel,
getHotelPage,
@@ -16,7 +18,6 @@ import { getIntl } from "@/i18n"
import { getLang } from "@/i18n/serverContext"
import { setFacilityCards } from "@/utils/facilityCards"
import { generateHotelSchema } from "@/utils/jsonSchemas"
import { safeTry } from "@/utils/safeTry"
import MapCard from "./Map/MapCard"
import MapWithCardWrapper from "./Map/MapWithCard"

View File

@@ -1,3 +1,4 @@
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { getMeetingRooms } from "@/lib/trpc/memoizedRequests"
@@ -7,7 +8,6 @@ import StickyMeetingPackageWidget from "@/components/StickyMeetingPackageWidget"
import Divider from "@/components/TempDesignSystem/Divider"
import { getIntl } from "@/i18n"
import { getLang } from "@/i18n/serverContext"
import { safeTry } from "@/utils/safeTry"
import HeroHeader from "../HeroHeader"
import HtmlContent from "../HtmlContent"

View File

@@ -1,12 +1,13 @@
import { notFound } from "next/navigation"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { env } from "@/env/server"
import { getCityCoordinates } from "@/lib/trpc/memoizedRequests"
import TrackingSDK from "@/components/TrackingSDK"
import { getLang } from "@/i18n/serverContext"
import { getHotelSearchDetails } from "@/utils/hotelSearchDetails"
import { safeTry } from "@/utils/safeTry"
import { getHotelPins } from "../../HotelCardDialogListing/utils"
import { getFiltersFromHotels, getHotels } from "../helpers"

1
apps/scandic-web/global.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
import "@scandic-hotels/common/global.d.ts"

View File

@@ -1,7 +1,8 @@
import * as Sentry from "@sentry/nextjs"
import { isEdge } from "@scandic-hotels/common/utils/isEdge"
import { env } from "./env/server"
import { isEdge } from "./utils/isEdge"
export async function register() {
/*

View File

@@ -6,10 +6,10 @@ import { arrayMerge } from "@/utils/merge"
import { request } from "./request"
import type { CacheTime } from "@scandic-hotels/common/dataCache"
import type { BatchRequestDocument } from "graphql-request"
import type { Data } from "@/types/request"
import type { CacheTime } from "@/services/dataCache"
export async function batchRequest<T>(
queries: (BatchRequestDocument & {

View File

@@ -3,11 +3,14 @@ import { GraphQLClient } from "graphql-request"
import stringify from "json-stable-stringify-without-jsonify"
import { cache as reactCache } from "react"
import {
type CacheTime,
getCacheClient,
} from "@scandic-hotels/common/dataCache"
import { env } from "@/env/server"
import { getPreviewHash, isPreviewByUid } from "@/lib/previewContext"
import { type CacheTime, getCacheClient } from "@/services/dataCache"
import { request as _request } from "./_request"
import { getOperationName } from "./getOperationName"

View File

@@ -1,9 +1,10 @@
import { type NextMiddleware, NextResponse } from "next/server"
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import { notFound } from "@/server/errors/next"
import { getPublicNextURL } from "@/server/utils"
import { getCacheClient } from "@/services/dataCache"
import { findLang } from "@/utils/languages"
import { getDefaultRequestHeaders } from "./utils"

View File

@@ -5,7 +5,7 @@ import {
type WarmupFunctionsKey,
warmupKeys,
} from "@/services/warmup/warmupKeys"
import { safeTry } from "@/utils/safeTry"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { timeout } from "@/utils/timeout"
import type { Config, Context } from "@netlify/functions"

View File

@@ -119,6 +119,7 @@
"@eslint/js": "^9.26.0",
"@formatjs/cli": "^6.7.1",
"@lokalise/node-api": "^14.0.0",
"@scandic-hotels/common": "workspace:*",
"@scandic-hotels/typescript-config": "workspace:*",
"@svgr/webpack": "^8.1.0",
"@testing-library/jest-dom": "^6.6.3",

View File

@@ -1,12 +1,12 @@
import { z } from "zod"
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { Lang } from "@/constants/languages"
import { safeProtectedServiceProcedure } from "@/server/trpc"
import { isDefined } from "@/server/utils"
import { getCacheClient } from "@/services/dataCache"
import { safeTry } from "@/utils/safeTry"
import { getCityPageUrls } from "../contentstack/destinationCityPage/utils"
import { getCountryPageUrls } from "../contentstack/destinationCountryPage/utils"
import { getHotelPageUrls } from "../contentstack/hotelPage/utils"

View File

@@ -1,3 +1,5 @@
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { Lang } from "@/constants/languages"
import {
GetDestinationOverviewPage,
@@ -13,7 +15,6 @@ import {
} from "@/server/trpc"
import { generateRefsResponseTag, generateTag } from "@/utils/generateTag"
import { safeTry } from "@/utils/safeTry"
import {
getCitiesByCountry,

View File

@@ -1,3 +1,5 @@
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import * as api from "@/lib/api"
import {
GetRewards as GetRewards,
@@ -7,7 +9,6 @@ import { request } from "@/lib/graphql/request"
import { notFound } from "@/server/errors/trpc"
import { createCounter } from "@/server/telemetry"
import { getCacheClient } from "@/services/dataCache"
import {
generateLoyaltyConfigTag,
generateRefsResponseTag,

View File

@@ -1,3 +1,5 @@
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import { REDEMPTION } from "@/constants/booking"
import { Lang } from "@/constants/languages"
import { env } from "@/env/server"
@@ -16,8 +18,6 @@ import {
} from "@/server/trpc"
import { toApiLang } from "@/server/utils"
import { getCacheClient } from "@/services/dataCache"
import { getHotelPageUrls } from "../contentstack/hotelPage/utils"
import { additionalDataSchema } from "./schemas/hotel/include/additionalData"
import { meetingRoomsSchema } from "./schemas/meetingRoom"

View File

@@ -1,6 +1,8 @@
import deepmerge from "deepmerge"
import stringify from "json-stable-stringify-without-jsonify"
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import { BookingErrorCodeEnum, REDEMPTION } from "@/constants/booking"
import { Lang } from "@/constants/languages"
import { selectRate } from "@/constants/routes/hotelReservation"
@@ -11,7 +13,6 @@ import { createCounter } from "@/server/telemetry"
import { toApiLang } from "@/server/utils"
import { generateChildrenString } from "@/components/HotelReservation/utils"
import { getCacheClient } from "@/services/dataCache"
import { cache } from "@/utils/cache"
import { chunk } from "@/utils/chunk"
import { sortRoomConfigs } from "@/utils/sort"

View File

@@ -1,10 +1,11 @@
import { cache } from "react"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import * as routes from "@/constants/routes/myPages"
import { env } from "@/env/server"
import { getIntl } from "@/i18n"
import { safeTry } from "@/utils/safeTry"
import { getEurobonusMembership } from "@/utils/user"
import type { UserLoyalty } from "@/types/user"

View File

@@ -1,8 +1,8 @@
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import { createCounter } from "@/server/telemetry"
import { publicProcedure, router } from "@/server/trpc"
import { getCacheClient } from "@/services/dataCache"
import { jobylonFeedSchema } from "./output"
export const TWENTYFOUR_HOURS = 60 * 60 * 24

View File

@@ -1,10 +1,10 @@
import { trace, type Tracer } from "@opentelemetry/api"
import { getCacheClient } from "@scandic-hotels/common/dataCache"
import { env } from "@/env/server"
import { createCounter } from "@/server/telemetry"
import { getCacheClient } from "@/services/dataCache"
import type { ServiceTokenResponse } from "@/types/tokens"
export async function getServiceToken() {

View File

@@ -1,102 +0,0 @@
import { describe, expect, it, jest } from "@jest/globals"
jest.doMock("@/env/server", () => ({
env: {
NODE_ENV: "test",
},
}))
const { env } = require("@/env/server")
const { getPrefix } = require("./getPrefix")
const mockedEnv = env as { BRANCH: string; GIT_SHA: string }
describe("getPrefix", () => {
const OLD_ENV = process.env
beforeEach(() => {
jest.resetModules()
})
afterEach(() => {
process.env = OLD_ENV
})
it.each([
"prod",
"production",
"release",
"release-v1",
"release-v2",
"release-v2-alpha",
"release-v2.1-alpha",
"release-v2.1.2-alpha",
])(
"should return gitsha for production branches when name is '%s'",
(branchName: string) => {
mockedEnv.BRANCH = branchName
mockedEnv.GIT_SHA = "gitsha"
const result = getPrefix()
expect(result).toBe("gitsha")
}
)
it.each([
"fix/stuff",
"feat/my-feature",
"feature/my-feature",
"releasee",
"release-vA",
"FEAT",
])(
"should return branch name and gitsha for non-production branches when name is '%s'",
(branchName: string) => {
mockedEnv.BRANCH = branchName
mockedEnv.GIT_SHA = "gitsha"
const result = getPrefix()
expect(result).toBe(`${mockedEnv.BRANCH}:${mockedEnv.GIT_SHA}`)
}
)
it("should throw if BRANCH and/or GIT_SHA is not set", () => {
mockedEnv.BRANCH = ""
mockedEnv.GIT_SHA = ""
expect(getPrefix).toThrow(
"Unable to getPrefix, BRANCH and GIT_SHA must be set"
)
mockedEnv.BRANCH = "hasBranch"
mockedEnv.GIT_SHA = ""
expect(getPrefix).toThrow("Unable to getPrefix, GIT_SHA must be set")
mockedEnv.BRANCH = ""
mockedEnv.GIT_SHA = "hasGitSha"
expect(getPrefix).toThrow("Unable to getPrefix, BRANCH must be set")
})
it("should return dev or local user if running locally", () => {
;(process.env.NODE_ENV as any) = "development"
process.env.USER = "test_user"
process.env.USERNAME = "test_username"
mockedEnv.BRANCH = ""
mockedEnv.GIT_SHA = ""
expect(getPrefix()).toBe("test_user")
process.env.USER = ""
expect(getPrefix()).toBe("test_username")
process.env.USERNAME = ""
expect(getPrefix()).toBe("dev")
})
})

View File

@@ -1,3 +1,5 @@
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { Lang } from "@/constants/languages"
import {
getCountries,
@@ -5,8 +7,6 @@ import {
} from "@/server/routers/hotels/utils"
import { getServiceToken } from "@/server/tokenManager"
import { safeTry } from "@/utils/safeTry"
import type { WarmupFunction, WarmupResult } from "."
export const warmupHotelIdsByCountry =

View File

@@ -1,10 +1,11 @@
import { notFound } from "next/navigation"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { REDEMPTION } from "@/constants/booking"
import { getLocations } from "@/lib/trpc/memoizedRequests"
import { generateChildrenString } from "@/components/HotelReservation/utils"
import { safeTry } from "@/utils/safeTry"
import type { BookingSearchType } from "@/types/components/hotelReservation/booking"
import type { Child } from "@/types/components/hotelReservation/selectRate/selectRate"

View File

@@ -9,7 +9,8 @@
"dev:ds": "turbo run dev --filter=@scandic-hotels/design-system --output-logs new-only",
"test": "turbo run test",
"postinstall": "husky",
"icons:update": "node scripts/material-symbols-update.mjs"
"icons:update": "node scripts/material-symbols-update.mjs",
"check-types": "turbo run check-types"
},
"workspaces": [
"apps/*",

View File

@@ -0,0 +1,2 @@
NODE_ENV="development"
BRANCH="test"

View File

@@ -1,5 +1,3 @@
import { type CacheTime, type DataCache } from "@/services/dataCache/Cache"
import {
type CacheOrGetOptions,
shouldGetFromCache,
@@ -9,6 +7,8 @@ import { generateCacheKey } from "./generateCacheKey"
import { get } from "./get"
import { set } from "./set"
import type { CacheTime, DataCache } from "../Cache"
export const cacheOrGet: DataCache["cacheOrGet"] = async <T>(
key: string | string[],
callback: (overrideTTL: (cacheTime: CacheTime) => void) => Promise<T>,

View File

@@ -1,11 +1,10 @@
import { env } from "@/env/server"
import { env } from "../../env/server"
import { cacheOrGet } from "./cacheOrGet"
import { deleteKey } from "./deleteKey"
import { get } from "./get"
import { set } from "./set"
import type { DataCache } from "@/services/dataCache/Cache"
import type { DataCache } from "../Cache"
export const API_KEY = env.REDIS_API_KEY ?? ""
export async function createDistributedCache(): Promise<DataCache> {

View File

@@ -1,6 +1,6 @@
import * as Sentry from "@sentry/nextjs"
import { safeTry } from "@/utils/safeTry"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { cacheLogger } from "../logger"
import { API_KEY } from "./client"

View File

@@ -1,4 +1,4 @@
import { env } from "@/env/server"
import { env } from "../../env/server"
export function getCacheEndpoint(key: string) {
if (!env.REDIS_API_HOST) {

View File

@@ -1,4 +1,4 @@
import { describe, expect, it } from "@jest/globals"
import { describe, expect, it } from "vitest"
import { getBranchPrefix } from "./getBranchPrefix"

View File

@@ -0,0 +1,123 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"
vi.mock("@/env/server", () => ({
env: {
NODE_ENV: "test",
},
}))
import { env } from "../../../env/server"
import { getPrefix } from "./getPrefix"
const mockedEnv = env as { BRANCH: string; GIT_SHA: string }
describe("getPrefix", () => {
beforeEach(() => {
vi.resetModules()
})
afterEach(() => {
vi.unstubAllEnvs()
})
it.each([
"prod",
"production",
"release",
"release-v1",
"release-v2",
"release-v2-alpha",
"release-v2.1-alpha",
"release-v2.1.2-alpha",
])(
"should return gitsha for production branches when name is '%s'",
(branchName: string) => {
mockedEnv.BRANCH = branchName
mockedEnv.GIT_SHA = "gitsha"
const result = getPrefix({
includeGitHashInKey: true,
includeBranchPrefix: true,
})
expect(result).toBe("gitsha")
}
)
it.each([
"fix/stuff",
"feat/my-feature",
"feature/my-feature",
"releasee",
"release-vA",
"FEAT",
])(
"should return branch name and gitsha for non-production branches when name is '%s'",
(branchName: string) => {
mockedEnv.BRANCH = branchName
mockedEnv.GIT_SHA = "gitsha"
const result = getPrefix({
includeGitHashInKey: true,
includeBranchPrefix: true,
})
expect(result).toBe(`${"gitsha"}:${branchName}`)
}
)
it("should throw if BRANCH and/or GIT_SHA is not set", () => {
mockedEnv.BRANCH = "hasBranch"
mockedEnv.GIT_SHA = ""
expect(() =>
getPrefix({
includeBranchPrefix: true,
includeGitHashInKey: true,
})
).toThrow("Unable to getPrefix, GIT_SHA must be set")
mockedEnv.BRANCH = ""
mockedEnv.GIT_SHA = "hasGitSha"
expect(() =>
getPrefix({
includeBranchPrefix: true,
includeGitHashInKey: true,
})
).toThrow("Unable to getPrefix, BRANCH must be set")
})
it("should return dev or local user if running locally", () => {
vi.stubEnv("NODE_ENV", "development")
vi.stubEnv("USER", "test_user")
vi.stubEnv("USERNAME", "test_username")
mockedEnv.BRANCH = ""
mockedEnv.GIT_SHA = ""
expect(
getPrefix({
includeGitHashInKey: false,
includeBranchPrefix: false,
})
).toBe("test_user")
process.env.USER = ""
expect(
getPrefix({
includeGitHashInKey: false,
includeBranchPrefix: false,
})
).toBe("test_username")
process.env.USERNAME = ""
expect(
getPrefix({
includeGitHashInKey: false,
includeBranchPrefix: false,
})
).toBe("dev")
})
})

View File

@@ -1,5 +1,4 @@
import { env } from "@/env/server"
import { env } from "../../../env/server"
import { getBranchPrefix } from "./getBranchPrefix"
export function getPrefix(options: {

View File

@@ -1,23 +1,14 @@
import { describe, expect, it, jest } from "@jest/globals"
import { describe, expect, it, vi } from "vitest"
jest.mock("./getPrefix", () => ({
getPrefix: jest.fn(() => "gitsha"),
vi.mock("./getPrefix", () => ({
getPrefix: vi.fn(() => "gitsha"),
}))
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
const indexModule: typeof import(".") = require(".")
const { generateCacheKey } = indexModule
import { generateCacheKey } from "./index"
describe("generateCacheKey", () => {
const OLD_ENV = process.env
beforeEach(() => {
jest.resetModules()
})
afterEach(() => {
process.env = OLD_ENV
vi.resetModules()
})
it("generates cachekey with prefix and key using string", () => {

View File

@@ -1,6 +1,6 @@
import * as Sentry from "@sentry/nextjs"
import { safeTry } from "@/utils/safeTry"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { cacheLogger } from "../logger"
import { API_KEY } from "./client"

View File

@@ -1,6 +1,6 @@
import * as Sentry from "@sentry/nextjs"
import { safeTry } from "@/utils/safeTry"
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { type CacheTime, getCacheTimeInSeconds } from "../Cache"
import { API_KEY } from "./client"

View File

@@ -1,13 +1,13 @@
import { type CacheTime, type DataCache } from "@/services/dataCache/Cache"
import { cacheLogger } from "@/services/dataCache/logger"
import {
type CacheOrGetOptions,
shouldGetFromCache,
} from "../../cacheOrGetOptions"
import { cacheLogger } from "../../logger"
import { get } from "./get"
import { set } from "./set"
import type { CacheTime, DataCache } from "../../Cache"
export const cacheOrGet: DataCache["cacheOrGet"] = async <T>(
key: string | string[],
callback: (overrideTTL?: (cacheTime: CacheTime) => void) => Promise<T>,

View File

@@ -1,5 +1,4 @@
import { cacheLogger } from "@/services/dataCache/logger"
import { cacheLogger } from "../../logger"
import { cacheMap } from "./cacheMap"
export async function deleteKey(key: string, opts?: { fuzzy?: boolean }) {

View File

@@ -1,5 +1,4 @@
import { cacheLogger } from "@/services/dataCache/logger"
import { cacheLogger } from "../../logger"
import { cacheMap } from "./cacheMap"
export async function get<T>(key: string): Promise<T | undefined> {

View File

@@ -3,7 +3,7 @@ import { deleteKey } from "./deleteKey"
import { get } from "./get"
import { set } from "./set"
import type { DataCache } from "@/services/dataCache/Cache"
import type { DataCache } from "../../Cache"
export async function createInMemoryCache(): Promise<DataCache> {
return { type: "in-memory", cacheOrGet, deleteKey, get, set }

View File

@@ -1,8 +1,4 @@
import {
type CacheTime,
getCacheTimeInSeconds,
} from "@/services/dataCache/Cache"
import { type CacheTime, getCacheTimeInSeconds } from "../../Cache"
import { cacheMap } from "./cacheMap"
export async function set<T>(

View File

@@ -1,7 +1,6 @@
import { type DataCache } from "../Cache"
import { createInMemoryCache } from "./InMemoryCache"
import type { DataCache } from "@/services/dataCache/Cache"
export function createMemoryCache(): Promise<DataCache> {
return createInMemoryCache()
}

View File

@@ -1,7 +1,5 @@
import { env } from "@/env/server"
import { isEdge } from "@/utils/isEdge"
import { env } from "../env/server"
import { isEdge } from "../utils/isEdge"
import { createMemoryCache } from "./MemoryCache/createMemoryCache"
import { type DataCache } from "./Cache"
import { createDistributedCache } from "./DistributedCache"

29
packages/common/env/server.ts vendored Normal file
View File

@@ -0,0 +1,29 @@
import { createEnv } from "@t3-oss/env-nextjs"
import { z } from "zod"
export const env = createEnv({
/**
* Due to t3-env only checking typeof window === "undefined"
* and Netlify running Deno, window is never "undefined"
* https://github.com/t3-oss/t3-env/issues/154
*/
isServer: true,
server: {
NODE_ENV: z.enum(["development", "test", "production"]),
REDIS_API_HOST: z.string().optional(),
REDIS_API_KEY: z.string().optional(),
BRANCH:
process.env.NODE_ENV !== "development"
? z.string()
: z.string().optional().default("dev"),
GIT_SHA: z.string().optional(),
},
emptyStringAsUndefined: true,
runtimeEnv: {
NODE_ENV: process.env.NODE_ENV,
REDIS_API_HOST: process.env.REDIS_API_HOST,
REDIS_API_KEY: process.env.REDIS_API_KEY,
BRANCH: process.env.BRANCH,
GIT_SHA: process.env.GIT_SHA,
},
})

View File

@@ -0,0 +1,87 @@
import { FlatCompat } from "@eslint/eslintrc"
import js from "@eslint/js"
import typescriptEslint from "@typescript-eslint/eslint-plugin"
import tsParser from "@typescript-eslint/parser"
import { defineConfig } from "eslint/config"
import simpleImportSort from "eslint-plugin-simple-import-sort"
const compat = new FlatCompat({
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})
export default defineConfig([
{
files: ["**/*.ts", "**/*.tsx"],
extends: compat.extends("plugin:import/typescript"),
plugins: {
"simple-import-sort": simpleImportSort,
"@typescript-eslint": typescriptEslint,
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
languageOptions: {
parser: tsParser,
},
rules: {
"no-unused-vars": "off",
"simple-import-sort/imports": [
"error",
{
groups: [
["^\\u0000"],
["^node:"],
["^@?\\w"],
["^@scandic-hotels/(?!.*\u0000$).*$"],
[
"^@/constants/?(?!.*\u0000$).*$",
"^@/env/?(?!.*\u0000$).*$",
"^@/lib/?(?!.*\u0000$).*$",
"^@/server/?(?!.*\u0000$).*$",
"^@/stores/?(?!.*\u0000$).*$",
],
["^@/(?!(types|.*\u0000$)).*$"],
[
"^\\.\\.(?!/?$)",
"^\\.\\./?$",
"^\\./(?=.*/)(?!/?$)",
"^\\.(?!/?$)",
"^\\./?$",
],
["^(?!\\u0000).+\\.s?css$"],
["^node:.*\\u0000$", "^@?\\w.*\\u0000$"],
[
"^@scandichotels/.*\\u0000$",
"^@/types/.*",
"^@/.*\\u0000$",
"^[^.].*\\u0000$",
"^\\..*\\u0000$",
],
],
},
],
"simple-import-sort/exports": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
},
])

View File

@@ -1,4 +1,4 @@
import type { DataCache } from "@/services/dataCache"
import type { DataCache } from "./dataCache/Cache"
declare global {
var cacheClient: Promise<DataCache> | undefined

View File

@@ -0,0 +1,7 @@
const config = {
"*.{ts,tsx}": [() => "tsc -p tsconfig.json --noEmit", "prettier --write"],
"*.{json,md}": "prettier --write",
"*.{html,js,cjs,mjs,css}": "prettier --write",
}
export default config

View File

@@ -0,0 +1,39 @@
{
"name": "@scandic-hotels/common",
"version": "1.0.0",
"main": "index.ts",
"scripts": {
"test": "vitest run",
"test:watch": "vitest",
"check-types": "tsc --noEmit",
"lint": "eslint . --max-warnings 0 && tsc --noEmit"
},
"dependencies": {
"@opentelemetry/api": "^1.9.0",
"@sentry/nextjs": "^8.41.0",
"@t3-oss/env-nextjs": "^0.13.4",
"zod": "^3.24.4"
},
"devDependencies": {
"@eslint/compat": "^1.2.9",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.26.0",
"@scandic-hotels/typescript-config": "workspace:*",
"@typescript-eslint/eslint-plugin": "^8.32.0",
"@typescript-eslint/parser": "^8.32.0",
"dotenv": "^16.5.0",
"eslint": "^9",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"typescript": "5.8.3",
"vitest": "^3.2.3"
},
"prettier": {
"semi": false,
"trailingComma": "es5",
"singleQuote": false,
"printWidth": 80,
"tabWidth": 2,
"endOfLine": "lf"
}
}

View File

@@ -0,0 +1,3 @@
{
"extends": "@scandic-hotels/typescript-config/base.json"
}

View File

@@ -0,0 +1,3 @@
import { config } from "dotenv"
config({ path: "./.env.test" })

View File

@@ -0,0 +1,17 @@
import path from "path"
import { fileURLToPath } from "url"
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
export default {
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./vitest-setup.ts"],
},
resolve: {
alias: {
"@": path.resolve(__dirname, "."),
},
},
}

View File

@@ -11,6 +11,7 @@
"cache": false
},
"lint": {},
"test": {}
"test": {},
"check-types": {}
}
}

548
yarn.lock
View File

@@ -6424,6 +6424,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-android-arm-eabi@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-android-arm-eabi@npm:4.42.0"
conditions: os=android & cpu=arm
languageName: node
linkType: hard
"@rollup/rollup-android-arm64@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-android-arm64@npm:4.34.9"
@@ -6438,6 +6445,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-android-arm64@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-android-arm64@npm:4.42.0"
conditions: os=android & cpu=arm64
languageName: node
linkType: hard
"@rollup/rollup-darwin-arm64@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-darwin-arm64@npm:4.34.9"
@@ -6452,6 +6466,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-darwin-arm64@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-darwin-arm64@npm:4.42.0"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
"@rollup/rollup-darwin-x64@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-darwin-x64@npm:4.34.9"
@@ -6466,6 +6487,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-darwin-x64@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-darwin-x64@npm:4.42.0"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
"@rollup/rollup-freebsd-arm64@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-freebsd-arm64@npm:4.34.9"
@@ -6480,6 +6508,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-freebsd-arm64@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-freebsd-arm64@npm:4.42.0"
conditions: os=freebsd & cpu=arm64
languageName: node
linkType: hard
"@rollup/rollup-freebsd-x64@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-freebsd-x64@npm:4.34.9"
@@ -6494,6 +6529,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-freebsd-x64@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-freebsd-x64@npm:4.42.0"
conditions: os=freebsd & cpu=x64
languageName: node
linkType: hard
"@rollup/rollup-linux-arm-gnueabihf@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.34.9"
@@ -6508,6 +6550,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-arm-gnueabihf@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.42.0"
conditions: os=linux & cpu=arm & libc=glibc
languageName: node
linkType: hard
"@rollup/rollup-linux-arm-musleabihf@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.34.9"
@@ -6522,6 +6571,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-arm-musleabihf@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.42.0"
conditions: os=linux & cpu=arm & libc=musl
languageName: node
linkType: hard
"@rollup/rollup-linux-arm64-gnu@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.34.9"
@@ -6536,6 +6592,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-arm64-gnu@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.42.0"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
"@rollup/rollup-linux-arm64-musl@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-linux-arm64-musl@npm:4.34.9"
@@ -6550,6 +6613,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-arm64-musl@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-arm64-musl@npm:4.42.0"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
"@rollup/rollup-linux-loongarch64-gnu@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.34.9"
@@ -6564,6 +6634,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-loongarch64-gnu@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.42.0"
conditions: os=linux & cpu=loong64 & libc=glibc
languageName: node
linkType: hard
"@rollup/rollup-linux-powerpc64le-gnu@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.34.9"
@@ -6578,6 +6655,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-powerpc64le-gnu@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.42.0"
conditions: os=linux & cpu=ppc64 & libc=glibc
languageName: node
linkType: hard
"@rollup/rollup-linux-riscv64-gnu@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.34.9"
@@ -6592,6 +6676,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-riscv64-gnu@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.42.0"
conditions: os=linux & cpu=riscv64 & libc=glibc
languageName: node
linkType: hard
"@rollup/rollup-linux-riscv64-musl@npm:4.40.2":
version: 4.40.2
resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.40.2"
@@ -6599,6 +6690,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-riscv64-musl@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.42.0"
conditions: os=linux & cpu=riscv64 & libc=musl
languageName: node
linkType: hard
"@rollup/rollup-linux-s390x-gnu@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.34.9"
@@ -6613,6 +6711,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-s390x-gnu@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.42.0"
conditions: os=linux & cpu=s390x & libc=glibc
languageName: node
linkType: hard
"@rollup/rollup-linux-x64-gnu@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-linux-x64-gnu@npm:4.34.9"
@@ -6627,6 +6732,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-x64-gnu@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-x64-gnu@npm:4.42.0"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
"@rollup/rollup-linux-x64-gnu@npm:4.9.5":
version: 4.9.5
resolution: "@rollup/rollup-linux-x64-gnu@npm:4.9.5"
@@ -6648,6 +6760,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-linux-x64-musl@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-linux-x64-musl@npm:4.42.0"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
"@rollup/rollup-win32-arm64-msvc@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.34.9"
@@ -6662,6 +6781,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-win32-arm64-msvc@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.42.0"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
"@rollup/rollup-win32-ia32-msvc@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.34.9"
@@ -6676,6 +6802,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-win32-ia32-msvc@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.42.0"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
"@rollup/rollup-win32-x64-msvc@npm:4.34.9":
version: 4.34.9
resolution: "@rollup/rollup-win32-x64-msvc@npm:4.34.9"
@@ -6690,6 +6823,13 @@ __metadata:
languageName: node
linkType: hard
"@rollup/rollup-win32-x64-msvc@npm:4.42.0":
version: 4.42.0
resolution: "@rollup/rollup-win32-x64-msvc@npm:4.42.0"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
"@rtsao/scc@npm:^1.1.0":
version: 1.1.0
resolution: "@rtsao/scc@npm:1.1.0"
@@ -6806,6 +6946,29 @@ __metadata:
languageName: node
linkType: hard
"@scandic-hotels/common@workspace:*, @scandic-hotels/common@workspace:packages/common":
version: 0.0.0-use.local
resolution: "@scandic-hotels/common@workspace:packages/common"
dependencies:
"@eslint/compat": "npm:^1.2.9"
"@eslint/eslintrc": "npm:^3.3.1"
"@eslint/js": "npm:^9.26.0"
"@opentelemetry/api": "npm:^1.9.0"
"@scandic-hotels/typescript-config": "workspace:*"
"@sentry/nextjs": "npm:^8.41.0"
"@t3-oss/env-nextjs": "npm:^0.13.4"
"@typescript-eslint/eslint-plugin": "npm:^8.32.0"
"@typescript-eslint/parser": "npm:^8.32.0"
dotenv: "npm:^16.5.0"
eslint: "npm:^9"
eslint-plugin-import: "npm:^2.31.0"
eslint-plugin-simple-import-sort: "npm:^12.1.1"
typescript: "npm:5.8.3"
vitest: "npm:^3.2.3"
zod: "npm:^3.24.4"
languageName: unknown
linkType: soft
"@scandic-hotels/design-system@workspace:*, @scandic-hotels/design-system@workspace:packages/design-system":
version: 0.0.0-use.local
resolution: "@scandic-hotels/design-system@workspace:packages/design-system"
@@ -6919,6 +7082,7 @@ __metadata:
"@opentelemetry/sdk-trace-base": "npm:^1.29.0"
"@radix-ui/react-slot": "npm:^1.2.2"
"@react-aria/ssr": "npm:^3.9.8"
"@scandic-hotels/common": "workspace:*"
"@scandic-hotels/design-system": "workspace:*"
"@scandic-hotels/typescript-config": "workspace:*"
"@sentry/nextjs": "npm:^8.41.0"
@@ -8712,6 +8876,15 @@ __metadata:
languageName: node
linkType: hard
"@types/chai@npm:^5.2.2":
version: 5.2.2
resolution: "@types/chai@npm:5.2.2"
dependencies:
"@types/deep-eql": "npm:*"
checksum: 10c0/49282bf0e8246800ebb36f17256f97bd3a8c4fb31f92ad3c0eaa7623518d7e87f1eaad4ad206960fcaf7175854bdff4cb167e4fe96811e0081b4ada83dd533ec
languageName: node
linkType: hard
"@types/connect@npm:3.4.36":
version: 3.4.36
resolution: "@types/connect@npm:3.4.36"
@@ -8737,6 +8910,13 @@ __metadata:
languageName: node
linkType: hard
"@types/deep-eql@npm:*":
version: 4.0.2
resolution: "@types/deep-eql@npm:4.0.2"
checksum: 10c0/bf3f811843117900d7084b9d0c852da9a044d12eb40e6de73b552598a6843c21291a8a381b0532644574beecd5e3491c5ff3a0365ab86b15d59862c025384844
languageName: node
linkType: hard
"@types/doctrine@npm:^0.0.9":
version: 0.0.9
resolution: "@types/doctrine@npm:0.0.9"
@@ -9573,6 +9753,19 @@ __metadata:
languageName: node
linkType: hard
"@vitest/expect@npm:3.2.3":
version: 3.2.3
resolution: "@vitest/expect@npm:3.2.3"
dependencies:
"@types/chai": "npm:^5.2.2"
"@vitest/spy": "npm:3.2.3"
"@vitest/utils": "npm:3.2.3"
chai: "npm:^5.2.0"
tinyrainbow: "npm:^2.0.0"
checksum: 10c0/5eb6278be8f5294779472d1276e150a1b573274441a68c2681c447179abd22af451813fdfbe87e04f5909ca7a0926700f9b79022f227c9816e5d0fa8e0229e15
languageName: node
linkType: hard
"@vitest/mocker@npm:3.1.3":
version: 3.1.3
resolution: "@vitest/mocker@npm:3.1.3"
@@ -9592,6 +9785,25 @@ __metadata:
languageName: node
linkType: hard
"@vitest/mocker@npm:3.2.3":
version: 3.2.3
resolution: "@vitest/mocker@npm:3.2.3"
dependencies:
"@vitest/spy": "npm:3.2.3"
estree-walker: "npm:^3.0.3"
magic-string: "npm:^0.30.17"
peerDependencies:
msw: ^2.4.9
vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0
peerDependenciesMeta:
msw:
optional: true
vite:
optional: true
checksum: 10c0/b670f229c3b1de5561de3cbbecb18f964d4888355d7f1cb8bbff4350b2cfbe477bef834cc2f66af7727ca7dc567540018885eb652f46e0be1cda4015491dc0a9
languageName: node
linkType: hard
"@vitest/pretty-format@npm:2.0.5":
version: 2.0.5
resolution: "@vitest/pretty-format@npm:2.0.5"
@@ -9619,6 +9831,15 @@ __metadata:
languageName: node
linkType: hard
"@vitest/pretty-format@npm:3.2.3, @vitest/pretty-format@npm:^3.2.3":
version: 3.2.3
resolution: "@vitest/pretty-format@npm:3.2.3"
dependencies:
tinyrainbow: "npm:^2.0.0"
checksum: 10c0/e8fa7b97822c58404bef07d19fa9a49d5b7edb6797dd355584ad7246585bbbe9c55dd1fb05d0c3939b9c15fba05c3e134e2b96ea0cb64ca79a2b9dab60087a6a
languageName: node
linkType: hard
"@vitest/runner@npm:3.1.3":
version: 3.1.3
resolution: "@vitest/runner@npm:3.1.3"
@@ -9629,6 +9850,17 @@ __metadata:
languageName: node
linkType: hard
"@vitest/runner@npm:3.2.3":
version: 3.2.3
resolution: "@vitest/runner@npm:3.2.3"
dependencies:
"@vitest/utils": "npm:3.2.3"
pathe: "npm:^2.0.3"
strip-literal: "npm:^3.0.0"
checksum: 10c0/c20cb6e2ac4fdfb3d4f5136714ea65f9063562d3afaa1574dc82f53d061444bc01583f9915346768ca75f5ea0658f02fb594752e21abbca5ab50290f58732147
languageName: node
linkType: hard
"@vitest/snapshot@npm:3.1.3":
version: 3.1.3
resolution: "@vitest/snapshot@npm:3.1.3"
@@ -9640,6 +9872,17 @@ __metadata:
languageName: node
linkType: hard
"@vitest/snapshot@npm:3.2.3":
version: 3.2.3
resolution: "@vitest/snapshot@npm:3.2.3"
dependencies:
"@vitest/pretty-format": "npm:3.2.3"
magic-string: "npm:^0.30.17"
pathe: "npm:^2.0.3"
checksum: 10c0/f6dd0248afb3f3cbcbbb9fd39c2c8273c4ec92176f65e6ba9d36a0c33552d3658013e3a02944e14c7637f51d6702a5c07963b59707ca459bd1ac31f39c81160c
languageName: node
linkType: hard
"@vitest/spy@npm:2.0.5":
version: 2.0.5
resolution: "@vitest/spy@npm:2.0.5"
@@ -9658,6 +9901,15 @@ __metadata:
languageName: node
linkType: hard
"@vitest/spy@npm:3.2.3":
version: 3.2.3
resolution: "@vitest/spy@npm:3.2.3"
dependencies:
tinyspy: "npm:^4.0.3"
checksum: 10c0/ce77d5934ac4741513993aad9d8ff44ff03ff5cf5a177e010c7ffcd8d3060087e56df1938c1100d49de712daf952cd2c72dd83e1684d043e698bd2afe0025f5e
languageName: node
linkType: hard
"@vitest/utils@npm:2.0.5":
version: 2.0.5
resolution: "@vitest/utils@npm:2.0.5"
@@ -9681,6 +9933,17 @@ __metadata:
languageName: node
linkType: hard
"@vitest/utils@npm:3.2.3":
version: 3.2.3
resolution: "@vitest/utils@npm:3.2.3"
dependencies:
"@vitest/pretty-format": "npm:3.2.3"
loupe: "npm:^3.1.3"
tinyrainbow: "npm:^2.0.0"
checksum: 10c0/c7a785a73bc0d7c0202ced0d9912639b9deb6f05dd6c25700a13d97e13320ccec57660f11ad1f9225419ac485339fdf7af28c8d77456bcb9558e6c7d73ad538a
languageName: node
linkType: hard
"@vitest/utils@npm:^2.1.1":
version: 2.1.9
resolution: "@vitest/utils@npm:2.1.9"
@@ -11986,6 +12249,18 @@ __metadata:
languageName: node
linkType: hard
"debug@npm:^4.4.1":
version: 4.4.1
resolution: "debug@npm:4.4.1"
dependencies:
ms: "npm:^2.1.3"
peerDependenciesMeta:
supports-color:
optional: true
checksum: 10c0/d2b44bc1afd912b49bb7ebb0d50a860dc93a4dd7d946e8de94abc957bb63726b7dd5aa48c18c2386c379ec024c46692e15ed3ed97d481729f929201e671fcd55
languageName: node
linkType: hard
"decimal.js@npm:10, decimal.js@npm:^10.4.2, decimal.js@npm:^10.4.3":
version: 10.5.0
resolution: "decimal.js@npm:10.5.0"
@@ -13684,6 +13959,18 @@ __metadata:
languageName: node
linkType: hard
"fdir@npm:^6.4.5":
version: 6.4.6
resolution: "fdir@npm:6.4.6"
peerDependencies:
picomatch: ^3 || ^4
peerDependenciesMeta:
picomatch:
optional: true
checksum: 10c0/45b559cff889934ebb8bc498351e5acba40750ada7e7d6bde197768d2fa67c149be8ae7f8ff34d03f4e1eb20f2764116e56440aaa2f6689e9a4aa7ef06acafe9
languageName: node
linkType: hard
"fetch-mock@npm:^12.5.2":
version: 12.5.2
resolution: "fetch-mock@npm:12.5.2"
@@ -16102,6 +16389,13 @@ __metadata:
languageName: node
linkType: hard
"js-tokens@npm:^9.0.1":
version: 9.0.1
resolution: "js-tokens@npm:9.0.1"
checksum: 10c0/68dcab8f233dde211a6b5fd98079783cbcd04b53617c1250e3553ee16ab3e6134f5e65478e41d82f6d351a052a63d71024553933808570f04dbf828d7921e80e
languageName: node
linkType: hard
"js-yaml@npm:^3.13.1":
version: 3.14.1
resolution: "js-yaml@npm:3.14.1"
@@ -17839,6 +18133,15 @@ __metadata:
languageName: node
linkType: hard
"nanoid@npm:^3.3.11":
version: 3.3.11
resolution: "nanoid@npm:3.3.11"
bin:
nanoid: bin/nanoid.cjs
checksum: 10c0/40e7f70b3d15f725ca072dfc4f74e81fcf1fbb02e491cf58ac0c79093adc9b0a73b152bcde57df4b79cd097e13023d7504acb38404a4da7bc1cd8e887b82fe0b
languageName: node
linkType: hard
"nanoid@npm:^5.1.5":
version: 5.1.5
resolution: "nanoid@npm:5.1.5"
@@ -19041,6 +19344,17 @@ __metadata:
languageName: node
linkType: hard
"postcss@npm:^8.5.4":
version: 8.5.4
resolution: "postcss@npm:8.5.4"
dependencies:
nanoid: "npm:^3.3.11"
picocolors: "npm:^1.1.1"
source-map-js: "npm:^1.2.1"
checksum: 10c0/0feff648614a834f7cd5396ea6b05b658ca0507e10a4eaad03b56c348f6aec93f42a885fc1b30522630c6a7e49ae53b38a061e3cba526f2d9857afbe095a22bb
languageName: node
linkType: hard
"postgres-array@npm:~2.0.0":
version: 2.0.0
resolution: "postgres-array@npm:2.0.0"
@@ -20432,6 +20746,81 @@ __metadata:
languageName: node
linkType: hard
"rollup@npm:^4.40.0":
version: 4.42.0
resolution: "rollup@npm:4.42.0"
dependencies:
"@rollup/rollup-android-arm-eabi": "npm:4.42.0"
"@rollup/rollup-android-arm64": "npm:4.42.0"
"@rollup/rollup-darwin-arm64": "npm:4.42.0"
"@rollup/rollup-darwin-x64": "npm:4.42.0"
"@rollup/rollup-freebsd-arm64": "npm:4.42.0"
"@rollup/rollup-freebsd-x64": "npm:4.42.0"
"@rollup/rollup-linux-arm-gnueabihf": "npm:4.42.0"
"@rollup/rollup-linux-arm-musleabihf": "npm:4.42.0"
"@rollup/rollup-linux-arm64-gnu": "npm:4.42.0"
"@rollup/rollup-linux-arm64-musl": "npm:4.42.0"
"@rollup/rollup-linux-loongarch64-gnu": "npm:4.42.0"
"@rollup/rollup-linux-powerpc64le-gnu": "npm:4.42.0"
"@rollup/rollup-linux-riscv64-gnu": "npm:4.42.0"
"@rollup/rollup-linux-riscv64-musl": "npm:4.42.0"
"@rollup/rollup-linux-s390x-gnu": "npm:4.42.0"
"@rollup/rollup-linux-x64-gnu": "npm:4.42.0"
"@rollup/rollup-linux-x64-musl": "npm:4.42.0"
"@rollup/rollup-win32-arm64-msvc": "npm:4.42.0"
"@rollup/rollup-win32-ia32-msvc": "npm:4.42.0"
"@rollup/rollup-win32-x64-msvc": "npm:4.42.0"
"@types/estree": "npm:1.0.7"
fsevents: "npm:~2.3.2"
dependenciesMeta:
"@rollup/rollup-android-arm-eabi":
optional: true
"@rollup/rollup-android-arm64":
optional: true
"@rollup/rollup-darwin-arm64":
optional: true
"@rollup/rollup-darwin-x64":
optional: true
"@rollup/rollup-freebsd-arm64":
optional: true
"@rollup/rollup-freebsd-x64":
optional: true
"@rollup/rollup-linux-arm-gnueabihf":
optional: true
"@rollup/rollup-linux-arm-musleabihf":
optional: true
"@rollup/rollup-linux-arm64-gnu":
optional: true
"@rollup/rollup-linux-arm64-musl":
optional: true
"@rollup/rollup-linux-loongarch64-gnu":
optional: true
"@rollup/rollup-linux-powerpc64le-gnu":
optional: true
"@rollup/rollup-linux-riscv64-gnu":
optional: true
"@rollup/rollup-linux-riscv64-musl":
optional: true
"@rollup/rollup-linux-s390x-gnu":
optional: true
"@rollup/rollup-linux-x64-gnu":
optional: true
"@rollup/rollup-linux-x64-musl":
optional: true
"@rollup/rollup-win32-arm64-msvc":
optional: true
"@rollup/rollup-win32-ia32-msvc":
optional: true
"@rollup/rollup-win32-x64-msvc":
optional: true
fsevents:
optional: true
bin:
rollup: dist/bin/rollup
checksum: 10c0/160fdb0874af5f0f619987b4e9abb3b136fc154f759762bfde4d65d864d6d06594ae7d1d8e6d4558d1b8ef329aaa6a8de543e90feead3d872db15cf61f78426c
languageName: node
linkType: hard
"router@npm:^2.2.0":
version: 2.2.0
resolution: "router@npm:2.2.0"
@@ -21622,6 +22011,15 @@ __metadata:
languageName: node
linkType: hard
"strip-literal@npm:^3.0.0":
version: 3.0.0
resolution: "strip-literal@npm:3.0.0"
dependencies:
js-tokens: "npm:^9.0.1"
checksum: 10c0/d81657f84aba42d4bbaf2a677f7e7f34c1f3de5a6726db8bc1797f9c0b303ba54d4660383a74bde43df401cf37cce1dff2c842c55b077a4ceee11f9e31fba828
languageName: node
linkType: hard
"stubborn-fs@npm:^1.2.5":
version: 1.2.5
resolution: "stubborn-fs@npm:1.2.5"
@@ -21919,6 +22317,16 @@ __metadata:
languageName: node
linkType: hard
"tinyglobby@npm:^0.2.14":
version: 0.2.14
resolution: "tinyglobby@npm:0.2.14"
dependencies:
fdir: "npm:^6.4.4"
picomatch: "npm:^4.0.2"
checksum: 10c0/f789ed6c924287a9b7d3612056ed0cda67306cd2c80c249fd280cf1504742b12583a2089b61f4abbd24605f390809017240e250241f09938054c9b363e51c0a6
languageName: node
linkType: hard
"tinypool@npm:^1.0.2":
version: 1.0.2
resolution: "tinypool@npm:1.0.2"
@@ -21926,6 +22334,13 @@ __metadata:
languageName: node
linkType: hard
"tinypool@npm:^1.1.0":
version: 1.1.0
resolution: "tinypool@npm:1.1.0"
checksum: 10c0/deb6bde5e3d85d4ba043806c66f43fb5b649716312a47b52761a83668ffc71cd0ea4e24254c1b02a3702e5c27e02605f0189a1460f6284a5930a08bd0c06435c
languageName: node
linkType: hard
"tinyrainbow@npm:^1.2.0":
version: 1.2.0
resolution: "tinyrainbow@npm:1.2.0"
@@ -21947,6 +22362,13 @@ __metadata:
languageName: node
linkType: hard
"tinyspy@npm:^4.0.3":
version: 4.0.3
resolution: "tinyspy@npm:4.0.3"
checksum: 10c0/0a92a18b5350945cc8a1da3a22c9ad9f4e2945df80aaa0c43e1b3a3cfb64d8501e607ebf0305e048e3c3d3e0e7f8eb10cea27dc17c21effb73e66c4a3be36373
languageName: node
linkType: hard
"tldts-core@npm:^6.1.78":
version: 6.1.78
resolution: "tldts-core@npm:6.1.78"
@@ -22908,6 +23330,21 @@ __metadata:
languageName: node
linkType: hard
"vite-node@npm:3.2.3":
version: 3.2.3
resolution: "vite-node@npm:3.2.3"
dependencies:
cac: "npm:^6.7.14"
debug: "npm:^4.4.1"
es-module-lexer: "npm:^1.7.0"
pathe: "npm:^2.0.3"
vite: "npm:^5.0.0 || ^6.0.0 || ^7.0.0-0"
bin:
vite-node: vite-node.mjs
checksum: 10c0/b952b0d9e45662506ea7303ac87d08e02f1e3355777cf7d426f211292c4f87e8837aef589e552bb11404d1bc0a9bd18871ce6ba874b5f0bb171f8e010de20a11
languageName: node
linkType: hard
"vite-plugin-dts@npm:^4.5.3":
version: 4.5.3
resolution: "vite-plugin-dts@npm:4.5.3"
@@ -22996,6 +23433,61 @@ __metadata:
languageName: node
linkType: hard
"vite@npm:^5.0.0 || ^6.0.0 || ^7.0.0-0":
version: 7.0.0-beta.1
resolution: "vite@npm:7.0.0-beta.1"
dependencies:
esbuild: "npm:^0.25.0"
fdir: "npm:^6.4.5"
fsevents: "npm:~2.3.3"
picomatch: "npm:^4.0.2"
postcss: "npm:^8.5.4"
rollup: "npm:^4.40.0"
tinyglobby: "npm:^0.2.14"
peerDependencies:
"@types/node": ^20.19.0 || >=22.12.0
jiti: ">=1.21.0"
less: ^4.0.0
lightningcss: ^1.21.0
sass: ^1.70.0
sass-embedded: ^1.70.0
stylus: ">=0.54.8"
sugarss: ^5.0.0
terser: ^5.16.0
tsx: ^4.8.1
yaml: ^2.4.2
dependenciesMeta:
fsevents:
optional: true
peerDependenciesMeta:
"@types/node":
optional: true
jiti:
optional: true
less:
optional: true
lightningcss:
optional: true
sass:
optional: true
sass-embedded:
optional: true
stylus:
optional: true
sugarss:
optional: true
terser:
optional: true
tsx:
optional: true
yaml:
optional: true
bin:
vite: bin/vite.js
checksum: 10c0/0ab20103182244b310fb2bb4a9f3fb21110a61328052e73accfebf3503270bddd1d19417c2d17bd93f1108125da5ffbc52a1f05c8bf3f564907919ffc64d3d78
languageName: node
linkType: hard
"vite@npm:^6.3.5":
version: 6.3.5
resolution: "vite@npm:6.3.5"
@@ -23105,6 +23597,62 @@ __metadata:
languageName: node
linkType: hard
"vitest@npm:^3.2.3":
version: 3.2.3
resolution: "vitest@npm:3.2.3"
dependencies:
"@types/chai": "npm:^5.2.2"
"@vitest/expect": "npm:3.2.3"
"@vitest/mocker": "npm:3.2.3"
"@vitest/pretty-format": "npm:^3.2.3"
"@vitest/runner": "npm:3.2.3"
"@vitest/snapshot": "npm:3.2.3"
"@vitest/spy": "npm:3.2.3"
"@vitest/utils": "npm:3.2.3"
chai: "npm:^5.2.0"
debug: "npm:^4.4.1"
expect-type: "npm:^1.2.1"
magic-string: "npm:^0.30.17"
pathe: "npm:^2.0.3"
picomatch: "npm:^4.0.2"
std-env: "npm:^3.9.0"
tinybench: "npm:^2.9.0"
tinyexec: "npm:^0.3.2"
tinyglobby: "npm:^0.2.14"
tinypool: "npm:^1.1.0"
tinyrainbow: "npm:^2.0.0"
vite: "npm:^5.0.0 || ^6.0.0 || ^7.0.0-0"
vite-node: "npm:3.2.3"
why-is-node-running: "npm:^2.3.0"
peerDependencies:
"@edge-runtime/vm": "*"
"@types/debug": ^4.1.12
"@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0
"@vitest/browser": 3.2.3
"@vitest/ui": 3.2.3
happy-dom: "*"
jsdom: "*"
peerDependenciesMeta:
"@edge-runtime/vm":
optional: true
"@types/debug":
optional: true
"@types/node":
optional: true
"@vitest/browser":
optional: true
"@vitest/ui":
optional: true
happy-dom:
optional: true
jsdom:
optional: true
bin:
vitest: vitest.mjs
checksum: 10c0/1d853016622f32020e91cc72348d0dc642bde2ddcbd648655a9d33d420375c7cbd6f1a6f5c4398a5d4f59b8c2b120e62eba49fb37f8042e5d4c688b7e60148ef
languageName: node
linkType: hard
"vscode-uri@npm:^3.0.8":
version: 3.1.0
resolution: "vscode-uri@npm:3.1.0"