Spawn child processes with detached:true on Unix so they get their own
process group. Signal handlers now kill the entire group via
process.kill(-pid) instead of just the immediate child, preventing
orphaned dev servers from surviving CLI crashes or kill -9.
Add `portless prune` command as a safety net to find and kill orphaned
dev servers left behind by dead CLI sessions. It reads stale route
entries, checks if something is still listening on each port, and
terminates the orphan.
Add e2e tests covering both the SIGKILL cleanup path and the prune
command.
* Fix lock contention when running parallel commands (#174)
Replace the fixed-delay retry strategy (20 retries * 50ms = 1s budget)
with exponential backoff and jitter (10ms-500ms delays, 5s budget).
The old approach caused "Failed to acquire route lock" errors in
monorepos running many portless commands in parallel.
* Fix Windows CI: use file URL for ESM import in worker script
On Windows, path.resolve produces backslash-separated paths which
Node.js ESM does not accept in import specifiers. Convert to a
file:// URL with pathToFileURL so the worker script loads correctly
on all platforms.
Also reorder assertions so lock failures surface before the ENOENT
on routes.json.
This PR adds Windows compatibility for hosts file management functionality in portless.
## Problem
The CLI was hardcoded to use Unix-style paths and commands for hosts file operations (`/etc/hosts`, `sudo`), making it incompatible with Windows systems.
## Changes
- Added Windows detection and proper hosts file path resolution (`C:\Windows\System32\drivers\etc\hosts`)
- Updated all CLI help text and error messages to use platform-appropriate file paths and commands
- Replaced hardcoded `/etc/hosts` references with dynamic `HOSTS_DISPLAY` variable
- Replaced `sudo` prefix with platform-aware `SUDO_PREFIX` (empty on Windows, "sudo " on Unix)
- Updated error messages to suggest "run as Administrator" on Windows vs "requires sudo" on Unix
## Implementation Details
- Added `isWindows` platform detection using `process.platform`
- Created display-friendly constants for consistent messaging across all commands
- Updated hosts file path resolution in `hosts.ts` to use `SystemRoot` environment variable with fallback
Fixes#112