This commit is contained in:
2026-08-18 02:03:34 +08:00
parent d2cd3b9fa8
commit 517c4cf46e
157 changed files with 16536 additions and 37 deletions
@@ -96,10 +96,10 @@ namespace ShrinkContext.AppAdapter
ModuleIds.Where(IsModuleWaiting).ToArray();
public bool IsModuleActive(string moduleId) =>
TryGetLoaderFiber(moduleId, out var fiber) && fiber.State == ShrinkFiberState.Active;
TryGetLoaderFiber(moduleId, out var fiber) && fiber is { State: ShrinkFiberState.Active };
public bool IsModuleWaiting(string moduleId) =>
TryGetLoaderFiber(moduleId, out var fiber) && fiber.State == ShrinkFiberState.Inactive;
TryGetLoaderFiber(moduleId, out var fiber) && fiber is { State: ShrinkFiberState.Inactive };
public bool IsModuleDisabled(string moduleId) =>
!string.IsNullOrWhiteSpace(moduleId) &&
@@ -1,4 +1,6 @@
#nullable enable
using System;
using System.Collections.Generic;
using NUnit.Framework;
using ShrinkApp.Starter.Basic;
using ShrinkCommand.Integration.App;
@@ -26,7 +28,16 @@ namespace ShrinkContext.AppAdapter.Tests
ShrinkAppLoaderHost? host = null;
try
{
host = new ShrinkAppLoaderHost(settings);
var coreInstallers = new List<IShrinkAppModuleInstaller>();
foreach (var installerType in ShrinkAppInstallers.GetDiscoveredInstallerTypes())
{
if (Activator.CreateInstance(installerType) is not IShrinkAppModuleInstaller installer)
continue;
if (installer.ModuleId is "shrink.network" or "shrink.command" or "shrink.datasaver")
coreInstallers.Add(installer);
}
host = new ShrinkAppLoaderHost(settings, coreInstallers);
ShrinkAppBasicContextComposition.Configure(host);
host.ApplyComposition(ShrinkAppBasicContextComposition.CreateDefaultDocument());