first commit

This commit is contained in:
Joren de Graaf
2026-10-12 20:49:13 +02:00
commit 16ab9a3f8d
31 changed files with 2300 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import { createServer } from 'node:net';
import { spawn } from 'node:child_process';
const check = (port) => new Promise((resolve, reject) => {
const server = createServer();
server.once('error', reject);
server.listen(port, '127.0.0.1', () => server.close(resolve));
});
for (const port of [8765, 5174]) {
try { await check(port); }
catch { console.error(`Port ${port} is in use. Stop that process or choose another port before starting.`); process.exit(1); }
}
const child = spawn('npm', ['run', 'dev:servers'], { stdio: 'inherit', shell: process.platform === 'win32' });
child.on('exit', code => process.exit(code ?? 0));
for (const signal of ['SIGINT', 'SIGTERM']) process.on(signal, () => child.kill(signal));