Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Aspire.Cli/Aspire.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
<Compile Include="$(SharedDir)UserSecrets\UserSecretsPathHelper.cs" Link="Utils\UserSecretsPathHelper.cs" />
<Compile Include="$(SharedDir)UserSecrets\IsolatedUserSecretsHelper.cs" Link="Utils\IsolatedUserSecretsHelper.cs" />
<Compile Include="$(SharedDir)UserSecrets\SecretsStore.cs" Link="Secrets\SecretsStore.cs" />
<Compile Include="$(SharedDir)Json\AtsJsonCodeWriter.cs" Link="Utils\AtsJsonCodeWriter.cs" />
<Compile Include="$(SharedDir)Json\JsonFlattener.cs" Link="Utils\JsonFlattener.cs" />
<Compile Include="$(SharedDir)Otlp\OtlpHelpers.cs" Link="Otlp\OtlpHelpers.cs" />
<Compile Include="$(SharedDir)Otlp\IOtlpResource.cs" Link="Otlp\IOtlpResource.cs" />
Expand Down
2 changes: 1 addition & 1 deletion src/Aspire.Cli/Commands/Sdk/SdkDumpCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Aspire.Cli.Projects;
using Aspire.Cli.Telemetry;
using Aspire.Cli.Utils;
using Aspire.TypeSystem;
using Aspire.Shared.Json;
using Microsoft.Extensions.Logging;
using Semver;
using Spectre.Console;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<EmbeddedResource Include="Resources\base.go" LogicalName="Aspire.Hosting.CodeGeneration.Go.Resources.base.go" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(SharedDir)Json\AtsJsonCodeWriter.cs" Link="AtsJsonCodeWriter.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Aspire.TypeSystem\Aspire.TypeSystem.csproj" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Aspire.Hosting.CodeGeneration.Go/AtsGoCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Reflection;
using System.Text;
using System.Text.Json.Nodes;
using Aspire.Shared.Json;
using Aspire.TypeSystem;

namespace Aspire.Hosting.CodeGeneration.Go;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<EmbeddedResource Include="Resources\Base.java" LogicalName="Aspire.Hosting.CodeGeneration.Java.Resources.Base.java" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(SharedDir)Json\AtsJsonCodeWriter.cs" Link="AtsJsonCodeWriter.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Aspire.TypeSystem\Aspire.TypeSystem.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Reflection;
using System.Text;
using System.Text.Json.Nodes;
using Aspire.Shared.Json;
using Aspire.TypeSystem;

namespace Aspire.Hosting.CodeGeneration.Java;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<EmbeddedResource Include="Resources\microvenv.py" LogicalName="Aspire.Hosting.CodeGeneration.Python.Resources.microvenv.py" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(SharedDir)Json\AtsJsonCodeWriter.cs" Link="AtsJsonCodeWriter.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Aspire.TypeSystem\Aspire.TypeSystem.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Reflection;
using System.Text;
using System.Text.Json.Nodes;
using Aspire.Shared.Json;
using Aspire.TypeSystem;

namespace Aspire.Hosting.CodeGeneration.Python;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<EmbeddedResource Include="Resources\base.rs" LogicalName="Aspire.Hosting.CodeGeneration.Rust.Resources.base.rs" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(SharedDir)Json\AtsJsonCodeWriter.cs" Link="AtsJsonCodeWriter.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Aspire.TypeSystem\Aspire.TypeSystem.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Reflection;
using System.Text;
using System.Text.Json;
using Aspire.Shared.Json;
using Aspire.TypeSystem;

namespace Aspire.Hosting.CodeGeneration.Rust;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

<ItemGroup>
<Compile Include="$(SharedDir)AppHostProfilePortGenerator.cs" Link="AppHostProfilePortGenerator.cs" />
<Compile Include="$(SharedDir)Json\AtsJsonCodeWriter.cs" Link="AtsJsonCodeWriter.cs" />
<Compile Include="$(SharedDir)NpmVersionHelper.cs" Link="NpmVersionHelper.cs" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Globalization;
using System.Reflection;
using System.Text.Json.Nodes;
using Aspire.Shared.Json;
using Aspire.TypeSystem;

namespace Aspire.Hosting.CodeGeneration.TypeScript;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
using System.Text.Json;
using System.Text.Json.Nodes;

namespace Aspire.TypeSystem;
namespace Aspire.Shared.Json;

/// <summary>
/// Provides JSON literal formatting helpers for generated ATS source code.
/// </summary>
public static class AtsJsonCodeWriter
internal static class AtsJsonCodeWriter
{
private static readonly JsonSerializerOptions s_relaxedJsonOptions = new()
{
Expand All @@ -20,15 +20,15 @@ public static class AtsJsonCodeWriter
/// <summary>
/// Formats a JSON node using relaxed escaping so non-ASCII content remains readable in generated source.
/// </summary>
public static string ToRelaxedJsonString(this JsonNode value)
internal static string ToRelaxedJsonString(this JsonNode value)
{
return value.ToJsonString(s_relaxedJsonOptions);
}

/// <summary>
/// Formats a string literal as JSON using relaxed escaping.
/// </summary>
public static string ToRelaxedJsonString(string value)
internal static string ToRelaxedJsonString(string value)
{
return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
}
Expand Down
Loading