3 Commits
Author SHA1 Message Date
cneicy ccb2ad59c1 fix: download release SDK directly from Microsoft Blob
Publish NuGet packages / publish (push) Canceled after 0s
Publish UPM package / publish (push) Successful in 2s
2026-11-06 19:26:42 +08:00
cneicy c522594520 feat: update Godot integration and coordinated package dependencies 2026-11-06 19:13:17 +08:00
cneicy fea752a8ff chore: align SDK dependencies and document reusable capabilities
Publish UPM package / publish (push) Successful in 2s
Publish NuGet packages / publish (push) Successful in 5m52s
2026-09-29 10:14:43 +08:00
8 changed files with 109 additions and 30 deletions

No files matched your search

+2 -1
View File
@@ -63,7 +63,8 @@ jobs:
const release = metadata.releases.find(item => item.sdk?.version === sdkVersion); const release = metadata.releases.find(item => item.sdk?.version === sdkVersion);
const file = release?.sdk?.files?.find(item => item.rid === 'linux-x64' && item.name.endsWith('.tar.gz')); const file = release?.sdk?.files?.find(item => item.rid === 'linux-x64' && item.name.endsWith('.tar.gz'));
if (!file) throw new Error(`Linux x64 SDK archive not found for ${sdkVersion}`); if (!file) throw new Error(`Linux x64 SDK archive not found for ${sdkVersion}`);
const archiveResponse = await fetch(file.url); const archiveUrl = `https://dotnetcli.blob.core.windows.net/dotnet/Sdk/${sdkVersion}/dotnet-sdk-${sdkVersion}-linux-x64.tar.gz`;
const archiveResponse = await fetch(archiveUrl);
if (!archiveResponse.ok) throw new Error(`SDK download failed: ${archiveResponse.status}`); if (!archiveResponse.ok) throw new Error(`SDK download failed: ${archiveResponse.status}`);
await writeFile('/tmp/dotnet-sdk.tar.gz', new Uint8Array(await archiveResponse.arrayBuffer())); await writeFile('/tmp/dotnet-sdk.tar.gz', new Uint8Array(await archiveResponse.arrayBuffer()));
+12
View File
@@ -2,6 +2,18 @@
本文件记录 `ShrinkDataSaver.Integration.App` 的包内变更。 本文件记录 `ShrinkDataSaver.Integration.App` 的包内变更。
## [0.3.0] - 2026-11-06
### Added
- 新增 `ShrinkDataSaverAppModuleConfig`,可同时传入 `ShrinkAppServices` 和自定义 `ShrinkDataSaverRuntimeConfig`。
- `ShrinkDataSaverAppComponent` 新增接收运行时配置的构造函数。
### Changed
- App 停止时等待 `ShrinkSettings.SaveAsync()` 完成,并把写入失败传播到停用链,不再 fire-and-forget。
- 精确依赖 `ShrinkDataSaver 2.5.0`、`ShrinkSDK.Runtime.Abstractions 0.2.0`。
## [0.1.3] - 2026-08-28 ## [0.1.3] - 2026-08-28
### Changed ### Changed
@@ -5,16 +5,16 @@
<AssemblyName>ShrinkDataSaver.Integration.App</AssemblyName> <AssemblyName>ShrinkDataSaver.Integration.App</AssemblyName>
<RootNamespace>ShrinkDataSaver.Integration.App</RootNamespace> <RootNamespace>ShrinkDataSaver.Integration.App</RootNamespace>
<PackageId>ShrinkSDK.DataSaver.Integration.App</PackageId> <PackageId>ShrinkSDK.DataSaver.Integration.App</PackageId>
<Version>0.2.0</Version> <Version>0.3.1</Version>
<Description>ShrinkDataSaver and App host integration.</Description> <Description>ShrinkDataSaver and App host integration.</Description>
<ShrinkCodeGenEnabled>true</ShrinkCodeGenEnabled> <ShrinkCodeGenEnabled>true</ShrinkCodeGenEnabled>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Runtime\*.cs" /> <Compile Include="..\Runtime\*.cs" />
<PackageReference Include="ShrinkSDK.Runtime.Abstractions" Version="0.1.0" /> <PackageReference Include="ShrinkSDK.Runtime.Abstractions" Version="0.2.0" />
<PackageReference Include="ShrinkSDK.Context.Core" Version="0.2.0" /> <PackageReference Include="ShrinkSDK.Context.Core" Version="0.3.1" />
<PackageReference Include="ShrinkSDK.App.Core" Version="0.2.0" /> <PackageReference Include="ShrinkSDK.App.Core" Version="0.2.4" />
<PackageReference Include="ShrinkSDK.DataSaver" Version="2.3.0" /> <PackageReference Include="ShrinkSDK.DataSaver" Version="2.5.0" />
<PackageReference Include="ShrinkSDK.CodeGen" Version="0.1.0" PrivateAssets="compile;runtime;contentfiles;native" /> <PackageReference Include="ShrinkSDK.CodeGen" Version="0.2.0" PrivateAssets="compile;runtime;contentfiles;native" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+10
View File
@@ -29,3 +29,13 @@ var reader = communityContext.Get<IShrinkDataSaverReader>(
``` ```
这是服务能力的最小化暴露:只约束通过 `ShrinkCtx.Get` 解析该键的调用方。它不会限制代码绕过上下文后直接访问静态 API,也不构成不可信模组沙箱。 这是服务能力的最小化暴露:只约束通过 `ShrinkCtx.Get` 解析该键的调用方。它不会限制代码绕过上下文后直接访问静态 API,也不构成不可信模组沙箱。
## 可复用能力
<!-- shrink:capabilities -->
Capability: 把存档接到宿主,并区分读取与写入权限
Aliases: 存档宿主 只读 read only
Limits: intercept 的只读限制不能绕过;数据由业务模块持有
Extension: IShrinkDataSaverReader/Writer 和访问策略
Evidence: [ShrinkDataSaverAppComponent](Runtime/ShrinkDataSaverAppComponent.cs)
<!-- /shrink:capabilities -->
+41 -19
View File
@@ -21,6 +21,16 @@ namespace ShrinkDataSaver.Integration.App
public const string ModuleKey = "app.module.shrink.datasaver"; public const string ModuleKey = "app.module.shrink.datasaver";
private static readonly string[] ProvideKeys = { ModuleKey, ServiceKey }; private static readonly string[] ProvideKeys = { ModuleKey, ServiceKey };
private readonly ShrinkDataSaverRuntimeConfig? _runtimeConfig;
public ShrinkDataSaverAppComponent()
{
}
public ShrinkDataSaverAppComponent(ShrinkDataSaverRuntimeConfig? runtimeConfig)
{
_runtimeConfig = runtimeConfig;
}
public string Name => "shrink.datasaver"; public string Name => "shrink.datasaver";
@@ -28,22 +38,27 @@ namespace ShrinkDataSaver.Integration.App
public IReadOnlyList<string> Provide => ProvideKeys; public IReadOnlyList<string> Provide => ProvideKeys;
public async UniTask ApplyAsync(ShrinkCtx ctx, object? config) public UniTask ApplyAsync(ShrinkCtx ctx, object? config)
{ {
// 编辑器/EditMode 环境下 DontDestroyOnLoad 会抛异常,驱动只在播放模式常驻 ShrinkAppServices? appServices = null;
ShrinkDataSaverRuntime.Initialize(new ShrinkDataSaverRuntimeConfig var runtimeConfig = _runtimeConfig ?? CreateDefaultRuntimeConfig();
if (config is ShrinkDataSaverAppModuleConfig moduleConfig)
{ {
#if UNITY_5_3_OR_NEWER appServices = moduleConfig.Services;
DontDestroyOnLoadDriver = UnityEngine.Application.isPlaying if (moduleConfig.RuntimeConfig != null)
#else runtimeConfig = moduleConfig.RuntimeConfig;
DontDestroyOnLoadDriver = false }
#endif else if (config is ShrinkAppServices services)
}); {
appServices = services;
}
ShrinkDataSaverRuntime.Initialize(runtimeConfig);
var facade = new ShrinkDataSaverService(); var facade = new ShrinkDataSaverService();
ctx.Set(ServiceKey, facade, new ShrinkDataSaverAccessPolicy(facade)); ctx.Set(ServiceKey, facade, new ShrinkDataSaverAccessPolicy(facade));
ctx.Set(ModuleKey, Name); ctx.Set(ModuleKey, Name);
if (config is ShrinkAppServices appServices) if (appServices != null)
{ {
appServices.Register(facade); appServices.Register(facade);
ctx.EffectInverse(() => ctx.EffectInverse(() =>
@@ -53,17 +68,24 @@ namespace ShrinkDataSaver.Integration.App
}); });
} }
await ctx.EffectAsync(async () => ctx.EffectInverse(async () =>
{ {
await UniTask.CompletedTask; await ShrinkSettings.SaveAsync();
return () =>
{
// 终止动作(触发式):停用时把防抖中的设置写盘。
// 磁盘 IO 在线程池完成,不阻塞停用链;未初始化环境安全跳过(SaveAsync 守卫)。
ShrinkSettings.SaveAsync().Forget();
return UniTask.CompletedTask;
};
}); });
return UniTask.CompletedTask;
}
private static ShrinkDataSaverRuntimeConfig CreateDefaultRuntimeConfig()
{
// 编辑器/EditMode 环境下 DontDestroyOnLoad 会抛异常,驱动只在播放模式常驻
return new ShrinkDataSaverRuntimeConfig
{
#if UNITY_5_3_OR_NEWER
DontDestroyOnLoadDriver = UnityEngine.Application.isPlaying
#else
DontDestroyOnLoadDriver = false
#endif
};
} }
} }
} }
+23
View File
@@ -0,0 +1,23 @@
#nullable enable
using ShrinkApp;
namespace ShrinkDataSaver.Integration.App
{
public sealed class ShrinkDataSaverAppModuleConfig
{
public ShrinkDataSaverAppModuleConfig()
{
}
public ShrinkDataSaverAppModuleConfig(ShrinkAppServices? services,
ShrinkDataSaverRuntimeConfig? runtimeConfig = null)
{
Services = services;
RuntimeConfig = runtimeConfig;
}
public ShrinkAppServices? Services { get; set; }
public ShrinkDataSaverRuntimeConfig? RuntimeConfig { get; set; }
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bd27f288ce72493889806887d825b37d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+4 -4
View File
@@ -1,14 +1,14 @@
{ {
"name": "com.cneicy.shrink-datasaver-integration-app", "name": "com.cneicy.shrink-datasaver-integration-app",
"version": "0.2.0", "version": "0.3.1",
"displayName": "ShrinkDataSaver - App Integration", "displayName": "ShrinkDataSaver - App Integration",
"description": "ShrinkDataSaver 与 ShrinkApp 的桥接层,提供宿主接管初始化与服务注册。", "description": "ShrinkDataSaver 与 ShrinkApp 的桥接层,提供宿主接管初始化与服务注册。",
"unity": "2022.3", "unity": "2022.3",
"dependencies": { "dependencies": {
"com.cneicy.shrink-datasaver": "2.3.0", "com.cneicy.shrink-datasaver": "2.5.0",
"com.cneicy.shrink-app-core": "0.2.0", "com.cneicy.shrink-app-core": "0.2.4",
"com.cysharp.unitask": "2.5.10", "com.cysharp.unitask": "2.5.10",
"com.cneicy.shrink-context-core": "0.2.0" "com.cneicy.shrink-context-core": "0.3.1"
}, },
"keywords": [ "keywords": [
"save", "save",