4 Commits
Author SHA1 Message Date
cneicy 012728ffac chore: release 0.2.4
Publish UPM package / publish (push) Successful in 2s
2026-08-28 04:31:05 +08:00
cneicy 885da4366d chore(release): 发布 v0.2.3
Publish UPM package / publish (push) Successful in 2s
2026-08-28 03:44:10 +08:00
cneicy 7096459763 fix(installer): complete context bundle roots
Publish UPM package / publish (push) Successful in 2s
2026-08-26 13:22:01 +08:00
cneicy c42d24bcde fix(installer): refresh package state after resolution
Publish UPM package / publish (push) Successful in 2s
2026-08-26 13:01:52 +08:00
7 changed files with 111 additions and 20 deletions
+16
View File
@@ -0,0 +1,16 @@
# Changelog
本文件记录 `ShrinkInstaller` 的包内变更。
## [0.2.4] - 2026-08-28
### Changed
- 目录切换到 `ShrinkEventBus 2.0.1` 及其精确依赖链,常用完整套件仍只安装四个直接根。
## [0.2.3] - 2026-08-28
### Changed
- 目录固定到 App Core 0.1.3、Context App Adapter 0.1.4、Starter Basic 0.2.1、DataSaver 2.2.2、ModFramework 0.2.3 及对应 Integration 稳定版本。
- 常用完整套件继续只安装 Starter、Context EventBus Adapter、ModFramework 与 Tutorial 四个直接根,并固定 UniTask revision。
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 827b7796ca4548bcb5e249b351489ed1
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -36,6 +36,21 @@ public static class ShrinkInstallerDevelopmentValidation
?.GetValue(null) as IEnumerable;
Require(Count(packages) == 20, "包目录数量不是 20。");
Require(Count(bundles) == 8, "推荐组合数量不是 8。");
Require(BundleContainsInstallRoot(bundles, "基础应用(推荐)",
"com.cneicy.shrink-context-eventbus-adapter"),
"基础应用组合没有显式安装 Context 事件适配。");
Require(BundleContainsInstallRoot(bundles, "常用完整套件",
"com.cneicy.shrink-context-eventbus-adapter"),
"常用完整套件没有显式安装 Context 事件适配。");
Require(BundleContainsInstallRoot(bundles, "常用完整套件",
"com.cneicy.shrink-app-starter-basic"),
"常用完整套件没有显式安装 Starter。");
Require(BundleContainsInstallRoot(bundles, "常用完整套件",
"com.cneicy.shrink-mod-framework"),
"常用完整套件没有显式安装 ModFramework。");
Require(BundleContainsInstallRoot(bundles, "常用完整套件",
"com.cneicy.shrink-tutorial"),
"常用完整套件没有显式安装 Tutorial。");
}
finally
{
@@ -60,6 +75,32 @@ public static class ShrinkInstallerDevelopmentValidation
return count;
}
private static bool BundleContainsInstallRoot(IEnumerable bundles, string bundleName, string packageName)
{
foreach (var bundle in bundles)
{
var bundleType = bundle.GetType();
if (!string.Equals(bundleType.GetProperty("DisplayName")?.GetValue(bundle) as string, bundleName,
StringComparison.Ordinal))
continue;
var roots = bundleType.GetProperty("InstallRoots")?.GetValue(bundle) as IEnumerable;
if (roots == null)
return false;
foreach (var root in roots)
{
var value = root.GetType().GetProperty("PackageName")?.GetValue(root) as string;
if (string.Equals(value, packageName, StringComparison.Ordinal))
return true;
}
return false;
}
return false;
}
private static Type FindType(string fullName) => AppDomain.CurrentDomain.GetAssemblies()
.Select(assembly => assembly.GetType(fullName, false))
.FirstOrDefault(type => type != null)
+27 -1
View File
@@ -20,6 +20,9 @@ namespace ShrinkSDK.Installer
private ListRequest? _listRequest;
private bool _resolvePending;
private double _resolveRequestedAt;
private bool _listRetryPending;
private double _nextListRetryAt;
private int _listRetryCount;
private HelpBox? _statusBox;
private Label? _registryState;
private VisualElement? _page;
@@ -71,14 +74,18 @@ namespace ShrinkSDK.Installer
header.style.paddingBottom = 10f;
header.style.borderBottomWidth = 1f;
header.style.borderBottomColor = new Color(0.25f, 0.25f, 0.25f);
header.style.minHeight = 104f;
var title = new Label("ShrinkSDK 包管理");
title.style.fontSize = 20f;
title.style.unityFontStyleAndWeight = FontStyle.Bold;
title.style.height = 28f;
title.style.unityTextAlign = TextAnchor.MiddleLeft;
header.Add(title);
var description = new Label("以 Context 为组合基础,按用途安装固定版本的模块与集成包。");
description.style.marginTop = 4f;
description.style.minHeight = 20f;
description.style.whiteSpace = WhiteSpace.Normal;
header.Add(description);
@@ -86,6 +93,7 @@ namespace ShrinkSDK.Installer
registryRow.style.flexDirection = FlexDirection.Row;
registryRow.style.alignItems = Align.Center;
registryRow.style.marginTop = 10f;
registryRow.style.minHeight = 22f;
registryRow.Add(new Label("软件源:"));
_registryState = new Label();
@@ -331,7 +339,7 @@ namespace ShrinkSDK.Installer
: "已安装 " + installed.version + " · 固定 " + package.Version;
}
private bool IsBusy => _listRequest != null || _resolvePending;
private bool IsBusy => _listRequest != null || _resolvePending || _listRetryPending;
private void Update()
{
@@ -342,6 +350,12 @@ namespace ShrinkSDK.Installer
StartListRequest();
}
if (_listRetryPending && EditorApplication.timeSinceStartup >= _nextListRetryAt)
{
_listRetryPending = false;
StartListRequest();
}
if (_listRequest == null || !_listRequest.IsCompleted)
return;
@@ -349,12 +363,21 @@ namespace ShrinkSDK.Installer
_listRequest = null;
if (list.Status == StatusCode.Success)
{
_listRetryCount = 0;
_installed.Clear();
foreach (var package in list.Result)
_installed[package.name] = package;
var count = _installed.Keys.Count(name => name.StartsWith("com.cneicy.", StringComparison.Ordinal));
SetStatus("状态已刷新:当前项目共解析到 " + count + " 个 ShrinkSDK 包。", HelpBoxMessageType.Info);
}
else if (string.IsNullOrWhiteSpace(list.Error?.message) && _listRetryCount < 4)
{
_listRetryCount++;
_listRetryPending = true;
_nextListRetryAt = EditorApplication.timeSinceStartup + 1d;
SetStatus("Unity 正在完成依赖解析,稍后自动重试安装状态(" + _listRetryCount + "/4)。",
HelpBoxMessageType.Info);
}
else
{
SetStatus("读取安装状态失败:" + GetRequestError(list.Error), HelpBoxMessageType.Warning);
@@ -399,6 +422,8 @@ namespace ShrinkSDK.Installer
{
_listRequest = null;
Client.Resolve();
_listRetryPending = false;
_listRetryCount = 0;
_resolvePending = true;
_resolveRequestedAt = EditorApplication.timeSinceStartup;
SetStatus(status, HelpBoxMessageType.Info);
@@ -409,6 +434,7 @@ namespace ShrinkSDK.Installer
{
if (IsBusy)
return;
_listRetryCount = 0;
StartListRequest();
SetStatus("正在读取当前项目的直接与间接依赖。", HelpBoxMessageType.Info);
RenderPage();
+16 -16
View File
@@ -70,33 +70,33 @@ namespace ShrinkSDK.Installer
"com.cneicy.shrink-context-core", "0.1.0", ShrinkSdkPackageLayer.Context, true);
internal static readonly ShrinkSdkPackageEntry ContextAppAdapter = Package(
"Context 应用适配", "用 ContextLoader 承载 ShrinkApp 组合根和运行时诊断。",
"com.cneicy.shrink-context-app-adapter", "0.1.3", ShrinkSdkPackageLayer.Context, true);
"com.cneicy.shrink-context-app-adapter", "0.1.5", ShrinkSdkPackageLayer.Context, true);
internal static readonly ShrinkSdkPackageEntry ContextEventBusAdapter = Package(
"Context 事件适配", "把事件订阅纳入 Context 的安装与自动撤回。",
"com.cneicy.shrink-context-eventbus-adapter", "0.1.0", ShrinkSdkPackageLayer.Context, true);
"com.cneicy.shrink-context-eventbus-adapter", "0.1.1", ShrinkSdkPackageLayer.Context, true);
internal static readonly ShrinkSdkPackageEntry AppCore = Package(
"应用宿主", "统一启动、服务门面与应用生命周期。",
"com.cneicy.shrink-app-core", "0.1.2", ShrinkSdkPackageLayer.Host, true);
"com.cneicy.shrink-app-core", "0.1.4", ShrinkSdkPackageLayer.Host, true);
internal static readonly ShrinkSdkPackageEntry StarterBasic = Package(
"基础应用起步包", "默认 Context 组合根,包含命令、存档、网络及其集成。",
"com.cneicy.shrink-app-starter-basic", "0.2.0", ShrinkSdkPackageLayer.Host, true);
"com.cneicy.shrink-app-starter-basic", "0.2.2", ShrinkSdkPackageLayer.Host, true);
internal static readonly ShrinkSdkPackageEntry Command = Package(
"命令系统", "命令路由、参数、权限与自动注册。",
"com.cneicy.shrink-command", "0.2.0", ShrinkSdkPackageLayer.Feature, true);
internal static readonly ShrinkSdkPackageEntry DataSaver = Package(
"存档系统", "异步存档、设置、备份恢复与数据观察。",
"com.cneicy.shrink-datasaver", "2.2.1", ShrinkSdkPackageLayer.Feature, true);
"com.cneicy.shrink-datasaver", "2.2.2", ShrinkSdkPackageLayer.Feature, true);
internal static readonly ShrinkSdkPackageEntry EventBus = Package(
"事件总线", "类型安全事件、请求结果、调度与代码生成。",
"com.cneicy.shrink-eventbus", "2.0.0", ShrinkSdkPackageLayer.Feature, true);
"com.cneicy.shrink-eventbus", "2.0.1", ShrinkSdkPackageLayer.Feature, true);
internal static readonly ShrinkSdkPackageEntry EventBusEntities = Package(
"Entities 事件适配", "将事件总线接入 Unity Entities。",
"com.cneicy.shrink-eventbus-entities", "0.1.0", ShrinkSdkPackageLayer.Integration, true);
"com.cneicy.shrink-eventbus-entities", "0.1.1", ShrinkSdkPackageLayer.Integration, true);
internal static readonly ShrinkSdkPackageEntry ModFramework = Package(
"模组框架", "Context 托管的模组生命周期、热替换与外部 DLL 加载。",
"com.cneicy.shrink-mod-framework", "0.2.2", ShrinkSdkPackageLayer.Feature, true);
"com.cneicy.shrink-mod-framework", "0.2.4", ShrinkSdkPackageLayer.Feature, true);
internal static readonly ShrinkSdkPackageEntry Network = Package(
"网络系统", "消息、RPC、权限、序列化与多种传输层。",
"com.cneicy.shrink-network", "0.2.1", ShrinkSdkPackageLayer.Feature, true);
@@ -106,25 +106,25 @@ namespace ShrinkSDK.Installer
internal static readonly ShrinkSdkPackageEntry CommandApp = Package(
"命令 - 应用集成", "以原生 Context 组件向应用宿主发布命令服务。",
"com.cneicy.shrink-command-integration-app", "0.1.1", ShrinkSdkPackageLayer.Integration, true);
"com.cneicy.shrink-command-integration-app", "0.1.3", ShrinkSdkPackageLayer.Integration, true);
internal static readonly ShrinkSdkPackageEntry CommandEventBus = Package(
"命令 - 事件集成", "通过事件总线执行命令并发布执行状态。",
"com.cneicy.shrink-command-integration-eventbus", "0.1.1", ShrinkSdkPackageLayer.Integration, true);
"com.cneicy.shrink-command-integration-eventbus", "0.1.2", ShrinkSdkPackageLayer.Integration, true);
internal static readonly ShrinkSdkPackageEntry CommandNetwork = Package(
"命令 - 网络集成", "通过网络 RPC 执行远程命令。",
"com.cneicy.shrink-command-integration-network", "0.1.1", ShrinkSdkPackageLayer.Integration, true);
internal static readonly ShrinkSdkPackageEntry DataSaverApp = Package(
"存档 - 应用集成", "以原生 Context 组件向应用宿主发布存档服务。",
"com.cneicy.shrink-datasaver-integration-app", "0.1.1", ShrinkSdkPackageLayer.Integration, true);
"com.cneicy.shrink-datasaver-integration-app", "0.1.3", ShrinkSdkPackageLayer.Integration, true);
internal static readonly ShrinkSdkPackageEntry DataSaverEventBus = Package(
"存档 - 事件集成", "通过事件总线请求读写并观察存档变化。",
"com.cneicy.shrink-datasaver-integration-eventbus", "2.1.1", ShrinkSdkPackageLayer.Integration, true);
"com.cneicy.shrink-datasaver-integration-eventbus", "2.1.3", ShrinkSdkPackageLayer.Integration, true);
internal static readonly ShrinkSdkPackageEntry NetworkApp = Package(
"网络 - 应用集成", "以原生 Context 组件向应用宿主发布网络服务。",
"com.cneicy.shrink-network-integration-app", "0.1.1", ShrinkSdkPackageLayer.Integration, true);
"com.cneicy.shrink-network-integration-app", "0.1.3", ShrinkSdkPackageLayer.Integration, true);
internal static readonly ShrinkSdkPackageEntry NetworkEventBus = Package(
"网络 - 事件集成", "把网络消息与事件请求桥接为可撤回的 Context 组件。",
"com.cneicy.shrink-network-integration-eventbus", "0.1.2", ShrinkSdkPackageLayer.Integration, true);
"com.cneicy.shrink-network-integration-eventbus", "0.1.3", ShrinkSdkPackageLayer.Integration, true);
internal static readonly ShrinkSdkPackageEntry SharedCodeGen = Package(
"共享代码生成", "各功能包使用的编译期注册表基础设施。",
"com.cneicy.shrink-shared-codegen", "0.1.0", ShrinkSdkPackageLayer.Tooling);
@@ -153,7 +153,7 @@ namespace ShrinkSDK.Installer
DataSaverApp, DataSaverEventBus, NetworkApp, NetworkEventBus,
StarterBasic
},
new[] { StarterBasic },
new[] { StarterBasic, ContextEventBusAdapter },
recommended: true),
new ShrinkSdkPackageBundle(
"Context 最小基座",
@@ -195,7 +195,7 @@ namespace ShrinkSDK.Installer
DataSaverApp, DataSaverEventBus, NetworkApp, NetworkEventBus,
StarterBasic
},
new[] { StarterBasic, ModFramework, Tutorial })
new[] { StarterBasic, ContextEventBusAdapter, ModFramework, Tutorial })
};
internal static IReadOnlyList<ShrinkSdkPackageEntry> DistinctInstallRoots(
+1 -1
View File
@@ -15,5 +15,5 @@
## 引导地址
```text
https://git.crash.work/ShrinkSDK/Installer.git#v0.2.0
https://git.crash.work/ShrinkSDK/Installer.git#v0.2.3
```
+3 -2
View File
@@ -1,10 +1,11 @@
{
"name": "com.cneicy.shrink-installer",
"version": "0.2.0",
"version": "0.2.4",
"displayName": "ShrinkSDK 包管理",
"description": "基于 UI Toolkit 的 ShrinkSDK 固定版本包管理器,提供安装状态、Context 分层与推荐组合。",
"unity": "2022.3",
"documentationUrl": "https://git.crash.work/ShrinkSDK/Installer",
"documentationUrl": "https://git.crash.work/ShrinkSDK/Installer",
"changelogUrl": "https://git.crash.work/ShrinkSDK/Installer/src/branch/main/CHANGELOG.md",
"dependencies": {
"com.unity.nuget.newtonsoft-json": "3.2.2"
},