Files
Enes Yakıştır 33b0940012
Build and Push Docker Images / build (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s
feat: SnapCAD Studio'yu YakHub deposuna taşı
- DWG/DXF içe aktarma ve .skf yeniden açma düzeltmeleri

- YakNet Bulut eşitlemede boş/eski kopya koruması ve yerel-only proje bildirimi

- Panelden içe aktarma duyuruları ve erişilebilir Türkçe hata mesajları

- AGPL-3.0 lisansı, README ve YakHub bağlantıları
2026-10-25 18:20:21 +03:00

43 lines
2.2 KiB
JavaScript

// Stages WebAssembly runtimes for DWG conversion into apps/web/public
// so that AutoCAD drawings (.dwg) can be converted directly in the browser
// without requiring native software or backend servers.
import { cp, mkdir, readdir } from "node:fs/promises";
import { existsSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
// 1. Stage dwgdxf (acadrust Rust WASM - 820 KB)
const dwgdxfSrc = join(root, "node_modules", "dwgdxf", "dist", "wasm");
const dwgdxfDest = join(root, "apps", "web", "public", "dwgdxf");
if (existsSync(dwgdxfSrc)) {
await mkdir(dwgdxfDest, { recursive: true });
const entries = await readdir(dwgdxfSrc);
const wanted = entries.filter((name) => name.endsWith(".js") || name.endsWith(".wasm"));
await Promise.all(wanted.map((name) => cp(join(dwgdxfSrc, name), join(dwgdxfDest, name))));
console.log(`[copy-dwg-wasm] staged ${wanted.length} files into apps/web/public/dwgdxf/`);
}
// 2. Stage @mlightcad/libredwg-web wasm
const mlightSrc = join(root, "node_modules", "@mlightcad", "libredwg-web", "wasm");
const mlightDest = join(root, "apps", "web", "public", "libredwg-web");
if (existsSync(mlightSrc)) {
await mkdir(mlightDest, { recursive: true });
const entries = await readdir(mlightSrc);
const wanted = entries.filter((name) => name.endsWith(".js") || name.endsWith(".wasm"));
await Promise.all(wanted.map((name) => cp(join(mlightSrc, name), join(mlightDest, name))));
console.log(`[copy-dwg-wasm] staged ${wanted.length} files into apps/web/public/libredwg-web/`);
}
// 3. Stage legacy dwg2dxf-converter wasm
const legacySrc = join(root, "node_modules", "dwg2dxf-converter", "wasm");
const legacyDest = join(root, "apps", "web", "public", "libredwg");
if (existsSync(legacySrc)) {
await mkdir(legacyDest, { recursive: true });
const entries = await readdir(legacySrc);
const wanted = entries.filter((name) => name.endsWith(".js") || name.endsWith(".wasm"));
await Promise.all(wanted.map((name) => cp(join(legacySrc, name), join(legacyDest, name))));
console.log(`[copy-dwg-wasm] staged ${wanted.length} files into apps/web/public/libredwg/`);
}