Merge [C1][C2] DXF-/DWG-Import in Rust ueber acadrust (import.rs, split.rs, common.rs); libredwg-web nur noch Test-Abhaengigkeit
dxf-parser und libredwg-web aus der App entfernt; DWG 200k Linien 6-8 s -> 0.8 s, DXF ab 4 MB parallel. Neu/behoben: Binaer-DXF, Bulges tesselliert, DWG mit Texten/Schraffuren/Ebenenfarben, cp1252-Umlaute. libredwg-web bleibt devDependency als unabhaengiger Gegenleser im DWG-Export-Test. Browser-Build startet geprueft. Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
This commit is contained in:
39 files changed
+2583
-2994
No files matched your search
@@ -0,0 +1,18 @@
|
||||
// Nur für Tests/Werkzeuge in Node: Format-Modul (pkgFileIo) synchron aus der Datei laden. Nicht im
|
||||
// globalen Vitest-Setup, weil nur wenige Tests DXF/DWG lesen (das Modul ist gross) — dort per
|
||||
// `beforeAll(loadFileioForTests)`.
|
||||
|
||||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { initFileioSync } from "./fileioWasm";
|
||||
|
||||
export async function loadFileioForTests(): Promise<void> {
|
||||
const file = fileURLToPath(new URL("./pkgFileIo/fileio_bg.wasm", import.meta.url));
|
||||
let bytes: Buffer;
|
||||
try {
|
||||
bytes = readFileSync(file);
|
||||
} catch {
|
||||
throw new Error(`Format-Modul fehlt (${file}): zuerst \`npm run build:fileio\`.`);
|
||||
}
|
||||
await initFileioSync(new Uint8Array(bytes));
|
||||
}
|
||||
@@ -28,6 +28,11 @@ export function fileio(): FileioModule {
|
||||
return mod;
|
||||
}
|
||||
|
||||
/** Das geladene Format-Modul oder `null` (vorher `loadFileio()`/`initFileioSync()`). */
|
||||
export function fileioLoaded(): FileioModule | null {
|
||||
return mod;
|
||||
}
|
||||
|
||||
/** Synchron laden aus vorliegenden Bytes (Node: Tests, Werkzeuge). */
|
||||
export async function initFileioSync(bytes: BufferSource): Promise<FileioModule> {
|
||||
if (mod) return mod;
|
||||
|
||||
Reference in new issue
Block a user