mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 22:26:13 +00:00
fix(tz): split pure helpers out of resolver to keep client bundle clean
`@/lib/tz/resolver` imported `prisma` at module top so any client component that pulled `detectBrowserTimezone`, `listSupportedTimezones`, `formatInUserTz`, `userDayKey`, or `DEFAULT_TIMEZONE` dragged `node:module` into the browser bundle and broke the Turbopack build (register page, timezone picker, admin general/login sections, `@/lib/export`). Pure helpers now live in `@/lib/tz/format` (no Prisma). The resolver re-exports them so every server-side caller keeps its `@/lib/tz/resolver` import path; the four client modules + the export helper now import from `./format` directly.
This commit is contained in:
1 parent
ee560a435c
commit
7bede83d22
7 files changed
+251
-226
No files matched your search
@@ -4,7 +4,7 @@ import { useMemo } from "react";
|
||||
import { Settings } from "lucide-react";
|
||||
import { useTranslations } from "@/lib/i18n/context";
|
||||
import { SettingsToggle, useAdminSettings, useUpdateSettings } from "./_shared";
|
||||
import { listSupportedTimezones } from "@/lib/tz/resolver";
|
||||
import { listSupportedTimezones } from "@/lib/tz/format";
|
||||
|
||||
const NATIVE_SELECT_CLASS =
|
||||
"border-input bg-background text-foreground ring-offset-background focus-visible:ring-ring flex h-9 rounded-md border px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-none";
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
import { formatDateTime } from "@/lib/format";
|
||||
import { useTranslations } from "@/lib/i18n/context";
|
||||
import { toCSV } from "@/lib/export";
|
||||
import { formatInUserTz, DEFAULT_TIMEZONE } from "@/lib/tz/resolver";
|
||||
import { formatInUserTz, DEFAULT_TIMEZONE } from "@/lib/tz/format";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import {
|
||||
type AdminAuditEntry,
|
||||
|
||||
Reference in new issue
Block a user