diff --git a/packages/server/package.json b/packages/server/package.json index 1d9e9bfe2..59a1ef5fd 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -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});\"", diff --git a/packages/server/scripts/supervision-parity.test.ts b/packages/server/scripts/supervision-parity.test.ts index a834587e5..5b80aeb4b 100644 --- a/packages/server/scripts/supervision-parity.test.ts +++ b/packages/server/scripts/supervision-parity.test.ts @@ -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 }; + + 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$/); + }); });