Files
zeekayandHanzo Dev c24e700a18 feat(desktop): complete 100% Tauri v2 migration, native SnapShot/SSH/updater/CLI/preview, standalone bundles & CI
Finishes migrating Hanzo Dev off Electron to native Rust Tauri v2:
- Native Rust SnapShot capture (snapshot.rs), direct SSH port-forward supervisor (ssh.rs), GitHub release updater, ~/.local/bin/hanzo-dev-app CLI installer, global shortcuts (CmdOrCtrl+Shift+I/J/2), macOS Dock Reopen restore, and Tauri preview iframe host.
- Self-contained .app/.dmg/.AppImage/.exe/.msi resource staging via apps/desktop/scripts/stage-tauri-resources.mjs + tauri.conf.json.
- Migrates all GitHub Actions CI & release workflows (.github/workflows/*) to Rust + Tauri v2 and purges all @electron/* dependencies and legacy Electron packaging scripts.
- Cleans unused web/mobile deps so knip passes with zero issues across all 43 workspaces.

Co-authored-by: Hanzo Dev <[email protected]>
2026-11-19 11:37:00 -08:00

49 lines
1.3 KiB
JavaScript

import * as NodeChildProcess from "node:child_process";
import * as NodeFS from "node:fs";
import * as NodeOS from "node:os";
import * as NodePath from "node:path";
const desktopDir = NodePath.resolve(import.meta.dirname, "..");
const repoRoot = NodePath.resolve(desktopDir, "..", "..");
const manifestPath = NodePath.join(desktopDir, "src-tauri", "Cargo.toml");
// oxlint-disable-next-line hanzo/no-global-process-runtime -- standalone Node launcher script outside Effect runtime
const exeSuffix = NodeOS.platform() === "win32" ? ".exe" : "";
const releaseBin = NodePath.join(
desktopDir,
"src-tauri",
"target",
"release",
`hanzo-dev-desktop${exeSuffix}`,
);
if (!NodeFS.existsSync(releaseBin)) {
NodeChildProcess.execFileSync(
"cargo",
["build", "--release", "--features", "custom-protocol", "--manifest-path", manifestPath],
{
stdio: "inherit",
cwd: desktopDir,
},
);
}
const childEnv = {
...process.env,
HANZO_DEV_REPO_ROOT: repoRoot,
};
delete childEnv.VITE_DEV_SERVER_URL;
const child = NodeChildProcess.spawn(releaseBin, [], {
stdio: "inherit",
cwd: desktopDir,
env: childEnv,
});
child.on("exit", (code, signal) => {
if (signal) {
process.kill(process.pid, signal);
return;
}
process.exit(code ?? 0);
});