Skip to content

Commit 6d4bae8

Browse files
Make Nitro CLI project build (#8539)
1 parent ac0dd64 commit 6d4bae8

File tree

94 files changed

+442
-435
lines changed

Some content is hidden

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

94 files changed

+442
-435
lines changed

src/All.slnx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@
288288
<Project Path="HotChocolate/Utilities/test/Utilities.Introspection.Tests/HotChocolate.Utilities.Introspection.Tests.csproj" />
289289
<Project Path="HotChocolate/Utilities/test/Utilities.Tests/HotChocolate.Utilities.Tests.csproj" />
290290
</Folder>
291+
<Folder Name="/Nitro/">
292+
<Project Path="Nitro/src/CommandLine/Legacy.Fusion/HotChocolate.Fusion.Abstractions.csproj" />
293+
<Project Path="Nitro/src/CommandLine/Nitro.CommandLine.Cloud/ChilliCream.Nitro.CLI.csproj" />
294+
</Folder>
291295
<Folder Name="/StrawberryShake/" />
292296
<Folder Name="/StrawberryShake/Client/" />
293297
<Folder Name="/StrawberryShake/Client/src/">

src/Directory.Packages.props

Lines changed: 72 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -3,76 +3,77 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageVersion Include="AlterNats.Hosting" Version="1.0.6" />
7-
<PackageVersion Include="Aspire.Hosting.AppHost" Version="8.0.0" />
8-
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="8.0.0" />
9-
<PackageVersion Include="Aspire.Hosting.RabbitMQ" Version="8.0.0" />
10-
<PackageVersion Include="Aspire.Hosting.Redis" Version="8.0.0" />
11-
<PackageVersion Include="Aspire.Hosting" Version="8.0.0" />
12-
<PackageVersion Include="Azure.Storage.Blobs" Version="12.23.0" />
13-
<PackageVersion Include="Basic.Reference.Assemblies.Net100" Version="1.8.2" />
14-
<PackageVersion Include="Basic.Reference.Assemblies.Net80" Version="1.8.2" />
15-
<PackageVersion Include="Basic.Reference.Assemblies.Net90" Version="1.8.2" />
16-
<PackageVersion Include="ChilliCream.Nitro.App" Version="$(NitroVersion)" />
17-
<PackageVersion Include="ChilliCream.Testing.Utilities" Version="0.2.0" />
18-
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
19-
<PackageVersion Include="DiffPlex" Version="1.8.0" />
20-
<PackageVersion Include="Duende.IdentityModel.OidcClient" Version="6.0.1" />
21-
<PackageVersion Include="Glob" Version="1.1.9" />
22-
<PackageVersion Include="IdentityModel" Version="4.1.1" />
23-
<PackageVersion Include="JsonPointer.Net" Version="5.0.0" />
24-
<PackageVersion Include="Marten" Version="7.33.0" />
25-
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="4.0.1" />
26-
<PackageVersion Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
27-
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Core" Version="1.4.0" />
28-
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Abstractions" Version="1.1.0" />
29-
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
30-
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
31-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0" />
32-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" />
33-
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="7.0.3" />
34-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
35-
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.14" />
36-
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.14" />
37-
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.14.2" />
38-
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
39-
<PackageVersion Include="Moq" Version="4.20.72" />
40-
<PackageVersion Include="NetTopologySuite" Version="2.0.0" />
41-
<PackageVersion Include="Newtonsoft.Json" Version="13.0.2" />
42-
<PackageVersion Include="NodaTime" Version="3.2.1" />
43-
<PackageVersion Include="Npgsql" Version="8.0.4" />
44-
<PackageVersion Include="OpenTelemetry.Api" Version="1.1.0" />
45-
<PackageVersion Include="ProjNET" Version="2.0.0" />
46-
<PackageVersion Include="RabbitMQ.Client" Version="6.4.0" />
47-
<PackageVersion Include="RavenDB.Client" Version="6.0.104" />
48-
<PackageVersion Include="Snapshooter.Xunit" Version="0.5.4" />
49-
<PackageVersion Include="Spectre.Console.Json" Version="0.50.0" />
50-
<PackageVersion Include="Spectre.Console" Version="0.50.0" />
51-
<PackageVersion Include="sqlite-net-pcl" Version="1.9.172" />
52-
<PackageVersion Include="SQLitePCLRaw.bundle_green" Version="2.1.8" />
53-
<PackageVersion Include="Squadron.AzureStorage" Version="0.25.0-preview.2" />
54-
<PackageVersion Include="Squadron.Mongo" Version="0.25.0-preview.2" />
55-
<PackageVersion Include="Squadron.Nats" Version="0.25.0-preview.2" />
56-
<PackageVersion Include="Squadron.PostgreSql" Version="0.25.0-preview.2" />
57-
<PackageVersion Include="Squadron.RabbitMQ" Version="0.25.0-preview.2" />
58-
<PackageVersion Include="Squadron.RavenDB" Version="0.25.0-preview.2" />
59-
<PackageVersion Include="Squadron.Redis" Version="0.25.0-preview.2" />
60-
<PackageVersion Include="StackExchange.Redis" Version="2.6.80" />
61-
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
62-
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
63-
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.13.1" />
64-
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
65-
<PackageVersion Include="System.Reactive" Version="6.0.0" />
66-
<PackageVersion Include="Testcontainers" Version="4.6.0" />
67-
<PackageVersion Include="TUnit" Version="0.25.21" />
68-
<PackageVersion Include="xunit.assert" Version="2.9.3" />
69-
<PackageVersion Include="xunit.extensibility.core" Version="2.9.3" />
70-
<PackageVersion Include="xunit.extensibility.execution" Version="2.9.3" />
71-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.1" />
72-
<PackageVersion Include="xunit.v3.assert" Version="1.1.0" />
73-
<PackageVersion Include="xunit.v3.extensibility.core" Version="1.1.0" />
74-
<PackageVersion Include="xunit.v3" Version="1.1.0" />
75-
<PackageVersion Include="xunit" Version="2.9.3" />
6+
<PackageVersion Include="AlterNats.Hosting" Version="1.0.6" />
7+
<PackageVersion Include="Aspire.Hosting.AppHost" Version="8.0.0" />
8+
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="8.0.0" />
9+
<PackageVersion Include="Aspire.Hosting.RabbitMQ" Version="8.0.0" />
10+
<PackageVersion Include="Aspire.Hosting.Redis" Version="8.0.0" />
11+
<PackageVersion Include="Aspire.Hosting" Version="8.0.0" />
12+
<PackageVersion Include="Azure.Storage.Blobs" Version="12.23.0" />
13+
<PackageVersion Include="Basic.Reference.Assemblies.Net100" Version="1.8.2" />
14+
<PackageVersion Include="Basic.Reference.Assemblies.Net80" Version="1.8.2" />
15+
<PackageVersion Include="Basic.Reference.Assemblies.Net90" Version="1.8.2" />
16+
<PackageVersion Include="ChilliCream.Nitro.App" Version="$(NitroVersion)" />
17+
<PackageVersion Include="ChilliCream.Testing.Utilities" Version="0.2.0" />
18+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
19+
<PackageVersion Include="DiffPlex" Version="1.8.0" />
20+
<PackageVersion Include="Duende.IdentityModel.OidcClient" Version="6.0.1" />
21+
<PackageVersion Include="Glob" Version="1.1.9" />
22+
<PackageVersion Include="IdentityModel" Version="4.1.1" />
23+
<PackageVersion Include="JsonPointer.Net" Version="5.0.0" />
24+
<PackageVersion Include="Marten" Version="7.33.0" />
25+
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="4.0.1" />
26+
<PackageVersion Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
27+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Core" Version="1.4.0" />
28+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Abstractions" Version="1.1.0" />
29+
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
30+
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
31+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0" />
32+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" />
33+
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="7.0.3" />
34+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
35+
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.14" />
36+
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.14" />
37+
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.14.2" />
38+
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
39+
<PackageVersion Include="Moq" Version="4.20.72" />
40+
<PackageVersion Include="NetTopologySuite" Version="2.0.0" />
41+
<PackageVersion Include="Newtonsoft.Json" Version="13.0.2" />
42+
<PackageVersion Include="NodaTime" Version="3.2.1" />
43+
<PackageVersion Include="Npgsql" Version="8.0.4" />
44+
<PackageVersion Include="OpenTelemetry.Api" Version="1.1.0" />
45+
<PackageVersion Include="ProjNET" Version="2.0.0" />
46+
<PackageVersion Include="RabbitMQ.Client" Version="6.4.0" />
47+
<PackageVersion Include="RavenDB.Client" Version="6.0.104" />
48+
<PackageVersion Include="Snapshooter.Xunit" Version="0.5.4" />
49+
<PackageVersion Include="Spectre.Console.Json" Version="0.50.0" />
50+
<PackageVersion Include="Spectre.Console" Version="0.50.0" />
51+
<PackageVersion Include="sqlite-net-pcl" Version="1.9.172" />
52+
<PackageVersion Include="SQLitePCLRaw.bundle_green" Version="2.1.8" />
53+
<PackageVersion Include="Squadron.AzureStorage" Version="0.25.0-preview.2" />
54+
<PackageVersion Include="Squadron.Mongo" Version="0.25.0-preview.2" />
55+
<PackageVersion Include="Squadron.Nats" Version="0.25.0-preview.2" />
56+
<PackageVersion Include="Squadron.PostgreSql" Version="0.25.0-preview.2" />
57+
<PackageVersion Include="Squadron.RabbitMQ" Version="0.25.0-preview.2" />
58+
<PackageVersion Include="Squadron.RavenDB" Version="0.25.0-preview.2" />
59+
<PackageVersion Include="Squadron.Redis" Version="0.25.0-preview.2" />
60+
<PackageVersion Include="StackExchange.Redis" Version="2.6.80" />
61+
<PackageVersion Include="StrawberryShake.Server" Version="15.1.8" />
62+
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
63+
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
64+
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.13.1" />
65+
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
66+
<PackageVersion Include="System.Reactive" Version="6.0.0" />
67+
<PackageVersion Include="Testcontainers" Version="4.6.0" />
68+
<PackageVersion Include="TUnit" Version="0.25.21" />
69+
<PackageVersion Include="xunit.assert" Version="2.9.3" />
70+
<PackageVersion Include="xunit.extensibility.core" Version="2.9.3" />
71+
<PackageVersion Include="xunit.extensibility.execution" Version="2.9.3" />
72+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.1" />
73+
<PackageVersion Include="xunit.v3.assert" Version="1.1.0" />
74+
<PackageVersion Include="xunit.v3.extensibility.core" Version="1.1.0" />
75+
<PackageVersion Include="xunit.v3" Version="1.1.0" />
76+
<PackageVersion Include="xunit" Version="2.9.3" />
7677
</ItemGroup>
7778
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
7879
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="10.0.0-preview.5.25277.114" />
@@ -161,4 +162,4 @@
161162
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.13.1" />
162163
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.13.1" />
163164
</ItemGroup>
164-
</Project>
165+
</Project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Solution>
2+
<Folder Name="/Legacy.Fusion/">
3+
<Project Path="Legacy.Fusion/HotChocolate.Fusion.Abstractions.csproj" />
4+
</Folder>
5+
<Folder Name="/Nitro.CommandLine.Cloud/">
6+
<Project Path="Nitro.CommandLine.Cloud/ChilliCream.Nitro.CLI.csproj" />
7+
</Folder>
8+
<Project Path="../../../HotChocolate/Language/src/Language.SyntaxTree/HotChocolate.Language.SyntaxTree.csproj" />
9+
<Project Path="../../../HotChocolate/Language/src/Language.Utf8/HotChocolate.Language.Utf8.csproj" />
10+
<Project Path="../../../HotChocolate/Language/src/Language.Visitors/HotChocolate.Language.Visitors.csproj" />
11+
<Project Path="../../../HotChocolate/Language/src/Language.Web/HotChocolate.Language.Web.csproj" />
12+
<Project Path="../../../HotChocolate/Language/src/Language/HotChocolate.Language.csproj" />
13+
<Project Path="../../../HotChocolate/Utilities/src/Utilities.Buffers/HotChocolate.Utilities.Buffers.csproj" />
14+
</Solution>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1+
using System.Buffers;
12
using System.Text.Json;
2-
using HotChocolate.Utilities;
33

44
namespace HotChocolate.Fusion.Composition;
55

66
internal static class JsonElementExtensions
77
{
88
public static JsonElement SafeClone(this JsonElement element)
99
{
10-
using var writer = new ArrayWriter();
10+
var writer = new ArrayBufferWriter<byte>();
1111
using var jsonWriter = new Utf8JsonWriter(writer);
1212

1313
element.WriteTo(jsonWriter);
1414
jsonWriter.Flush();
1515

16-
var reader = new Utf8JsonReader(writer.GetWrittenSpan(), true, default);
16+
var reader = new Utf8JsonReader(writer.WrittenSpan, true, default);
1717
return JsonElement.ParseValue(ref reader);
1818
}
1919
}

src/Nitro/src/CommandLine/Legacy.Fusion/Composition/SubgraphConfigJsonSerializer.cs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ internal static class SubgraphConfigJsonSerializer
2727
public static string Format(
2828
SubgraphConfigJson config)
2929
{
30-
if (config is null)
31-
{
32-
throw new ArgumentNullException(nameof(config));
33-
}
30+
ArgumentNullException.ThrowIfNull(config);
3431

3532
var buffer = new ArrayBufferWriter<byte>();
3633
using var writer = new Utf8JsonWriter(buffer);
@@ -99,15 +96,9 @@ public static async ValueTask FormatAsync(
9996
Stream stream,
10097
CancellationToken cancellationToken)
10198
{
102-
if (config is null)
103-
{
104-
throw new ArgumentNullException(nameof(config));
105-
}
99+
ArgumentNullException.ThrowIfNull(config);
106100

107-
if (stream is null)
108-
{
109-
throw new ArgumentNullException(nameof(stream));
110-
}
101+
ArgumentNullException.ThrowIfNull(stream);
111102

112103
await using var writer = new Utf8JsonWriter(stream);
113104

src/Nitro/src/CommandLine/Legacy.Fusion/Composition/SubgraphConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public SubgraphConfiguration(
6363
string extensions,
6464
IReadOnlyList<IClientConfiguration> clients,
6565
JsonElement? configurationExtensions)
66-
: this(name, schema, new[] { extensions, }, clients, configurationExtensions) { }
66+
: this(name, schema, new[] { extensions }, clients, configurationExtensions) { }
6767

6868
/// <summary>
6969
/// Initializes a new instance of the <see cref="SubgraphConfiguration"/> class.
@@ -89,7 +89,7 @@ public SubgraphConfiguration(
8989
string extensions,
9090
IClientConfiguration client,
9191
JsonElement? configurationExtensions)
92-
: this(name, schema, new[] { extensions, }, new[] { client, }, configurationExtensions) { }
92+
: this(name, schema, new[] { extensions }, new[] { client }, configurationExtensions) { }
9393

9494
/// <summary>
9595
/// Gets the name of the subgraph.

src/Nitro/src/CommandLine/Legacy.Fusion/FusionGraphPackage.cs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public sealed class FusionGraphPackage : IDisposable, IAsyncDisposable
2828
new()
2929
{
3030
Indented = true,
31-
MaxDirectivesPerLine = 0,
31+
MaxDirectivesPerLine = 0
3232
};
3333

3434
private readonly Package _package;
@@ -158,10 +158,7 @@ public Task SetFusionGraphAsync(
158158
DocumentNode document,
159159
CancellationToken cancellationToken = default)
160160
{
161-
if (document is null)
162-
{
163-
throw new ArgumentNullException(nameof(document));
164-
}
161+
ArgumentNullException.ThrowIfNull(document);
165162

166163
if (_package.FileOpenAccess != FileAccess.ReadWrite)
167164
{
@@ -289,10 +286,7 @@ public Task SetSchemaAsync(
289286
DocumentNode document,
290287
CancellationToken cancellationToken = default)
291288
{
292-
if (document is null)
293-
{
294-
throw new ArgumentNullException(nameof(document));
295-
}
289+
ArgumentNullException.ThrowIfNull(document);
296290

297291
if (_package.FileOpenAccess != FileAccess.ReadWrite)
298292
{
@@ -408,10 +402,7 @@ public async Task SetSubgraphConfigurationAsync(
408402
SubgraphConfiguration configuration,
409403
CancellationToken cancellationToken = default)
410404
{
411-
if (configuration is null)
412-
{
413-
throw new ArgumentNullException(nameof(configuration));
414-
}
405+
ArgumentNullException.ThrowIfNull(configuration);
415406

416407
if (_package.FileOpenAccess != FileAccess.ReadWrite)
417408
{
@@ -510,7 +501,7 @@ private static async Task<JsonDocument> ReadJsonPartAsync(
510501
PackagePart schemaPart,
511502
CancellationToken ct)
512503
{
513-
var options = new JsonDocumentOptions { MaxDepth = 16, CommentHandling = JsonCommentHandling.Skip, };
504+
var options = new JsonDocumentOptions { MaxDepth = 16, CommentHandling = JsonCommentHandling.Skip };
514505
await using var stream = schemaPart.GetStream(FileMode.Open, FileAccess.Read);
515506
return await JsonDocument.ParseAsync(stream, options, ct);
516507
}
@@ -525,7 +516,7 @@ private async Task WriteJsonPartAsync(
525516
var uri = PackUriHelper.CreatePartUri(new Uri(fileName, UriKind.Relative));
526517
var part = _package.CreatePart(uri, JsonMediaType);
527518

528-
var options = new JsonWriterOptions { Indented = true, MaxDepth = 16, };
519+
var options = new JsonWriterOptions { Indented = true, MaxDepth = 16 };
529520
await using var stream = part.GetStream(FileMode.Create);
530521
await using var writer = new Utf8JsonWriter(stream, options);
531522
document.WriteTo(writer);

src/Nitro/src/CommandLine/Legacy.Fusion/FusionGraphPackageConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static class FusionGraphPackageConstants
4343
/// <summary>
4444
/// Gets the file name of a GraphQL schema document.
4545
/// </summary>
46-
public const string SchemaFileName = "schema.graphql";
46+
public const string SchemaFileName = "schema.graphql";
4747

4848
/// <summary>
4949
/// Gets the relationship id of the root GraphQL schema document in a package.

0 commit comments

Comments
 (0)