Improves the plugin system documentation, tests and conventions

- Documents the book metadata DTOs and the Book aggregate constructor parameters
- References ADR-0006 in the scan snapshot repository remarks, explaining the Dapper choice
- Extracts shared plugin entity fixtures and uses them in the plugin and metadata provider tests
- Moves PluginLoadResult to the Common DTO models, renaming it PluginLoadResultDto
- Replaces the duplicate Contracts plugin setting type with the shared kernel enum
- Removes the generated plugin view Designer file and its project wiring
- Drops redundant braces in the plugin repositories
This commit is contained in:
BinaryAlley committed 2026-08-12 13:58:47 -07:00
1 parent 42566dcf06
commit 3653ff5bd7
25 files changed
+168 -321

No files matched your search

@@ -14,6 +14,7 @@ using Lumina.Domain.Core.BoundedContexts.LibraryManagementBoundedContext.Library
using Lumina.Domain.Core.BoundedContexts.LibraryManagementBoundedContext.LibraryScanAggregate.Services.Queue;
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services.Jobs;
using Lumina.Infrastructure.Common.DomainEvents;
using Lumina.Infrastructure.Common.Models.DTO.Plugins;
using Lumina.Infrastructure.Core.Authentication;
using Lumina.Infrastructure.Core.Authorization;
using Lumina.Infrastructure.Core.Authorization.Policies.Common.Factory;
@@ -89,7 +90,7 @@ public static class InfrastructureLayerServices
// plugins: load the plugin assemblies from the plugins directory, register their services and provide the plugin manager
string pluginsDirectorySetting = configuration.GetSection(PluginsSettingsDto.SECTION_NAME)["Directory"] ?? "plugins";
string pluginsDirectory = Path.Combine(AppContext.BaseDirectory, pluginsDirectorySetting);
PluginLoadResult pluginLoadResult = PluginLoader.LoadPlugins(pluginsDirectory, services);
PluginLoadResultDto pluginLoadResult = PluginLoader.LoadPlugins(pluginsDirectory, services);
services.AddSingleton<IPluginManager>(new PluginManager(pluginLoadResult.Plugins));
services.AddScoped<IPluginSettingsStore, PluginSettingsStore>();
services.AddSingleton(serviceProvider => new PluginDetectionSyncJob(
@@ -0,0 +1,13 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Plugins.Contracts.Core.Plugins;
using System.Collections.Generic;
#endregion
namespace Lumina.Infrastructure.Common.Models.DTO.Plugins;
/// <summary>
/// Data transfer object for the result of loading the plugins from the plugins directory.
/// </summary>
/// <param name="Plugins">The plugins that were loaded successfully.</param>
/// <param name="Errors">The errors that occurred while loading the plugins.</param>
internal sealed record PluginLoadResultDto(IReadOnlyList<IPlugin> Plugins, IReadOnlyList<string> Errors);