Skip to content

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-sjogren committed Dec 18, 2024
2 parents 421f2cc + 440d71d commit b5919e5
Show file tree
Hide file tree
Showing 19 changed files with 155 additions and 898 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:

strategy:
matrix:
type: [base, frontend, github]
type: [base, frontend, github, no-benchmarks]

steps:
# This is needed to pass linting
Expand Down
2 changes: 1 addition & 1 deletion Karls.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageType>Template</PackageType>
<PackageVersion>1.4.22</PackageVersion>
<PackageVersion>1.5.0</PackageVersion>
<PackageId>Karls.Templates</PackageId>
<Title>Karls Templates</Title>
<Authors>Karl-Johan Sjögren</Authors>
Expand Down
32 changes: 31 additions & 1 deletion templates/opinionated-solution/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@
".github/workflows/**"
]
},
{
"condition": "(!includeBenchmarkProject)",
"exclude": [
"benchmarks/**"
]
},
{
"condition": "(!includeHttpClientSetup)",
"exclude": [
"src/BASE_NAME.Core/Common/HttpClientBase.cs",
"src/BASE_NAME.Core/Exceptions/Http*",
"test/BASE_NAME.TestHelpers/Http/**"
]
},
{
"condition": "(!addFrontendProject)",
"exclude": [
Expand All @@ -61,7 +75,9 @@
"982AABDB-799C-4A5A-817B-421D100AAE99",
"6E055661-9DD9-47EA-BFA4-E20862522A9C",
"23CAAE77-3BA6-47E6-BE31-048D000E3FAC",
"42D2B2C1-C0EA-40B8-9A50-6FE4C43C79C4"
"42D2B2C1-C0EA-40B8-9A50-6FE4C43C79C4",
"7DC3C50C-8B09-4DB3-B4FA-3D26E87810E7",
"32396585-F3DF-4216-81DF-6131E1FF498F"
],
"symbols": {
"skipRestore": {
Expand All @@ -84,6 +100,20 @@
"displayName": "Add frontend project",
"description": "If set to true, adds a Vite based frontend project (includes Yarn, Vite, Vitest, Eslint, etc).",
"defaultValue": "false"
},
"includeHttpClientSetup": {
"type": "parameter",
"datatype": "bool",
"displayName": "Include HttpClient setup",
"description": "If set to true, adds a base class for HttpClient with better error handling and testability.",
"defaultValue": "false"
},
"includeBenchmarkProject": {
"type": "parameter",
"datatype": "bool",
"displayName": "Include benchmark project",
"description": "If set to true, adds a benchmark project based on BenchmarkDotNet.",
"defaultValue": "true"
}
},
"primaryOutputs": [
Expand Down
16 changes: 16 additions & 0 deletions templates/opinionated-solution/BASE_NAME.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BASE_NAME.Frontend", "src\BASE_NAME.Frontend\BASE_NAME.Frontend.csproj", "{42D2B2C1-C0EA-40B8-9A50-6FE4C43C79C4}"
EndProject
#endif
#if (includeBenchmarkProject)
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{32396585-F3DF-4216-81DF-6131E1FF498F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BASE_NAME.Benchmarks", "benchmarks\BASE_NAME.Benchmarks\BASE_NAME.Benchmarks.csproj", "{7DC3C50C-8B09-4DB3-B4FA-3D26E87810E7}"
EndProject
#endif

Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -43,6 +50,12 @@ Global
{42D2B2C1-C0EA-40B8-9A50-6FE4C43C79C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42D2B2C1-C0EA-40B8-9A50-6FE4C43C79C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42D2B2C1-C0EA-40B8-9A50-6FE4C43C79C4}.Release|Any CPU.Build.0 = Release|Any CPU
#endif
#if (includeBenchmarkProject)
{7DC3C50C-8B09-4DB3-B4FA-3D26E87810E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DC3C50C-8B09-4DB3-B4FA-3D26E87810E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DC3C50C-8B09-4DB3-B4FA-3D26E87810E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DC3C50C-8B09-4DB3-B4FA-3D26E87810E7}.Release|Any CPU.Build.0 = Release|Any CPU
#endif
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
Expand All @@ -51,6 +64,9 @@ Global
{23CAAE77-3BA6-47E6-BE31-048D000E3FAC} = {982AABDB-799C-4A5A-817B-421D100AAE99}
#if (addFrontendProject)
{42D2B2C1-C0EA-40B8-9A50-6FE4C43C79C4} = {362B8B37-5E5D-4E36-B272-17E0D985B7A0}
#endif
#if (includeBenchmarkProject)
{7DC3C50C-8B09-4DB3-B4FA-3D26E87810E7} = {32396585-F3DF-4216-81DF-6131E1FF498F}
#endif
EndGlobalSection
EndGlobal
5 changes: 3 additions & 2 deletions templates/opinionated-solution/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
<!-- Package restore configuration -->
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(TF_BUILD)' == 'True' Or '$(CI)' == 'true'">true</RestoreLockedMode>
<!-- This doesn't currently work with dependabot, see https://github.com/dependabot/dependabot-core/issues/10863 -->
<RestorePackagesWithLockFile>false</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(TF_BUILD)' == 'True' Or '$(CI)' == 'true'">false</RestoreLockedMode>
</PropertyGroup>

</Project>
11 changes: 5 additions & 6 deletions templates/opinionated-solution/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project>

<ItemGroup>
<GlobalPackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25" />
<GlobalPackageReference Include="Karls.Analyzers" Version="0.4.3" />
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.12.9" />
<GlobalPackageReference Include="Roslynator.Formatting.Analyzers" Version="4.12.9" />
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.12.10" />
<GlobalPackageReference Include="Roslynator.Formatting.Analyzers" Version="4.12.10" />
<GlobalPackageReference Include="TestableIO.System.IO.Abstractions.Analyzers" Version="2022.0.0" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="coverlet.msbuild" Version="6.0.2"/>
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="FakeItEasy.Analyzer.CSharp" Version="6.1.1" />
<PackageVersion Include="FakeItEasy" Version="8.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
Expand All @@ -23,5 +23,4 @@
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0" />
<PackageVersion Include="xunit.v3" Version="1.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>

<PropertyGroup>
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<Configuration>Release</Configuration>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Condition="'$(OS)' == 'Windows_NT'"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using BenchmarkDotNet.Running;

[assembly: ExcludeFromCodeCoverage]

var switcher = new BenchmarkSwitcher(Assembly.GetExecutingAssembly());
switcher.Run(args);
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;

namespace BASE_NAME.Benchmarks;

[Config(typeof(Config))]
public class SampleBenchmark {
[Benchmark(Baseline = true)]
public int Add() {
return 1 + 2;
}

[Benchmark]
public int Substract() {
return 1 - 2;
}

[Benchmark]
public int Multiply() {
return 1 * 2;
}

[Benchmark]
public int Divide() {
return 1 / 2;
}

private class Config : ManualConfig {
public Config() {
AddDiagnoser(MemoryDiagnoser.Default);
}
}
}
Empty file.

This file was deleted.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"postcss-scss": "^4.0.9",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.82.0",
"sass": "^1.83.0",
"stylelint": "^16.12.0",
"stylelint-config-standard": "^36.0.1",
"stylelint-config-standard-scss": "^14.0.0",
Expand Down
10 changes: 5 additions & 5 deletions templates/opinionated-solution/src/BASE_NAME.Frontend/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b5919e5

Please sign in to comment.