Skip to content

Commit b17b265

Browse files
committed
Change Scss and Js Compilers & Remove All Dependencies Except MudBlazor
1 parent c6570f8 commit b17b265

16 files changed

Lines changed: 6040 additions & 110 deletions

CodeBeam.MudBlazor.Extensions.Docs.Wasm/wwwroot/CodeBeam.MudBlazor.Extensions.xml

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<OutputType>Exe</OutputType>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="NUglify" Version="1.19.1" />
11+
</ItemGroup>
12+
13+
</Project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using NUglify;
2+
using System.Text;
3+
4+
Console.WriteLine("Minifying MudExtensions.js...");
5+
6+
// Solution root
7+
var solutionRoot = Directory.GetCurrentDirectory();
8+
9+
// Ana proje klasörü
10+
var projectRoot = Path.Combine(solutionRoot, "CodeBeam.MudBlazor.Extensions");
11+
12+
var input = Path.Combine(projectRoot, "TScripts", "MudExtensions.js");
13+
var output = Path.Combine(projectRoot, "wwwroot", "MudExtensions.min.js");
14+
15+
Console.WriteLine($"IN : {input}");
16+
Console.WriteLine($"OUT: {output}");
17+
18+
if (!File.Exists(input))
19+
{
20+
Console.Error.WriteLine($"Input file not found: {input}");
21+
Environment.Exit(1);
22+
}
23+
24+
var js = File.ReadAllText(input, Encoding.UTF8);
25+
var result = Uglify.Js(js);
26+
27+
if (result.HasErrors)
28+
{
29+
foreach (var error in result.Errors)
30+
Console.Error.WriteLine(error.ToString());
31+
32+
Environment.Exit(1);
33+
}
34+
35+
Directory.CreateDirectory(Path.GetDirectoryName(output)!);
36+
File.WriteAllText(output, result.Code!, Encoding.UTF8);
37+
38+
Console.WriteLine("✔ MudExtensions.min.js generated successfully");

CodeBeam.MudBlazor.Extensions/CodeBeam.MudBlazor.Extensions.csproj

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<PackageLicenseExpression>MIT</PackageLicenseExpression>
8+
<PackageReadmeFile>README.md</PackageReadmeFile>
89
<Version>9.0.0-preview.1</Version>
910
<Title>CodeBeam.MudBlazor.Extensions</Title>
11+
<PackageId>CodeBeam.MudBlazor.Extensions</PackageId>
1012
<Authors>CodeBeam</Authors>
1113
<Company>CodeBeam</Company>
1214
<Description>MudBlazor extension components from contributors. Includes 30+ components and utilities.</Description>
1315
<Copyright>CodeBeam OpenSource MIT</Copyright>
1416
<PackageIcon>Mud_Secondary.png</PackageIcon>
1517
<PackageProjectUrl>https://mudextensions.codebeam.org/</PackageProjectUrl>
18+
<RepositoryType>git</RepositoryType>
1619
<RepositoryUrl>https://github.com/CodeBeamOrg/CodeBeam.MudBlazor.Extensions</RepositoryUrl>
1720
<PackageTags>Blazor; MudBlazor; Component; Extension; Material3; Animate; Stepper; ComboBox; Select; List; Loading; Gallery; ChipField; Transfer; Barcode; QR; SpeedDial; RangeSlider; Teleport</PackageTags>
1821
<RootNamespace>MudExtensions</RootNamespace>
@@ -23,65 +26,41 @@
2326
<TrimMode>link</TrimMode>
2427
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
2528
<GenerateDocumentationFile>True</GenerateDocumentationFile>
29+
<SassCompilerEnableWatcher>false</SassCompilerEnableWatcher>
2630
</PropertyGroup>
2731

28-
<!--Added for workaround https://github.com/dotnet/aspnetcore/issues/57147#issuecomment-2572752277-->
29-
<!--<PropertyGroup>
30-
<PrepareForBuildDependsOn>BundleMinify;$(PrepareForBuildDependsOn)</PrepareForBuildDependsOn>
31-
</PropertyGroup>-->
32-
3332
<ItemGroup>
3433
<SupportedPlatform Include="browser" />
3534
</ItemGroup>
3635

3736
<ItemGroup>
38-
<!--<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />-->
3937
<PackageReference Include="MudBlazor" Version="9.0.0-preview.1" />
38+
<PackageReference Include="MudBlazor.SassCompiler" Version="2.0.7">
39+
<PrivateAssets>all</PrivateAssets>
40+
</PackageReference>
4041
</ItemGroup>
4142

42-
<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0' ">
43-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="10.0.*" />
44-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.0.*" />
45-
</ItemGroup>
46-
47-
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
48-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="9.0.*" />
49-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.*" />
50-
</ItemGroup>
51-
52-
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
53-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0.*" />
54-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.*" />
55-
</ItemGroup>
56-
57-
<!--Uncomment it on development and debug to compile scss and generate min.css on rebuild
58-
This sections causes to fail auto deployment to CloudFlare-->
59-
<!--<Target Name="ToolRestore" BeforeTargets="PreBuildEvent">
60-
<Exec Command="dotnet tool restore" StandardOutputImportance="high" />
61-
</Target>-->
43+
<Target Name="CopyMudExtensionsCss" AfterTargets="Build">
44+
<Copy SourceFiles="wwwroot/css/MudExtensions.min.css" DestinationFiles="wwwroot/MudExtensions.min.css" SkipUnchangedFiles="true" Condition="Exists('wwwroot/css/MudExtensions.min.css')" />
45+
</Target>
6246

63-
<!--<Target Name="PreBuild" AfterTargets="ToolRestore">
64-
<Exec Command="dotnet tool run webcompiler -r Styles/MudExtensions.scss -c excubowebcompiler.json" StandardOutputImportance="high" />
65-
</Target>-->
47+
<Target Name="MinifyMudExtensionsJs" AfterTargets="Build" Condition="'$(TargetFramework)' == 'net10.0' AND Exists('TScripts/MudExtensions.js')">
48+
<Message Importance="high" Text="Minifying MudExtensions.js → MudExtensions.min.js" />
49+
<Exec WorkingDirectory="$(SolutionDir)" Command="dotnet run --project CodeBeam.MudBlazor.Extensions.JsMinifier\CodeBeam.MudBlazor.Extensions.JsMinifier.csproj --configuration $(Configuration)" />
50+
</Target>
6651

6752
<ItemGroup>
68-
<Content Remove="bundleconfig.json" />
69-
<Content Remove="compilerconfig.json" />
70-
<Content Remove="excubowebcompiler.json" />
53+
<Content Remove="sasscompiler.json" />
54+
<Content Remove="wwwroot/css/**" />
7155
</ItemGroup>
7256

73-
<ItemGroup>
74-
<_ContentIncludedByDefault Remove="bundleconfig.json" />
75-
</ItemGroup>
76-
7757
<ItemGroup>
7858
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
7959
<_Parameter1>CodeBeam.MudBlazor.Extensions.UnitTests</_Parameter1>
8060
</AssemblyAttribute>
8161
</ItemGroup>
8262

8363
<ItemGroup>
84-
<None Include="bundleconfig.json" />
8564
<None Include="Mud_Secondary.png">
8665
<Pack>True</Pack>
8766
<PackagePath>\</PackagePath>

CodeBeam.MudBlazor.Extensions/bundleconfig.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

CodeBeam.MudBlazor.Extensions/compilerconfig.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

CodeBeam.MudBlazor.Extensions/excubowebcompiler.json

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"private": true,
3+
"devDependencies": {
4+
"esbuild": "^0.21.5"
5+
}
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"Source": "Styles",
3+
"Output": "wwwroot",
4+
"Minify": true
5+
}

CodeBeam.MudBlazor.Extensions/wwwroot/MudExtensions.min.css

Lines changed: 2031 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)