Skip to content

Commit fe325e4

Browse files
authored
Merge pull request #2161 from Cratis:fix/lifecycle
Fix/lifecycle
2 parents 1a9fe64 + 9ac1597 commit fe325e4

File tree

9 files changed

+48
-51
lines changed

9 files changed

+48
-51
lines changed

Directory.Packages.props

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
56
</PropertyGroup>
67
<ItemGroup>
78
<!-- System -->
89
<PackageVersion Include="System.Reactive" Version="6.1.0" />
910
<PackageVersion Include="System.Text.Encoding.Extensions" Version="4.3.0" />
10-
<PackageVersion Include="System.Text.Json" Version="9.0.9" />
11+
<PackageVersion Include="System.Text.Json" Version="9.0.10" />
1112
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
1213
<!-- Microsoft -->
13-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
14+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.10" />
1415
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.10" />
15-
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="9.0.9" />
16+
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="9.0.10" />
1617
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.10" />
17-
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.9" />
18-
<PackageVersion Include="Microsoft.Extensions.Resilience" Version="9.9.0" />
18+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
19+
<PackageVersion Include="Microsoft.Extensions.Resilience" Version="9.10.0" />
1920
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
2021
<!-- Cratis -->
21-
<PackageVersion Include="Cratis.Fundamentals" Version="7.2.0" />
22-
<PackageVersion Include="Cratis.Metrics.Roslyn" Version="7.2.0" />
23-
<PackageVersion Include="Cratis.Applications" Version="17.16.2" />
24-
<PackageVersion Include="Cratis.Applications.MongoDB" Version="17.16.2" />
25-
<PackageVersion Include="Cratis.Applications.Orleans" Version="17.16.2" />
26-
<PackageVersion Include="Cratis.Applications.Orleans.MongoDB" Version="17.16.2" />
27-
<PackageVersion Include="Cratis.Applications.ProxyGenerator.Build" Version="17.16.2" />
28-
<PackageVersion Include="Cratis.Applications.Swagger" Version="17.16.2" />
22+
<PackageVersion Include="Cratis.Fundamentals" Version="7.2.1" />
23+
<PackageVersion Include="Cratis.Metrics.Roslyn" Version="7.2.1" />
24+
<PackageVersion Include="Cratis.Applications" Version="17.16.6" />
25+
<PackageVersion Include="Cratis.Applications.MongoDB" Version="17.16.6" />
26+
<PackageVersion Include="Cratis.Applications.Orleans" Version="17.16.6" />
27+
<PackageVersion Include="Cratis.Applications.Orleans.MongoDB" Version="17.16.6" />
28+
<PackageVersion Include="Cratis.Applications.ProxyGenerator.Build" Version="17.16.6" />
29+
<PackageVersion Include="Cratis.Applications.Swagger" Version="17.16.6" />
2930
<!-- Orleans -->
3031
<PackageVersion Include="Microsoft.Orleans.Core.Abstractions" Version="9.2.1" />
3132
<PackageVersion Include="Microsoft.Orleans.Clustering.AzureStorage" Version="9.2.1" />
@@ -45,7 +46,7 @@
4546
<PackageVersion Include="Orleans.Providers.MongoDB" Version="9.2.0" />
4647
<!-- Open Telemetry -->
4748
<PackageVersion Include="OpenTelemetry" Version="1.13.1" />
48-
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.13.0" />
49+
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.13.1" />
4950
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.12.0" />
5051
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.12.0" />
5152
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.12.0" />
@@ -60,7 +61,7 @@
6061
<PackageVersion Include="Microsoft.Orleans.Analyzers" Version="9.2.1" />
6162
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" NoWarn="NU5104" />
6263
<PackageVersion Include="Roslynator.Analyzers" Version="4.14.1" />
63-
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.224" />
64+
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.228" />
6465
<!-- Not categorized -->
6566
<PackageVersion Include="BenchmarkDotNet" Version="0.15.4" />
6667
<PackageVersion Include="castle.core" Version="5.2.1" />
@@ -82,15 +83,15 @@
8283
<PackageVersion Include="Grpc.Net.Client" Version="2.71.0" />
8384
<PackageVersion Include="mongodb.driver" Version="3.5.0" />
8485
<PackageVersion Include="Swashbuckle.AspNetCore" Version="9.0.6" />
85-
<PackageVersion Include="Swashbuckle.AspNetCore.Filters" Version="9.0.0" />
86+
<PackageVersion Include="Swashbuckle.AspNetCore.Filters" Version="9.0.1" />
8687
<PackageVersion Include="FluentValidation" Version="12.0.0" />
8788
<PackageVersion Include="handlebars.net" Version="2.1.6" />
8889
<PackageVersion Include="OneOf" Version="3.0.271" />
8990
<PackageVersion Include="OneOf.SourceGenerator" Version="3.0.271" />
9091
<!-- Testing & Specifications -->
9192
<PackageVersion Include="Cratis.Specifications" Version="3.0.4" />
9293
<PackageVersion Include="Cratis.Specifications.XUnit" Version="3.0.4" />
93-
<PackageVersion Include="Testcontainers" Version="4.7.0" />
94+
<PackageVersion Include="Testcontainers" Version="4.8.0" />
9495
<PackageVersion Include="xunit" Version="2.9.3" />
9596
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
9697
<PackageVersion Include="NSubstitute" Version="5.3.0" />
@@ -100,6 +101,6 @@
100101
<Import Project="$(MSBuildThisFileDirectory)/Directory.Packages.NET8.props" Condition=" '$(TargetFramework)' == 'net8.0' " />
101102

102103
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
103-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.9" />
104+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.10" />
104105
</ItemGroup>
105106
</Project>

Source/Clients/AspNetCore/ChronicleClientServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static IServiceCollection AddCratisChronicleClient(this IServiceCollectio
7979
services.AddScoped(sp => sp.GetRequiredService<IEventStore>().Reactors);
8080
services.AddScoped(sp => sp.GetRequiredService<IEventStore>().Reducers);
8181
services.AddScoped(sp => sp.GetRequiredService<IEventStore>().Projections);
82-
services.AddScoped<IRules, Rules>();
82+
services.AddSingleton<IRules, Rules>();
8383
services.AddSingleton(sp => sp.GetRequiredService<IChronicleClient>().Options.ArtifactsProvider);
8484
services.AddSingleton(sp => sp.GetRequiredService<IChronicleClient>().Options.NamingPolicy);
8585

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Cratis. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
using System.Text.Json;
54
using Cratis.Chronicle.Projections;
65
using Cratis.Serialization;
76

@@ -11,14 +10,12 @@ public class all_dependencies : Specification
1110
{
1211
protected IClientArtifactsProvider _clientArtifacts;
1312
protected IProjections _projections;
14-
protected JsonSerializerOptions _jsonSerializerOptions;
1513
protected INamingPolicy _namingPolicy;
1614

1715
void Establish()
1816
{
1917
_namingPolicy = new DefaultNamingPolicy();
2018
_clientArtifacts = Substitute.For<IClientArtifactsProvider>();
2119
_projections = Substitute.For<IProjections>();
22-
_jsonSerializerOptions = new JsonSerializerOptions();
2320
}
2421
}

Source/Clients/DotNET.Specs/Rules/for_Rules/given/no_rules.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public class no_rules : all_dependencies
1010
protected Rules rules;
1111

1212
void Establish() => rules = new(
13-
_jsonSerializerOptions,
1413
new DefaultNamingPolicy(),
1514
_projections,
1615
_clientArtifacts);

Source/Clients/DotNET.Specs/Rules/for_Rules/given/one_rule_for_type.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ void Establish()
1313
_clientArtifacts.Rules.Returns([typeof(RulesForTypeForRules)]);
1414

1515
rules = new(
16-
_jsonSerializerOptions,
1716
_namingPolicy,
1817
_projections,
1918
_clientArtifacts);

Source/Clients/DotNET.Specs/Rules/for_Rules/when_projecting_to_rule/with_model_identifier.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Text.Json.Nodes;
55
using Cratis.Chronicle.Projections;
66
using Cratis.Chronicle.ReadModels;
7+
using Cratis.Strings;
78

89
namespace Cratis.Chronicle.Rules.for_Rules.when_projecting_to_rule;
910

@@ -29,8 +30,8 @@ void Establish()
2930
[nameof(RuleWithState.SecondStateValue)] = SecondStateValue,
3031
[nameof(RuleWithState.ComplexState)] = new JsonObject
3132
{
32-
[nameof(ComplexState.SomeInteger)] = ComplexStateSomeInteger,
33-
[nameof(ComplexState.SomeString)] = ComplexStateSomeString
33+
[nameof(ComplexState.SomeInteger).ToCamelCase()] = ComplexStateSomeInteger,
34+
[nameof(ComplexState.SomeString).ToCamelCase()] = ComplexStateSomeString
3435
}
3536
};
3637

Source/Clients/DotNET.Specs/Rules/for_Rules/when_projecting_to_rule/with_no_model_identifier.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Text.Json.Nodes;
55
using Cratis.Chronicle.Projections;
66
using Cratis.Chronicle.ReadModels;
7+
using Cratis.Strings;
78

89
namespace Cratis.Chronicle.Rules.for_Rules.when_projecting_to_rule;
910

@@ -27,8 +28,8 @@ void Establish()
2728
[nameof(RuleWithState.SecondStateValue)] = SecondStateValue,
2829
[nameof(RuleWithState.ComplexState)] = new JsonObject
2930
{
30-
[nameof(ComplexState.SomeInteger)] = ComplexStateSomeInteger,
31-
[nameof(ComplexState.SomeString)] = ComplexStateSomeString
31+
[nameof(ComplexState.SomeInteger).ToCamelCase()] = ComplexStateSomeInteger,
32+
[nameof(ComplexState.SomeString).ToCamelCase()] = ComplexStateSomeString
3233
}
3334
};
3435

Source/Clients/DotNET/Rules/Rules.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Text.Json;
66
using Cratis.Chronicle.Projections;
77
using Cratis.Chronicle.ReadModels;
8+
using Cratis.Json;
89
using Cratis.Serialization;
910

1011
namespace Cratis.Chronicle.Rules;
@@ -15,13 +16,11 @@ namespace Cratis.Chronicle.Rules;
1516
/// <remarks>
1617
/// Initializes a new instance of the <see cref="Rules"/> class.
1718
/// </remarks>
18-
/// <param name="serializerOptions"><see cref="JsonSerializerOptions"/> to use for deserialization.</param>
1919
/// <param name="namingPolicy"><see cref="INamingPolicy"/> to use for property naming.</param>
2020
/// <param name="projections"><see cref="IProjections"/> client.</param>
2121
/// <param name="clientArtifacts">Optional <see cref="IClientArtifactsProvider"/> for the client artifacts.</param>
2222
[Singleton]
2323
public class Rules(
24-
JsonSerializerOptions serializerOptions,
2524
INamingPolicy namingPolicy,
2625
IProjections projections,
2726
IClientArtifactsProvider clientArtifacts) : IRules
@@ -54,7 +53,7 @@ public void ProjectTo(IRule rule, object? modelIdentifier = default)
5453
var node = result.ReadModel[name];
5554
if (node is not null)
5655
{
57-
property.SetValue(rule, node.Deserialize(property.PropertyType, serializerOptions));
56+
property.SetValue(rule, node.Deserialize(property.PropertyType, Globals.JsonSerializerOptions));
5857
}
5958
}
6059
}

Source/Workbench/Web/package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"preview": "vite preview"
1616
},
1717
"dependencies": {
18-
"@cratis/applications": "^17.12.2",
19-
"@cratis/applications.react": "^17.12.2",
20-
"@cratis/applications.react.mvvm": "^17.12.2",
21-
"@cratis/applications.vite": "^17.12.2",
18+
"@cratis/applications": "^17.16.5",
19+
"@cratis/applications.react": "^17.16.5",
20+
"@cratis/applications.react.mvvm": "^17.16.5",
21+
"@cratis/applications.vite": "^17.16.5",
2222
"allotment": "^1.20.4",
2323
"echarts": "^6.0.0",
2424
"primeicons": "^7.0.0",
@@ -28,46 +28,46 @@
2828
"usehooks-ts": "3.1.1"
2929
},
3030
"devDependencies": {
31-
"@tailwindcss/postcss": "4.1.14",
32-
"@tailwindcss/vite": "4.1.14",
33-
"@types/chai": "5.2.2",
31+
"@tailwindcss/postcss": "4.1.15",
32+
"@tailwindcss/vite": "4.1.15",
33+
"@types/chai": "5.2.3",
3434
"@types/chai-as-promised": "8.0.2",
3535
"@types/mocha": "10.0.10",
36-
"@types/node": "24.6.2",
37-
"@types/react": "19.2.0",
38-
"@types/react-dom": "19.2.0",
36+
"@types/node": "24.9.1",
37+
"@types/react": "19.2.2",
38+
"@types/react-dom": "19.2.2",
3939
"@types/sinon": "17.0.4",
4040
"@types/sinon-chai": "4.0.0",
41-
"@typescript-eslint/eslint-plugin": "8.45.0",
42-
"@typescript-eslint/parser": "8.45.0",
41+
"@typescript-eslint/eslint-plugin": "8.46.2",
42+
"@typescript-eslint/parser": "8.46.2",
4343
"@vitejs/plugin-react": "5.0.4",
4444
"@vitest/coverage-v8": "3.2.4",
4545
"autoprefixer": "10.4.21",
4646
"chai": "6.2.0",
4747
"chai-as-promised": "8.0.2",
48-
"eslint": "9.37.0",
48+
"eslint": "9.38.0",
4949
"eslint-config-prettier": "10.1.8",
5050
"eslint-plugin-header": "3.1.1",
5151
"eslint-plugin-import": "2.32.0",
5252
"eslint-plugin-no-null": "1.0.2",
53-
"eslint-plugin-prettier": "5.5.3",
53+
"eslint-plugin-prettier": "5.5.4",
5454
"eslint-plugin-react": "7.37.5",
55-
"eslint-plugin-react-hooks": "6.1.1",
56-
"eslint-plugin-react-refresh": "0.4.23",
55+
"eslint-plugin-react-hooks": "7.0.0",
56+
"eslint-plugin-react-refresh": "0.4.24",
5757
"globals": "16.4.0",
5858
"hash-files": "1.1.1",
5959
"mocha": "11.7.4",
6060
"react": "19.2.0",
6161
"react-dom": "19.2.0",
62-
"react-router-dom": "7.9.3",
62+
"react-router-dom": "7.9.4",
6363
"sinon": "21.0.0",
6464
"sinon-chai": "4.0.1",
65-
"tailwindcss": "4.1.14",
65+
"tailwindcss": "4.1.15",
6666
"ts-node": "10.9.2",
6767
"tsconfig-paths": "4.2.0",
6868
"typescript": "5.9.3",
69-
"typescript-eslint": "8.45.0",
70-
"vite": "7.1.9",
69+
"typescript-eslint": "8.46.2",
70+
"vite": "7.1.11",
7171
"vite-plugin-commonjs": "0.10.4",
7272
"vite-tsconfig-paths": "5.1.4",
7373
"vitest": "3.2.4"

0 commit comments

Comments
 (0)