Refactor TODO list and enhance sourcemap watch functionality

- Updated the TODO list to refine tasks related to sync performance in scripts only mode, emphasizing the need to prune non-script leaves.
- Enhanced the sourcemap command to handle non-terminal stdin during watch mode, allowing for graceful exit when stdin is closed.

These changes aim to improve project management and optimize the sourcemap functionality.
This commit is contained in:
Joe 2026-02-28 05:31:01 -06:00
parent 8fc56dc6f0
commit 89e7e0282d
2 changed files with 18 additions and 11 deletions

View file

@ -1,6 +1,6 @@
use std::{
borrow::Cow,
io::{BufWriter, Write},
io::{BufWriter, IsTerminal, Write},
mem::forget,
path::{self, Path, PathBuf},
process,
@ -104,6 +104,22 @@ impl SourcemapCommand {
)?;
if self.watch {
if !std::io::stdin().is_terminal() {
std::thread::spawn(|| {
use std::io::Read;
let mut buf = [0u8; 1];
loop {
match std::io::stdin().lock().read(&mut buf) {
Ok(0) | Err(_) => {
log::trace!("stdin closed, exiting --watch");
process::exit(0);
}
Ok(_) => {}
}
}
});
}
let rt = Runtime::new().unwrap();
loop {