feat: complete CLI integration with plugin system
**CLI Integration:** - Added --engine parameter to md-render command - Default engine selection: testdrive-jsui for edit/insert, standard for view - Graceful fallback to standard rendering when plugin unavailable - Engine validation and mode compatibility checking **Plugin Discovery:** - Enhanced RenderingEngineManager with builtin plugin registration - Automatic discovery and registration of testdrive-jsui engine - Support for both plugin system discovery and direct registration **Configuration Management:** - Production-ready RenderingConfig for CLI usage - Asset deployment to _markitect/plugins/ structure - Configurable asset base URLs and deployment strategies **Testing Infrastructure:** - Comprehensive test suite for plugin discovery - CLI integration testing without Click framework dependencies - Complete scenario testing (default, explicit, fallback, unknown engines) - Integration verification scripts **Documentation:** - Complete PLUGIN_SYSTEM.md documentation - Architecture overview and development workflows - JavaScript-first development guide - Asset management and deployment strategies - CLI usage examples and troubleshooting guide **Key Features:** - `markitect md-render --edit` now uses testdrive-jsui by default - `markitect md-render --engine testdrive-jsui --edit` for explicit selection - `markitect md-render --engine standard --edit` for legacy behavior - Automatic fallback with user-friendly error messages This completes the plugin infrastructure implementation, enabling independent JavaScript development with seamless CLI integration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -183,7 +183,7 @@ class RenderingEngineManager:
|
||||
|
||||
def _discover_rendering_engines(self):
|
||||
"""Discover rendering engine plugins."""
|
||||
# Get all plugins from the main plugin manager
|
||||
# First, try to load plugins from main plugin manager
|
||||
all_plugins = self.plugin_manager.discover_plugins()
|
||||
|
||||
for plugin_name, plugin_info in all_plugins.items():
|
||||
@@ -197,6 +197,22 @@ class RenderingEngineManager:
|
||||
except Exception as e:
|
||||
print(f"⚠️ Failed to load rendering engine {plugin_name}: {e}")
|
||||
|
||||
# Additionally, try to directly import and register known rendering engines
|
||||
self._register_builtin_rendering_engines()
|
||||
|
||||
def _register_builtin_rendering_engines(self):
|
||||
"""Register built-in rendering engines directly."""
|
||||
try:
|
||||
# Import and register testdrive-jsui engine
|
||||
from .testdrive_jsui import TestDriveJSUIEngine
|
||||
engine = TestDriveJSUIEngine()
|
||||
self._engines[engine.metadata.name] = engine
|
||||
print(f"✅ Registered built-in rendering engine: {engine.metadata.name}")
|
||||
except ImportError as e:
|
||||
print(f"⚠️ Could not import testdrive-jsui engine: {e}")
|
||||
except Exception as e:
|
||||
print(f"⚠️ Failed to register testdrive-jsui engine: {e}")
|
||||
|
||||
def get_engine(self, name: str) -> Optional[RenderingEnginePlugin]:
|
||||
"""Get a rendering engine by name."""
|
||||
return self._engines.get(name)
|
||||
|
||||
Reference in New Issue
Block a user