Upgraded to MudBlazor 9 (#1137)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-10-31 10:48:20 +01:00
1 parent e0337a99bc
commit aeba1fbccc
625 files changed
+408 -882

No files matched your search

+28 -17
View File
@@ -8,6 +8,12 @@ namespace Build.Commands;
public sealed class UpdateWebAssetsCommand
{
/// <summary>
/// The pre-compressed copies and the source maps of the web assets. The app serves its web assets
/// from the files embedded into it and uses neither, so they would only enlarge it.
/// </summary>
private static readonly HashSet<string> SKIPPED_EXTENSIONS = new(StringComparer.OrdinalIgnoreCase) { ".br", ".gz", ".map" };
[Command("update-web", Description = "Update web assets")]
public void UpdateWebAssets()
{
@@ -29,26 +35,31 @@ public sealed class UpdateWebAssetsCommand
return;
}
//
// The destination also holds files of our own, such as the code editor. Hence, we replace
// only the folder of each package, so that files a package no longer ships disappear:
//
var destinationPath = Path.Join(cwd, "wwwroot", "system");
if(Directory.Exists(destinationPath))
Directory.Delete(destinationPath, true);
Directory.CreateDirectory(destinationPath);
var sourcePaths = Directory.EnumerateFiles(contentPath, "*", SearchOption.AllDirectories);
var counter = 0;
foreach(var sourcePath in sourcePaths)
foreach (var packagePath in Directory.EnumerateDirectories(contentPath))
{
counter++;
var relativePath = sourcePath
.Replace(contentPath, "")
.TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
var targetPath = Path.Join(cwd, "wwwroot", "system", relativePath);
var targetDirectory = Path.GetDirectoryName(targetPath);
if (targetDirectory != null)
Directory.CreateDirectory(targetDirectory);
File.Copy(sourcePath, targetPath, true);
var packageDestinationPath = Path.Join(destinationPath, Path.GetFileName(packagePath));
if (Directory.Exists(packageDestinationPath))
Directory.Delete(packageDestinationPath, true);
foreach (var sourcePath in Directory.EnumerateFiles(packagePath, "*", SearchOption.AllDirectories))
{
if (SKIPPED_EXTENSIONS.Contains(Path.GetExtension(sourcePath)))
continue;
counter++;
var targetPath = Path.Join(packageDestinationPath, Path.GetRelativePath(packagePath, sourcePath));
var targetDirectory = Path.GetDirectoryName(targetPath);
if (targetDirectory != null)
Directory.CreateDirectory(targetDirectory);
File.Copy(sourcePath, targetPath, true);
}
}
Console.WriteLine($" {counter:###,###} web assets updated successfully.");