The best way to control Claude Code, Codex and more from any computer or phone
| 1 | /** |
| 2 | * `pnpm dev`: the fast loop for designing the slideshow. |
| 3 | * |
| 4 | * - The live presenter (http://localhost:5199, live/) plays the real Remotion |
| 5 | * compositions step by step, like the tcut presenter, and hot-reloads when |
| 6 | * a component in remotion/ changes. |
| 7 | * - intro/watch.ts rebuilds the intro whenever intro/steps.ts or a snippet |
| 8 | * changes; the presenter reloads the data and stays on the same step. |
| 9 | * |
| 10 | * Extra arguments go to Vite, e.g. `pnpm dev --port 5200 --open`. |
| 11 | * `pnpm studio` still opens Remotion Studio for frame-by-frame work. |
| 12 | */ |
| 13 | import { spawn } from "node:child_process"; |
| 14 | import path from "node:path"; |
| 15 | |
| 16 | const dir = import.meta.dirname; |
| 17 | const bin = path.join(dir, "node_modules", ".bin"); |
| 18 | const children = [ |
| 19 | spawn(process.execPath, [path.join(dir, "intro", "watch.ts")], { stdio: "inherit" }), |
| 20 | spawn(path.join(bin, "vite"), ["--config", "live/vite.config.ts", ...process.argv.slice(2)], { |
| 21 | cwd: dir, |
| 22 | stdio: "inherit", |
| 23 | }), |
| 24 | ]; |
| 25 | const stop = () => { |
| 26 | for (const child of children) child.kill(); |
| 27 | process.exit(0); |
| 28 | }; |
| 29 | process.on("SIGINT", stop); |
| 30 | process.on("SIGTERM", stop); |
| 31 | for (const child of children) child.on("exit", stop); |