# Ruitu-Training-Demo-Modules **Repository Path**: smartent/ruitu-training-demo-modules ## Basic Information - **Project Name**: Ruitu-Training-Demo-Modules - **Description**: OrchardCore相关的培训模块 - **Primary Language**: C# - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: http://demo.ruitujiaoyu.com - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-09-06 - **Last Updated**: 2025-07-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Lombiq 的开源 Orchard Core 扩展 [![构建和测试](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/actions/workflows/build-and-test.yml) [![Windows 构建和测试](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/actions/workflows/build-and-test-windows.yml/badge.svg)](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/actions/workflows/build-and-test-windows.yml) [![GitHub 提交活动](https://img.shields.io/github/commit-activity/m/Lombiq/Open-Source-Orchard-Core-Extensions)](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/commits/dev) [![GitHub 最后提交](https://img.shields.io/github/last-commit/Lombiq/Open-Source-Orchard-Core-Extensions)](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/commits/dev) [![GitHub 贡献者](https://img.shields.io/github/contributors/Lombiq/Open-Source-Orchard-Core-Extensions)](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/graphs/contributors) ## 关于 正在寻找一些有用的 Orchard Core 扩展?这里是 [Lombiq](https://lombiq.com) 所有开源 Orchard Core 扩展(模块和主题)的捆绑解决方案。克隆并试用它们! 这是一个 [Orchard Core](https://orchardcore.net/) Visual Studio 解决方案,包含 [Lombiq](https://lombiq.com) 的大部分开源 Orchard 模块和主题,以及相关实用工具和库。请注意,只包含使用 Orchard 最新发布版本的扩展(即依赖夜间构建的前沿扩展还不在这里)。 这也作为使用 NuGet 中的 Orchard 的 ASP.NET Core Web 应用程序的示例。 请注意,此解决方案还有一个 Orchard 1 对应版本,[Lombiq 的开源 Orchard 扩展](https://github.com/Lombiq/Open-Source-Orchard-Extensions)。 ## 先决条件和快速开始 - 您需要 Node.js 来构建多个项目中的客户端资源。查看 [Lombiq Node.js 扩展说明](https://github.com/Lombiq/NodeJs-Extensions/#prerequisites) 了解详细信息。 - 要开发和测试用 PowerShell 编写的脚本,请安装并使用 [PowerShell 7](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell) 而不是 Windows PowerShell(即最高版本 5.x)。静态代码分析仅通过 PowerShell 7 执行。 - 由于扩展作为 git 子模块包含在克隆此存储库时,请确保初始化子模块:使用 GUI 时这很可能会默认发生,使用命令行时使用 `--recurse-submodules` 开关。如果您在没有初始化子模块的情况下克隆,那么您可以稍后运行 `git submodule update --init --recursive` 来初始化它们。 ## 包含的项目 ### 库 - [`Lombiq.HelpfulLibraries`](https://github.com/Lombiq/Helpful-Libraries):在开发 Orchard Core 时可能派上用场的各种库,可在您自己的 Orchard 模块中使用。 - [`Lombiq.HelpfulLibraries.Cli`](https://github.com/Lombiq/Helpful-Libraries/tree/dev/Lombiq.HelpfulLibraries.Cli):命令行库。此项目帮助执行命令行调用。 - [`Lombiq.HelpfulLibraries.LinqToDb`](https://github.com/Lombiq/Helpful-Libraries/tree/dev/Lombiq.HelpfulLibraries.LinqToDb):借助此项目,您可以编写 LINQ 表达式并使用 [YesSql](https://github.com/sebastienros/yessql) `ISession` 扩展方法从数据库查询,而不是编写纯 SQL 查询。使用 [LINQ to DB 项目](https://linq2db.github.io/)。您可以在此处观看项目的演示视频:[这里](https://www.youtube.com/watch?v=ldJOdCSsWJo)。 - [`Lombiq.HelpfulLibraries.Refit`](https://github.com/Lombiq/Helpful-Libraries/tree/dev/Lombiq.HelpfulLibraries.Refit):为使用 [Refit](https://github.com/reactiveui/refit) 添加帮助程序。 - [`Lombiq.HelpfulLibraries.RestEase`](https://github.com/Lombiq/Helpful-Libraries/tree/dev/Lombiq.HelpfulLibraries.RestEase):使用 RestEase 为服务集合添加类型化 HTTP 客户端。 - [`Lombiq.HelpfulLibraries.SourceGenerators`](https://github.com/Lombiq/Helpful-Libraries/tree/dev/Lombiq.HelpfulLibraries.SourceGenerators):有用的源代码生成器集合。您可以在此处观看项目的演示视频:[这里](https://www.youtube.com/watch?v=MluV1ocZGiE)。 - [`Lombiq.OrchardCoreApiClient`](https://github.com/Lombiq/Orchard-Core-API-Client):用于与 [Orchard Core](https://www.orchardcore.net/) Web API 通信的客户端库,它包含租户和内容管理 API 的实现以及用于测试和演示的控制台应用程序。您可以在此处观看项目的演示视频:[这里](https://www.youtube.com/watch?v=VrYoN34uFQI)。 ### 模块 - [`Lombiq.AuditTrailExtensions`](https://github.com/Lombiq/Audit-Trail-Extensions):为 Orchard Core 中的 [Audit Trail 模块](https://docs.orchardcore.net/en/latest/docs/reference/modules/AuditTrail/) 提供额外功能的模块。 - [`Lombiq.ChartJs`](https://github.com/Lombiq/Orchard-Chart.js):[Chart.js](https://www.chartjs.org/) 库的 Orchard Core 包装器,用于将数据集显示为各种图表。 - [`Lombiq.ContentEditors`](https://github.com/Lombiq/Orchard-Content-Editors):借助此模块,您可以创建具有异步加载和保存功能的自定义多页编辑器。在此处观看 Orchard 社区会议的演示视频:[这里](https://www.youtube.com/watch?v=WJ4dmbG9oVs)。 - [`Lombiq.ContentEditors.Samples`](https://github.com/Lombiq/Orchard-Content-Editors/tree/dev/Lombiq.ContentEditors.Samples):使用 Lombiq Content Editors 的示例 Orchard Core 模块。 - [`Lombiq.DataTables`](https://github.com/Lombiq/Orchard-Data-Tables):[DataTables](https://datatables.net/) 库的 Orchard Core 包装器,用于显示来自自定义数据源的表格数据。 - [`Lombiq.DataTables.Samples`](https://github.com/Lombiq/Orchard-Data-Tables/tree/dev/Lombiq.DataTables.Samples):使用 Lombiq Data Tables for Orchard Core 的示例 Orchard Core 模块。 - [`Lombiq.EmailClient`](https://github.com/Lombiq/Orchard-Email-Client):一个 Orchard Core 模块,可以从 IMAP 服务器获取电子邮件,通过后台任务定期获取或按需获取。 - [`Lombiq.HelpfulExtensions`](https://github.com/Lombiq/Helpful-Extensions):包含一些方便扩展的 Orchard Core 模块(例如有用的内容类型和小部件)。此模块也可在 [DotNest,Orchard Core SaaS](https://dotnest.com/) 的所有站点上使用。 - [`Lombiq.HelpfulLibraries.Samples`](https://github.com/Lombiq/Helpful-Libraries/tree/dev/Lombiq.HelpfulLibraries.Samples):使用 Lombiq Helpful Libraries 的示例 Orchard Core 模块。 - [`Lombiq.Hosting.Azure.ApplicationInsights`](https://github.com/Lombiq/Orchard-Azure-Application-Insights):此 [Orchard Core](https://orchardcore.net/) 模块可以轻松集成 [Azure Application Insights](https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview) 遥测到 Orchard 中。只需安装模块,从配置源(如 _appsettings.json_ 文件)配置检测密钥,就像通常为 AI 所做的那样,收集的数据将开始出现在 Azure 门户中。如 [Orchard 社区会议](https://www.youtube.com/watch?v=NKKR4R3UPog) 中所见。请注意,此模块在 [`dev-orchard-1` 分支](https://github.com/Lombiq/Orchard-Azure-Application-Insights/tree/dev-orchard-1) 中有 Orchard 1 版本。请注意,该模块依赖于 [Helpful Libraries](https://github.com/Lombiq/Helpful-Libraries/)。 - [`Lombiq.Hosting.BuildVersionDisplay`](https://github.com/Lombiq/Hosting-Build-Version-Display):在 `Default` 租户的管理员中显示构建版本(即 .NET 程序集版本或其他)的模块。这对于一目了然地看到您当前部署到给定环境的应用程序版本很有用。 - [`Lombiq.Hosting.MediaTheme.Bridge`](https://github.com/Lombiq/Hosting-Media-Theme):借助此模块,您将能够从媒体库托管主题资源和模板。它可以与 [`Lombiq.Hosting.MediaTheme`](https://github.com/Lombiq/Hosting-Media-Theme) 一起使用。 - [`Lombiq.Hosting.Tenants.Admin.Login`](https://github.com/Lombiq/Hosting-Tenants/tree/dev/Lombiq.Hosting.Tenants.Admin.Login):借助此模块,您可以从 Default 租户的管理仪表板以管理员用户身份登录到任何其他租户。如果您管理大量客户租户并且不想为每个租户创建个人登录,这很有用。 - [`Lombiq.Hosting.Tenants.EnvironmentRobots`](https://github.com/Lombiq/Hosting-Tenants/tree/dev/Lombiq.Hosting.Tenants.EnvironmentRobots):借助此模块,您可以确保您的站点不会被搜索机器人索引。在此处查看此模块的演示视频:[这里](https://youtu.be/Rp3ao2ZbNRs)。 - [`Lombiq.Hosting.Tenants.FeaturesGuard`](https://github.com/Lombiq/Hosting-Tenants/tree/dev/Lombiq.Hosting.Tenants.FeaturesGuard):一个模块,可以条件性地启用和条件性地保持启用,或完全阻止启用租户上的可配置功能集。 - [`Lombiq.Hosting.Tenants.IdleTenantManagement`](https://github.com/Lombiq/Hosting-Tenants/tree/dev/Lombiq.Hosting.Tenants.IdleTenantManagement):借助此模块,您可以确保启用该功能的任何租户在预设时间过去后将关闭。这可用于释放资源。 - [`Lombiq.Hosting.Tenants.Maintenance`](https://github.com/Lombiq/Hosting-Tenants/tree/dev/Lombiq.Hosting.Tenants.Maintenance):借助此模块,您可以在租户上执行维护任务。 - [`Lombiq.Hosting.Tenants.Management`](https://github.com/Lombiq/Hosting-Tenants/tree/dev/Lombiq.Hosting.Tenants.Management):借助此模块,您可以设置租户创建限制并在租户编辑器中设置租户级别的 shell 设置。 - [`Lombiq.JsonEditor`](https://github.com/Lombiq/Orchard-JSON-Editor):用于显示像 [jsoneditoronline.org](https://jsoneditoronline.org/) 上那样的 JSON 编辑器的 Orchard Core 模块。在此处观看 Orchard 社区会议的演示视频:[这里](https://www.youtube.com/watch?app=desktop&v=nFhRjhXTKAY)。 - [`Lombiq.LoginAsAnybody`](https://github.com/Lombiq/Orchard-Login-as-Anybody):借助此模块,管理员可以在管理仪表板上以任何人的身份登录。在此处观看 Orchard 社区会议的演示视频:[这里](https://www.youtube.com/watch?v=UlZhblts1BI)。 - [`Lombiq.OSOCE.Samples`](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/tree/dev/src/Modules/Lombiq.OSOCE.Samples):这是一个占位符模块,将包含 UI 测试的示例代码和我们开源 Orchard Core 扩展的演示内容。 - [`Lombiq.Privacy`](https://github.com/Lombiq/Orchard-Privacy):包含与数据保护/隐私相关的功能以及欧盟相关法律的 Orchard 模块,即 [通用数据保护条例](https://eur-lex.europa.eu/legal-content/EN/TXT/?qid=1462439808430&uri=CELEX:32016R0679) (GDPR)。在此处查看此模块的演示视频:[这里](https://www.youtube.com/watch?v=GnyYL9Zdo8Q)。**重要!** 仅使用此模块不会使您的站点符合 GDPR。不要忘记创建一个隐私政策页面,您需要从各种同意请求功能链接到该页面。 - [`Lombiq.TrainingDemo`](https://github.com/Lombiq/Orchard-Training-Demo-Module):用于培训目的的演示 Orchard Core 模块,指导您成为 Orchard 开发人员。请注意,此模块在存储库的 [`dev-orchard-1` 分支](https://github.com/Lombiq/Orchard-Training-Demo-Module/tree/dev-orchard-1) 中也有 Orchard 1.x 版本。如果您更喜欢教程视频,请查看 [道场课程 3,完整的 Orchard Core 教程系列](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial)。 - [`Lombiq.UIKit`](https://github.com/Lombiq/Orchard-UIKit):此模块包含可重用的形状,如文本编辑器、自定义样式复选框、下拉编辑器,以及将来可能更复杂的编辑器。[这里](https://www.youtube.com/watch?v=PONfn2K8AHg) 您也可以看到它的演示。该模块的小部件功能提供基于 Lombiq UI Kit 可重用形状的小部件。 - [`Lombiq.VueJs`](https://github.com/Lombiq/Orchard-Vue.js):[Orchard Core](https://orchardproject.net/) 模块,包含 [Vue.js](https://vuejs.org/) 和常用的 Vue.js 组件,可在其他 Vue.js 应用程序中作为依赖项使用。提供可扩展性以创建 Vue.js 组件模板作为 Orchard Core 形状,使它们能够在主题或模块中被覆盖。 - [`Lombiq.Walkthroughs`](https://github.com/Lombiq/Orchard-Walkthroughs):您想通过一个动手教程了解最重要的 Orchard Core 功能,该教程通过交互式工具提示在 Orchard Core 中指导您吗?这个模块适合您!在此处查看它的演示视频:[这里](https://www.youtube.com/watch?v=mWfngBADvX0)。 ### 主题 - [`Lombiq.BaseTheme`](https://github.com/Lombiq/Orchard-Base-Theme):此主题包含具有标准化区域和内置前端菜单显示的自定义 Bootstrap 5 主题的基础设施。 - [`Lombiq.BaseTheme.Samples`](https://github.com/Lombiq/Orchard-Base-Theme/tree/dev/Lombiq.BaseTheme.Samples):演示 [`Lombiq.BaseTheme`](https://github.com/Lombiq/Orchard-Base-Theme) 功能的示例主题。 - [`Lombiq.Hosting.MediaTheme`](https://github.com/Lombiq/Hosting-Media-Theme):借助此主题及其依赖项 [`Lombiq.Hosting.MediaTheme.Bridge`](https://github.com/Lombiq/Hosting-Media-Theme),您将能够从媒体库托管主题资源和模板。 - [`Lombiq.Hosting.MediaTheme.Tests.Theme`](https://github.com/Lombiq/Hosting-Media-Theme):仅用于测试的主题,演示媒体主题的本地开发版本。 ### 实用工具 - [`Lombiq.Hosting.MediaTheme.Targets`](https://github.com/Lombiq/Hosting-Media-Theme):在构建期间提供自动媒体主题包创建。 - [`Lombiq.NodeJs.Extensions`](https://github.com/Lombiq/NodeJs-Extensions):使用 npm 脚本实现的可配置和 MSBuild 集成的前端资源管道,用于 SCSS、JS、MD 和外部库。在底层使用 NPM Targets。 - [`Lombiq.Npm.Targets`](https://github.com/Lombiq/NPM-Targets):在构建 .NET 项目之前提供自动 NPM 包安装和自定义 NPM 命令执行。这样就可以管理文件夹中的资源(例如 .scss 文件或图像),这些资源将在构建时自动编译到 _wwwroot_ 文件夹中,然后可以从版本控制系统中排除。 - [`Lombiq.SetupExtensions`](https://github.com/Lombiq/Setup-Extensions):用于设置 Orchard Core 应用程序的扩展。 ### 测试 - [`Lombiq.Tests`](https://github.com/Lombiq/Testing-Toolbox):通用和单元测试扩展和帮助程序,主要用于 ASP.NET Core 和 Orchard Core。另请参阅我们的 [UI 测试工具箱](https://github.com/Lombiq/UI-Testing-Toolbox)。 - [`Lombiq.Tests.UI`](https://github.com/Lombiq/UI-Testing-Toolbox/tree/dev/Lombiq.Tests.UI):主要用于 Orchard Core 应用程序的 Web UI 测试工具箱。使用 Selenium 对 Orchard 应用程序进行 UI 测试所需的一切都在这里。 - [`Lombiq.Tests.UI.AppExtensions`](https://github.com/Lombiq/UI-Testing-Toolbox/tree/dev/Lombiq.Tests.UI.AppExtensions):用于被测试 Web 应用程序的 UI 测试相关配置扩展。请注意,该模块依赖于 [Helpful Libraries](https://github.com/Lombiq/Helpful-Libraries)。 - [`Lombiq.Tests.UI.Samples`](https://github.com/Lombiq/UI-Testing-Toolbox/tree/dev/Lombiq.Tests.UI.Samples):示例 UI 测试项目。整个项目都有详细文档,教您如何使用 UI 测试工具箱编写 UI 测试。它指导您完成这个过程,就像 [Lombiq Training Demo for Orchard Core](https://github.com/Lombiq/Orchard-Training-Demo-Module) 教授 Orchard Core 和 Orchard 1 开发一样。 - [`Lombiq.Tests.UI.Shortcuts`](https://github.com/Lombiq/UI-Testing-Toolbox/tree/dev/Lombiq.Tests.UI.Shortcuts):为 UI 测试可能想要执行或检查的常见操作提供一些有用的快捷方式,例如打开或关闭功能,或登录用户。这样,UI 测试就不需要使用多步骤 UI 过程来执行这些操作(从而隐式地与这些功能耦合并测试它们)。请注意,该模块依赖于 [Helpful Libraries](https://github.com/Lombiq/Helpful-Libraries)。 ### 工具 - [`Lombiq.Analyzers`](https://github.com/Lombiq/.NET-Analyzers):[Lombiq](https://lombiq.com) 项目的 .NET 代码分析器和代码约定设置,主要用于 [Orchard Core](https://orchardcore.net/) 应用程序,但也适用于任何 .NET 应用程序。我们使用这些来在所有 .NET 项目中强制执行通用标准,包括例如我们所有的 [开源 Orchard Core 扩展](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions)。 - [`Lombiq.Analyzers.PowerShell`](https://github.com/Lombiq/PowerShell-Analyzers):通过 [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) 和 Lombiq 的推荐配置进行 PowerShell 静态代码分析。从 CLI、GitHub Actions 或集成到 MSBuild 构建中使用它。 - [`Lombiq.GitHub.Actions`](https://github.com/Lombiq/GitHub-Actions):Lombiq 项目之间共享的一些常见工作流和操作,例如构建和测试 Orchard Core 应用程序、将包发布到 NuGet、验证 Git 子模块拉取请求是否有相应的超项目拉取请求。这些可以从任何其他存储库的构建中调用。 ## 示例和配方 您可以在站点中激活各种示例内容: - [`Lombiq.JsonEditor`](https://github.com/Lombiq/Orchard-JSON-Editor):转到管理仪表板中的配方并选择"Lombiq Open Source Orchard Core Extensions - JSON Editor Sample"。 - 内容项目 > JSON 示例页面:显示正在运行的示例项目。编辑显示 JSON 编辑器,您可以在其中更改 JSON 值。视图演示了使用 JSON 内容的简单 JavaScript。 - 内容定义 > 内容类型 > JSON 示例页面 > JsonExampleField:您可以在此处编辑此字段的 JSON 编辑器的配置对象。查看模板属性! - [`Lombiq.UITestingToolbox`](https://github.com/Lombiq/UI-Testing-Toolbox):主要用于 Orchard Core 应用程序的 Web UI 测试工具箱。在此解决方案中查看 [其示例](https://github.com/Lombiq/UI-Testing-Toolbox/blob/dev/Lombiq.Tests.UI.Samples/Readme.md)。 - [`Lombiq.TrainingDemo`](https://github.com/Lombiq/Orchard-Training-Demo-Module/):首次运行站点时选择 _Training Demo_ 设置配方。 - [`Lombiq.DataTables`](https://github.com/Lombiq/Orchard-Data-Tables): - 转到管理仪表板中的功能并选择"Lombiq Data Tables - Samples"。 - 转到管理仪表板中的配方并选择"Lombiq Data Tables - Sample Content - Employee"。 - [`Lombiq.BaseTheme`](https://github.com/Lombiq/Orchard-Base-Theme): - "TEST: Basic Orchard Features" 设置配方会自动设置它。如果不使用它,请运行"Lombiq Orchard Core Base Theme - Layers and Zones"配方,然后在管理 → 设计 → 主题中启用主题。 - 在主题开发的情况下,您可以使用"Lombiq Orchard Core Base Theme - Styling Demo"主题来测试一些常见的 HTML 元素。 - [`Lombiq.ChartJs`](https://github.com/Lombiq/Orchard-Chart.js):转到管理仪表板中的配方并选择"Lombiq Chart.js - Sample Content - Income/Expense"。 - [`Lombiq.Privacy`](https://github.com/Lombiq/Orchard-Privacy):转到管理仪表板中的配方并选择"Lombiq Privacy - Sample Content - Privacy, Forms, Workflows"。 - [`Lombiq.Hosting.MediaTheme`](https://github.com/Lombiq/Hosting-Media-Theme):转到管理仪表板中的配方并选择"Lombiq Hosting - Media Theme - Samples"。 ## 贡献和支持 热烈欢迎错误报告、功能请求、评论、问题、代码贡献和情书。您可以通过 GitHub 问题和拉取请求将它们发送给我们。请在此过程中遵守我们的[开源指南](https://lombiq.com/open-source-guidelines)。 此项目由 [Lombiq Technologies](https://lombiq.com/) 开发。通过 Lombiq 提供商业级支持。 ### 添加新扩展或重要新功能 添加新扩展或现有扩展的重要新功能时,请执行以下操作: - 对于面向用户的功能,向其添加配方,用示例数据演示其用法。在这种情况下,请在上面的部分中引用它。 - 如果不需要数据或功能更像库,请添加示例项目(或除了配方之外)。将此项目放在子模块的根目录中,以便主项目和示例项目的文件夹并排。 - 根据需要添加低级单元/集成测试,使用 [Lombiq Testing Toolbox for Orchard Core](https://github.com/Lombiq/Testing-Toolbox/)。 - 如果示例项目包含 MVC 操作,请创建一个继承自 `MainMenuNavigationProviderBase` 的服务,并添加前端主菜单项。顶级菜单项应具有项目的缩短名称,子菜单项应具有各个操作。如果您有多个控制器,请使用分隔符和标签,如您可以在 [TrainingDemoNavigationProvider.cs](https://github.com/Lombiq/Orchard-Training-Demo-Module/blob/dev/Navigation/TrainingDemoNavigationProvider.cs) 中看到的那样。 - 如果功能面向用户,还请使用 [Lombiq UI Testing Toolbox for Orchard Core](https://github.com/Lombiq/UI-Testing-Toolbox/) 添加 UI 测试扩展方法,断言一些重要方面,并从 `Lombiq.OSOCE.Tests.UI` 中的新 UI 测试执行它们(有关灵感,请参阅那里的示例)。这些方法也旨在从其他项目的 UI 测试中执行,以测试它如何与其他功能集成。如果您向其添加了演示配方或示例项目,那么也在测试中使用它(请参阅 `ExecuteRecipeDirectlyAsync()`)。为此,您还需要在 _Lombiq.OSOCE.Tests.recipe_ 中启用该功能。 - 如果项目在 NuGet 上发布,也从 `Lombiq.OSOCE.NuGet` 解决方案中的应用程序引用它,并在 _Lombiq.OSOCE.NuGet.Tests.recipe_ 中启用其功能。如果它有 UI 测试方法,也从 `Lombiq.OSOCE.NuGet.Tests.UI` 运行它们。 - 如果在此项目中添加、删除或显著更新了扩展,则在此 Readme 的"包含的项目"部分下添加、删除或更新其描述。 ### 打开拉取请求 - 为每个子模块拉取请求在此存储库中打开拉取请求。这样,静态代码分析和复杂测试可以运行。如果您忘记这样做,子模块中的检查将失败。一旦您在此处创建了 PR,只需在您的子模块中点击"重新运行作业"。 - 如果您在拉取请求下看到构建错误,请查看其详细信息:它会将您发送到操作选项卡中的失败步骤。您也可以点击侧边栏上的"摘要"下载工件(日志、截图等),在 UI 测试失败的情况下,您会找到链接到哪个测试失败的注释。 - 为所有非琐碎更改(如拼写错误)打开拉取请求,以便我们可以很好地跟踪它们,包括为下一个版本生成发布说明时。 - 如果您引入 .NET 破坏性更改,Validate NuGet Publish 工作流将由于 [基线包验证](https://learn.microsoft.com/en-us/dotnet/fundamentals/apicompat/package-validation/baseline-version-validator) 而失败。如果可能,最好调整更改以不破坏;如果必须是破坏性更改,那么您需要创建 _CompatibilitySuppressions.xml_ 文件将其标记为故意的,您可以使用以下命令执行此操作: ```powershell dotnet pack /p:EnablePackageValidation=true /p:PackageValidationBaselineVersion=<当前版本,如 1.2.3> /p:Version=<下一个补丁版本,如 1.2.4> /p:NuGetBuild=true /p:GenerateCompatibilitySuppressionFile=true ``` ### .NET 和 Orchard Core 版本支持政策 我们试图平衡允许每个人使用他们最舒适的最新 .NET 和 Orchard Core 版本,同时不强迫每个人停留在前沿。为了实现这一点,我们执行以下操作: - 我们所有的项目都针对 .NET 的最新长期支持 (LTS) 版本(偶数版本,如 .NET 8)。虽然这意味着如果非 LTS 版本是当前版本(奇数版本,如 .NET 9),这些项目无法使用最新的 .NET API,但它也允许消费者项目在下一个 LTS 版本发布之前(每两年)停留在 LTS 版本上。同时,消费者项目如果愿意,总是可以使用更近期的 .NET 版本。 - Lombiq GitHub Actions 的 .NET 构建工作流 [始终默认为 .NET SDK 最新 LTS 版本下的特定版本](https://github.com/Lombiq/GitHub-Actions?tab=readme-ov-file#default-net-version),原因相同。但是,如果正在构建的应用程序需要不同的版本,可以配置 SDK 版本。 - 我们所有共享的 Orchard Core 使用项目(即也发布到 NuGet 的项目)都针对 Orchard Core 的最新 `.0.0` 主要版本(除非有任何不兼容性要求我们偏离这一点),例如 `2.0.0`。这允许消费者项目在相同主要版本下的任何更高版本的 Orchard Core(如 `2.0.1` 或 `2.1.5`)中使用它们,我们不会强制更新超出该范围。"根" Web 项目,如此解决方案中的 `Lombiq.OSOCE.Web`,始终针对最新的 Orchard Core 版本(如 `2.1.7`),以使应用程序受益于最新改进。 ### Lombiq 项目之间的依赖关系 当让 Lombiq 项目依赖于此解决方案中的另一个项目时,除了为 Orchard Core 扩展添加项目引用和扩展清单中的依赖项外,还添加条件包引用。这样,当发布到 NuGet 时,依赖项仍然有效。请参阅 `Lombiq.HelpfulExtensions` 的项目文件作为示例。 如果两个项目都在 NuGet 上发布(如 [UI Testing Toolbox](https://github.com/Lombiq/UI-Testing-Toolbox) 的项目之间),您可以在同一存储库中的项目之间只有项目引用,因为这些将自动转换为包依赖项。 您可以使用根 _Directory.Build.props_ 文件中的 `NuGetBuild` 开关使所有项目使用 NuGet 引用,这样您就可以为整个解决方案更新 Lombiq 包。