Fix Turbopack module resolution for lzma and restore path imports

This commit is contained in:
openhands committed 2026-08-25 22:19:59 +02:00
1 parent a5044c80d7
commit e06596391e
35 files changed
+392 -333

No files matched your search

+7 -2
View File
@@ -1,6 +1,7 @@
import { existsSync } from "node:fs";
import path from "node:path";
import { getGamedataRoot } from "@/lib/services/furni-asset-dirs";
import { getRuntimePath } from "@/lib/utils/runtime-path";
// The CMS default gamedata JSON paths point under public/nitro-assets/gamedata/,
// but this deployment keeps the gamedata JSON (FigureMap/FigureData/EffectMap…)
@@ -11,7 +12,11 @@ import { getGamedataRoot } from "@/lib/services/furni-asset-dirs";
// `bundled/` dir, the location the Nitro client loads from.)
function pub(...segs: string[]): string {
return path.join(/*turbopackIgnore: true*/ process.cwd(), "public", ...segs);
return getRuntimePath(
/*turbopackIgnore: true*/ process.cwd(),
"public",
...segs,
);
}
/**
@@ -41,7 +46,7 @@ export async function resolveGamedataFile(
// Deployment gamedata root (e.g. /var/www/Gamedata/config/…).
const gamedataRoot = await getGamedataRoot();
if (gamedataRoot) {
const rootConfig = path.join(
const rootConfig = getRuntimePath(
/*turbopackIgnore: true*/ gamedataRoot,
"config",
fallbackName,
@@ -1,7 +1,7 @@
import { promises as fs } from "node:fs";
import os from "node:os";
import path from "node:path";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { getRuntimePath } from "@/lib/utils/runtime-path";
import {
readGamedataJson,
withGamedataLock,
@@ -12,8 +12,8 @@ let dir: string;
let file: string;
beforeEach(async () => {
dir = await fs.mkdtemp(path.join(os.tmpdir(), "gamedata-"));
file = path.join(dir, "EffectMap.json");
dir = await fs.mkdtemp(getRuntimePath(os.tmpdir(), "gamedata-"));
file = getRuntimePath(dir, "EffectMap.json");
await fs.writeFile(
file,
JSON.stringify({ effects: [{ id: "1", lib: "A" }] }),