Skip to content

Commit

Permalink
2.0 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Nov 27, 2023
1 parent 13d0ac4 commit 2fa01be
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 12 deletions.
4 changes: 2 additions & 2 deletions ProjectTemplates/ShinyApp/ShinyApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<ShinyVersion>3.1.2</ShinyVersion>
<ShinyVersion>3.2.-beta-0019</ShinyVersion>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
Expand Down Expand Up @@ -156,7 +156,7 @@
<PackageReference Include="Shiny.Push.FirebaseMessaging" Version="$(ShinyVersion)" />
<!--#endif-->
<!--#if (health)-->
<PackageReference Include="Shiny.Health" Version="1.0.0-beta-0013" />
<PackageReference Include="Shiny.Health" Version="1.0.0-beta-0018" />
<!--#endif-->
<!--#if (barcodes)-->
<PackageReference Include="ZXing.Net.Maui.Controls" Version="0.4.0" />
Expand Down
14 changes: 14 additions & 0 deletions ProjectTemplates/ShinyAspNet/EmptyResponseGlobalPostProcessor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// this is a temp hack to deal with swagger cs client gen where there is always a return on 200
namespace ShinyAspNet;


public class EmptyResponseGlobalPostProcessor : IGlobalPostProcessor
{
public async Task PostProcessAsync(IPostProcessorContext context, CancellationToken ct)
{
if (!context.HasValidationFailures && context.Response == null && context.HttpContext.Response.StatusCode == 200)
{
await context.HttpContext.Response.SendOkAsync(new { }, cancellation: ct);
}
}
}
20 changes: 15 additions & 5 deletions ProjectTemplates/ShinyAspNet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@
);
});
#endif

//-:cnd:noEmit
#if DEBUG
builder.Services.AddCors();
#endif
//+:cnd:noEmit
builder.Services.AddDbContext<AppDbContext>(
opts => opts.UseSqlServer(builder.Configuration.GetConnectionString("Main"))
);
Expand All @@ -132,10 +136,11 @@
builder.Services.AddScoped<JwtService>();
builder.Services.AddFastEndpoints();
//#if (swagger)
builder.Services.AddSwaggerDoc(x =>
builder.Services.AddSwaggerDocument(x =>
{
x.DocumentName = "v1";
}, shortSchemaNames: true);
//shortSchemaNames: true
});
//#endif
//#if (olreans)
builder.Host.UseOrleans(x => x
Expand All @@ -152,12 +157,16 @@
//#if (push)
app.MapPushEndpoints("push", true, x => x.User.FindFirstValue(ClaimTypes.NameIdentifier)!);
//#endif
app.UseFastEndpoints();
app.UseFastEndpoints(x => x.Endpoints.Configurator = ep =>
{
ep.PostProcessors(Order.After, new EmptyResponseGlobalPostProcessor());
});

//#if (signalr)
app.MapHub<BizHub>("/biz");
//#endif

//-:cnd:noEmit
#if DEBUG
// easier debugging
app.UseCors(x => x
Expand All @@ -167,6 +176,7 @@
//.AllowCredentials()
);
#endif
//+:cnd:noEmit

if (app.Environment.IsDevelopment())
{
Expand All @@ -176,7 +186,7 @@
// scope.ServiceProvider.GetRequiredService<AppDbContext>().Database.EnsureCreated();
// }
#if (swagger)
app.UseSwaggerGen();
app.UseSwaggerGen();
app.MapCSharpClientEndpoint("/cs-client", "v1", s =>
{
s.ClassName = "ApiClient";
Expand Down
2 changes: 1 addition & 1 deletion ProjectTemplates/ShinyAspNet/ShinyAspNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<OrleansVersion>7.2.3</OrleansVersion>
<!--#endif-->
<!--#if (email || push)-->
<ShinyExtensionsVersion>2.0.0-preview-0009</ShinyExtensionsVersion>
<ShinyExtensionsVersion>2.0.0-preview-0013</ShinyExtensionsVersion>
<!--#endif-->
</PropertyGroup>

Expand Down
9 changes: 6 additions & 3 deletions ProjectTemplates/XplatLib/XplatLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<TargetFrameworks>$(TargetFrameworks);{DOTNET_TFM}-android</TargetFrameworks>
<!--#endif-->
<!--#if (mauilib)-->
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<!--#endif-->
<Nullable>enable</Nullable>
Expand Down Expand Up @@ -44,8 +43,12 @@
<None Include="Platforms\**\*.cs" />
<Compile Remove="Platforms\**\*.cs" />

<PackageReference Include="NerdBank.GitVersioning" Version="3.5.109" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="NerdBank.GitVersioning" Version="3.6.133" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<!--#if (mauilib)-->
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.3" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.3" />
<!--#endif-->
<!--
<None Include="$(MSBuildThisFileDirectory)nuget.png" Pack="true" PackagePath="icon.png" />
<None Include="$(MSBuildThisFileDirectory)nuget.txt" Pack="true" PackagePath="readme.txt" />
Expand Down
2 changes: 1 addition & 1 deletion Template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>Shiny.NET Templates - One stop shop to setup almost everything you can imagine within your .NET MAUI application</Description>
<PackageType>Template</PackageType>
<PackageVersion>1.2.0</PackageVersion>
<PackageVersion>2.0.0-beta-0001</PackageVersion>
<PackageId>Shiny.Templates</PackageId>
<Title>Shiny Templates</Title>
<Authors>Allan Ritchie</Authors>
Expand Down

0 comments on commit 2fa01be

Please sign in to comment.