From 1428b99ab58ba2cd48eaf7cd7dea077fcc045c9c Mon Sep 17 00:00:00 2001 From: Chris Olszewski Date: Thu, 7 Nov 2024 16:47:21 -0500 Subject: [PATCH] chore(watch): warn if daemon is disabled --- crates/turborepo-lib/src/run/watch.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/turborepo-lib/src/run/watch.rs b/crates/turborepo-lib/src/run/watch.rs index 1059acca44eef..cc6c6311725ac 100644 --- a/crates/turborepo-lib/src/run/watch.rs +++ b/crates/turborepo-lib/src/run/watch.rs @@ -8,7 +8,7 @@ use futures::StreamExt; use miette::{Diagnostic, SourceSpan}; use thiserror::Error; use tokio::{select, sync::Notify, task::JoinHandle}; -use tracing::{instrument, trace}; +use tracing::{instrument, trace, warn}; use turborepo_repository::package_graph::PackageName; use turborepo_telemetry::events::command::CommandEventBuilder; use turborepo_ui::sender::UISender; @@ -113,12 +113,16 @@ impl WatchClient { pub async fn new(base: CommandBase, telemetry: CommandEventBuilder) -> Result { let signal = commands::run::get_signal()?; let handler = SignalHandler::new(signal); - let root_turbo_json_path = base.config()?.root_turbo_json_path(&base.repo_root); + let config = base.config()?; + let root_turbo_json_path = config.root_turbo_json_path(&base.repo_root); if root_turbo_json_path != base.repo_root.join_component(CONFIG_FILE) { return Err(Error::NonStandardTurboJsonPath( root_turbo_json_path.to_string(), )); } + if matches!(config.daemon(), Some(false)) { + warn!("daemon is required for watch, ignoring request to disable daemon"); + } let Some(Command::Watch(execution_args)) = &base.args().command else { unreachable!()