Browse Source

Add `Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling` package.

pull/19968/head
maliming 2 years ago
parent
commit
081b8aa9a8
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 7
      framework/Volo.Abp.sln
  2. 34
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling/AbpAspNetCoreComponentsMauiBlazorThemingModule.cs
  3. 14
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling/MauiBlazorStandardBundles.cs
  4. 13
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling/MauiScriptContributor.cs
  5. 18
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling/MauiStyleContributor.cs
  6. 16
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling.csproj
  7. 4
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/AbpAspNetCoreComponentsMauiBlazorThemingModule.cs
  8. 32
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/ComponentsComponentsBundleContributor.cs
  9. 1
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.csproj
  10. 3
      nupkg/common.ps1
  11. 2
      nupkg/common.ps1.bak
  12. 13
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Client/MyProjectNameBundleContributor.cs
  13. 2
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/MyCompanyName.MyProjectName.Blazor.WebAssembly.Server.csproj
  14. 16
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host.Client/MyProjectNameBlazorHostBundleContributor.cs

7
framework/Volo.Abp.sln

@ -469,6 +469,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Abstrac
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling", "src\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling.csproj", "{2F9BA650-395C-4BE0-8CCB-9978E753562A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling", "src\Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling\Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling.csproj", "{7ADB6D92-82CC-4A2A-8BCF-FC6C6308796D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1399,6 +1401,10 @@ Global
{2F9BA650-395C-4BE0-8CCB-9978E753562A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F9BA650-395C-4BE0-8CCB-9978E753562A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F9BA650-395C-4BE0-8CCB-9978E753562A}.Release|Any CPU.Build.0 = Release|Any CPU
{7ADB6D92-82CC-4A2A-8BCF-FC6C6308796D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7ADB6D92-82CC-4A2A-8BCF-FC6C6308796D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7ADB6D92-82CC-4A2A-8BCF-FC6C6308796D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7ADB6D92-82CC-4A2A-8BCF-FC6C6308796D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1635,6 +1641,7 @@ Global
{DACD4485-61BE-4DE5-ACAE-4FFABC122500} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{E1051CD0-9262-4869-832D-B951723F4DDE} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{2F9BA650-395C-4BE0-8CCB-9978E753562A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{7ADB6D92-82CC-4A2A-8BCF-FC6C6308796D} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}

34
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling/AbpAspNetCoreComponentsMauiBlazorThemingModule.cs

@ -0,0 +1,34 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling;
[DependsOn(
typeof(AbpAspNetCoreMvcUiBundlingAbstractionsModule)
)]
public class AbpAspNetCoreComponentsMauiBlazorThemingBundlingModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpBundlingOptions>(options =>
{
options.GlobalAssets.Enabled = true;
options.GlobalAssets.GlobalStyleBundleName = MauiBlazorStandardBundles.Styles.Global;
options.GlobalAssets.GlobalScriptBundleName = MauiBlazorStandardBundles.Scripts.Global;
options
.StyleBundles
.Add(MauiBlazorStandardBundles.Styles.Global, bundle =>
{
bundle.AddContributors(typeof(MauiStyleContributor));
});
options
.ScriptBundles
.Add(MauiBlazorStandardBundles.Scripts.Global, bundle =>
{
bundle.AddContributors(typeof(MauiScriptContributor));
});
});
}
}

14
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling/MauiBlazorStandardBundles.cs

@ -0,0 +1,14 @@
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling;
public class MauiBlazorStandardBundles
{
public static class Styles
{
public static string Global = "MauiBlazor.Global";
}
public static class Scripts
{
public static string Global = "MauiBlazor.Global";
}
}

13
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling/MauiScriptContributor.cs

@ -0,0 +1,13 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling;
public class MauiScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js");
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/lang-utils.js");
}
}

18
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling/MauiStyleContributor.cs

@ -0,0 +1,18 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling;
public class MauiStyleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/bootstrap/css/bootstrap.min.css");
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/fontawesome/css/all.css");
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/css/abp.css");
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/flag-icon/css/flag-icon.css");
context.Files.AddIfNotContains("_content/Blazorise/blazorise.css");
context.Files.AddIfNotContains("_content/Blazorise.Bootstrap5/blazorise.bootstrap5.css");
context.Files.AddIfNotContains("_content/Blazorise.Snackbar/blazorise.snackbar.css");
}
}

16
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling.csproj

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions\Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions.csproj" />
</ItemGroup>
</Project>

4
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/AbpAspNetCoreComponentsMauiBlazorThemingModule.cs

@ -1,9 +1,11 @@
using Volo.Abp.AspNetCore.Components.Web.Theming;
using Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling;
using Volo.Abp.AspNetCore.Components.Web.Theming;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming;
[DependsOn(
typeof(AbpAspNetCoreComponentsMauiBlazorThemingBundlingModule),
typeof(AbpAspNetCoreComponentsWebThemingModule),
typeof(AbpAspNetCoreComponentsMauiBlazorModule)
)]

32
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/ComponentsComponentsBundleContributor.cs

@ -1,32 +0,0 @@
using Volo.Abp.Bundling;
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming;
public class ComponentsComponentsBundleContributor : IBundleContributor
{
public void AddScripts(BundleContext context)
{
context.Add("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js");
context.Add("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/lang-utils.js");
}
public void AddStyles(BundleContext context)
{
if (!context.InteractiveAuto)
{
context.BundleDefinitions.Insert(0, new BundleDefinition
{
Source = "_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/bootstrap/css/bootstrap.min.css"
});
context.BundleDefinitions.Insert(1, new BundleDefinition
{
Source = "_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/fontawesome/css/all.css"
});
}
context.Add("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/css/abp.css");
context.Add("_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/flag-icon/css/flag-icon.css");
context.Add("_content/Blazorise/blazorise.css");
context.Add("_content/Blazorise.Bootstrap5/blazorise.bootstrap5.css");
context.Add("_content/Blazorise.Snackbar/blazorise.snackbar.css");
}
}

1
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.csproj

@ -10,6 +10,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling\Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.Web.Theming\Volo.Abp.AspNetCore.Components.Web.Theming.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.MauiBlazor\Volo.Abp.AspNetCore.Components.MauiBlazor.csproj" />
</ItemGroup>

3
nupkg/common.ps1

@ -111,7 +111,8 @@ $projects = (
"framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling"
"framework/src/Volo.Abp.AspNetCore.Components.Server",
"framework/src/Volo.Abp.AspNetCore.Components.Server.Theming",
"framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming",
"framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming",
"framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling",
"framework/src/Volo.Abp.AspNetCore.MultiTenancy",
"framework/src/Volo.Abp.AspNetCore.Mvc.Client",
"framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common",

2
nupkg/common.ps1.bak

@ -106,7 +106,6 @@ $projects = (
"framework/src/Volo.Abp.AspNetCore.Components.Web.Theming",
"framework/src/Volo.Abp.AspNetCore.Components.WebAssembly",
"framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.Theming",
"framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling"
"framework/src/Volo.Abp.AspNetCore.Components.Server",
"framework/src/Volo.Abp.AspNetCore.Components.Server.Theming",
"framework/src/Volo.Abp.AspNetCore.MultiTenancy",
@ -268,7 +267,6 @@ $projects = (
"modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme",
"modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme",
"modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme",
"modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Bundling",
"modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic",
"modules/basic-theme/src/Volo.Abp.BasicTheme.Installer",
"source-codeVolo.Abp.BasicTheme.SourceCode",

13
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Client/MyProjectNameBundleContributor.cs

@ -1,19 +1,14 @@
using Volo.Abp.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace MyCompanyName.MyProjectName;
/* Add your global styles/scripts here.
* See https://docs.abp.io/en/abp/latest/UI/Blazor/Global-Scripts-Styles to learn how to use it
*/
public class MyProjectNameBundleContributor : IBundleContributor
public class MyProjectNameBundleContributor : BundleContributor
{
public void AddScripts(BundleContext context)
public override void ConfigureBundle(BundleConfigurationContext context)
{
}
public void AddStyles(BundleContext context)
{
context.Add("main.css", true);
context.Files.Add(new BundleFile("main.css", true));
}
}

2
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Server/MyCompanyName.MyProjectName.Blazor.WebAssembly.Server.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Compoutor : IBundleContributornents.WebAssembly.Server" Version="8.0.4" />
</ItemGroup>
<ItemGroup>

16
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host.Client/MyProjectNameBlazorHostBundleContributor.cs

@ -1,16 +1,14 @@
using Volo.Abp.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace MyCompanyName.MyProjectName.Blazor.Host.Client;
public class MyProjectNameBlazorHostBundleContributor : IBundleContributor
/* Add your global styles/scripts here.
* See https://docs.abp.io/en/abp/latest/UI/Blazor/Global-Scripts-Styles to learn how to use it
*/
public class MyProjectNameBlazorHostBundleContributor : BundleContributor
{
public void AddScripts(BundleContext context)
public override void ConfigureBundle(BundleConfigurationContext context)
{
}
public void AddStyles(BundleContext context)
{
context.Add("main.css", true);
context.Files.Add(new BundleFile("main.css", true));
}
}

Loading…
Cancel
Save