From 436e12381dd79e419dce755718be17b66d73e17f Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 9 Jun 2026 00:09:08 +0900 Subject: feat(event-dispatcher): unify event dispatch via EventInterface trait Extract a superclass-trait EventInterface from the base Event. pool_builder's PrePoolCreateEvent stays deferred: its constructor needs owned, non-cloneable Request and repository boxes the builder only holds by reference (owned-payload blocker). The event is plugin-only, so its construction is re-tagged TODO(plugin). Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/command/remove_command.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/command/remove_command.rs') diff --git a/crates/shirabe/src/command/remove_command.rs b/crates/shirabe/src/command/remove_command.rs index ddb14f0..1857b17 100644 --- a/crates/shirabe/src/command/remove_command.rs +++ b/crates/shirabe/src/command/remove_command.rs @@ -485,18 +485,17 @@ impl RemoveCommand { root_package.set_dev_requires(links.remove("require-dev").unwrap_or_default()); } - // TODO(plugin): dispatch CommandEvent(PluginEvents::COMMAND, 'remove', input, output) - let command_event = crate::plugin::CommandEvent::new( + let mut command_event = crate::plugin::CommandEvent::new( crate::plugin::PluginEvents::COMMAND, "remove", input.clone(), output, ); + let command_event_name = command_event.get_name().to_string(); composer .get_event_dispatcher() .borrow_mut() - // TODO(phase-b): dispatch expects Option; CommandEvent is a different type - .dispatch(Some(command_event.get_name()), None); + .dispatch(Some(&command_event_name), Some(&mut command_event)); let allow_plugins = composer.get_config().borrow_mut().get("allow-plugins"); let removed_plugins: Vec = -- cgit v1.3.1