chore: remove 4 unused files (theme-editor-fields, use-user-bulk-actions, user-columns, use-media-library)
CI / check (push) Successful in 1m42s
CI / deploy (push) Successful in 1m36s
CI / e2e (push) Successful in 21s

This commit is contained in:
openhands committed 2026-09-05 23:27:02 +02:00
1 parent 9bc0834bbb
commit 9ae03056e2
17 files changed
+149 -1028

No files matched your search

+17 -1
View File
@@ -1,7 +1,12 @@
export type DateFormatVariant = "date" | "datetime" | "datetime-seconds";
export type DateFormatVariant =
| "date"
| "time"
| "datetime"
| "datetime-seconds";
const FALLBACKS: Record<DateFormatVariant, string> = {
date: "",
time: "—",
datetime: "—",
"datetime-seconds": "—",
};
@@ -11,6 +16,7 @@ const FALLBACKS: Record<DateFormatVariant, string> = {
* admin/site pages no longer each redefine their own copy.
*
* - "date" → 2026-07-18
* - "time" → 18:30
* - "datetime" → 2026-07-18 18:30
* - "datetime-seconds"→ 2026-07-18 18:30:45
*
@@ -27,9 +33,19 @@ export function formatDate(
switch (variant) {
case "date":
return iso.slice(0, 10);
case "time":
return iso.slice(11, 16);
case "datetime-seconds":
return iso.slice(0, 19).replace("T", " ");
default:
return iso.slice(0, 16).replace("T", " ");
}
}
/**
* Format a number with grouped thousands. Uses the provided locale or a
* consistent default for admin pages. Keeps number formatting in one place.
*/
export function formatNumber(n: number, locale: string = "en-US"): string {
return n.toLocaleString(locale);
}
@@ -25,6 +25,7 @@ const mocks = vi.hoisted(() => ({
dirs: vi.fn(),
data: vi.fn(),
settings: vi.fn(),
publicRoot: vi.fn(),
}));
vi.mock("@/lib/db", () => ({
db: { $client: { getConnection: async () => mocks } },
@@ -36,6 +37,9 @@ vi.mock("@/lib/services/furni-asset-dirs", () => ({
vi.mock("@/lib/services/furni-data", () => ({
getFurnitureDataPath: mocks.data,
}));
vi.mock("@/lib/services/public-asset-root", () => ({
getPublicAssetRoot: mocks.publicRoot,
}));
vi.mock("@/lib/services/site-settings", () => ({
siteSettings: { get: mocks.settings },
}));
@@ -109,6 +113,7 @@ describe("catalog snapshot", () => {
await writeFile(path.join(root, "custom/FigureMap.json"), "{}");
await writeFile(path.join(root, "custom/EffectMap.json"), "{}");
mocks.gamedata.mockResolvedValue(root);
mocks.publicRoot.mockReturnValue(root);
mocks.dirs.mockResolvedValue({
nitroDir: path.join(root, "bundled/furniture"),
iconDir: path.join(root, "icons"),
+4 -3
View File
@@ -10,6 +10,7 @@ import {
getGamedataRoot,
} from "@/lib/services/furni-asset-dirs";
import { getFurnitureDataPath } from "@/lib/services/furni-data";
import { getPublicAssetRoot } from "@/lib/services/public-asset-root";
import { siteSettings } from "@/lib/services/site-settings";
import {
CATALOG_LANGUAGE_ROOT,
@@ -59,12 +60,12 @@ export async function createCatalogSnapshot(
const furnitureData = await getFurnitureDataPath();
// Default files first; configured live locations take precedence.
await addTree(
path.join(process.cwd(), "public/swf/c_images"),
path.join(getPublicAssetRoot(), "public/swf/c_images"),
"Gamedata/c_images",
/\.(png|gif|webp|jpe?g)$/i,
);
await addTree(
path.join(process.cwd(), "public/nitro-assets/bundled"),
path.join(getPublicAssetRoot(), "public/nitro-assets/bundled"),
"Gamedata/bundled",
/\.nitro$/i,
);
@@ -94,7 +95,7 @@ export async function createCatalogSnapshot(
}
// Pets currently write directly to the CMS directory.
await addTree(
path.join(process.cwd(), "public/nitro-assets/bundled/pet"),
path.join(getPublicAssetRoot(), "public/nitro-assets/bundled/pet"),
"Gamedata/bundled/pet",
/\.nitro$/i,
);