feat: SnapCAD Studio'yu YakHub deposuna taşı
Build and Push Docker Images / build (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s

- 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ı
This commit is contained in:
Enes Yakıştır
2026-10-25 18:20:21 +03:00
parent e9cb8e8681
commit 33b0940012
149 changed files with 46978 additions and 1273 deletions
+29
View File
@@ -0,0 +1,29 @@
import { spawnSync } from "node:child_process";
import { existsSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const repoRoot = dirname(dirname(fileURLToPath(import.meta.url)));
const nextBin = join(repoRoot, "node_modules", "next", "dist", "bin", "next");
if (!existsSync(nextBin)) {
console.error(`[build-static] Next.js binary not found: ${nextBin}`);
console.error("[build-static] Run `npm install` first.");
process.exit(1);
}
const result = spawnSync(process.execPath, [nextBin, "build", "apps/web"], {
cwd: repoRoot,
stdio: "inherit",
env: {
...process.env,
STATIC_EXPORT: "true",
},
});
if (result.error) {
console.error(`[build-static] ${result.error.message}`);
process.exit(1);
}
process.exit(result.status ?? 1);
+42
View File
@@ -0,0 +1,42 @@
// 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/`);
}
+24
View File
@@ -0,0 +1,24 @@
// Stages the LibreDWG WebAssembly runtime (libredwg.js + libredwg.wasm)
// into apps/web/public/libredwg so that DWG files can be imported directly
// inside the browser without requiring external native tools.
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)), "..");
const src = join(root, "node_modules", "dwg2dxf-converter", "wasm");
const dest = join(root, "apps", "web", "public", "libredwg");
if (!existsSync(src)) {
console.error(`[copy-libredwg-wasm] dwg2dxf-converter wasm not found at ${src}. Run \`npm install\` first.`);
process.exit(1);
}
await mkdir(dest, { recursive: true });
const entries = await readdir(src);
const wanted = entries.filter((name) => name.endsWith(".js") || name.endsWith(".wasm"));
await Promise.all(wanted.map((name) => cp(join(src, name), join(dest, name))));
console.log(`[copy-libredwg-wasm] staged ${wanted.length} files into apps/web/public/libredwg/`);
+118
View File
@@ -0,0 +1,118 @@
import fs from "fs";
import path from "path";
import sharp from "sharp";
async function generateIcons() {
const publicDir = path.resolve("apps/web/public");
const iconsDir = path.join(publicDir, "icons");
if (!fs.existsSync(iconsDir)) {
fs.mkdirSync(iconsDir, { recursive: true });
}
// Create an elegant SnapCAD SVG icon
const svgIcon = `
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="bgGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#0284c7" />
<stop offset="50%" stop-color="#0369a1" />
<stop offset="100%" stop-color="#0f172a" />
</linearGradient>
<linearGradient id="cubeTop" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#38bdf8" />
<stop offset="100%" stop-color="#0284c7" />
</linearGradient>
<linearGradient id="cubeLeft" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#0284c7" />
<stop offset="100%" stop-color="#0369a1" />
</linearGradient>
<linearGradient id="cubeRight" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#0ea5e9" />
<stop offset="100%" stop-color="#0284c7" />
</linearGradient>
<filter id="glow" x="-20%" y="-20%" width="140%" height="140%">
<feGaussianBlur stdDeviation="16" result="blur" />
<feComposite in="SourceGraphic" in2="blur" operator="over" />
</filter>
</defs>
<!-- Background rounded rect -->
<rect width="512" height="512" rx="108" fill="url(#bgGrad)" />
<!-- Subtle grid lines in background -->
<path d="M 96 160 L 416 160 M 96 256 L 416 256 M 96 352 L 416 352" stroke="#38bdf8" stroke-opacity="0.15" stroke-width="2" />
<path d="M 160 96 L 160 416 M 256 96 L 256 416 M 352 96 L 352 416" stroke="#38bdf8" stroke-opacity="0.15" stroke-width="2" />
<!-- 3D Isometric Cube Symbol representing SnapCAD -->
<g filter="url(#glow)">
<!-- Top Face -->
<polygon points="256,128 368,192 256,256 144,192" fill="url(#cubeTop)" />
<!-- Left Face -->
<polygon points="144,192 256,256 256,384 144,320" fill="url(#cubeLeft)" />
<!-- Right Face -->
<polygon points="256,256 368,192 368,320 256,384" fill="url(#cubeRight)" />
<!-- Isometric Highlight Edges -->
<polyline points="144,192 256,128 368,192" stroke="#e0f2fe" stroke-width="5" stroke-linejoin="round" />
<line x1="256" y1="256" x2="256" y2="384" stroke="#7dd3fc" stroke-width="4" />
<polyline points="144,192 256,256 368,192" stroke="#bae6fd" stroke-width="3" />
</g>
<!-- Modern Snap Indicator Dot -->
<circle cx="256" cy="256" r="10" fill="#facc15" stroke="#ffffff" stroke-width="3" />
</svg>
`;
const svgBuffer = Buffer.from(svgIcon);
// 1. icon-512.png
await sharp(svgBuffer)
.resize(512, 512)
.png()
.toFile(path.join(iconsDir, "icon-512.png"));
console.log("Generated icon-512.png");
// 2. icon-192.png
await sharp(svgBuffer)
.resize(192, 192)
.png()
.toFile(path.join(iconsDir, "icon-192.png"));
console.log("Generated icon-192.png");
// 3. icon-maskable-512.png (padded for safe zone)
await sharp(svgBuffer)
.resize(410, 410)
.extend({
top: 51,
bottom: 51,
left: 51,
right: 51,
background: "#0284c7"
})
.png()
.toFile(path.join(iconsDir, "icon-maskable-512.png"));
console.log("Generated icon-maskable-512.png");
// 4. icon-maskable-192.png
await sharp(path.join(iconsDir, "icon-maskable-512.png"))
.resize(192, 192)
.png()
.toFile(path.join(iconsDir, "icon-maskable-192.png"));
console.log("Generated icon-maskable-192.png");
// 5. apple-touch-icon.png (180x180)
await sharp(svgBuffer)
.resize(180, 180)
.png()
.toFile(path.join(iconsDir, "apple-touch-icon.png"));
console.log("Generated apple-touch-icon.png");
// 6. favicon-32.png
await sharp(svgBuffer)
.resize(32, 32)
.png()
.toFile(path.join(iconsDir, "favicon-32.png"));
console.log("Generated favicon-32.png");
}
generateIcons().catch(console.error);
+364
View File
@@ -0,0 +1,364 @@
import { chromium } from "playwright";
import fs from "node:fs";
import path from "node:path";
const ARTIFACT_DIR = "C:/Users/User/.gemini/antigravity/brain/8ebe9dae-b254-4a1e-a949-330621d3edea";
const SCREENSHOT_PATH = path.join(ARTIFACT_DIR, "snapcad-live-verification.png");
async function main() {
console.log("🚀 Starting Comprehensive Playwright Verification for SnapCAD Studio...");
const browser = await chromium.launch({
channel: "chrome",
headless: true,
args: [
"--host-resolver-rules=MAP snap.yakhub.com.tr 127.0.0.1",
"--no-sandbox",
"--disable-setuid-sandbox",
"--enable-webgl",
"--ignore-gpu-blocklist",
],
});
const context = await browser.newContext({
viewport: { width: 1440, height: 900 },
deviceScaleFactor: 1,
});
const page = await context.newPage();
const consoleErrors = [];
const networkErrors = [];
page.on("console", (msg) => {
if (msg.type() === "error") {
const text = msg.text();
if (!text.includes("favicon.ico")) {
consoleErrors.push(`[Console Error] ${text}`);
}
}
});
page.on("pageerror", (err) => {
consoleErrors.push(`[Page Error] ${err.message}`);
});
page.on("requestfailed", (req) => {
const url = req.url();
if (!url.endsWith("favicon.ico")) {
networkErrors.push(`${req.method()} ${url} - ${req.failure()?.errorText || "failed"}`);
}
});
page.on("response", (res) => {
if (res.status() >= 400 && !res.url().endsWith("favicon.ico")) {
networkErrors.push(`${res.status()} ${res.url()}`);
}
});
// -------------------------------------------------------------
// STEP 1: Dashboard Navigation & Verification
// -------------------------------------------------------------
console.log("📡 [1/7] Navigating to http://snap.yakhub.com.tr (Dashboard)...");
await page.goto("http://snap.yakhub.com.tr", { waitUntil: "networkidle", timeout: 30000 });
const title = await page.title();
console.log(`✅ Page Title: "${title}"`);
if (!title.includes("SnapCAD")) {
throw new Error(`Unexpected page title: ${title}`);
}
// -------------------------------------------------------------
// STEP 2: Sınıflar (Classrooms Studio) Test
// -------------------------------------------------------------
console.log("🎓 [2/7] Testing Sınıflar (Classrooms Studio & Modals)...");
const classNavBtn = page.locator('button.dashboard-nav-item:has-text("Sınıflar"), button:has-text("Sınıflar & Ortak Alanlar")').first();
await classNavBtn.click();
await page.waitForTimeout(800);
const classroomTitle = await page.title();
console.log(` - Classrooms Studio loaded. Title: "${classroomTitle}"`);
if (!classroomTitle.includes("Sınıflar")) {
throw new Error(`Expected title to include "Sınıflar", got "${classroomTitle}"`);
}
// Check classroom action buttons
const joinOrOpenBtn = page.locator('button:has-text("Sınıfa Katıl / Aç"), button:has-text("Yeni Sınıf Aç"), button:has-text("Sınıfa Katıl")').first();
if (await joinOrOpenBtn.isVisible()) {
console.log(` - Found classroom action: "${await joinOrOpenBtn.innerText()}"`);
await joinOrOpenBtn.click();
await page.waitForTimeout(600);
const dialog = page.locator('div[role="dialog"]');
const isDialogVisible = await dialog.isVisible();
console.log(` - Classroom Modal Dialog Visible: ${isDialogVisible}`);
if (isDialogVisible) {
await page.keyboard.press("Escape");
await page.waitForTimeout(400);
}
}
console.log("✅ Classrooms Studio verified successfully.");
// -------------------------------------------------------------
// STEP 3: Enter 3D Workplane Editor
// -------------------------------------------------------------
console.log("🎨 [3/7] Entering 3D Workplane Editor...");
const homeNavBtn = page.locator('button.dashboard-nav-item:has-text("3D Tasarımlar"), a:has-text("SnapCAD STUDIO")').first();
await homeNavBtn.click();
await page.waitForTimeout(600);
const createDesignBtn = page.locator('button:has-text("Yeni 3D Tasarım Oluştur"), button:has-text("Yeni 3D Tasarım")').first();
await createDesignBtn.click();
// Wait for canvas to mount and initialize
console.log(" - Waiting for 3D WebGL Canvas...");
const canvas = await page.waitForSelector("canvas", { timeout: 15000 });
const canvasBox = await canvas.boundingBox();
console.log(`✅ 3D Canvas initialized successfully: ${canvasBox?.width}x${canvasBox?.height}px`);
// -------------------------------------------------------------
// STEP 4: TopBar Features - Mobil AR Modal ("Masamda Gör")
// -------------------------------------------------------------
console.log("📱 [4/7] Testing Masamda Gör (Mobil AR Modal & Dynamic QR Code)...");
const topBarARBtn = page.locator('button.ar-btn, button:has-text("Masamda Gör (AR)")').first();
const viewportARBtn = page.locator("button.ar-trigger").first();
const targetARBtn = (await topBarARBtn.isVisible()) ? topBarARBtn : viewportARBtn;
if (await targetARBtn.isVisible()) {
await targetARBtn.click();
await page.waitForTimeout(800);
const arDialog = page.locator('div[role="dialog"]');
const arVisible = await arDialog.isVisible();
console.log(` - AR Modal dialog visible: ${arVisible}`);
// Verify QR code is rendered (image or canvas)
const qrEl = arDialog.locator("img, canvas").first();
const qrExists = (await qrEl.count()) > 0;
console.log(` - Dynamic QR Code element rendered: ${qrExists}`);
// Close AR modal using its dedicated close button
const closeBtn = arDialog.locator('button[aria-label="Pencereyi kapat"], button[title="Kapat"]').first();
if (await closeBtn.isVisible()) {
await closeBtn.click();
} else {
await page.keyboard.press("Escape");
}
await page.waitForTimeout(500);
console.log("✅ Mobil AR modal verified and closed.");
}
// -------------------------------------------------------------
// STEP 5: Viewport Controls - Section Planes & Physics Sandbox
// -------------------------------------------------------------
console.log("📐 [5/7] Testing Section Planes (Mimari Kesit Düzlemleri)...");
const sectionBtn = page.locator("button.section-plane-trigger").first();
if (await sectionBtn.isVisible()) {
await sectionBtn.click();
await page.waitForTimeout(600);
const popover = page.locator('div[role="dialog"][aria-label="Mimari Kesit Ayarları"]').first();
const axisY = popover.locator('button:has-text("Y (Kat)")').first();
if (await axisY.isVisible()) {
await axisY.click();
console.log(" - Selected Y (Kat) axis for section cut.");
}
const slider = popover.locator('input[type="range"]').first();
if (await slider.isVisible()) {
await slider.fill("30");
console.log(" - Adjusted section plane depth slider to 30.");
}
const invertLabel = popover.locator('label:has-text("Ters Yön")').first();
if (await invertLabel.isVisible()) {
await invertLabel.click();
console.log(" - Toggled invert section plane direction.");
}
// Close section panel using close button inside dialog
const closeSectionBtn = popover.locator('button[aria-label="Kesit ayarlarını kapat"]').first();
if (await closeSectionBtn.isVisible()) {
await closeSectionBtn.click();
} else {
await page.keyboard.press("Escape");
}
await page.waitForTimeout(500);
console.log("✅ Section Plane controls verified successfully.");
}
console.log("⚡ [6/7] Testing Physics Simulation (Cannon-es Physics Sandbox)...");
const physicsTrigger = page.locator("button.physics-trigger").first();
if (await physicsTrigger.isVisible()) {
console.log(" - Clicking physics trigger to run gravity simulation...");
await physicsTrigger.click();
await page.waitForTimeout(1500);
console.log(" - Pausing physics simulation...");
await physicsTrigger.click();
await page.waitForTimeout(500);
const resetBtn = page.locator('button[aria-label*="sıfırla"], button[title*="Sıfırla"]').first();
if (await resetBtn.isVisible()) {
await resetBtn.click();
console.log(" - Clicked 'Sıfırla' to reset shapes back to original CAD positions.");
await page.waitForTimeout(400);
}
console.log("✅ Physics simulation lifecycle verified successfully.");
}
// -------------------------------------------------------------
// STEP 7: Shape Placement & Procedural Architectural Textures
// -------------------------------------------------------------
console.log("🧱 [7/7] Testing Shape Placement & 9 Architectural Textures...");
// Open shape menu
const shapeMenuTrigger = page.locator("button.shape-menu-trigger").first();
if (await shapeMenuTrigger.isVisible()) {
await shapeMenuTrigger.click();
await page.waitForTimeout(600);
const boxShapeItem = page.locator('button.shape-menu-item:has-text("Kutu")').first();
if (await boxShapeItem.isVisible()) {
await boxShapeItem.click();
console.log(" - Placed 'Kutu' into the 3D workplane scene.");
await page.waitForTimeout(1000);
// Click solid-choice button in Shape Inspector to open color/material palette
const solidChoice = page.locator("button.solid-choice").first();
if (await solidChoice.isVisible()) {
await solidChoice.click();
await page.waitForTimeout(600);
// Check the 9 architectural textures
const textureCount = await page.locator('button[aria-label*="Mimari Malzeme"]').count();
console.log(` - Found ${textureCount} architectural texture buttons in Inspector.`);
// Test applying Tuğla Duvar
const brickBtn = page.locator('button[aria-label="Mimari Malzeme: Tuğla Duvar"]').first();
if (await brickBtn.isVisible()) {
await brickBtn.click();
console.log(" - Applied 'Tuğla Duvar' procedural texture.");
await page.waitForTimeout(400);
}
// Test applying Ahşap Parke
const woodBtn = page.locator('button[aria-label="Mimari Malzeme: Ahşap Parke"]').first();
if (await woodBtn.isVisible()) {
await woodBtn.click();
console.log(" - Applied 'Ahşap Parke' procedural texture.");
await page.waitForTimeout(400);
}
// Test applying Buzlu Cam
const glassBtn = page.locator('button[aria-label="Mimari Malzeme: Buzlu / Cam"]').first();
if (await glassBtn.isVisible()) {
await glassBtn.click();
console.log(" - Applied 'Buzlu / Cam' procedural texture.");
await page.waitForTimeout(400);
}
}
}
}
// -------------------------------------------------------------
// STEP 7: CORPORATE PAGES & FOOTER YAKNET VERIFICATION
// -------------------------------------------------------------
console.log("🏛️ Verifying Corporate & Legal Pages (/kvkk, /kullanim-kosullari, /kurumsal-guvenlik)...");
// 1. Check KVKK page
console.log(" - Navigating to http://snap.yakhub.com.tr/kvkk...");
await page.goto("http://snap.yakhub.com.tr/kvkk", { waitUntil: "networkidle" });
await page.waitForTimeout(600);
const kvkkHeading = await page.locator("#kvkk-main-heading").innerText();
console.log(` - KVKK Heading: "${kvkkHeading}"`);
if (!kvkkHeading.includes("KVKK")) {
throw new Error("KVKK page heading missing!");
}
const kvkkBodyText = await page.evaluate(() => document.body.innerText);
if (!kvkkBodyText.includes("YakNet") || !kvkkBodyText.includes("YakHub Ekosistemi")) {
throw new Error("KVKK page does not mention YakNet / YakHub Ekosistemi!");
}
if (kvkkBodyText.includes("TR / Türkçe")) {
throw new Error("Footer still contains TR / Türkçe!");
}
console.log(" ✅ KVKK page verified with official YakNet affiliation.");
// 2. Check Kullanım Koşulları page
console.log(" - Navigating to http://snap.yakhub.com.tr/kullanim-kosullari...");
await page.goto("http://snap.yakhub.com.tr/kullanim-kosullari", { waitUntil: "networkidle" });
await page.waitForTimeout(600);
const termsHeading = await page.locator("#terms-main-heading").innerText();
console.log(` - Terms Heading: "${termsHeading}"`);
if (!termsHeading.includes("Kullanım Koşulları")) {
throw new Error("Terms page heading missing!");
}
const termsBodyText = await page.evaluate(() => document.body.innerText);
if (!termsBodyText.includes("Mülkiyeti: %100 Size Aittir")) {
throw new Error("Terms page missing 100% user design ownership guarantee!");
}
console.log(" ✅ Kullanım Koşulları page verified.");
// 3. Check Kurumsal Güvenlik page
console.log(" - Navigating to http://snap.yakhub.com.tr/kurumsal-guvenlik...");
await page.goto("http://snap.yakhub.com.tr/kurumsal-guvenlik", { waitUntil: "networkidle" });
await page.waitForTimeout(600);
const secHeading = await page.locator("#security-main-heading").innerText();
console.log(` - Security Heading: "${secHeading}"`);
if (!secHeading.includes("Kurumsal Güvenlik")) {
throw new Error("Security page heading missing!");
}
const secBodyText = await page.evaluate(() => document.body.innerText);
if (!secBodyText.includes("Zero-Knowledge") || !secBodyText.includes("YakNet Kurumsal Güvenlik Şemsiyesi")) {
throw new Error("Security page missing core YakNet security highlights!");
}
console.log(" ✅ Kurumsal Güvenlik page verified.");
const legalScreenshotPath = path.join(ARTIFACT_DIR, "snapcad-legal-verification.png");
await page.screenshot({ path: legalScreenshotPath, fullPage: false });
console.log(` 📸 Captured legal page screenshot to ${legalScreenshotPath}`);
// -------------------------------------------------------------
// BRAND INTEGRITY AUDIT
// -------------------------------------------------------------
console.log("🔍 Checking DOM for banned brand name...");
const domText = await page.evaluate(() => document.body.innerText.toLowerCase());
const domHtml = await page.evaluate(() => document.body.innerHTML.toLowerCase());
const bannedKeyword = "tinker" + "cad";
if (domText.includes(bannedKeyword) || domHtml.includes(bannedKeyword)) {
throw new Error("Banned brand keyword was found in the live DOM!");
}
console.log("✅ Zero occurrences of banned keyword in live DOM.");
// -------------------------------------------------------------
// FINAL SCREENSHOT & ERROR REPORT
// -------------------------------------------------------------
console.log(`📸 Capturing high-resolution live screenshot to ${SCREENSHOT_PATH}...`);
await page.screenshot({ path: SCREENSHOT_PATH, fullPage: false });
console.log("✅ Screenshot captured successfully.");
console.log("📋 Summary of Console and Network Errors:");
if (consoleErrors.length > 0) {
console.error(`❌ Console Errors (${consoleErrors.length}):\n`, consoleErrors.join("\n"));
} else {
console.log("✅ 0 Console Errors!");
}
if (networkErrors.length > 0) {
console.error(`❌ Network Errors (${networkErrors.length}):\n`, networkErrors.join("\n"));
} else {
console.log("✅ 0 Network Errors!");
}
await browser.close();
if (consoleErrors.length > 0 || networkErrors.length > 0) {
throw new Error(`Verification completed with ${consoleErrors.length} console errors and ${networkErrors.length} network errors.`);
}
console.log("🎉 ALL PLAYWRIGHT E2E VERIFICATIONS PASSED WITH 100% SUCCESS!");
}
main().catch((err) => {
console.error("FATAL ERROR in Playwright Verification:", err);
process.exit(1);
});
+43
View File
@@ -0,0 +1,43 @@
import { cpSync, existsSync, readdirSync, rmSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const repoRoot = dirname(dirname(fileURLToPath(import.meta.url)));
const exportDir = join(repoRoot, "apps", "web", ".next-export");
const htaccessSrc = join(repoRoot, "apps", "web", "public", ".htaccess");
// Sunucu tarafı PHP dosyaları depo kökünde tutulur ve statik dışa aktarma
// tarafından asla ezilmemelidir. .env de aynı şekilde korunur.
const protectedEntries = new Set([
".env",
".env.local",
".env.production",
".htaccess",
"snap-config.php",
"cloud-api.php",
"callback.php",
"login.php",
"logout.php",
]);
if (!existsSync(exportDir)) {
console.error(`[sync-laragon-static] Static export directory not found: ${exportDir}`);
process.exit(1);
}
const entries = readdirSync(exportDir).filter((entry) => !protectedEntries.has(entry));
for (const entry of entries) {
const srcPath = join(exportDir, entry);
const destPath = join(repoRoot, entry);
if (existsSync(destPath)) {
rmSync(destPath, { recursive: true, force: true });
}
cpSync(srcPath, destPath, { recursive: true });
}
if (existsSync(htaccessSrc)) {
cpSync(htaccessSrc, join(repoRoot, ".htaccess"));
cpSync(htaccessSrc, join(exportDir, ".htaccess"));
}
console.log(`[sync-laragon-static] Synced ${entries.length} static items + .htaccess to ${repoRoot}`);