Skip to content

Conversation

@mphstudios
Copy link
Member

@mphstudios mphstudios commented Jan 17, 2026

Encapsulate process control for quire-cli subprocesses.

Purpose

Implement graceful shutdown handling for CLI subprocesses (Eleventy, Paged.js, PrinceXML) when a user presses Ctrl-C or the process receives termination signals. Previously, subprocesses would be orphaned on signal, leaving resources unreleased and requiring users to force-quit or kill the process by other means.

The ProcessManager module (lib/process/manager.js) exports a shared AbortSignal for automatic subprocess cancellation via execa and a registry for cleanup handlers. Hung cleanup handlers are terminated by a 5 second timeout and sending Ctrl-C signal a second time will force exit a process before the timeout.

Architecture

For simplicty, the Process Manager is used through a direct import pattern; each module manages its own integration. Signal handlers are registered in bin/cli.js, the CLI entry point.

@mphstudios mphstudios requested a review from cbutcosk January 17, 2026 02:06
@mphstudios mphstudios merged commit 6e2305d into main Jan 20, 2026
7 checks passed
@mphstudios mphstudios deleted the fix/process-control branch January 20, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants