From 6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 11 Jun 2026 02:39:35 +0900 Subject: feat(console): resolve phase-b TODOs in doRun and IO wiring Wire up ConsoleIO with HelperSet/QuestionHelper, register the ErrorHandler with the IO instance, and fall back to a default output in run(). Replace resolved phase-b TODOs across the console, command, io, factory, installer, dependency_resolver, and util modules; reclassify the remaining blockers (typed Symfony command registry, stdin resource caching) as phase-c. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/command/base_dependency_command.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'crates/shirabe/src/command/base_dependency_command.rs') diff --git a/crates/shirabe/src/command/base_dependency_command.rs b/crates/shirabe/src/command/base_dependency_command.rs index decfd5b..27f3544 100644 --- a/crates/shirabe/src/command/base_dependency_command.rs +++ b/crates/shirabe/src/command/base_dependency_command.rs @@ -40,9 +40,6 @@ pub trait BaseDependencyCommand: BaseCommand { fn colors(&self) -> &[String]; fn colors_mut(&mut self) -> &mut Vec; - // TODO(phase-b): these wrappers existed to forward BaseCommand setters, but they - // shadowed the BaseCommand methods and caused ambiguity. Use BaseCommand directly. - fn do_execute( &mut self, input: std::rc::Rc>, @@ -153,12 +150,12 @@ pub trait BaseDependencyCommand: BaseCommand { FindPackageConstraint::String(text_constraint.clone()), )?; if matched_package.is_none() { + let rm = composer.get_repository_manager(); let mut default_repos = CompositeRepository::new( RepositoryFactory::default_repos( Some(self.get_io()), Some(composer.get_config()), - // TODO(phase-b): get_repository_manager returns &; default_repos needs &mut - Some(todo!("share repository_manager as &mut")), + Some(&mut rm.borrow_mut()), )? .into_values() .collect(), @@ -402,10 +399,12 @@ pub trait BaseDependencyCommand: BaseCommand { "blue".to_string(), ]; for color in self.colors() { - // TODO(phase-b): output.get_formatter() returns &OutputFormatter; set_style needs - // &mut. Need interior mutability or `get_formatter_mut`. - let _ = OutputFormatterStyle::new(Some(color), None, None); - let _ = output.borrow().get_formatter(); + let style = OutputFormatterStyle::new(Some(color), None, None); + output + .borrow() + .get_formatter() + .borrow_mut() + .set_style(color, style); } } -- cgit v1.3.1