fix(server): preserve dev runner signal handling

This commit is contained in:
Mohamed Boudra
2026-04-22 17:53:53 +07:00
parent a582fccef0
commit 274a7fd217
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -28,7 +28,7 @@
}
},
"scripts": {
"dev": "cross-env NODE_ENV=development tsx scripts/dev-runner.ts",
"dev": "cross-env NODE_ENV=development node --import tsx scripts/dev-runner.ts",
"dev:tsx": "cross-env NODE_ENV=development tsx watch --ignore '**/*.timestamp-*' src/server/index.ts",
"build": "node -e \"require('node:fs').rmSync('dist',{ recursive: true, force: true })\" && npm run build:lib && npm run build:scripts",
"build:lib": "tsc -p tsconfig.server.json --incremental false && node -e \"const fs=require('node:fs'); fs.mkdirSync('dist/server/server/speech/providers/local/sherpa/assets',{recursive:true}); fs.copyFileSync('src/server/speech/providers/local/sherpa/assets/silero_vad.onnx','dist/server/server/speech/providers/local/sherpa/assets/silero_vad.onnx'); fs.cpSync('src/terminal/shell-integration','dist/server/terminal/shell-integration',{recursive:true}); fs.cpSync('src/terminal/shell-integration','dist/src/terminal/shell-integration',{recursive:true});\"",
@@ -22,4 +22,15 @@ describe("supervision parity", () => {
expect(devRunner).not.toContain("spawnSync");
expect(devRunner).toContain('supervisor.on("exit"');
});
test("npm dev script runs dev-runner as the signal-handling node process", () => {
const packageJson = JSON.parse(
readFileSync(new URL("../package.json", import.meta.url), "utf8"),
) as { scripts?: Record<string, string> };
const devScript = packageJson.scripts?.dev ?? "";
expect(devScript).toContain("node --import tsx scripts/dev-runner.ts");
expect(devScript).not.toMatch(/^cross-env NODE_ENV=development tsx scripts\/dev-runner\.ts$/);
});
});