com.cneicy.shrink-command-integration-app (0.2.0)
Published 2026-09-05 04:15:20 +08:00 by cneicy
Installation
registry=https://git.crash.work/api/packages/ShrinkSDK/npm/npm install com.cneicy.shrink-command-integration-app@0.2.0"com.cneicy.shrink-command-integration-app": "0.2.0"About this package
ShrinkCommand 与 ShrinkApp 的桥接层,把默认命令服务纳入统一宿主服务容器。
ShrinkCommand.Integration.App
ShrinkCommand.Integration.App 是 ShrinkCommand 与 ShrinkApp.Core 的桥接层。它的职责很简单:把默认命令服务挂进 ShrinkApp 的服务容器里,让项目在进入统一宿主模式后,仍能用熟悉的命令系统,而不需要到处手动拿 ShrinkCommandRuntime.Default。
Godot 和普通 .NET 项目安装 ShrinkSDK.Command.Integration.App;可打包源码位于 DotNet~。
当前能力
- 提供原生
ShrinkCommandAppComponent,发布shrink.service.command - 把
ShrinkCommandRuntime.Default包装为ShrinkCommandAppService - ContextLoader 下由 Starter 组合根装配,服务门面随组件停用可逆注销
ShrinkCommandAppInstaller仅保留给 ClassicHost 兼容路径,已标记过时
使用示例
var command = ShrinkApp.ShrinkApp.Services.GetRequired<ShrinkCommand.Integration.App.ShrinkCommandAppService>();
var result = await command.ExecuteAsync(source, "help");
说明
- 本包不改变
ShrinkCommand的原有 API。 - 静态命令的默认注册仍由
ShrinkCommandRuntime.Default完成。 - 运行时实例命令仍然走
RegisterCommands(object target)。
Dependencies
Dependencies
| ID | Version |
|---|---|
| com.cneicy.shrink-app-core | 0.2.0 |
| com.cneicy.shrink-command | 0.3.0 |
| com.cneicy.shrink-context-core | 0.2.0 |
| com.cysharp.unitask | 2.5.10 |
Keywords
command
integration
app
console