Fix Turbopack module resolution for lzma and restore path imports
This commit is contained in:
1 parent
a5044c80d7
commit
e06596391e
35 files changed
+392
-333
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import path from "node:path";
|
||||
import { getRuntimePath } from "@/lib/utils/runtime-path";
|
||||
/**
|
||||
* Localized furnidata builder — generates FurnitureData_<lang>.json files
|
||||
* (nl/en/de/fr/es/tr/it/pt/fi/pl/ru/ar/ja) from the master FurnitureData.json
|
||||
@@ -10,7 +12,6 @@
|
||||
*/
|
||||
|
||||
import { existsSync, promises as fs } from "node:fs";
|
||||
import path from "node:path";
|
||||
import type { HabboGamedataHotel } from "@/lib/habbo-gamedata-hotel";
|
||||
import { habboFurnidataUrl } from "@/lib/habbo-gamedata-hotel";
|
||||
import { logger } from "@/lib/logger";
|
||||
@@ -105,8 +106,8 @@ async function loadLibreCache(): Promise<Map<string, string>> {
|
||||
try {
|
||||
const gamedataRoot = await getGamedataRoot();
|
||||
const cachePath = gamedataRoot
|
||||
? path.join(gamedataRoot, "config", LIBRE_CACHE_FILE)
|
||||
: path.join(process.cwd(), LIBRE_CACHE_FILE);
|
||||
? getRuntimePath(gamedataRoot, "config", LIBRE_CACHE_FILE)
|
||||
: getRuntimePath(process.cwd(), LIBRE_CACHE_FILE);
|
||||
if (existsSync(cachePath)) {
|
||||
const raw = await fs.readFile(cachePath, "utf-8");
|
||||
const obj = JSON.parse(raw) as LibreCache;
|
||||
@@ -126,8 +127,8 @@ async function saveLibreCache(): Promise<void> {
|
||||
try {
|
||||
const gamedataRoot = await getGamedataRoot();
|
||||
const cachePath = gamedataRoot
|
||||
? path.join(gamedataRoot, "config", LIBRE_CACHE_FILE)
|
||||
: path.join(process.cwd(), LIBRE_CACHE_FILE);
|
||||
? getRuntimePath(gamedataRoot, "config", LIBRE_CACHE_FILE)
|
||||
: getRuntimePath(process.cwd(), LIBRE_CACHE_FILE);
|
||||
const obj: LibreCache = Object.fromEntries(libreMemoryCache.entries());
|
||||
await fs.mkdir(path.dirname(cachePath), { recursive: true });
|
||||
await fs.writeFile(cachePath, JSON.stringify(obj), "utf-8");
|
||||
@@ -363,7 +364,7 @@ async function getLocalizedWritePaths(lang: string): Promise<string[]> {
|
||||
for (const base of bases) {
|
||||
const dir = path.dirname(base);
|
||||
const langFile = `FurnitureData_${lang}.json`;
|
||||
out.push(path.join(dir, langFile));
|
||||
out.push(getRuntimePath(dir, langFile));
|
||||
}
|
||||
// Deduplicate same normalized path.
|
||||
const seen = new Set<string>();
|
||||
|
||||
Reference in new issue
Block a user