Compare commits

..

No commits in common. "2b6c7adff87ed071807f9fb02d00a78da13f7920" and "7557cb0538638ecad112c04bcdb96027cf927c57" have entirely different histories.

24 changed files with 167 additions and 254 deletions

View File

@ -64,7 +64,7 @@ module.exports = {
maxSubjectLength: Infinity, maxSubjectLength: Infinity,
minSubjectLength: 0, minSubjectLength: 0,
scopeOverrides: undefined, scopeOverrides: undefined,
defaultBody: '[skip ci]', defaultBody: '',
defaultIssues: '', defaultIssues: '',
defaultScope: '', defaultScope: '',
defaultSubject: '' defaultSubject: ''

View File

@ -1,59 +1,56 @@
# 此文件为 EditorConfig 配置文件,用于设置跨编辑器的代码格式化规则。
# root = true 表示此文件是根配置文件。
root = true root = true
[*] [*]
charset = utf-8 # 文件字符集为 UTF-8 charset = utf-8
end_of_line = lf # 行结束符为 LF end_of_line = lf
ij_xml_attribute_wrap = off # IntelliJ IDEA 中 XML 属性不换行 ij_xml_attribute_wrap = off
ij_xml_text_wrap = off # IntelliJ IDEA 中 XML 文本不换行 ij_xml_text_wrap = off
indent_size = 4 # 缩进大小为 4 个空格 indent_size = 4
indent_style = space # 使用空格进行缩进 indent_style = space
insert_final_newline = false # 不在文件末尾插入空行 insert_final_newline = false
max_line_length = 150 # 行长度限制为 150 个字符 trim_trailing_whitespace = true
trim_trailing_whitespace = true # 删除行尾的空格
[{*.json,*.yml}] [{*.json,*.yml}]
indent_size = 2 # 对于 JSON 和 YAML 文件,缩进大小为 2 个空格 indent_size = 2
[*.cs] [*.cs]
dotnet_analyzer_diagnostic.severity = warning # 设置 C# 文件中所有 dotnet_analyzer_diagnostic 的严重性级别为 warning dotnet_analyzer_diagnostic.severity = warning
# ReSharper properties # ReSharper properties
resharper_align_linq_query = true # 启用对LINQ查询的对齐 resharper_align_linq_query = true
resharper_align_multiline_argument = true # 启用多行参数的对齐 resharper_align_multiline_argument = true
resharper_align_multiline_array_and_object_initializer = true # 启用多行数组和对象初始化器的对齐 resharper_align_multiline_array_and_object_initializer = true
resharper_align_multiline_binary_patterns = true # 启用多行二元模式的对齐 resharper_align_multiline_binary_patterns = true
resharper_align_multiline_calls_chain = true # 启用多行调用链的对齐 resharper_align_multiline_calls_chain = true
resharper_align_multiline_extends_list = true # 启用多行扩展列表的对齐 resharper_align_multiline_extends_list = true
resharper_align_multiline_parameter = true # 启用多行参数的对齐 resharper_align_multiline_parameter = true
resharper_align_multiline_property_pattern = true # 启用多行属性模式的对齐 resharper_align_multiline_property_pattern = true
resharper_align_multiline_switch_expression = true # 启用多行切换表达式的对齐 resharper_align_multiline_switch_expression = true
resharper_align_multiple_declaration = true # 启用多个声明的对齐 resharper_align_multiple_declaration = true
resharper_align_multline_type_parameter_constrains = true # 启用多行类型参数约束的对齐 resharper_align_multline_type_parameter_constrains = true
resharper_align_multline_type_parameter_list = true # 启用多行类型参数列表的对齐 resharper_align_multline_type_parameter_list = true
resharper_align_tuple_components = true # 启用元组组件的对齐 resharper_align_tuple_components = true
resharper_allow_comment_after_lbrace = true # 允许在大括号前添加注释 resharper_allow_comment_after_lbrace = true
resharper_blank_lines_before_single_line_comment = 1 # 在单行注释前添加空行 resharper_blank_lines_before_single_line_comment = 1
resharper_csharp_empty_block_style = together_same_line # 设置空块的样式为“在一起,在同一行” resharper_csharp_empty_block_style = together_same_line
resharper_csharp_outdent_commas = true # 是否将逗号后的代码退缩 resharper_csharp_outdent_commas = true
resharper_csharp_place_type_constraints_on_same_line = false # 在类型约束上是否保持在同一行 resharper_csharp_place_type_constraints_on_same_line = false
resharper_csharp_stick_comment = false # 是否将注释粘贴在代码行的末尾 resharper_csharp_stick_comment = false
resharper_csharp_wrap_before_comma = true # 在逗号前是否添加换行 resharper_csharp_wrap_before_comma = true
resharper_indent_nested_for_stmt = true # 是否对嵌套的for语句进行缩进 resharper_indent_nested_for_stmt = true
resharper_indent_nested_foreach_stmt = true # 是否对嵌套的foreach语句进行缩进 resharper_indent_nested_foreach_stmt = true
resharper_indent_nested_while_stmt = true # 是否对嵌套的while语句进行缩进 resharper_indent_nested_while_stmt = true
resharper_indent_preprocessor_if = usual_indent # 设置预处理器指令`if`的缩进方式 resharper_indent_preprocessor_if = usual_indent
resharper_indent_preprocessor_other = usual_indent # 设置其他预处理器指令的缩进方式 resharper_indent_preprocessor_other = usual_indent
resharper_int_align = true # 启用整数对齐 resharper_int_align = true
resharper_keep_existing_arrangement = false # 在重新排列时是否保留现有的布局 resharper_keep_existing_arrangement = false
resharper_place_linq_into_on_new_line = false # 是否将LINQ表达式放在新行 resharper_place_linq_into_on_new_line = false
resharper_place_simple_embedded_statement_on_same_line = false # 是否将简单的嵌入式语句放在同一行 resharper_place_simple_embedded_statement_on_same_line = false
resharper_place_simple_switch_expression_on_single_line = true # 是否将简单的切换表达式放在单行 resharper_place_simple_switch_expression_on_single_line = true
resharper_wrap_before_eq = true # 在等号前是否添加换行 resharper_wrap_before_eq = true
resharper_wrap_chained_method_calls = chop_if_long # 是否拆分链式方法调用 resharper_wrap_chained_method_calls = chop_if_long
resharper_wrap_switch_expression = chop_if_long # 是否拆分切换表达式 resharper_wrap_switch_expression = chop_if_long
# Microsoft .NET properties # Microsoft .NET properties
csharp_indent_braces = false # 设置为false表示花括号不跟随代码行缩进 csharp_indent_braces = false
csharp_new_line_before_open_brace = local_functions, methods, types # 这里设置为local_functions, methods, types表示在局部函数、方法和类型定义的开放花括号前应换行 csharp_new_line_before_open_brace = local_functions, methods, types

6
.gitignore vendored
View File

@ -55,7 +55,7 @@ nunit-*.xml
dlldata.c dlldata.c
# Benchmark Results # Benchmark Results
BenchmarkDotNet.Artifacts/ BenchmarkNSExtNet.Artifacts/
# .NET Core # .NET Core
project.lock.json project.lock.json
@ -130,12 +130,12 @@ $tf/
# ReSharper is a .NET coding add-in # ReSharper is a .NET coding add-in
_ReSharper*/ _ReSharper*/
*.[Rr]e[Ss]harper *.[Rr]e[Ss]harper
*.DotSettings.user *.NSExtSettings.user
# TeamCity is a build add-in # TeamCity is a build add-in
_TeamCity* _TeamCity*
# DotCover is a Code Coverage Tool # NSExtCover is a Code Coverage Tool
*.dotCover *.dotCover
# AxoCover is a Code Coverage Tool # AxoCover is a Code Coverage Tool

View File

@ -2,8 +2,6 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [2.2.1](https://github.com/nsnail/NSExt/compare/v2.2.0...v2.2.1) (2024-11-25)
## [2.2.0](https://github.com/nsnail/NSExt/compare/v2.1.0...v2.2.0) (2024-07-02) ## [2.2.0](https://github.com/nsnail/NSExt/compare/v2.1.0...v2.2.0) (2024-07-02)

View File

@ -22,11 +22,11 @@
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/nsnail/NSExt.git</RepositoryUrl> <RepositoryUrl>https://github.com/nsnail/NSExt.git</RepositoryUrl>
<RootNamespace>NSExt</RootNamespace> <RootNamespace>NSExt</RootNamespace>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks> <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Title>$(AssemblyName)</Title> <Title>$(AssemblyName)</Title>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MinVer" Version="6.0.0"> <PackageReference Include="MinVer" Version="5.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

139
NSExt.sln
View File

@ -8,88 +8,87 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "backend", "backend", "{4DAF9366-855F-46BB-AE4C-660C92FA0697}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "backend", "backend", "{4DAF9366-855F-46BB-AE4C-660C92FA0697}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{5198A03D-0CAC-4828-A807-34A693F73859}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{5198A03D-0CAC-4828-A807-34A693F73859}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.commitlintrc.js = .commitlintrc.js .commitlintrc.js = .commitlintrc.js
.editorconfig = .editorconfig .editorconfig = .editorconfig
.gitattributes = .gitattributes .gitattributes = .gitattributes
.gitignore = .gitignore .gitignore = .gitignore
CHANGELOG.md = CHANGELOG.md CHANGELOG.md = CHANGELOG.md
Directory.Build.props = Directory.Build.props Directory.Build.props = Directory.Build.props
dotnet-tools.json = dotnet-tools.json dotnet-tools.json = dotnet-tools.json
global.json = global.json global.json = global.json
key.snk = key.snk key.snk = key.snk
LICENSE = LICENSE LICENSE = LICENSE
NSExt.sln.DotSettings = NSExt.sln.DotSettings NSExt.sln.DotSettings = NSExt.sln.DotSettings
nuget.config = nuget.config nuget.config = nuget.config
package.json = package.json package.json = package.json
README.md = README.md README.md = README.md
README.zh-CN.md = README.zh-CN.md README.zh-CN.md = README.zh-CN.md
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B25C9-0901-4923-913F-00F9A6B352A5}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B25C9-0901-4923-913F-00F9A6B352A5}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
1.git.pull.request.ps1 = scripts/1.git.pull.request.ps1 1.git.pull.request.ps1 = scripts/1.git.pull.request.ps1
2.git.release.ps1 = scripts/2.git.release.ps1 2.git.release.ps1 = scripts/2.git.release.ps1
3.git.recreate.branch.ps1 = scripts/3.git.recreate.branch.ps1 3.git.recreate.branch.ps1 = scripts/3.git.recreate.branch.ps1
4.git.del.obsolete.tags.ps1 = scripts/4.git.del.obsolete.tags.ps1 clean.ln.csx = scripts/clean.ln.csx
clean.ln.csx = scripts/clean.ln.csx code.clean.csx = scripts/code.clean.csx
code.clean.csx = scripts/code.clean.csx code.clean.ps1 = scripts/code.clean.ps1
code.clean.ps1 = scripts/code.clean.ps1 gen.cs.tt = scripts/gen.cs.tt
find.unused.ln.csx = scripts/find.unused.ln.csx gen.ln.cmd = scripts/gen.ln.cmd
gen.cs.tt = scripts/gen.cs.tt gen.resx.tt = scripts/gen.resx.tt
gen.ln.cmd = scripts/gen.ln.cmd image.optimize.csx = scripts/image.optimize.csx
gen.resx.tt = scripts/gen.resx.tt install.as.tpl.ps1 = scripts/install.as.tpl.ps1
image.optimize.csx = scripts/image.optimize.csx rename.csx = scripts/rename.csx
install.as.tpl.ps1 = scripts/install.as.tpl.ps1 resharper.full.ps1 = scripts/resharper.full.ps1
rename.csx = scripts/rename.csx switcher.nsext.json = scripts/switcher.nsext.json
resharper.full.ps1 = scripts/resharper.full.ps1 switcher.ps1 = scripts/switcher.ps1
switch.nuget.or.project.csx = scripts/switch.nuget.or.project.csx sync.sln.files.csx = scripts/sync.sln.files.csx
sync.sln.files.csx = scripts/sync.sln.files.csx EndProjectSection
EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1129FE25-466B-4F4F-85FC-3752664245E1}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1129FE25-466B-4F4F-85FC-3752664245E1}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3C6F049E-3EE8-4D66-9AFF-E8A369032487}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3C6F049E-3EE8-4D66-9AFF-E8A369032487}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
ci.yml = .github/workflows/ci.yml ci.yml = .github/workflows/ci.yml
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8E4C93BA-9493-4892-80C4-5E174C504829}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8E4C93BA-9493-4892-80C4-5E174C504829}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
code.quality.props = build/code.quality.props code.quality.props = build/code.quality.props
copy.pkg.xml.comment.files.targets = build/copy.pkg.xml.comment.files.targets copy.pkg.xml.comment.files.targets = build/copy.pkg.xml.comment.files.targets
minver.targets = build/minver.targets minver.targets = build/minver.targets
nuget.package.props = build/nuget.package.props nuget.package.props = build/nuget.package.props
prebuild.targets = build/prebuild.targets prebuild.targets = build/prebuild.targets
stylecop.analyzers.ruleset = build/stylecop.analyzers.ruleset stylecop.analyzers.ruleset = build/stylecop.analyzers.ruleset
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NSExt", "src\backend\NSExt\NSExt.csproj", "{1E62C322-EE42-4699-A6F1-791C53EFA62D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NSExt", "src\backend\NSExt\NSExt.csproj", "{1E62C322-EE42-4699-A6F1-791C53EFA62D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NSExt.Tests", "src\backend\NSExt.Tests\NSExt.Tests.csproj", "{00604162-C444-478B-B773-3AB23C856CA7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NSExt.Tests", "src\backend\NSExt.Tests\NSExt.Tests.csproj", "{00604162-C444-478B-B773-3AB23C856CA7}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1E62C322-EE42-4699-A6F1-791C53EFA62D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1E62C322-EE42-4699-A6F1-791C53EFA62D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E62C322-EE42-4699-A6F1-791C53EFA62D}.Debug|Any CPU.Build.0 = Debug|Any CPU {1E62C322-EE42-4699-A6F1-791C53EFA62D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E62C322-EE42-4699-A6F1-791C53EFA62D}.Release|Any CPU.ActiveCfg = Release|Any CPU {1E62C322-EE42-4699-A6F1-791C53EFA62D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E62C322-EE42-4699-A6F1-791C53EFA62D}.Release|Any CPU.Build.0 = Release|Any CPU {1E62C322-EE42-4699-A6F1-791C53EFA62D}.Release|Any CPU.Build.0 = Release|Any CPU
{00604162-C444-478B-B773-3AB23C856CA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {00604162-C444-478B-B773-3AB23C856CA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00604162-C444-478B-B773-3AB23C856CA7}.Debug|Any CPU.Build.0 = Debug|Any CPU {00604162-C444-478B-B773-3AB23C856CA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00604162-C444-478B-B773-3AB23C856CA7}.Release|Any CPU.ActiveCfg = Release|Any CPU {00604162-C444-478B-B773-3AB23C856CA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00604162-C444-478B-B773-3AB23C856CA7}.Release|Any CPU.Build.0 = Release|Any CPU {00604162-C444-478B-B773-3AB23C856CA7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{4DAF9366-855F-46BB-AE4C-660C92FA0697} = {C84EB5A0-37AD-4B17-A51E-E36888C4441E} {4DAF9366-855F-46BB-AE4C-660C92FA0697} = {C84EB5A0-37AD-4B17-A51E-E36888C4441E}
{3C6F049E-3EE8-4D66-9AFF-E8A369032487} = {1129FE25-466B-4F4F-85FC-3752664245E1} {3C6F049E-3EE8-4D66-9AFF-E8A369032487} = {1129FE25-466B-4F4F-85FC-3752664245E1}
{1E62C322-EE42-4699-A6F1-791C53EFA62D} = {4DAF9366-855F-46BB-AE4C-660C92FA0697} {1E62C322-EE42-4699-A6F1-791C53EFA62D} = {4DAF9366-855F-46BB-AE4C-660C92FA0697}
{00604162-C444-478B-B773-3AB23C856CA7} = {4DAF9366-855F-46BB-AE4C-660C92FA0697} {00604162-C444-478B-B773-3AB23C856CA7} = {4DAF9366-855F-46BB-AE4C-660C92FA0697}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -78,7 +78,6 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002EMemberReordering_002EMigrations_002ECSharpFileLayoutPatternRemoveIsAttributeUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>

View File

@ -15,15 +15,15 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19"> <PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="4.12.9"> <PackageReference Include="Roslynator.Analyzers" Version="4.12.4">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167"> <PackageReference Include="SonarAnalyzer.CSharp" Version="9.28.0.94264">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View File

@ -3,7 +3,7 @@
"isRoot": true, "isRoot": true,
"tools": { "tools": {
"dotnet-t4": { "dotnet-t4": {
"version": "3.0.0", "version": "2.3.1",
"commands": [ "commands": [
"t4" "t4"
] ]

View File

@ -2,6 +2,7 @@
<configuration> <configuration>
<packageSources> <packageSources>
<add key="nuget.cdn.azure.cn" value="https://nuget.cdn.azure.cn/v3/index.json" /> <clear/>
<add key="nuget.cdn.azure.cn" value="https://nuget.cdn.azure.cn/v3/index.json"/>
</packageSources> </packageSources>
</configuration> </configuration>

View File

@ -1,9 +1,9 @@
{ {
"version": "2.2.1", "version": "2.2.0",
"devDependencies": { "devDependencies": {
"cz-git": "^1.11.0", "cz-git": "^1.7.1",
"commitizen": "^4.3.1", "commitizen": "^4.3.0",
"prettier": "^3.3.3", "prettier": "^3.1.0",
"standard-version": "^9.5.0" "standard-version": "^9.5.0"
}, },
"config": { "config": {
@ -11,4 +11,4 @@
"path": "node_modules/cz-git" "path": "node_modules/cz-git"
} }
} }
} }

View File

@ -1,10 +1,6 @@
$branch = $( git branch --show-current ) $branch = $( git branch --show-current )
git add ../ git add ../
$skipFormat = Read-Host "输入 n 跳过代码整理" ./code.clean.ps1
if ($skipFormat -ne "n")
{
./code.clean.ps1
}
git add ../ git add ../
../node_modules/.bin/git-cz.ps1 ../node_modules/.bin/git-cz.ps1
git pull git pull

View File

@ -1,7 +1,7 @@
cd .. cd ..
$types = @{ $types = @{
'1' = @('major', '主版本') '1' = @('major', '主版本')
'2' = @('minor', '版本') '2' = @('minor', '版本')
'3' = @('patch', '修订版本') '3' = @('patch', '修订版本')
} }
$prefix = '' $prefix = ''
@ -10,20 +10,19 @@ while ($null -eq $types[$prefix])
$prefix = Read-Host "请选择版本类型`n" $( & { param($i) $i | ForEach-Object { "$_ : $( $types[$_][0] )$( $types[$_][1] )`n" } } $types.Keys | Sort-Object ) $prefix = Read-Host "请选择版本类型`n" $( & { param($i) $i | ForEach-Object { "$_ : $( $types[$_][0] )$( $types[$_][1] )`n" } } $types.Keys | Sort-Object )
} }
git checkout main git checkout main
git pull
git branch -D release git branch -D release
git checkout -b release git checkout -b release
./node_modules/.bin/standard-version -r $types[$prefix][0] ./node_modules/.bin/standard-version -r $types[$prefix][0]
cd ./scripts
./code.clean.ps1
git commit --amend --no-edit -a git commit --amend --no-edit -a
$tag = $( git describe --tags $( git rev-list --tags --max-count = 1 ) ) $tag = $(git describe --tags $(git rev-list --tags --max-count=1))
git tag -d $tag git tag -d $tag
git tag $tag git tag $tag
git push --tags origin release git push --tags origin release
Start-Process -FilePath "https://github.com/nsnail/NSExt/compare/main...release" Start-Process -FilePath "https://github.com/nsnail/NSExt/compare/main...release"
Write-Host "按『Enter』回到tk分支『Ctrl+C』退出" Write-Host "按『Enter』回到分支『Ctrl+C』退出"
Pause Pause
git checkout main git checkout main
git pull git pull
git branch -D release git branch -D release
git branch -D tk
git checkout -b tk

View File

@ -1,2 +0,0 @@
git push origin :refs/tags/$(git tag -l "*-*")
git tag -d $(git tag -l "*-*")

View File

@ -1,15 +0,0 @@
using System.Text.RegularExpressions;
Console.WriteLine(string.Join(Environment.NewLine
, Regex
.Matches(File.ReadAllText(@"../assets/res/Ln.resx")
, "data name=\"(.*?)\"")
.Select(x => x.Groups[1].Value)
.Where(x => !Directory
.GetFiles(@"../src/backend/", "*.cs"
, new EnumerationOptions {
RecurseSubdirectories = true
})
.Select(File.ReadAllText)
.Any(y => y.Contains(x)))));
Console.ReadKey();

View File

@ -1,7 +1,6 @@
<#@ template language="C#" #> <#@ template language="C#" #>
<#@ assembly name="System.Xml" #> <#@ assembly name="System.Xml" #>
<#@ output encoding="utf-8" extension="Designer.cs" #> <#@ output encoding="utf-8" extension="Designer.cs" #>
<#@ import namespace="System.Xml" #>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
@ -28,8 +27,8 @@ namespace NSExt.Languages;
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[DebuggerNonUserCode] [System.Diagnostics.DebuggerNonUserCode]
[CompilerGenerated] [System.Runtime.CompilerServices.CompilerGenerated]
public sealed class Ln public sealed class Ln
{ {
private static ResourceManager _resourceMan; private static ResourceManager _resourceMan;
@ -62,9 +61,9 @@ public sealed class Ln
[EditorBrowsable(EditorBrowsableState.Advanced)] [EditorBrowsable(EditorBrowsableState.Advanced)]
public static CultureInfo Culture { get; set; } public static CultureInfo Culture { get; set; }
<# <#
var xml = new XmlDocument(); var xml = new System.Xml.XmlDocument();
xml.Load("../assets/res/Ln.resx"); xml.Load("../assets/res/Ln.resx");
foreach (XmlNode data in xml.SelectNodes("//root/data")!) foreach (System.Xml.XmlNode data in xml.SelectNodes("//root/data")!)
{ {
#> #>
/// <summary> /// <summary>

View File

@ -1,8 +1,5 @@
<#@ template language="C#" #> <#@ template language="C#" #>
<#@ output encoding="utf-8" extension="resx" #> <#@ output encoding="utf-8" extension="resx" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
@ -28,12 +25,15 @@
</value> </value>
</resheader> </resheader>
<# <#
var regex = new Regex(@"^\d", RegexOptions.Compiled); var regex = new System.Text.RegularExpressions.Regex(@"^\d", System.Text.RegularExpressions.RegexOptions.Compiled);
foreach (var line in Directory.GetFiles("../assets/res/", "*.ln").SelectMany(x => File.ReadLines(x)).Distinct()) foreach (var file in System.IO.Directory.GetFiles("../assets/res/", "*.ln"))
{ {
foreach (var line in System.IO.File.ReadLines(file))
{
#> #>
<data name="<#= regex.IsMatch(line) ? "_" : "" #><#= line #>" xml:space="preserve"><value><#= line #></value></data> <data name="<#= regex.IsMatch(line) ? "_" : "" #><#= line #>" xml:space="preserve"><value><#= line #></value></data>
<# <#
}
} }
#> #>
</root> </root>

View File

@ -1,4 +1,4 @@
#r "nuget: NSExt, 2.2.0" #r "nuget: NSExt, 1.1.0"
using NSExt.Extensions; using NSExt.Extensions;
Console.WriteLine("请输入原始名称NSExt"); Console.WriteLine("请输入原始名称NSExt");

View File

@ -1,42 +0,0 @@
using System.Text.RegularExpressions;
string input = string.Empty;
while (!new[] { "1", "2" }.Contains(input))
{
Console.WriteLine("1.nuget 2.project");
input = Console.ReadLine();
}
var slnFile = Directory.GetFiles(@"../", "*.sln").First();
var csprojFiles = Directory.GetFiles(@"../src", "*.csproj", new EnumerationOptions { RecurseSubdirectories = true });
var slnContent = File.ReadAllText(slnFile);
if (input == "1")
{
slnContent = Regex.Replace(slnContent, "\\nProject\\((.*)#refs", "\n##Project($1#refs");
slnContent = Regex.Replace(slnContent, "\\nEndProject#refs", "\n##EndProject#refs");
foreach (Match m in Regex.Matches(slnContent, "\"(\\{[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\})\"#refs"))
{
slnContent = slnContent.Replace($" {m.Groups[1].Value}.", $" ##{m.Groups[1].Value}.");
}
foreach (var csprojFile in csprojFiles)
{
var csprojContent = File.ReadAllText(csprojFile);
csprojContent = Regex.Replace(csprojContent," <ProjectReference(.*)Label=\"refs\"(.*)>", " <!--<ProjectReference$1Label=\"refs\"$2>-->");
csprojContent = Regex.Replace(csprojContent," <!--<PackageReference(.*)Label=\"refs\"(.*)>-->", " <PackageReference$1Label=\"refs\"$2>");
File.WriteAllText(csprojFile, csprojContent);
}
}
else
{
slnContent = Regex.Replace(slnContent, "##", "");
foreach (var csprojFile in csprojFiles)
{
var csprojContent = File.ReadAllText(csprojFile);
csprojContent = Regex.Replace(csprojContent," <!--<ProjectReference(.*)Label=\"refs\"(.*)>-->", " <ProjectReference$1Label=\"refs\"$2>");
csprojContent = Regex.Replace(csprojContent," <PackageReference(.*)Label=\"refs\"(.*)>", " <!--<PackageReference$1Label=\"refs\"$2>-->");
File.WriteAllText(csprojFile, csprojContent);
}
}
Console.WriteLine(slnContent);
File.WriteAllText(slnFile, slnContent);

View File

@ -8,12 +8,12 @@ content = Regex.Replace(
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"meta\", \"meta\", \"{5198A03D-0CAC-4828-A807-34A693F73859}\"(?:.|\n)*?EndProject", "Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"meta\", \"meta\", \"{5198A03D-0CAC-4828-A807-34A693F73859}\"(?:.|\n)*?EndProject",
$$""" $$"""
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{5198A03D-0CAC-4828-A807-34A693F73859}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{5198A03D-0CAC-4828-A807-34A693F73859}"
ProjectSection(SolutionItems) = preProject {{'\t'}}ProjectSection(SolutionItems) = preProject
{{string.Join('\n', {{string.Join('\n',
Directory.GetFiles(@"../", "*").Where(x => !x.EndsWith(".sln") && !x.EndsWith(".user")) Directory.GetFiles(@"../", "*").Where(x => !x.EndsWith(".sln") && !x.EndsWith(".user"))
.Select(x=>$" {Path.GetFileName(x)} = {Path.GetFileName(x)}") .Select(x=>$"\t\t{Path.GetFileName(x)} = {Path.GetFileName(x)}")
)}} )}}
EndProject {{'\t'}}EndProject
""" """
); );
@ -22,12 +22,12 @@ content = Regex.Replace(
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"workflows\", \"workflows\", \"{3C6F049E-3EE8-4D66-9AFF-E8A369032487}\"(?:.|\n)*?EndProject", "Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"workflows\", \"workflows\", \"{3C6F049E-3EE8-4D66-9AFF-E8A369032487}\"(?:.|\n)*?EndProject",
$$""" $$"""
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3C6F049E-3EE8-4D66-9AFF-E8A369032487}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3C6F049E-3EE8-4D66-9AFF-E8A369032487}"
ProjectSection(SolutionItems) = preProject {{'\t'}}ProjectSection(SolutionItems) = preProject
{{string.Join('\n', {{string.Join('\n',
Directory.GetFiles(@"../.github/workflows", "*") Directory.GetFiles(@"../.github/workflows", "*")
.Select(x=>$" {Path.GetFileName(x)} = .github/workflows/{Path.GetFileName(x)}") .Select(x=>$"\t\t{Path.GetFileName(x)} = .github/workflows/{Path.GetFileName(x)}")
)}} )}}
EndProject {{'\t'}}EndProject
""" """
); );
@ -36,12 +36,12 @@ content = Regex.Replace(
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"scripts\", \"scripts\", \"{BB0B25C9-0901-4923-913F-00F9A6B352A5}\"(?:.|\n)*?EndProject", "Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"scripts\", \"scripts\", \"{BB0B25C9-0901-4923-913F-00F9A6B352A5}\"(?:.|\n)*?EndProject",
$$""" $$"""
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B25C9-0901-4923-913F-00F9A6B352A5}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B25C9-0901-4923-913F-00F9A6B352A5}"
ProjectSection(SolutionItems) = preProject {{'\t'}}ProjectSection(SolutionItems) = preProject
{{string.Join('\n', {{string.Join('\n',
Directory.GetFiles(@"../scripts", "*") Directory.GetFiles(@"../scripts", "*")
.Select(x=>$" {Path.GetFileName(x)} = scripts/{Path.GetFileName(x)}") .Select(x=>$"\t\t{Path.GetFileName(x)} = scripts/{Path.GetFileName(x)}")
)}} )}}
EndProject {{'\t'}}EndProject
""" """
); );
@ -50,12 +50,12 @@ content = Regex.Replace(
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"build\", \"build\", \"{8E4C93BA-9493-4892-80C4-5E174C504829}\"(?:.|\n)*?EndProject", "Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"build\", \"build\", \"{8E4C93BA-9493-4892-80C4-5E174C504829}\"(?:.|\n)*?EndProject",
$$""" $$"""
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8E4C93BA-9493-4892-80C4-5E174C504829}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8E4C93BA-9493-4892-80C4-5E174C504829}"
ProjectSection(SolutionItems) = preProject {{'\t'}}ProjectSection(SolutionItems) = preProject
{{string.Join('\n', {{string.Join('\n',
Directory.GetFiles(@"../build", "*") Directory.GetFiles(@"../build", "*")
.Select(x=>$" {Path.GetFileName(x)} = build/{Path.GetFileName(x)}") .Select(x=>$"\t\t{Path.GetFileName(x)} = build/{Path.GetFileName(x)}")
)}} )}}
EndProject {{'\t'}}EndProject
""" """
); );

View File

@ -1,6 +1,5 @@
global using System; global using System;
global using System.ComponentModel; global using System.ComponentModel;
global using System.Diagnostics;
global using System.Globalization; global using System.Globalization;
global using System.Text; global using System.Text;
global using System.Text.RegularExpressions; global using System.Text.RegularExpressions;

View File

@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0"/>
<PackageReference Include="xunit" Version="2.9.2"/> <PackageReference Include="xunit" Version="2.8.1"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0-pre.49"> <PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>

View File

@ -258,13 +258,10 @@ public static class StringExtensions
#pragma warning disable CA5350 #pragma warning disable CA5350
using var hmacSha1 = new HMACSHA1(e.GetBytes(secret)); using var hmacSha1 = new HMACSHA1(e.GetBytes(secret));
#pragma warning restore CA5350 #pragma warning restore CA5350
#if NET9_0_OR_GREATER
return Convert.ToHexStringLower(hmacSha1.ComputeHash(e.GetBytes(me)));
#else
return BitConverter.ToString(hmacSha1.ComputeHash(e.GetBytes(me))) return BitConverter.ToString(hmacSha1.ComputeHash(e.GetBytes(me)))
.Replace("-", string.Empty) .Replace("-", string.Empty)
.ToLower(CultureInfo.CurrentCulture); .ToLower(CultureInfo.CurrentCulture);
#endif
} }
/// <summary> /// <summary>
@ -408,14 +405,10 @@ public static class StringExtensions
public static string Md5(this string me, Encoding e) public static string Md5(this string me, Encoding e)
{ {
#pragma warning disable CA5351 #pragma warning disable CA5351
#if NET9_0_OR_GREATER
return Convert.ToHexStringLower(MD5.HashData(e.GetBytes(me)));
#else
return BitConverter.ToString(MD5.HashData(e.GetBytes(me))) return BitConverter.ToString(MD5.HashData(e.GetBytes(me)))
#pragma warning restore CA5351 #pragma warning restore CA5351
.Replace("-", string.Empty) .Replace("-", string.Empty)
.ToLower(CultureInfo.CurrentCulture); .ToLower(CultureInfo.CurrentCulture);
#endif
} }
/// <summary> /// <summary>
@ -497,14 +490,10 @@ public static class StringExtensions
public static string Sha1(this string me, Encoding e) public static string Sha1(this string me, Encoding e)
{ {
#pragma warning disable CA5350 #pragma warning disable CA5350
#if NET9_0_OR_GREATER
return Convert.ToHexStringLower(SHA1.HashData(e.GetBytes(me)));
#else
return BitConverter.ToString(SHA1.HashData(e.GetBytes(me))) return BitConverter.ToString(SHA1.HashData(e.GetBytes(me)))
#pragma warning restore CA5350 #pragma warning restore CA5350
.Replace("-", string.Empty) .Replace("-", string.Empty)
.ToLower(CultureInfo.CurrentCulture); .ToLower(CultureInfo.CurrentCulture);
#endif
} }
/// <summary> /// <summary>
@ -617,13 +606,9 @@ public static class StringExtensions
#pragma warning disable CA5351 #pragma warning disable CA5351
using var md5Hmac = new HMACMD5(e.GetBytes(key)); using var md5Hmac = new HMACMD5(e.GetBytes(key));
#pragma warning restore CA5351 #pragma warning restore CA5351
#if NET9_0_OR_GREATER
return Convert.ToHexStringLower(md5Hmac.ComputeHash(e.GetBytes(me)));
#else
return BitConverter.ToString(md5Hmac.ComputeHash(e.GetBytes(me))) return BitConverter.ToString(md5Hmac.ComputeHash(e.GetBytes(me)))
.Replace("-", string.Empty) .Replace("-", string.Empty)
.ToLower(CultureInfo.CurrentCulture); .ToLower(CultureInfo.CurrentCulture);
#endif
} }
} }
#pragma warning restore CodeLinesAnalyzer #pragma warning restore CodeLinesAnalyzer

View File

@ -7,7 +7,7 @@
<Import Project="$(SolutionDir)/build/copy.pkg.xml.comment.files.targets"/> <Import Project="$(SolutionDir)/build/copy.pkg.xml.comment.files.targets"/>
<Import Project="$(SolutionDir)/build/prebuild.targets"/> <Import Project="$(SolutionDir)/build/prebuild.targets"/>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0"/> <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Update="*.json"> <None Update="*.json">