From 37c76ae9891a5e09c0a067be983a57aa1eb5243f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=86=A0=E8=BE=B0?= Date: Wed, 24 Jun 2026 15:54:16 +0800 Subject: [PATCH] fix(opencode): export plugin as default --- hooks/opencode/rtk.ts | 2 ++ src/hooks/init.rs | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/hooks/opencode/rtk.ts b/hooks/opencode/rtk.ts index c4450cfa9..b36b3c3ed 100644 --- a/hooks/opencode/rtk.ts +++ b/hooks/opencode/rtk.ts @@ -37,3 +37,5 @@ export const RtkOpenCodePlugin: Plugin = async ({ $ }) => { }, } } + +export default RtkOpenCodePlugin diff --git a/src/hooks/init.rs b/src/hooks/init.rs index 28363f4ce..c33189401 100644 --- a/src/hooks/init.rs +++ b/src/hooks/init.rs @@ -4258,6 +4258,14 @@ mod tests { assert_eq!(content_updated, OPENCODE_PLUGIN); } + #[test] + fn test_opencode_plugin_template_exports_default() { + assert!( + OPENCODE_PLUGIN.contains("export default RtkOpenCodePlugin"), + "OpenCode loader requires a default plugin export" + ); + } + #[test] fn test_opencode_plugin_remove() { let temp = TempDir::new().unwrap();