Clear and concise description of the problem
when using tsdown --watch --on-success "node ..." to run a backend service (such as a web server with database connections), tsdown forcibly kills the child process immediately upon a file change to spawn the new process, resulting in graceful shutdown handlers not running.
Suggested solution
change the default restart behavior to send a graceful termination signal first (like SIGTERM or SIGINT), with a fallback to SIGKILL after a timeout if the process hangs.
Alternative
currently a workaround would be skipping --on-success and using concurrently and node --watch or tsx watch, but that requires yet another devDependency which isnt the end of the world but kind of defeats tsdown's elegance of being a reliable all-in-one devtool.
Additional context
tsx watch sends SIGTERM first before sending SIGKILL after 5 seconds (src)
nodemon sends SIGUSR2 first before sending SIGKILL I think
Validations
Clear and concise description of the problem
when using
tsdown --watch --on-success "node ..."to run a backend service (such as a web server with database connections),tsdownforcibly kills the child process immediately upon a file change to spawn the new process, resulting in graceful shutdown handlers not running.Suggested solution
change the default restart behavior to send a graceful termination signal first (like
SIGTERMorSIGINT), with a fallback toSIGKILLafter a timeout if the process hangs.Alternative
currently a workaround would be skipping --on-success and using
concurrentlyandnode --watchortsx watch, but that requires yet another devDependency which isnt the end of the world but kind of defeats tsdown's elegance of being a reliable all-in-one devtool.Additional context
tsx watchsends SIGTERM first before sending SIGKILL after 5 seconds (src)nodemonsends SIGUSR2 first before sending SIGKILL I thinkValidations