From 799507277f78dcdc999182b5a6b7b6d74c56b12c Mon Sep 17 00:00:00 2001
From: maliming
Date: Thu, 26 Dec 2024 20:16:38 +0800
Subject: [PATCH 1/2] Add more infomation to `CheckLibs` page.
---
.../Mvc/Libs/AbpMvcLibsErrorPage.Designer.cs | 107 +++++++++++++++---
.../Mvc/Libs/AbpMvcLibsErrorPage.cshtml | 105 ++++++++++++++---
.../AspNetCore/Mvc/Libs/AbpMvcLibsService.cs | 5 +-
3 files changed, 189 insertions(+), 28 deletions(-)
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.Designer.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.Designer.cs
index 9d30ea018c..5b861889bb 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.Designer.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.Designer.cs
@@ -27,20 +27,101 @@ using Volo.Abp.AspNetCore.RazorViews;
#line hidden
#nullable disable
WriteLiteral(@"
-
-
-
- Error - The Libs folder is missing!
-
-
- ⚠️ The Libs folder under the wwwroot/libs directory is empty!
-
+
+
+
+
+
+ Error - The Libs Folder is Missing!
+
+
+
+
+ ⚠️ The Libs folder is missing!
+
+
+ The Libs Folder is Missing!
The Libs folder contains mandatory NPM Packages for running the project.
-
- Make sure you run the abp install-libs CLI tool command.
-
- For more information, check out the ABP CLI documentation
-
+ <");
+ WriteLiteral(@"p>Make sure you run the abp install-libs CLI tool command.
+
+ If your application does not use any client-side libraries, you can disable this check by setting
+ AbpMvcLibsOptions.CheckLibs to false, as shown below:
+
+
+Configure<AbpMvcLibsOptions>(options =>
+{
+ options.CheckLibs = false;
+});
+ For more information, check out the ABP CLI documentation.
+
+
+
");
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.cshtml
index 5a5d6c8d19..1e9b269df4 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.cshtml
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.cshtml
@@ -5,18 +5,97 @@
Response.StatusCode = 500;
}
-
-
-
- Error - The Libs folder is missing!
-
-
- ⚠️ The Libs folder under the wwwroot/libs directory is empty!
-
+
+
+
+
+
+ Error - The Libs Folder is Missing!
+
+
+
+
+ ⚠️ The Libs folder is missing!
+
+
+ The Libs Folder is Missing!
The Libs folder contains mandatory NPM Packages for running the project.
-
- Make sure you run the abp install-libs CLI tool command.
-
- For more information, check out the ABP CLI documentation
-
+ Make sure you run the abp install-libs CLI tool command.
+
+ If your application does not use any client-side libraries, you can disable this check by setting
+ AbpMvcLibsOptions.CheckLibs to false, as shown below:
+
+
+Configure<AbpMvcLibsOptions>(options =>
+{
+ options.CheckLibs = false;
+});
+ For more information, check out the ABP CLI documentation.
+
+
+
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsService.cs
index 410260674b..dc6faf723c 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsService.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsService.cs
@@ -64,7 +64,7 @@ public class AbpMvcLibsService : IAbpMvcLibsService, ITransientDependency
var webHostEnvironment = httpContext.RequestServices.GetRequiredService();
if (webHostEnvironment.WebRootPath.IsNullOrWhiteSpace())
{
- logger.LogWarning("The 'WebRootPath' is not set! The 'CheckLibs' feature is disabled!");
+ logger.LogInformation("The 'WebRootPath' is not set, The 'CheckLibs' feature not needed.");
return Task.FromResult(true);
}
@@ -72,7 +72,8 @@ public class AbpMvcLibsService : IAbpMvcLibsService, ITransientDependency
var libsFolder = fileProvider.GetDirectoryContents("/libs");
if (!libsFolder.Exists || !libsFolder.Any())
{
- logger.LogError("The 'wwwroot/libs' folder does not exist or empty!");
+ logger.LogError("The 'wwwroot/libs' folder does not exist or empty! " +
+ "If your application does not use any client-side libraries, you can disable this check by setting 'AbpMvcLibsOptions.CheckLibs' to 'false'");
return Task.FromResult(false);
}
}
From ec04439f60ad944dad54795ea857d993489e3bb3 Mon Sep 17 00:00:00 2001
From: maliming
Date: Thu, 26 Dec 2024 20:23:20 +0800
Subject: [PATCH 2/2] Update texts.
---
.../Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.Designer.cs | 5 ++---
.../Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.cshtml | 1 -
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.Designer.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.Designer.cs
index 5b861889bb..4fe8e51000 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.Designer.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.Designer.cs
@@ -103,10 +103,9 @@ using Volo.Abp.AspNetCore.RazorViews;
⚠️ The Libs folder is missing!
- The Libs Folder is Missing!
The Libs folder contains mandatory NPM Packages for running the project.
- <");
- WriteLiteral(@"p>Make sure you run the abp install-libs CLI tool command.
+ Make sure you run the abp install-lib");
+ WriteLiteral(@"s CLI tool command.
If your application does not use any client-side libraries, you can disable this check by setting
AbpMvcLibsOptions.CheckLibs to false, as shown below:
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.cshtml
index 1e9b269df4..7b15ce94bf 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.cshtml
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsErrorPage.cshtml
@@ -80,7 +80,6 @@
⚠️ The Libs folder is missing!
- The Libs Folder is Missing!
The Libs folder contains mandatory NPM Packages for running the project.
Make sure you run the abp install-libs CLI tool command.