feat: complete dev_tools module self-containment
Migrate dev_tools module to self-contained structure: - routes/api/ - API endpoints - models/architecture_scan.py - Architecture scan models - models/test_run.py - Test run models - schemas/ - Pydantic schemas - services/ - Business logic services - tasks/ - Celery background tasks - exceptions.py - Module exceptions Updated definition.py with self-contained paths. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,35 +3,93 @@
|
||||
Dev-Tools module definition.
|
||||
|
||||
Defines the dev-tools module including its features, menu items,
|
||||
and route configurations.
|
||||
route configurations, and task definitions.
|
||||
|
||||
Note: This module primarily provides page routes, not API routes.
|
||||
Dev-Tools is an internal module providing:
|
||||
- Code quality scanning (architecture, security, performance validators)
|
||||
- Test execution and results management
|
||||
- Component library browser
|
||||
- Icon browser
|
||||
"""
|
||||
|
||||
from app.modules.base import ModuleDefinition
|
||||
from models.database.admin_menu_config import FrontendType
|
||||
|
||||
|
||||
def _get_admin_router():
|
||||
"""Lazy import of admin router to avoid circular imports."""
|
||||
from app.modules.dev_tools.routes.api.admin import admin_router
|
||||
|
||||
return admin_router
|
||||
|
||||
|
||||
# Dev-Tools module definition
|
||||
dev_tools_module = ModuleDefinition(
|
||||
code="dev-tools",
|
||||
name="Developer Tools",
|
||||
description="Component library and icon browser for development.",
|
||||
description=(
|
||||
"Internal development tools including code quality scanning, "
|
||||
"test execution, component library, and icon browser."
|
||||
),
|
||||
version="1.0.0",
|
||||
features=[
|
||||
"component_library", # UI component browser
|
||||
"icon_browser", # Icon library browser
|
||||
"code_quality", # Code quality scanning
|
||||
"architecture_validation", # Architecture validator
|
||||
"security_validation", # Security validator
|
||||
"performance_validation", # Performance validator
|
||||
"test_runner", # Test execution
|
||||
"violation_management", # Violation tracking and assignment
|
||||
],
|
||||
menu_items={
|
||||
FrontendType.ADMIN: [
|
||||
"components", # Component library page
|
||||
"icons", # Icon browser page
|
||||
"code-quality", # Code quality dashboard
|
||||
"tests", # Test runner dashboard
|
||||
],
|
||||
FrontendType.VENDOR: [], # No vendor menu items
|
||||
FrontendType.VENDOR: [], # No vendor menu items - internal module
|
||||
},
|
||||
is_core=False,
|
||||
is_internal=True, # Internal module - admin-only, not customer-facing
|
||||
# =========================================================================
|
||||
# Self-Contained Module Configuration
|
||||
# =========================================================================
|
||||
is_self_contained=True,
|
||||
services_path="app.modules.dev_tools.services",
|
||||
models_path="app.modules.dev_tools.models",
|
||||
schemas_path="app.modules.dev_tools.schemas",
|
||||
exceptions_path="app.modules.dev_tools.exceptions",
|
||||
tasks_path="app.modules.dev_tools.tasks",
|
||||
# =========================================================================
|
||||
# Scheduled Tasks
|
||||
# =========================================================================
|
||||
# Note: Code quality and test tasks are on-demand, not scheduled.
|
||||
# If scheduled scans are desired, they can be added here:
|
||||
# scheduled_tasks=[
|
||||
# ScheduledTask(
|
||||
# name="dev_tools.nightly_code_scan",
|
||||
# task="app.modules.dev_tools.tasks.code_quality.execute_code_quality_scan",
|
||||
# schedule="0 2 * * *", # Daily at 02:00
|
||||
# options={"queue": "long_running"},
|
||||
# ),
|
||||
# ],
|
||||
scheduled_tasks=[],
|
||||
)
|
||||
|
||||
|
||||
__all__ = ["dev_tools_module"]
|
||||
def get_dev_tools_module_with_routers() -> ModuleDefinition:
|
||||
"""
|
||||
Get dev-tools module with routers attached.
|
||||
|
||||
This function attaches the routers lazily to avoid circular imports
|
||||
during module initialization.
|
||||
"""
|
||||
dev_tools_module.admin_router = _get_admin_router()
|
||||
# No vendor router for internal modules
|
||||
dev_tools_module.vendor_router = None
|
||||
return dev_tools_module
|
||||
|
||||
|
||||
__all__ = ["dev_tools_module", "get_dev_tools_module_with_routers"]
|
||||
|
||||
Reference in New Issue
Block a user