-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add analyzers and correct warnings
- Loading branch information
Showing
145 changed files
with
1,276 additions
and
983 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<AnalysisMode>All</AnalysisMode> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.9.28"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,121 @@ | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Hosting; | ||
using HotChocolate.Execution.Configuration; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.Data.Sqlite; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Nikcio.UHeadless.Content.Basics.Queries; | ||
using Nikcio.UHeadless.Content.Extensions; | ||
using Nikcio.UHeadless.Extensions; | ||
using Nikcio.UHeadless.Media.Basics.Queries; | ||
using Nikcio.UHeadless.Media.Extensions; | ||
using Nikcio.UHeadless.Members.Basics.Queries; | ||
using Nikcio.UHeadless.Members.Extensions; | ||
using Umbraco.Cms.Core; | ||
using Umbraco.Cms.Core.DependencyInjection; | ||
using Umbraco.Extensions; | ||
|
||
namespace Examples; | ||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args); | ||
|
||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
=> CreateHostBuilder(args) | ||
.Build() | ||
.Run(); | ||
|
||
public static IHostBuilder CreateHostBuilder(string[] args) => | ||
Host.CreateDefaultBuilder(args) | ||
.ConfigureUmbracoDefaults() | ||
.ConfigureWebHostDefaults(webBuilder => | ||
builder.CreateUmbracoBuilder() | ||
.AddBackOffice() | ||
.AddWebsite() | ||
.AddDeliveryApi() | ||
.AddComposers() | ||
.AddUHeadless(new() | ||
{ | ||
PropertyServicesOptions = new() | ||
{ | ||
PropertyMapOptions = new() | ||
{ | ||
PropertyMappings = [] | ||
}, | ||
}, | ||
TracingOptions = new() | ||
{ | ||
TimestampProvider = null, | ||
TracingPreference = HotChocolate.Execution.Options.TracingPreference.Never, | ||
}, | ||
UHeadlessGraphQLOptions = new() | ||
{ | ||
GraphQLExtensions = (IRequestExecutorBuilder builder) => | ||
{ | ||
webBuilder.UseStaticWebAssets(); | ||
webBuilder.UseStartup<Startup>(); | ||
}); | ||
builder.AddAuthorization(); | ||
|
||
builder.UseContentQueries(); | ||
builder.AddTypeExtension<BasicContentAllQuery>(); | ||
builder.AddTypeExtension<BasicContentAtRootQuery>(); | ||
builder.AddTypeExtension<BasicContentByAbsoluteRouteQuery>(); | ||
builder.AddTypeExtension<BasicContentByContentTypeQuery>(); | ||
builder.AddTypeExtension<BasicContentByGuidQuery>(); | ||
builder.AddTypeExtension<BasicContentByIdQuery>(); | ||
builder.AddTypeExtension<BasicContentByTagQuery>(); | ||
builder.AddTypeExtension<BasicContentDescendantsByAbsoluteRouteQuery>(); | ||
builder.AddTypeExtension<BasicContentDescendantsByContentTypeQuery>(); | ||
builder.AddTypeExtension<BasicContentDescendantsByGuidQuery>(); | ||
builder.AddTypeExtension<BasicContentDescendantsByIdQuery>(); | ||
|
||
builder.UseMediaQueries(); | ||
builder.AddTypeExtension<BasicMediaAtRootQuery>(); | ||
builder.AddTypeExtension<BasicMediaByContentTypeQuery>(); | ||
builder.AddTypeExtension<BasicMediaByGuidQuery>(); | ||
builder.AddTypeExtension<BasicMediaByIdQuery>(); | ||
|
||
builder.UseMemberQueries(); | ||
builder.AddTypeExtension<BasicMembersAllQuery>(); | ||
builder.AddTypeExtension<BasicFindMembersByDisplayNameQuery>(); | ||
builder.AddTypeExtension<BasicFindMembersByEmailQuery>(); | ||
builder.AddTypeExtension<BasicFindMembersByRoleQuery>(); | ||
builder.AddTypeExtension<BasicFindMembersByUsernameQuery>(); | ||
builder.AddTypeExtension<BasicMemberByEmailQuery>(); | ||
builder.AddTypeExtension<BasicMemberByIdQuery>(); | ||
builder.AddTypeExtension<BasicMemberByKeyQuery>(); | ||
builder.AddTypeExtension<BasicMemberByUsernameQuery>(); | ||
builder.AddTypeExtension<BasicMembersByIdQuery>(); | ||
return builder; | ||
}, | ||
}, | ||
}) | ||
.Build(); | ||
|
||
WebApplication app = builder.Build(); | ||
|
||
await app.BootUmbracoAsync().ConfigureAwait(false); | ||
|
||
app.UseAuthentication(); | ||
app.UseAuthorization(); | ||
|
||
|
||
app.MapUHeadlessGraphQLEndpoint(new() | ||
{ | ||
CorsPolicy = null, | ||
GraphQLPath = "/graphql", | ||
GraphQLServerOptions = new() | ||
{ | ||
Tool = | ||
{ | ||
Enable = true | ||
} | ||
} | ||
}); | ||
|
||
app.UseUmbraco() | ||
.WithMiddleware(u => | ||
{ | ||
u.UseBackOffice(); | ||
u.UseWebsite(); | ||
}) | ||
.WithEndpoints(u => | ||
{ | ||
u.UseInstallerEndpoints(); | ||
u.UseBackOfficeEndpoints(); | ||
u.UseWebsiteEndpoints(); | ||
}); | ||
|
||
await app.RunAsync().ConfigureAwait(false); | ||
|
||
public partial class Program | ||
{ | ||
private Program() | ||
{ | ||
|
||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.