Skip to content

Commit 1f41662

Browse files
authored
Add configuration support for cli hosting (#79)
* feat: add configuration support with JSON file integration - Introduced `TryAddJsonFile` method in `ConfigurationBuilderExtensions` to conditionally add JSON configuration files. - Added new `CreativeCoders.Configuration` project to the solution with necessary dependencies. - Enhanced `ICliHostBuilder` with `UseConfiguration` method for customizable configuration setups. - Updated `Core.sln` and `CreativeCoders.Cli.Hosting` to incorporate new configuration capabilities. * chore: update package dependencies to latest versions - Upgraded multiple NuGet package references across source, sample, and test projects for consistency and security improvements. - Updated dependencies include `Microsoft.Extensions.*`, `FakeItEasy`, `AwesomeAssertions`, `coverlet.collector`, `xunit.runner.visualstudio`, and others. * feat(cli hosting): add configuration support to unit tests and integration tests - Introduced tests for `UseConfiguration` extension in `DefaultCliHostBuilder` to validate service registration. - Added integration test to ensure commands can access configuration settings at runtime. - Enhanced CLI framework with configuration sample commands for testing.
1 parent 2a491f6 commit 1f41662

58 files changed

Lines changed: 391 additions & 159 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Core.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreativeCoders.IO.Ports", "
262262
EndProject
263263
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreativeCoders.CakeBuild.Tests", "tests\CreativeCoders.CakeBuild.Tests\CreativeCoders.CakeBuild.Tests.csproj", "{A081DDB3-A9DB-498F-824B-C605ACFDB43A}"
264264
EndProject
265+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{2568D059-EB13-4489-8F12-769EB4DD449F}"
266+
EndProject
267+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreativeCoders.Configuration", "source\Configuration\CreativeCoders.Configuration\CreativeCoders.Configuration.csproj", "{86E41188-7778-415E-A783-2CEF2DADB21A}"
268+
EndProject
265269
Global
266270
GlobalSection(SolutionConfigurationPlatforms) = preSolution
267271
Debug|Any CPU = Debug|Any CPU
@@ -588,6 +592,10 @@ Global
588592
{A081DDB3-A9DB-498F-824B-C605ACFDB43A}.Debug|Any CPU.Build.0 = Debug|Any CPU
589593
{A081DDB3-A9DB-498F-824B-C605ACFDB43A}.Release|Any CPU.ActiveCfg = Release|Any CPU
590594
{A081DDB3-A9DB-498F-824B-C605ACFDB43A}.Release|Any CPU.Build.0 = Release|Any CPU
595+
{86E41188-7778-415E-A783-2CEF2DADB21A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
596+
{86E41188-7778-415E-A783-2CEF2DADB21A}.Debug|Any CPU.Build.0 = Debug|Any CPU
597+
{86E41188-7778-415E-A783-2CEF2DADB21A}.Release|Any CPU.ActiveCfg = Release|Any CPU
598+
{86E41188-7778-415E-A783-2CEF2DADB21A}.Release|Any CPU.Build.0 = Release|Any CPU
591599
EndGlobalSection
592600
GlobalSection(SolutionProperties) = preSolution
593601
HideSolutionNode = FALSE
@@ -698,6 +706,8 @@ Global
698706
{EC120660-306E-4E48-8FBB-43D9F3962CEE} = {F31389F0-613B-48B1-AA99-6BFC3D8D7D1A}
699707
{C34426F1-E40C-498D-8FDE-D4ECEB3E49D4} = {F31389F0-613B-48B1-AA99-6BFC3D8D7D1A}
700708
{A081DDB3-A9DB-498F-824B-C605ACFDB43A} = {5A3FFD14-2258-4007-AC77-BAFB3B3EB26F}
709+
{2568D059-EB13-4489-8F12-769EB4DD449F} = {2A7105AA-05B6-469A-93F5-719723A4D90D}
710+
{86E41188-7778-415E-A783-2CEF2DADB21A} = {2568D059-EB13-4489-8F12-769EB4DD449F}
701711
EndGlobalSection
702712
GlobalSection(ExtensibilityGlobals) = postSolution
703713
SolutionGuid = {EE24476B-9A4C-4146-B982-3461FAF8B3B0}

samples/BlazorWebAssemblySampleApp/BlazorWebAssemblySampleApp.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.1"/>
9-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.1" PrivateAssets="all"/>
10-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="10.0.1"/>
8+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.3"/>
9+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.3" PrivateAssets="all"/>
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="10.0.3"/>
1111
</ItemGroup>
1212

1313
<ItemGroup>

samples/CakeBuildSample/CakeBuildSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Cake.Frosting" Version="6.0.0"/>
11+
<PackageReference Include="Cake.Frosting" Version="6.1.0"/>
1212
<PackageDownload Include="ReportGenerator" Version="[5.5.1]"/>
1313
<PackageDownload Include="GitVersion.Tool" Version="[6.5.1]"/>
1414
</ItemGroup>

samples/NetSampleApp/NetSampleApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="10.0.1" />
9+
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="10.0.3"/>
1010
</ItemGroup>
1111

1212
<ItemGroup>

samples/ProcessUtilsSampleApp/ProcessUtilsSampleApp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
11-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.1" />
10+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3"/>
11+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3"/>
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/WebApiSampleApp/WebApiSampleApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.0" />
10+
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.4"/>
1111
</ItemGroup>
1212

1313
<ItemGroup>

source/AspNetCore/CreativeCoders.AspNetCore.Blazor/CreativeCoders.AspNetCore.Blazor.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="10.0.1" />
11-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.0.1" />
12-
<PackageReference Include="Microsoft.JSInterop" Version="10.0.1" />
10+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="10.0.3"/>
11+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.0.3"/>
12+
<PackageReference Include="Microsoft.JSInterop" Version="10.0.3"/>
1313
</ItemGroup>
1414

1515

source/AspNetCore/CreativeCoders.AspNetCore.TokenAuth.Jwt/CreativeCoders.AspNetCore.TokenAuth.Jwt.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.1" />
11-
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.1" />
10+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.3"/>
11+
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.3"/>
1212
</ItemGroup>
1313

1414
<ItemGroup>

source/AspNetCore/CreativeCoders.AspNetCore.TokenAuthApi.Jwt/CreativeCoders.AspNetCore.TokenAuthApi.Jwt.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<ItemGroup>
1010
<PackageReference Include="JetBrains.Annotations" Version="2025.2.4"/>
11-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.1" />
11+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.3"/>
1212
</ItemGroup>
1313

1414
<ItemGroup>

source/AspNetCore/CreativeCoders.AspNetCore/CreativeCoders.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.3.0" />
9+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.3.9"/>
1010
</ItemGroup>
1111

1212
<ItemGroup>

0 commit comments

Comments
 (0)