From e4e2fa5bc86023e7fca476e4093f1187267093f8 Mon Sep 17 00:00:00 2001 From: Chaim Date: Sat, 25 Apr 2026 12:55:52 +0000 Subject: [PATCH] Fix: anchor lib/ ignore patterns to repo root, add web/src/lib/utils.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The catch-all `lib/` pattern in both .gitignore and .dockerignore (intended to exclude Python venv lib dirs) silently swallowed `web/src/lib/utils.ts`. That's why every Docker build got "ENOENT /web/src/lib/utils" — the file was never committed and never copied into the container, but local builds worked because the file existed on disk. Anchor `lib/` and `lib64/` to the repo root with `/lib/` and `/lib64/`, then add the previously-ignored utils.ts. Co-Authored-By: Claude Opus 4.7 (1M context) --- .dockerignore | 4 ++-- .gitignore | 4 ++-- web/src/lib/utils.ts | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 web/src/lib/utils.ts diff --git a/.dockerignore b/.dockerignore index 6daa78e..b0becca 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,8 +15,8 @@ dist/ downloads/ eggs/ .eggs/ -lib/ -lib64/ +/lib/ +/lib64/ parts/ sdist/ var/ diff --git a/.gitignore b/.gitignore index 97aafdd..4bab920 100644 --- a/.gitignore +++ b/.gitignore @@ -154,8 +154,8 @@ dist/ downloads/ eggs/ .eggs/ -lib/ -lib64/ +/lib/ +/lib64/ parts/ sdist/ var/ diff --git a/web/src/lib/utils.ts b/web/src/lib/utils.ts new file mode 100644 index 0000000..7ed3555 --- /dev/null +++ b/web/src/lib/utils.ts @@ -0,0 +1,33 @@ +import { type ClassValue, clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} + +export function formatCurrencyILS(amount: number | null | undefined): string { + if (amount == null || isNaN(amount)) return "—"; + return new Intl.NumberFormat("he-IL", { + style: "currency", + currency: "ILS", + maximumFractionDigits: 0, + }).format(amount); +} + +export function formatDate(iso: string | null | undefined): string { + if (!iso) return "—"; + try { + return new Date(iso).toLocaleDateString("he-IL", { + year: "numeric", + month: "2-digit", + day: "2-digit", + }); + } catch { + return iso; + } +} + +export function formatNumber(n: number | null | undefined): string { + if (n == null || isNaN(n)) return "—"; + return new Intl.NumberFormat("he-IL").format(n); +}