Fixed bundling. Upgraded mooncore.extended
This commit is contained in:
@@ -10,12 +10,10 @@ namespace Moonlight.ApiServer.Implementations.Startup;
|
|||||||
public class CoreStartup : IPluginStartup
|
public class CoreStartup : IPluginStartup
|
||||||
{
|
{
|
||||||
private readonly AppConfiguration Configuration;
|
private readonly AppConfiguration Configuration;
|
||||||
private readonly BundleService BundleService;
|
|
||||||
|
|
||||||
public CoreStartup(AppConfiguration configuration, BundleService bundleService)
|
public CoreStartup(AppConfiguration configuration)
|
||||||
{
|
{
|
||||||
Configuration = configuration;
|
Configuration = configuration;
|
||||||
BundleService = bundleService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task BuildApplication(IHostApplicationBuilder builder)
|
public Task BuildApplication(IHostApplicationBuilder builder)
|
||||||
@@ -35,15 +33,9 @@ public class CoreStartup : IPluginStartup
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Assets
|
|
||||||
|
|
||||||
BundleService.BundleCss("css/core.min.css");
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Database
|
#region Database
|
||||||
|
|
||||||
builder.Services.AddDbContext<DbContext, CoreDataContext>();
|
builder.Services.AddDbContext<CoreDataContext>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="MoonCore" Version="1.8.3" />
|
<PackageReference Include="MoonCore" Version="1.8.3" />
|
||||||
<PackageReference Include="MoonCore.Extended" Version="1.2.9" />
|
<PackageReference Include="MoonCore.Extended" Version="1.3.0" />
|
||||||
<PackageReference Include="MoonCore.PluginFramework" Version="1.0.5" />
|
<PackageReference Include="MoonCore.PluginFramework" Version="1.0.5" />
|
||||||
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/>
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/>
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ public class BundleGenerationService : IHostedService
|
|||||||
if (mainStylesheet.ImportRules.Any(x => x.Text == importRule.Text))
|
if (mainStylesheet.ImportRules.Any(x => x.Text == importRule.Text))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
content += importRule.StylesheetText.Text + "\n";
|
content = importRule.StylesheetText.Text + "\n" + content;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Media Rules
|
// Media Rules
|
||||||
|
|||||||
@@ -126,6 +126,9 @@ public class PluginService
|
|||||||
PathBuilder.Dir(pluginFolder, "wwwroot")
|
PathBuilder.Dir(pluginFolder, "wwwroot")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(!Directory.Exists(wwwRootPath))
|
||||||
|
continue;
|
||||||
|
|
||||||
wwwRootProviders.Add(
|
wwwRootProviders.Add(
|
||||||
new PhysicalFileProvider(wwwRootPath)
|
new PhysicalFileProvider(wwwRootPath)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ public class Startup
|
|||||||
await CreateStorage();
|
await CreateStorage();
|
||||||
await SetupAppConfiguration();
|
await SetupAppConfiguration();
|
||||||
await SetupLogging();
|
await SetupLogging();
|
||||||
|
await SetupBundling();
|
||||||
await LoadPlugins();
|
await LoadPlugins();
|
||||||
await InitializePlugins();
|
await InitializePlugins();
|
||||||
|
|
||||||
@@ -126,6 +127,15 @@ public class Startup
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Task SetupBundling()
|
||||||
|
{
|
||||||
|
BundleService = new();
|
||||||
|
|
||||||
|
BundleService.BundleCss("css/core.min.css");
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
#region Base
|
#region Base
|
||||||
|
|
||||||
private Task RegisterBase()
|
private Task RegisterBase()
|
||||||
@@ -490,6 +500,7 @@ public class Startup
|
|||||||
private async Task RegisterDatabase()
|
private async Task RegisterDatabase()
|
||||||
{
|
{
|
||||||
WebApplicationBuilder.Services.AddDatabaseMappings();
|
WebApplicationBuilder.Services.AddDatabaseMappings();
|
||||||
|
WebApplicationBuilder.Services.AddServiceCollectionAccessor();
|
||||||
|
|
||||||
WebApplicationBuilder.Services.AddScoped(typeof(DatabaseRepository<>));
|
WebApplicationBuilder.Services.AddScoped(typeof(DatabaseRepository<>));
|
||||||
WebApplicationBuilder.Services.AddScoped(typeof(CrudHelper<,>));
|
WebApplicationBuilder.Services.AddScoped(typeof(CrudHelper<,>));
|
||||||
|
|||||||
Reference in New Issue
Block a user