mirror of
https://github.com/insistence/RuoYi-Vue3-FastAPI.git
synced 2026-09-24 05:26:59 +00:00
* feat: 初始化插件系统 * refactor: 收口插件系统运行时重构 * perf: 优化插件系统类型提示 * fix&perf: 修复和优化插件系统 * fix: 修复gitignore规则误忽略插件文件的问题 * fix: 修复运行时插件根路径算错的问题 * fix: 加强插件发现和路由注册的防护措施 * revert: 回滚定时任务白名单 * fix: 移除未使用的应用路由注册探测 * revert: 恢复部分代码 * perf: 优化插件系统 * docs: 新增插件开发文档 * perf: 优化插件管理模块 * perf: 提升插件系统核心能力 * refactor: 重构生命周期 step runner * fix: 修复lint错误 * test: 清理测试用例 * test: 调整测试目录名称 * fix: 修复前后端目录硬编码的问题 * fix: 修复插件系统安全性缺口 * refactor: 重新设计插件生命周期 Migration 事务与回滚 * perf: 优化插件系统边界问题 * refactor: 重构当前插件系统的依赖体系设计 * perf: 优化代码 * perf: 优化代码 * fix: 修复代码合并问题 * fix: 修复bug * perf: 优化代码 * perf&fix: 优化代码和修复bug * docs: 优化文档格式 * feat: 适配Vue2版本 * docs: 更新README文档 * fix: 修复ruff lint错误 * chore: 更新后端依赖文件
39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
import importlib
|
|
from functools import lru_cache
|
|
from typing import TYPE_CHECKING
|
|
|
|
import typer
|
|
|
|
from .commands.configuration import register_configuration_commands
|
|
from .commands.dependency import register_dependency_commands
|
|
from .commands.developer import register_developer_commands
|
|
from .commands.discovery import register_discovery_commands
|
|
from .commands.lifecycle import register_lifecycle_commands
|
|
|
|
if TYPE_CHECKING:
|
|
from .controller import PluginCommandController
|
|
|
|
app = typer.Typer(
|
|
help='插件管理相关命令',
|
|
no_args_is_help=True,
|
|
context_settings={'help_option_names': ['-h', '--help']},
|
|
)
|
|
|
|
|
|
@lru_cache(maxsize=1)
|
|
def _get_plugin_command_controller() -> 'PluginCommandController':
|
|
"""
|
|
延迟获取插件命令控制器。
|
|
|
|
:return: 插件命令控制器
|
|
"""
|
|
controller_class = importlib.import_module('cli.groups.plugin.controller').PluginCommandController
|
|
return controller_class()
|
|
|
|
|
|
register_discovery_commands(app, _get_plugin_command_controller)
|
|
register_configuration_commands(app, _get_plugin_command_controller)
|
|
register_dependency_commands(app, _get_plugin_command_controller)
|
|
register_lifecycle_commands(app, _get_plugin_command_controller)
|
|
register_developer_commands(app, _get_plugin_command_controller)
|