diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..22657b8e
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,45 @@
+name: CI
+run-name: CI ${{ github.event.pull_request.title }}
+
+on:
+ pull_request:
+
+jobs:
+ ci-build:
+ name: Build & Test ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest, windows-latest]
+
+ defaults:
+ run:
+ working-directory: ./src/Confix.Tool
+
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
+ 10.0.x
+
+ - name: Restore dependencies
+ run: dotnet restore
+
+ - name: Build
+ run: dotnet build
+
+ - name: Test
+ run: dotnet test
+
+ - name: Upload snapshot mismatches
+ if: failure()
+ uses: actions/upload-artifact@v4
+ with:
+ name: snapshot-mismatches-${{ matrix.os }}
+ path: ./**/test/**/__mismatch__/**
+ if-no-files-found: ignore
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
deleted file mode 100644
index 3fd880ac..00000000
--- a/.github/workflows/dotnet.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: Confix.Tool
-
-on:
- push:
- branches: [ "main" ]
- pull_request:
- branches: [ "main" ]
-
-jobs:
- ci-build:
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./src/Confix.Tool
- steps:
- - uses: actions/checkout@v3
- - name: Setup .NET
- uses: actions/setup-dotnet@v3
- with:
- dotnet-version: |
- 8.0.x
- 9.0.x
- 10.0.x
- - name: Restore dependencies
- run: dotnet restore
- - name: Build
- run: dotnet build
- - name: Test
- run: dotnet test
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
index 2af24cde..e470051a 100644
--- a/.github/workflows/gh-pages.yml
+++ b/.github/workflows/gh-pages.yml
@@ -1,4 +1,4 @@
-name: Deploy documentation with GitHub Pages
+name: GitHub Pages
on:
# Runs on pushes targeting the default branch
@@ -26,17 +26,17 @@ jobs:
working-directory: ./docs
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v6
- name: Setup Pages
- uses: actions/configure-pages@v3
+ uses: actions/configure-pages@v5
- name: Use Node.js
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v6
with:
node-version: 'latest'
- run: npm ci
- run: npm run build
- name: Upload artifact
- uses: actions/upload-pages-artifact@v1
+ uses: actions/upload-pages-artifact@v4
with:
path: ./docs/out/
@@ -50,4 +50,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
- uses: actions/deploy-pages@v2
+ uses: actions/deploy-pages@v4
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 2af337c2..4a6d35f5 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,4 +1,5 @@
-name: Confix.Tool.Release
+name: Release
+run-name: Release ${{ github.event.release.tag_name }}
on:
release:
@@ -14,9 +15,9 @@ jobs:
VERSION: ${{ github.event.release.tag_name }}
NUGET_TOKEN: ${{ secrets.NUGET_API_KEY }}
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v6
- name: Setup .NET
- uses: actions/setup-dotnet@v3
+ uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
diff --git a/All.sln b/All.sln
deleted file mode 100644
index 0ca26a3c..00000000
--- a/All.sln
+++ /dev/null
@@ -1,178 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.0.31903.59
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{38C599CE-FE35-487C-A7B8-03ABC8B2DB9A}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common.Components", "Common.Components", "{52E98B1F-1F9A-4653-90BE-46E7FD798712}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9AD057B7-3967-4748-AAB4-E7ABE5C0B81B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Components.DataProtection", "examples\Common.Components\src\Common.Components.DataProtection\Common.Components.DataProtection.csproj", "{F3BDF44B-E289-4721-8052-ED4DB330E013}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Components.Security", "examples\Common.Components\src\Common.Components.Security\Common.Components.Security.csproj", "{1A2ECD40-E062-4494-B910-ED73B9BEFE16}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MonoRepo", "MonoRepo", "{868FAC79-55D1-499A-A03A-49D12C13AC3F}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9F10E669-96E4-402E-8BC9-A51866098208}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service1", "Service1", "{6BD9F64C-816E-4C8D-BB49-44A8E0AE1CE0}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40BF09E1-3BA7-4EEA-B605-0C4B743A0214}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoRepo.Service1.Abstraction", "examples\MonoRepo\src\Service1\src\MonoRepo.Service1.Abstraction\MonoRepo.Service1.Abstraction.csproj", "{7EC2CC7F-2368-4E76-99AE-1B8E9D0CF958}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoRepo.Service1.Host", "examples\MonoRepo\src\Service1\src\MonoRepo.Service1.Host\MonoRepo.Service1.Host.csproj", "{2B3C05FE-9450-4E26-B684-84CB4C3F8477}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service2", "Service2", "{8EBEEC28-DFAA-4241-91C0-112E6C08C155}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5272442E-F381-4A93-A698-282B12D95282}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoRepo.Service2.Abstraction", "examples\MonoRepo\src\Service2\src\MonoRepo.Service2.Abstraction\MonoRepo.Service2.Abstraction.csproj", "{E90FECBE-5B8D-4C95-B55C-887A8565C09E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoRepo.Service2.DataAccess", "examples\MonoRepo\src\Service2\src\MonoRepo.Service2.DataAccess\MonoRepo.Service2.DataAccess.csproj", "{2A0458C6-D248-44A0-AC55-4E911949E333}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoRepo.Service2.Hosting", "examples\MonoRepo\src\Service2\src\MonoRepo.Service2.Hosting\MonoRepo.Service2.Hosting.csproj", "{FE172588-DE36-43D4-A7C0-FF20F69CFFA7}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{EF07F58E-E300-49AE-B58A-504EA3E5EB6F}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A1A0E658-C07F-49B4-9E74-C7EFA33DF6C5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoRepo.Shared.AzureExtensions", "examples\MonoRepo\src\Shared\src\MonoRepo.Shared.AzureExtensions\MonoRepo.Shared.AzureExtensions.csproj", "{EDD1335A-D093-479A-984C-F3C2591FEA8A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoRepo.Shared.Hosting", "examples\MonoRepo\src\Shared\src\MonoRepo.Shared.Hosting\MonoRepo.Shared.Hosting.csproj", "{FA760439-6F64-4D3A-A7ED-C1D4C1972C17}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SomeService.Repo", "SomeService.Repo", "{622E5D6E-A91E-4698-B828-B3B7D3C698BE}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3DD1D4C4-6FE9-4BE6-9C2F-887002EF1F60}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SomeService.Abstractions", "examples\SomeService.Repo\src\SomeService.Abstractions\SomeService.Abstractions.csproj", "{37CEC3AC-2EE1-45DB-A343-066029202F5C}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SomeService.Host", "examples\SomeService.Repo\src\SomeService.Host\SomeService.Host.csproj", "{45B05DB5-72A1-4217-B467-B70AF9B8204A}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{260F859B-A0DE-40F6-8C7A-A9AB06208BF0}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Confix.Tool", "Confix.Tool", "{5CFBA8BA-ADAD-4D90-8B80-771E995D15FE}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4D45BC4C-E2C4-433C-8FAC-DD791F7BE6D9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Confix.Library", "src\Confix.Tool\src\Confix.Library\Confix.Library.csproj", "{82571476-D3B2-41AC-8464-03DCBE1C37EB}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Confix.Nuke", "src\Confix.Tool\src\Confix.Nuke\Confix.Nuke.csproj", "{595D0610-73AD-4473-81B0-9C47E272EEA4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Confix.Tool", "src\Confix.Tool\src\Confix.Tool\Confix.Tool.csproj", "{8D202C18-7E5F-435D-BD31-8226088FBAA1}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{73A8A107-A7CA-4748-8062-32EF855E7BA7}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Confix.Tool.Tests", "src\Confix.Tool\test\Confix.Tool.Tests\Confix.Tool.Tests.csproj", "{BC042D47-49FE-4993-A43E-337A75EB20BC}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_build", ".build\_build.csproj", "{0CF3965A-74BA-47A6-B5A5-950723989A5D}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {F3BDF44B-E289-4721-8052-ED4DB330E013}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F3BDF44B-E289-4721-8052-ED4DB330E013}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F3BDF44B-E289-4721-8052-ED4DB330E013}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F3BDF44B-E289-4721-8052-ED4DB330E013}.Release|Any CPU.Build.0 = Release|Any CPU
- {1A2ECD40-E062-4494-B910-ED73B9BEFE16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1A2ECD40-E062-4494-B910-ED73B9BEFE16}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1A2ECD40-E062-4494-B910-ED73B9BEFE16}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1A2ECD40-E062-4494-B910-ED73B9BEFE16}.Release|Any CPU.Build.0 = Release|Any CPU
- {7EC2CC7F-2368-4E76-99AE-1B8E9D0CF958}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7EC2CC7F-2368-4E76-99AE-1B8E9D0CF958}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7EC2CC7F-2368-4E76-99AE-1B8E9D0CF958}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7EC2CC7F-2368-4E76-99AE-1B8E9D0CF958}.Release|Any CPU.Build.0 = Release|Any CPU
- {2B3C05FE-9450-4E26-B684-84CB4C3F8477}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2B3C05FE-9450-4E26-B684-84CB4C3F8477}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2B3C05FE-9450-4E26-B684-84CB4C3F8477}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2B3C05FE-9450-4E26-B684-84CB4C3F8477}.Release|Any CPU.Build.0 = Release|Any CPU
- {E90FECBE-5B8D-4C95-B55C-887A8565C09E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E90FECBE-5B8D-4C95-B55C-887A8565C09E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E90FECBE-5B8D-4C95-B55C-887A8565C09E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E90FECBE-5B8D-4C95-B55C-887A8565C09E}.Release|Any CPU.Build.0 = Release|Any CPU
- {2A0458C6-D248-44A0-AC55-4E911949E333}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2A0458C6-D248-44A0-AC55-4E911949E333}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2A0458C6-D248-44A0-AC55-4E911949E333}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2A0458C6-D248-44A0-AC55-4E911949E333}.Release|Any CPU.Build.0 = Release|Any CPU
- {FE172588-DE36-43D4-A7C0-FF20F69CFFA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FE172588-DE36-43D4-A7C0-FF20F69CFFA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FE172588-DE36-43D4-A7C0-FF20F69CFFA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FE172588-DE36-43D4-A7C0-FF20F69CFFA7}.Release|Any CPU.Build.0 = Release|Any CPU
- {EDD1335A-D093-479A-984C-F3C2591FEA8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EDD1335A-D093-479A-984C-F3C2591FEA8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EDD1335A-D093-479A-984C-F3C2591FEA8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EDD1335A-D093-479A-984C-F3C2591FEA8A}.Release|Any CPU.Build.0 = Release|Any CPU
- {FA760439-6F64-4D3A-A7ED-C1D4C1972C17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FA760439-6F64-4D3A-A7ED-C1D4C1972C17}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FA760439-6F64-4D3A-A7ED-C1D4C1972C17}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FA760439-6F64-4D3A-A7ED-C1D4C1972C17}.Release|Any CPU.Build.0 = Release|Any CPU
- {37CEC3AC-2EE1-45DB-A343-066029202F5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {37CEC3AC-2EE1-45DB-A343-066029202F5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {37CEC3AC-2EE1-45DB-A343-066029202F5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {37CEC3AC-2EE1-45DB-A343-066029202F5C}.Release|Any CPU.Build.0 = Release|Any CPU
- {45B05DB5-72A1-4217-B467-B70AF9B8204A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {45B05DB5-72A1-4217-B467-B70AF9B8204A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {45B05DB5-72A1-4217-B467-B70AF9B8204A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {45B05DB5-72A1-4217-B467-B70AF9B8204A}.Release|Any CPU.Build.0 = Release|Any CPU
- {82571476-D3B2-41AC-8464-03DCBE1C37EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {82571476-D3B2-41AC-8464-03DCBE1C37EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {82571476-D3B2-41AC-8464-03DCBE1C37EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {82571476-D3B2-41AC-8464-03DCBE1C37EB}.Release|Any CPU.Build.0 = Release|Any CPU
- {595D0610-73AD-4473-81B0-9C47E272EEA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {595D0610-73AD-4473-81B0-9C47E272EEA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {595D0610-73AD-4473-81B0-9C47E272EEA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {595D0610-73AD-4473-81B0-9C47E272EEA4}.Release|Any CPU.Build.0 = Release|Any CPU
- {8D202C18-7E5F-435D-BD31-8226088FBAA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8D202C18-7E5F-435D-BD31-8226088FBAA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8D202C18-7E5F-435D-BD31-8226088FBAA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8D202C18-7E5F-435D-BD31-8226088FBAA1}.Release|Any CPU.Build.0 = Release|Any CPU
- {BC042D47-49FE-4993-A43E-337A75EB20BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BC042D47-49FE-4993-A43E-337A75EB20BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BC042D47-49FE-4993-A43E-337A75EB20BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BC042D47-49FE-4993-A43E-337A75EB20BC}.Release|Any CPU.Build.0 = Release|Any CPU
- {0CF3965A-74BA-47A6-B5A5-950723989A5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0CF3965A-74BA-47A6-B5A5-950723989A5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0CF3965A-74BA-47A6-B5A5-950723989A5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0CF3965A-74BA-47A6-B5A5-950723989A5D}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {52E98B1F-1F9A-4653-90BE-46E7FD798712} = {38C599CE-FE35-487C-A7B8-03ABC8B2DB9A}
- {9AD057B7-3967-4748-AAB4-E7ABE5C0B81B} = {52E98B1F-1F9A-4653-90BE-46E7FD798712}
- {F3BDF44B-E289-4721-8052-ED4DB330E013} = {9AD057B7-3967-4748-AAB4-E7ABE5C0B81B}
- {1A2ECD40-E062-4494-B910-ED73B9BEFE16} = {9AD057B7-3967-4748-AAB4-E7ABE5C0B81B}
- {868FAC79-55D1-499A-A03A-49D12C13AC3F} = {38C599CE-FE35-487C-A7B8-03ABC8B2DB9A}
- {9F10E669-96E4-402E-8BC9-A51866098208} = {868FAC79-55D1-499A-A03A-49D12C13AC3F}
- {6BD9F64C-816E-4C8D-BB49-44A8E0AE1CE0} = {9F10E669-96E4-402E-8BC9-A51866098208}
- {40BF09E1-3BA7-4EEA-B605-0C4B743A0214} = {6BD9F64C-816E-4C8D-BB49-44A8E0AE1CE0}
- {7EC2CC7F-2368-4E76-99AE-1B8E9D0CF958} = {40BF09E1-3BA7-4EEA-B605-0C4B743A0214}
- {2B3C05FE-9450-4E26-B684-84CB4C3F8477} = {40BF09E1-3BA7-4EEA-B605-0C4B743A0214}
- {8EBEEC28-DFAA-4241-91C0-112E6C08C155} = {9F10E669-96E4-402E-8BC9-A51866098208}
- {5272442E-F381-4A93-A698-282B12D95282} = {8EBEEC28-DFAA-4241-91C0-112E6C08C155}
- {E90FECBE-5B8D-4C95-B55C-887A8565C09E} = {5272442E-F381-4A93-A698-282B12D95282}
- {2A0458C6-D248-44A0-AC55-4E911949E333} = {5272442E-F381-4A93-A698-282B12D95282}
- {FE172588-DE36-43D4-A7C0-FF20F69CFFA7} = {5272442E-F381-4A93-A698-282B12D95282}
- {EF07F58E-E300-49AE-B58A-504EA3E5EB6F} = {9F10E669-96E4-402E-8BC9-A51866098208}
- {A1A0E658-C07F-49B4-9E74-C7EFA33DF6C5} = {EF07F58E-E300-49AE-B58A-504EA3E5EB6F}
- {EDD1335A-D093-479A-984C-F3C2591FEA8A} = {A1A0E658-C07F-49B4-9E74-C7EFA33DF6C5}
- {FA760439-6F64-4D3A-A7ED-C1D4C1972C17} = {A1A0E658-C07F-49B4-9E74-C7EFA33DF6C5}
- {622E5D6E-A91E-4698-B828-B3B7D3C698BE} = {38C599CE-FE35-487C-A7B8-03ABC8B2DB9A}
- {3DD1D4C4-6FE9-4BE6-9C2F-887002EF1F60} = {622E5D6E-A91E-4698-B828-B3B7D3C698BE}
- {37CEC3AC-2EE1-45DB-A343-066029202F5C} = {3DD1D4C4-6FE9-4BE6-9C2F-887002EF1F60}
- {45B05DB5-72A1-4217-B467-B70AF9B8204A} = {3DD1D4C4-6FE9-4BE6-9C2F-887002EF1F60}
- {5CFBA8BA-ADAD-4D90-8B80-771E995D15FE} = {260F859B-A0DE-40F6-8C7A-A9AB06208BF0}
- {4D45BC4C-E2C4-433C-8FAC-DD791F7BE6D9} = {5CFBA8BA-ADAD-4D90-8B80-771E995D15FE}
- {82571476-D3B2-41AC-8464-03DCBE1C37EB} = {4D45BC4C-E2C4-433C-8FAC-DD791F7BE6D9}
- {595D0610-73AD-4473-81B0-9C47E272EEA4} = {4D45BC4C-E2C4-433C-8FAC-DD791F7BE6D9}
- {8D202C18-7E5F-435D-BD31-8226088FBAA1} = {4D45BC4C-E2C4-433C-8FAC-DD791F7BE6D9}
- {73A8A107-A7CA-4748-8062-32EF855E7BA7} = {5CFBA8BA-ADAD-4D90-8B80-771E995D15FE}
- {BC042D47-49FE-4993-A43E-337A75EB20BC} = {73A8A107-A7CA-4748-8062-32EF855E7BA7}
- EndGlobalSection
-EndGlobal
diff --git a/Directory.Build.props b/Directory.Build.props
index 9969cbb2..764f22ed 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -6,10 +6,10 @@
- net8.0;net9.0
+ net8.0;net9.0;net10.0
Confix
enable
- 11
+ latest
enable
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 4665ac3b..b8d59429 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -39,6 +39,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/global.json b/global.json
index 2bc13e80..1e7fdfa9 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "9.0.100",
+ "version": "10.0.100",
"rollForward": "latestMinor"
}
}
diff --git a/src/Confix.Tool/src/Confix.Library/Entities/Component/Configuration/ComponentReferenceConfiguration.cs b/src/Confix.Tool/src/Confix.Library/Entities/Component/Configuration/ComponentReferenceConfiguration.cs
index b257a6f1..4c854d99 100644
--- a/src/Confix.Tool/src/Confix.Library/Entities/Component/Configuration/ComponentReferenceConfiguration.cs
+++ b/src/Confix.Tool/src/Confix.Library/Entities/Component/Configuration/ComponentReferenceConfiguration.cs
@@ -1,3 +1,4 @@
+using System.Text.Json;
using System.Text.Json.Nodes;
using Confix.Utilities.Json;
using Confix.Utilities.Parsing;
@@ -48,7 +49,7 @@ public static ComponentReferenceConfiguration Parse(string key, JsonNode node)
"The component key must be in the format '@provider/componentName'.");
}
- if (node.GetSchemaValueType() is SchemaValueType.String)
+ if (node.GetValueKind() is JsonValueKind.String)
{
return new ComponentReferenceConfiguration(
provider,
@@ -58,7 +59,7 @@ public static ComponentReferenceConfiguration Parse(string key, JsonNode node)
null);
}
- if (node.GetSchemaValueType() is SchemaValueType.Boolean)
+ if (node.GetValueKind() is JsonValueKind.True || node.GetValueKind() is JsonValueKind.False)
{
return new ComponentReferenceConfiguration(
provider,
@@ -76,7 +77,7 @@ public static ComponentReferenceConfiguration Parse(string key, JsonNode node)
var mountingPoints =
obj.TryGetNonNullPropertyValue(FieldNames.MountingPoint, out var mountingPointNode)
- ? mountingPointNode.GetSchemaValueType() is SchemaValueType.Array
+ ? mountingPointNode.GetValueKind() is JsonValueKind.Array
? mountingPointNode
.ExpectArray()
.WhereNotNull()
diff --git a/src/Confix.Tool/src/Confix.Library/Entities/Environment/Configuration/EnvironmentConfiguration.cs b/src/Confix.Tool/src/Confix.Library/Entities/Environment/Configuration/EnvironmentConfiguration.cs
index d6c02f5a..93f7b0dc 100644
--- a/src/Confix.Tool/src/Confix.Library/Entities/Environment/Configuration/EnvironmentConfiguration.cs
+++ b/src/Confix.Tool/src/Confix.Library/Entities/Environment/Configuration/EnvironmentConfiguration.cs
@@ -1,3 +1,4 @@
+using System.Text.Json;
using System.Text.Json.Nodes;
using Confix.Utilities.Json;
using Json.Schema;
@@ -25,7 +26,7 @@ public EnvironmentConfiguration(
public static EnvironmentConfiguration Parse(JsonNode node)
{
- if (node.GetSchemaValueType() is SchemaValueType.String)
+ if (node.GetValueKind() is JsonValueKind.String)
{
return new EnvironmentConfiguration(node.ExpectValue(), null);
}
diff --git a/src/Confix.Tool/src/Confix.Library/Entities/Project/Configuration/ConfigurationFileConfiguration.cs b/src/Confix.Tool/src/Confix.Library/Entities/Project/Configuration/ConfigurationFileConfiguration.cs
index 54761853..237581cc 100644
--- a/src/Confix.Tool/src/Confix.Library/Entities/Project/Configuration/ConfigurationFileConfiguration.cs
+++ b/src/Confix.Tool/src/Confix.Library/Entities/Project/Configuration/ConfigurationFileConfiguration.cs
@@ -24,7 +24,7 @@ public ConfigurationFileConfiguration(string? type, JsonNode value)
public static ConfigurationFileConfiguration Parse(JsonNode node)
{
- if (node.GetSchemaValueType() is SchemaValueType.String)
+ if (node.GetValueKind() is JsonValueKind.String)
{
// TODO const?
return new ConfigurationFileConfiguration("inline", node);
diff --git a/src/Confix.Tool/src/Confix.Library/Entities/Project/DefaultValueVisitor.cs b/src/Confix.Tool/src/Confix.Library/Entities/Project/DefaultValueVisitor.cs
index 4d5e4b77..81b87f96 100644
--- a/src/Confix.Tool/src/Confix.Library/Entities/Project/DefaultValueVisitor.cs
+++ b/src/Confix.Tool/src/Confix.Library/Entities/Project/DefaultValueVisitor.cs
@@ -2,7 +2,7 @@
using System.Collections.ObjectModel;
using System.Text.Json.Nodes;
using Confix.Tool.Schema;
-using Json.More;
+using Confix.Utilities.Json;
using Json.Schema;
namespace Confix.Tool.Entities.Components.DotNet;
diff --git a/src/Confix.Tool/src/Confix.Library/Entities/Schema/MetadataKeyword.cs b/src/Confix.Tool/src/Confix.Library/Entities/Schema/MetadataKeyword.cs
index 8f84bf56..c895d5b9 100644
--- a/src/Confix.Tool/src/Confix.Library/Entities/Schema/MetadataKeyword.cs
+++ b/src/Confix.Tool/src/Confix.Library/Entities/Schema/MetadataKeyword.cs
@@ -1,7 +1,7 @@
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
-using Json.More;
+using Confix.Utilities.Json;
using Json.Schema;
namespace Confix.Entities.Schema;
@@ -78,7 +78,7 @@ public override MetadataKeyword Read(
{
var node = JsonSerializer.Deserialize(ref reader, options);
- return new MetadataKeyword(node);
+ return new MetadataKeyword(node ?? []);
}
public override void Write(
diff --git a/src/Confix.Tool/src/Confix.Library/Middlewares/LoadConfiguration/MagicPathRewriter.cs b/src/Confix.Tool/src/Confix.Library/Middlewares/LoadConfiguration/MagicPathRewriter.cs
index f9478e33..16d3987c 100644
--- a/src/Confix.Tool/src/Confix.Library/Middlewares/LoadConfiguration/MagicPathRewriter.cs
+++ b/src/Confix.Tool/src/Confix.Library/Middlewares/LoadConfiguration/MagicPathRewriter.cs
@@ -1,3 +1,4 @@
+using System.Text.Json;
using System.Text.Json.Nodes;
using Confix.Tool.Commands.Logging;
using Confix.Tool.Schema;
@@ -18,12 +19,13 @@ public sealed class MagicPathRewriter : JsonDocumentRewriter
{
protected override JsonNode Rewrite(JsonValue value, MagicPathContext context)
{
- switch (value.GetSchemaValueType())
+ switch (value.GetValueKind())
{
- case SchemaValueType.String when MagicPath.From(value) is { } magicPath:
+ case JsonValueKind.String when MagicPath.From(value) is { } magicPath:
+ var originalValue = (string?)value ?? string.Empty;
var replacedValue = magicPath.Replace(context);
- App.Log.ReplacedMagicPath((string?) value, replacedValue);
+ App.Log.ReplacedMagicPath(originalValue, replacedValue);
return JsonValue.Create(replacedValue)!;
diff --git a/src/Confix.Tool/src/Confix.Library/Pipelines/Reporting/Dependency/Regex/RegexDependencyProvider.cs b/src/Confix.Tool/src/Confix.Library/Pipelines/Reporting/Dependency/Regex/RegexDependencyProvider.cs
index d2ab7b13..25300f56 100644
--- a/src/Confix.Tool/src/Confix.Library/Pipelines/Reporting/Dependency/Regex/RegexDependencyProvider.cs
+++ b/src/Confix.Tool/src/Confix.Library/Pipelines/Reporting/Dependency/Regex/RegexDependencyProvider.cs
@@ -1,3 +1,4 @@
+using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.RegularExpressions;
using Json.More;
@@ -30,7 +31,7 @@ public RegexDependencyProvider(RegexDependencyProviderDefinition definition)
public void Analyze(DependencyAnalyzerContext context, JsonNode node)
{
- if (node.GetSchemaValueType() is not SchemaValueType.String)
+ if (node.GetValueKind() is not JsonValueKind.String)
{
return;
}
diff --git a/src/Confix.Tool/src/Confix.Library/Pipelines/Reporting/Dependency/ReportingDependencyConfiguration.cs b/src/Confix.Tool/src/Confix.Library/Pipelines/Reporting/Dependency/ReportingDependencyConfiguration.cs
index efefa642..333a3c41 100644
--- a/src/Confix.Tool/src/Confix.Library/Pipelines/Reporting/Dependency/ReportingDependencyConfiguration.cs
+++ b/src/Confix.Tool/src/Confix.Library/Pipelines/Reporting/Dependency/ReportingDependencyConfiguration.cs
@@ -1,3 +1,4 @@
+using System.Text.Json;
using System.Text.Json.Nodes;
using Confix.Utilities.Json;
using Json.Schema;
@@ -60,7 +61,7 @@ file static class Extensions
if (!configuration.Configuration.TryGetPropertyValue("Kind", out var kind) ||
kind is not JsonValue value ||
- value.GetSchemaValueType() is not SchemaValueType.String)
+ value.GetValueKind() is not JsonValueKind.String)
{
return null;
}
diff --git a/src/Confix.Tool/src/Confix.Library/Utilities/Json/JsonNodeExtensions.cs b/src/Confix.Tool/src/Confix.Library/Utilities/Json/JsonNodeExtensions.cs
index b92200d1..2249d01f 100644
--- a/src/Confix.Tool/src/Confix.Library/Utilities/Json/JsonNodeExtensions.cs
+++ b/src/Confix.Tool/src/Confix.Library/Utilities/Json/JsonNodeExtensions.cs
@@ -4,7 +4,6 @@
using System.Text.Json.Nodes;
using System.Text.RegularExpressions;
using Confix.Tool;
-using Json.More;
using Json.Schema;
using Spectre.Console;
@@ -12,6 +11,14 @@ namespace Confix.Utilities.Json;
public static partial class JsonNodeExtensions
{
+ ///
+ /// Checks if the JSON node is a non-null string value.
+ ///
+ /// The JSON node to check.
+ /// True if the node is not null and is a string; otherwise, false.
+ public static bool IsNonNullString(this JsonNode? node)
+ => node is not null && node.GetValueKind() == JsonValueKind.String;
+
public static bool TryGetNonNullPropertyValue(
this JsonObject obj,
string propertyName,
@@ -43,8 +50,8 @@ public static bool TryGetNonNullPropertyValue(
(_, JsonValue nodeValue) => nodeValue,
_ => throw new InvalidOperationException($"""
Cannot merge nodes of different types:
- Source: {source.GetSchemaValueType()}
- Node: {node.GetSchemaValueType()}
+ Source: {source.GetValueKind()}
+ Node: {node.GetValueKind()}
""")
};
@@ -210,4 +217,178 @@ public static async Task SerializeToStreamAsync(
[GeneratedRegex(@"^(?.+?)\[(?\d+)]$")]
private static partial Regex ParseSegmentRegex();
+
+ ///
+ /// Creates a deep copy of the JSON node.
+ ///
+ /// The JSON node to copy.
+ /// A deep copy of the JSON node.
+ public static JsonNode? Copy(this JsonNode? node)
+ {
+ if (node is null)
+ {
+ return null;
+ }
+
+ return node.GetValueKind() switch
+ {
+ JsonValueKind.Object => CopyObject((JsonObject)node),
+ JsonValueKind.Array => CopyArray((JsonArray)node),
+ _ => JsonValue.Create(JsonSerializer.Deserialize(node.ToJsonString()))
+ };
+ }
+
+ private static JsonObject CopyObject(JsonObject source)
+ {
+ var copy = new JsonObject();
+ foreach (var (key, value) in source)
+ {
+ copy[key] = Copy(value);
+ }
+ return copy;
+ }
+
+ private static JsonArray CopyArray(JsonArray source)
+ {
+ var copy = new JsonArray();
+ foreach (var item in source)
+ {
+ copy.Add(Copy(item));
+ }
+ return copy;
+ }
+
+ ///
+ /// Determines if two JSON nodes are equivalent.
+ ///
+ /// The first JSON node.
+ /// The second JSON node.
+ /// True if the nodes are equivalent; otherwise, false.
+ public static bool IsEquivalentTo(this JsonNode? a, JsonNode? b)
+ {
+ if (ReferenceEquals(a, b))
+ {
+ return true;
+ }
+
+ if (a is null || b is null)
+ {
+ return false;
+ }
+
+ var aKind = a.GetValueKind();
+ var bKind = b.GetValueKind();
+
+ if (aKind != bKind)
+ {
+ return false;
+ }
+
+ return aKind switch
+ {
+ JsonValueKind.Object => AreObjectsEquivalent((JsonObject)a, (JsonObject)b),
+ JsonValueKind.Array => AreArraysEquivalent((JsonArray)a, (JsonArray)b),
+ JsonValueKind.String => AreValuesEquivalent(a, b),
+ JsonValueKind.Number => AreValuesEquivalent(a, b),
+ JsonValueKind.True => true,
+ JsonValueKind.False => true,
+ JsonValueKind.Null => true,
+ _ => false
+ };
+ }
+
+ private static bool AreObjectsEquivalent(JsonObject a, JsonObject b)
+ {
+ if (a.Count != b.Count)
+ {
+ return false;
+ }
+
+ foreach (var (key, aValue) in a)
+ {
+ if (!b.TryGetPropertyValue(key, out var bValue))
+ {
+ return false;
+ }
+
+ if (!IsEquivalentTo(aValue, bValue))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private static bool AreArraysEquivalent(JsonArray a, JsonArray b)
+ {
+ if (a.Count != b.Count)
+ {
+ return false;
+ }
+
+ for (var i = 0; i < a.Count; i++)
+ {
+ if (!IsEquivalentTo(a[i], b[i]))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private static bool AreValuesEquivalent(JsonNode a, JsonNode b)
+ {
+ var aString = a.ToJsonString();
+ var bString = b.ToJsonString();
+ return aString == bString;
+ }
+
+ ///
+ /// Gets a hash code for the JSON node that is consistent with equivalence comparison.
+ ///
+ /// The JSON node.
+ /// A hash code value.
+ public static int GetEquivalenceHashCode(this JsonNode? node)
+ {
+ if (node is null)
+ {
+ return 0;
+ }
+
+ var kind = node.GetValueKind();
+
+ return kind switch
+ {
+ JsonValueKind.Object => GetObjectHashCode((JsonObject)node),
+ JsonValueKind.Array => GetArrayHashCode((JsonArray)node),
+ JsonValueKind.String or JsonValueKind.Number => node.ToJsonString().GetHashCode(),
+ JsonValueKind.True => true.GetHashCode(),
+ JsonValueKind.False => false.GetHashCode(),
+ JsonValueKind.Null => 0,
+ _ => 0
+ };
+ }
+
+ private static int GetObjectHashCode(JsonObject obj)
+ {
+ var hash = new HashCode();
+ foreach (var (key, value) in obj.OrderBy(x => x.Key))
+ {
+ hash.Add(key);
+ hash.Add(GetEquivalenceHashCode(value));
+ }
+ return hash.ToHashCode();
+ }
+
+ private static int GetArrayHashCode(JsonArray array)
+ {
+ var hash = new HashCode();
+ foreach (var item in array)
+ {
+ hash.Add(GetEquivalenceHashCode(item));
+ }
+ return hash.ToHashCode();
+ }
}
diff --git a/src/Confix.Tool/src/Confix.Library/Utilities/Json/JsonSchemaBuilderExtensions.cs b/src/Confix.Tool/src/Confix.Library/Utilities/Json/JsonSchemaBuilderExtensions.cs
index bbbe56a0..c7d9f4be 100644
--- a/src/Confix.Tool/src/Confix.Library/Utilities/Json/JsonSchemaBuilderExtensions.cs
+++ b/src/Confix.Tool/src/Confix.Library/Utilities/Json/JsonSchemaBuilderExtensions.cs
@@ -1,7 +1,6 @@
using System.Text.Json.Nodes;
using Confix.Entities.Schema;
using Confix.Utilities.Json;
-using Json.More;
using Json.Schema;
namespace Confix.Tool.Schema;
diff --git a/src/Confix.Tool/src/Confix.Library/Utilities/Json/PrefixJsonNamesRewriter.cs b/src/Confix.Tool/src/Confix.Library/Utilities/Json/PrefixJsonNamesRewriter.cs
index 799f8331..f9e0f008 100644
--- a/src/Confix.Tool/src/Confix.Library/Utilities/Json/PrefixJsonNamesRewriter.cs
+++ b/src/Confix.Tool/src/Confix.Library/Utilities/Json/PrefixJsonNamesRewriter.cs
@@ -1,3 +1,4 @@
+using System.Text.Json;
using System.Text.Json.Nodes;
using Json.More;
using Json.Schema;
@@ -28,7 +29,7 @@ protected override JsonNode Rewrite(JsonObject obj, PrefixJsonNamesContext conte
if (field is RefKeyword.Name &&
value is JsonValue refValue &&
- refValue.GetSchemaValueType() is SchemaValueType.String)
+ refValue.GetValueKind() is JsonValueKind.String)
{
var parts = refValue.GetValue