Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.
Rust chatgptclaudeclidesktopdesktop-appelectron-alternativegeminilinuxmacosnativefierno-electronrusttauriweb-to-desktopwebsite-to-appwebviewwindowsyoutube
:bug: debug windows action
Tw936df6f300c83a
diff --git a/.github/workflows/quality-and-test.yml b/.github/workflows/quality-and-test.ymlindex cdb99cb9..4076ea2b 100644--- a/.github/workflows/quality-and-test.yml+++ b/.github/workflows/quality-and-test.yml@@ -134,7 +134,7 @@ jobs:# Download and install WIX Toolset v3.11Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311.exe" -OutFile "wix311.exe"Start-Process -FilePath "wix311.exe" -ArgumentList "/quiet" -Wait-+# Add WIX to PATH$wixPath = "${env:ProgramFiles(x86)}\WiX Toolset v3.11\bin"if (Test-Path $wixPath) {diff --git a/tests/index.js b/tests/index.jsindex dd9a753f..24d3632c 100644--- a/tests/index.js+++ b/tests/index.js@@ -610,7 +610,10 @@ class PakeTestRunner {darwin: {app: path.join(config.PROJECT_ROOT, `${testName}.app`),installer: path.join(config.PROJECT_ROOT, `${testName}.dmg`),- bundleDir: path.join(config.PROJECT_ROOT, "src-tauri/target/release/bundle"),+ bundleDir: path.join(+ config.PROJECT_ROOT,+ "src-tauri/target/release/bundle",+ ),},linux: {app: path.join(@@ -621,7 +624,10 @@ class PakeTestRunner {config.PROJECT_ROOT,"src-tauri/target/release/bundle/deb",),- bundleDir: path.join(config.PROJECT_ROOT, "src-tauri/target/release/bundle"),+ bundleDir: path.join(+ config.PROJECT_ROOT,+ "src-tauri/target/release/bundle",+ ),},win32: {app: path.join(@@ -632,12 +638,24 @@ class PakeTestRunner {config.PROJECT_ROOT,"src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi",),- bundleDir: path.join(config.PROJECT_ROOT, "src-tauri/target/x86_64-pc-windows-msvc/release/bundle"),+ bundleDir: path.join(+ config.PROJECT_ROOT,+ "src-tauri/target/x86_64-pc-windows-msvc/release/bundle",+ ),// Alternative directories to checkaltDirs: [- path.join(config.PROJECT_ROOT, "src-tauri/target/release/bundle/msi"),- path.join(config.PROJECT_ROOT, "src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis"),- path.join(config.PROJECT_ROOT, "src-tauri/target/release/bundle/nsis"),+ path.join(+ config.PROJECT_ROOT,+ "src-tauri/target/release/bundle/msi",+ ),+ path.join(+ config.PROJECT_ROOT,+ "src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis",+ ),+ path.join(+ config.PROJECT_ROOT,+ "src-tauri/target/release/bundle/nsis",+ ),],},};@@ -647,7 +665,9 @@ class PakeTestRunner {console.log(`π§ Starting real build test for GitHub.com...`);console.log(`π Platform: ${platform}`);console.log(`π Expected app directory: ${expectedFiles.app}`);- console.log(`π Expected installer directory: ${expectedFiles.installer}`);+ console.log(+ `π Expected installer directory: ${expectedFiles.installer}`,+ );if (expectedFiles.bundleDir) {console.log(`π Bundle directory: ${expectedFiles.bundleDir}`);}@@ -715,15 +735,21 @@ class PakeTestRunner {// Real timeout - 8 minutes for actual buildconst timeout = setTimeout(() => {- console.log(" π Build timeout reached, checking for output files...");-- const foundFiles = this.findBuildOutputFiles(testName, expectedFiles, platform);-+ console.log(+ " π Build timeout reached, checking for output files...",+ );++ const foundFiles = this.findBuildOutputFiles(+ testName,+ expectedFiles,+ platform,+ );+if (foundFiles.length > 0) {console.log(" π Build completed successfully - found output files!",);- foundFiles.forEach(file => {+ foundFiles.forEach((file) => {console.log(` π± Found: ${file.path} (${file.type})`);});console.log(" β¨ Build artifacts preserved for inspection");@@ -735,7 +761,9 @@ class PakeTestRunner {);this.debugBuildDirectories(expectedFiles, platform);child.kill("SIGTERM");- reject(new Error("Real build test timeout - no output files found"));+ reject(+ new Error("Real build test timeout - no output files found"),+ );}}, 480000); // 8 minutes@@ -743,14 +771,18 @@ class PakeTestRunner {clearTimeout(timeout);console.log(` π Build process finished with exit code: ${code}`);-- const foundFiles = this.findBuildOutputFiles(testName, expectedFiles, platform);-++ const foundFiles = this.findBuildOutputFiles(+ testName,+ expectedFiles,+ platform,+ );+if (foundFiles.length > 0) {console.log(" π Real build test SUCCESS: Build file(s) generated!",);- foundFiles.forEach(file => {+ foundFiles.forEach((file) => {console.log(` π± ${file.type}: ${file.path}`);try {const stats = fs.statSync(file.path);@@ -889,17 +921,26 @@ class PakeTestRunner {// Multi-arch builds take longer - 12 minutes timeoutconst timeout = setTimeout(() => {- console.log(" π Multi-arch build timeout reached, checking for output files...");-- const foundFiles = this.findBuildOutputFiles(testName, {- app: appFile,- installer: dmgFile,- bundleDir: path.join(config.PROJECT_ROOT, "src-tauri/target/universal-apple-darwin/release/bundle")- }, "darwin");-+ console.log(+ " π Multi-arch build timeout reached, checking for output files...",+ );++ const foundFiles = this.findBuildOutputFiles(+ testName,+ {+ app: appFile,+ installer: dmgFile,+ bundleDir: path.join(+ config.PROJECT_ROOT,+ "src-tauri/target/universal-apple-darwin/release/bundle",+ ),+ },+ "darwin",+ );+if (foundFiles.length > 0) {console.log(" π Multi-arch build completed successfully!");- foundFiles.forEach(file => {+ foundFiles.forEach((file) => {console.log(` π± Found: ${file.path} (${file.type})`);});console.log(" π Universal binary preserved for inspection");@@ -909,11 +950,17 @@ class PakeTestRunner {console.log(" β Multi-arch build timeout - no output files generated",);- this.debugBuildDirectories({- app: appFile,- installer: dmgFile,- bundleDir: path.join(config.PROJECT_ROOT, "src-tauri/target/universal-apple-darwin/release/bundle")- }, "darwin");+ this.debugBuildDirectories(+ {+ app: appFile,+ installer: dmgFile,+ bundleDir: path.join(+ config.PROJECT_ROOT,+ "src-tauri/target/universal-apple-darwin/release/bundle",+ ),+ },+ "darwin",+ );child.kill("SIGTERM");reject(new Error("Multi-arch build test timeout"));}@@ -922,32 +969,43 @@ class PakeTestRunner {child.on("close", (code) => {clearTimeout(timeout);- console.log(` π Multi-arch build process finished with exit code: ${code}`);-- const foundFiles = this.findBuildOutputFiles(testName, {- app: appFile,- installer: dmgFile,- bundleDir: path.join(config.PROJECT_ROOT, "src-tauri/target/universal-apple-darwin/release/bundle")- }, "darwin");-+ console.log(+ ` π Multi-arch build process finished with exit code: ${code}`,+ );++ const foundFiles = this.findBuildOutputFiles(+ testName,+ {+ app: appFile,+ installer: dmgFile,+ bundleDir: path.join(+ config.PROJECT_ROOT,+ "src-tauri/target/universal-apple-darwin/release/bundle",+ ),+ },+ "darwin",+ );+if (foundFiles.length > 0) {console.log(" π Multi-arch build test SUCCESS: Universal binary generated!",);- foundFiles.forEach(file => {+ foundFiles.forEach((file) => {console.log(` π± ${file.type}: ${file.path}`);});console.log(" π Universal binary preserved for inspection");// Verify it's actually a universal binary- const appFile = foundFiles.find(f => f.type.includes('App'));+ const appFile = foundFiles.find((f) => f.type.includes("App"));if (appFile) {try {- const binaryPath = path.join(appFile.path, 'Contents/MacOS/pake');- const fileOutput = execSync(- `file "${binaryPath}"`,- { encoding: "utf8" },+ const binaryPath = path.join(+ appFile.path,+ "Contents/MacOS/pake",);+ const fileOutput = execSync(`file "${binaryPath}"`, {+ encoding: "utf8",+ });if (fileOutput.includes("universal binary")) {console.log(" β Verified: Universal binary created successfully",@@ -969,11 +1027,17 @@ class PakeTestRunner {console.log(" β οΈ Multi-arch build process completed but no output files found",);- this.debugBuildDirectories({- app: appFile,- installer: dmgFile,- bundleDir: path.join(config.PROJECT_ROOT, "src-tauri/target/universal-apple-darwin/release/bundle")- }, "darwin");+ this.debugBuildDirectories(+ {+ app: appFile,+ installer: dmgFile,+ bundleDir: path.join(+ config.PROJECT_ROOT,+ "src-tauri/target/universal-apple-darwin/release/bundle",+ ),+ },+ "darwin",+ );resolve(false);} else {// Only reject if the build never started or failed early@@ -1002,105 +1066,112 @@ class PakeTestRunner {// Enhanced file finding with better Windows supportfindBuildOutputFiles(testName, expectedFiles, platform) {const foundFiles = [];-+// Check different possible locations based on platformconst searchDirs = [];-+if (platform === "win32") {// Windows-specific search directoriessearchDirs.push(expectedFiles.app,expectedFiles.installer,- ...(expectedFiles.altDirs || [])+ ...(expectedFiles.altDirs || []),);} else if (platform === "darwin") {// macOS searchsearchDirs.push(path.dirname(expectedFiles.app),path.dirname(expectedFiles.installer),- expectedFiles.bundleDir+ expectedFiles.bundleDir,);} else {// Linux searchsearchDirs.push(path.dirname(expectedFiles.app),expectedFiles.installer,- expectedFiles.bundleDir+ expectedFiles.bundleDir,);}-- console.log(` π Searching for ${testName} build outputs in ${searchDirs.length} locations...`);-++ console.log(+ ` π Searching for ${testName} build outputs in ${searchDirs.length} locations...`,+ );+searchDirs.forEach((searchDir, index) => {if (!searchDir || !fs.existsSync(searchDir)) {- console.log(` β οΈ Location ${index + 1}: ${searchDir} - Directory not found`);+ console.log(+ ` β οΈ Location ${index + 1}: ${searchDir} - Directory not found`,+ );return;}-+console.log(` π Location ${index + 1}: ${searchDir}`);-+try {const files = fs.readdirSync(searchDir);- console.log(` Found ${files.length} files/dirs: [${files.join(', ')}]`);-+ console.log(+ ` Found ${files.length} files/dirs: [${files.join(", ")}]`,+ );+// Look for files matching our test name or common patterns- const relevantFiles = files.filter(file => {+ const relevantFiles = files.filter((file) => {const lowerFile = file.toLowerCase();const lowerTestName = testName.toLowerCase();-- return lowerFile.includes(lowerTestName) ||- lowerFile.includes('github') ||- lowerFile.endsWith('.msi') ||- lowerFile.endsWith('.exe') ||- lowerFile.endsWith('.dmg') ||- lowerFile.endsWith('.deb') ||- lowerFile.endsWith('.appimage') ||- lowerFile.endsWith('.app');++ return (+ lowerFile.includes(lowerTestName) ||+ lowerFile.includes("github") ||+ lowerFile.endsWith(".msi") ||+ lowerFile.endsWith(".exe") ||+ lowerFile.endsWith(".dmg") ||+ lowerFile.endsWith(".deb") ||+ lowerFile.endsWith(".appimage") ||+ lowerFile.endsWith(".app")+ );});-- relevantFiles.forEach(file => {++ relevantFiles.forEach((file) => {const fullPath = path.join(searchDir, file);const stats = fs.statSync(fullPath);-+if (stats.isFile()) {let fileType = "Unknown";- if (file.endsWith('.msi')) fileType = "MSI Installer";- else if (file.endsWith('.exe')) fileType = "Executable";- else if (file.endsWith('.dmg')) fileType = "DMG Image";- else if (file.endsWith('.deb')) fileType = "DEB Package";- else if (file.endsWith('.appimage')) fileType = "AppImage";- else if (file.endsWith('.app')) fileType = "macOS App";-+ if (file.endsWith(".msi")) fileType = "MSI Installer";+ else if (file.endsWith(".exe")) fileType = "Executable";+ else if (file.endsWith(".dmg")) fileType = "DMG Image";+ else if (file.endsWith(".deb")) fileType = "DEB Package";+ else if (file.endsWith(".appimage")) fileType = "AppImage";+ else if (file.endsWith(".app")) fileType = "macOS App";+foundFiles.push({path: fullPath,type: fileType,- size: stats.size+ size: stats.size,});-+console.log(` β Found ${fileType}: ${file}`);- } else if (stats.isDirectory() && file.endsWith('.app')) {+ } else if (stats.isDirectory() && file.endsWith(".app")) {foundFiles.push({path: fullPath,type: "macOS App Bundle",- size: 0+ size: 0,});console.log(` β Found macOS App Bundle: ${file}`);}});-} catch (error) {console.log(` β Error reading directory: ${error.message}`);}});-+console.log(` π Total found files: ${foundFiles.length}`);return foundFiles;}-+// Debug function to show directory structuredebugBuildDirectories(expectedFiles, platform) {console.log(" π Debug: Analyzing build directories...");-+const targetDir = path.join(config.PROJECT_ROOT, "src-tauri/target");if (fs.existsSync(targetDir)) {console.log(" π Target directory structure:");@@ -1112,20 +1183,22 @@ class PakeTestRunner {} else {console.log(` β Target directory does not exist: ${targetDir}`);}-+// Check project root for direct outputsconsole.log(" π Project root files:");try {- const rootFiles = fs.readdirSync(config.PROJECT_ROOT)- .filter(file =>- file.endsWith('.app') ||- file.endsWith('.dmg') ||- file.endsWith('.msi') ||- file.endsWith('.deb') ||- file.endsWith('.exe')+ const rootFiles = fs+ .readdirSync(config.PROJECT_ROOT)+ .filter(+ (file) =>+ file.endsWith(".app") ||+ file.endsWith(".dmg") ||+ file.endsWith(".msi") ||+ file.endsWith(".deb") ||+ file.endsWith(".exe"),);if (rootFiles.length > 0) {- rootFiles.forEach(file => {+ rootFiles.forEach((file) => {console.log(` π± ${file}`);});} else {@@ -1135,7 +1208,7 @@ class PakeTestRunner {console.log(` β Error reading project root: ${error.message}`);}}-+// Helper function to check if files exist (handles wildcards) - kept for compatibilitycheckFileExists(filePath) {if (filePath.includes("*")) {@@ -1187,12 +1260,21 @@ class PakeTestRunner {if (stats.isDirectory()) {console.log(`${indent}π ${relativePath}/`);// Show more directories for Windows debugging- if (item === "bundle" || item === "release" || item === "msi" || item === "nsis" ||- item.includes("windows") || item.includes("msvc")) {+ if (+ item === "bundle" ||+ item === "release" ||+ item === "msi" ||+ item === "nsis" ||+ item.includes("windows") ||+ item.includes("msvc")+ ) {this.listTargetContents(fullPath, maxDepth, currentDepth + 1);}} else {- const size = stats.size > 0 ? ` (${(stats.size / 1024 / 1024).toFixed(1)}MB)` : '';+ const size =+ stats.size > 0+ ? ` (${(stats.size / 1024 / 1024).toFixed(1)}MB)`+ : "";console.log(`${indent}π ${relativePath}${size}`);}} catch (statError) {@@ -1200,7 +1282,9 @@ class PakeTestRunner {}});} catch (error) {- console.log(` β οΈ Could not list contents of ${targetDir}: ${error.message}`);+ console.log(+ ` β οΈ Could not list contents of ${targetDir}: ${error.message}`,+ );}}