feat: improve modeling, exports, and hosted deployment

This commit is contained in:
Formsmith746
2026-08-23 10:20:57 +03:00
parent 4f3859f215
commit 95b029e274
19 changed files with 1643 additions and 126 deletions
+31
View File
@@ -0,0 +1,31 @@
import { spawn } from "node:child_process";
const parentPid = Number.parseInt(process.argv[2] || "", 10);
const repoRoot = process.argv[3] || process.cwd();
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
// Give the update API response time to reach the browser before stopping Next.
await sleep(1200);
if (Number.isFinite(parentPid) && parentPid > 0) {
try {
process.kill(parentPid, "SIGTERM");
} catch {
// The dev server may already have stopped on its own.
}
}
await sleep(1200);
const options = {
cwd: repoRoot,
detached: true,
stdio: "ignore",
windowsHide: true,
};
const child = process.platform === "win32"
? spawn("cmd.exe", ["/d", "/s", "/c", "npm run dev"], options)
: spawn("npm", ["run", "dev"], options);
child.unref();