diff --git a/Hosts/Moonlight.Frontend.Host/Styles/styles.css b/Hosts/Moonlight.Frontend.Host/Styles/styles.css index 97a69946..98cc703e 100644 --- a/Hosts/Moonlight.Frontend.Host/Styles/styles.css +++ b/Hosts/Moonlight.Frontend.Host/Styles/styles.css @@ -1,11 +1,11 @@ @import "tailwindcss"; @import "tw-animate-css"; -@import "../../../Moonlight.Frontend/bin/ShadcnBlazor/scrollbar.css"; -@import "../../../Moonlight.Frontend/bin/ShadcnBlazor/default-theme.css"; +@import "../bin/ShadcnBlazor/scrollbar.css"; +@import "../bin/ShadcnBlazor/default-theme.css"; @import "./theme.css"; -@source "../../../Moonlight.Frontend/bin/ShadcnBlazor/ShadcnBlazor.map"; +@source "../bin/ShadcnBlazor/ShadcnBlazor.map"; @source "../../../Moonlight.Api/**/*.razor"; @source "../../../Moonlight.Api/**/*.cs"; diff --git a/Moonlight.Frontend/Moonlight.Frontend.csproj b/Moonlight.Frontend/Moonlight.Frontend.csproj index f5522291..631888aa 100644 --- a/Moonlight.Frontend/Moonlight.Frontend.csproj +++ b/Moonlight.Frontend/Moonlight.Frontend.csproj @@ -24,8 +24,8 @@ - - + + @@ -36,5 +36,6 @@ + \ No newline at end of file diff --git a/Moonlight.Frontend/Moonlight.Frontend.targets b/Moonlight.Frontend/Moonlight.Frontend.targets index 6beede2b..95a0f686 100644 --- a/Moonlight.Frontend/Moonlight.Frontend.targets +++ b/Moonlight.Frontend/Moonlight.Frontend.targets @@ -5,7 +5,7 @@ - + diff --git a/Moonlight.Frontend/MoonlightPlugin.cs b/Moonlight.Frontend/MoonlightPlugin.cs index c5ca0592..df5bbc75 100644 --- a/Moonlight.Frontend/MoonlightPlugin.cs +++ b/Moonlight.Frontend/MoonlightPlugin.cs @@ -5,6 +5,13 @@ namespace Moonlight.Frontend; public abstract class MoonlightPlugin : IPluginModule { + protected MoonlightPlugin[] Plugins { get; private set; } + + public void Initialize(MoonlightPlugin[] plugins) + { + Plugins = plugins; + } + public virtual void PreBuild(WebAssemblyHostBuilder builder){} public virtual void PostBuild(WebAssemblyHost application){} } \ No newline at end of file diff --git a/Moonlight.Frontend/Startup/IAppStartup.cs b/Moonlight.Frontend/Startup/IAppStartup.cs deleted file mode 100644 index f9e821eb..00000000 --- a/Moonlight.Frontend/Startup/IAppStartup.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using SimplePlugin.Abstractions; - -namespace Moonlight.Frontend.Startup; - -public interface IAppStartup : IPluginModule -{ - public void PreBuild(WebAssemblyHostBuilder builder); - public void PostBuild(WebAssemblyHost application); -} \ No newline at end of file diff --git a/Moonlight.Frontend/StartupHandler.cs b/Moonlight.Frontend/StartupHandler.cs index f8522516..2a7a0817 100644 --- a/Moonlight.Frontend/StartupHandler.cs +++ b/Moonlight.Frontend/StartupHandler.cs @@ -10,11 +10,17 @@ public static class StartupHandler var builder = WebAssemblyHostBuilder.CreateDefault(args); + // Setting up context + foreach (var plugin in plugins) + plugin.Initialize(plugins); + + // Stage 1: Pre Build foreach (var plugin in plugins) plugin.PreBuild(builder); var app = builder.Build(); + // Stage 2: Post Build foreach(var plugin in plugins) plugin.PostBuild(app);