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
@@ -17,6 +17,7 @@ import {
|
||||
} from "@/lib/services/furni-import";
|
||||
import { nitroAnimationStatesCount } from "@/lib/services/furni-real-interaction";
|
||||
import { parseNitroBundle } from "@/lib/services/swf/nitro-builder";
|
||||
import { getRuntimePath, getRuntimeResolve } from "@/lib/utils/runtime-path";
|
||||
|
||||
export interface UploadResult {
|
||||
ok: boolean;
|
||||
@@ -42,7 +43,7 @@ export interface UploadParams {
|
||||
customparams?: string;
|
||||
}
|
||||
|
||||
const MIGRATIONS_DIR = path.resolve(
|
||||
const MIGRATIONS_DIR = getRuntimeResolve(
|
||||
/*turbopackIgnore: true*/ process.cwd(),
|
||||
"drizzle/migrations",
|
||||
);
|
||||
@@ -67,7 +68,7 @@ async function mirrorUploadedAsset(
|
||||
const sourceKey = pathKey(sourcePath);
|
||||
const seen = new Set<string>();
|
||||
for (const dir of dirs) {
|
||||
const targetPath = path.join(/*turbopackIgnore: true*/ dir, fileName);
|
||||
const targetPath = getRuntimePath(/*turbopackIgnore: true*/ dir, fileName);
|
||||
const targetKey = pathKey(targetPath);
|
||||
if (targetKey === sourceKey || seen.has(targetKey)) continue;
|
||||
seen.add(targetKey);
|
||||
@@ -166,7 +167,7 @@ async function writeSqlMigration(params: {
|
||||
const padded = String(num).padStart(4, "0");
|
||||
const className = params.classname.replace(/[^a-zA-Z0-9_-]/g, "_");
|
||||
const fileName = `${padded}_import_furni_${className}.sql`;
|
||||
const filePath = path.join(
|
||||
const filePath = getRuntimePath(
|
||||
/*turbopackIgnore: true*/ MIGRATIONS_DIR,
|
||||
fileName,
|
||||
);
|
||||
@@ -283,7 +284,7 @@ export async function uploadSingleFurni(params: {
|
||||
const { iconDir, nitroDir } = assetTargets;
|
||||
|
||||
const nitroFileName = `${classname}.nitro`;
|
||||
const nitroPath = path.join(
|
||||
const nitroPath = getRuntimePath(
|
||||
/*turbopackIgnore: true*/ nitroDir,
|
||||
nitroFileName,
|
||||
);
|
||||
@@ -301,7 +302,7 @@ export async function uploadSingleFurni(params: {
|
||||
let iconPath: string | null = null;
|
||||
if (iconBuffer && iconBuffer.length > 0) {
|
||||
iconFileName = `${classname}_icon.png`;
|
||||
iconPath = path.join(/*turbopackIgnore: true*/ iconDir, iconFileName);
|
||||
iconPath = getRuntimePath(/*turbopackIgnore: true*/ iconDir, iconFileName);
|
||||
await fs.writeFile(iconPath, iconBuffer);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user