Skip to content

Commit

Permalink
fix: added global usings to fix usings reordering on template generat…
Browse files Browse the repository at this point in the history
…ion (#38)

* fix: added global usings to fix usings reordering on template generation

* fix: rolling back to c#10

---------

Co-authored-by: Félix Perreault <perreault.felix@gmail.com>
  • Loading branch information
fperreaultnv and felixpp committed Apr 21, 2023
1 parent 92640e5 commit 9ea8f35
Show file tree
Hide file tree
Showing 32 changed files with 45 additions and 31 deletions.
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ use GitHub pull requests for this purpose. Consult [GitHub
Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

## Releasing a new version of the NV.Templates NuGet Package

To release a new version of the NV.Templates NuGet Package, the developer needs to create a tag on a commit.
The publish workflow pipeline will automatically kick in.

To do that :
- Go to the [releases page](https://github.com/nventive/DotNet.Backend.Template/releases/new)
- In **Choose a tag**, type in the tag name, starting with a **v** (ex: v2.5.3), and **Create new tag: v2.5.3**
- Choose your target branch (typically master)
- Type in the **Release Title** (same as the tag name)
- A quick description of the release, if necessary
- Choose options (pre-release or latest release)
- Click **Publish release**

After, you can check the [actions](https://github.com/nventive/DotNet.Backend.Template/actions) to see that the publish pipeline is executing properly.

When the pipeline completes, it can take a few minutes for the package to be available on NuGet.

To make the package available locally, you will need to reinstall the packages with DotNetCLI.

## Community Guidelines

This project follows [Google's Open Source Community
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Generated projects can:

- Install the templates locally
```shell
dotnet new install NV.Templates
dotnet new -i NV.Templates
```

### Generate a Backend project
Expand Down
2 changes: 1 addition & 1 deletion src/Content/Backend/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Authors>CompanyName</Authors>
<Copyright>Copyright (c) 2020, CompanyName</Copyright>
<Product>NV.Templates.Backend</Product>
<LangVersion>8.0</LangVersion>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using FluentAssertions;
using Microsoft.Extensions.Logging;
using Moq;
using NV.Templates.Backend.Console.General;
using NV.Templates.Backend.Core.General;
using Xunit;

namespace NV.Templates.Backend.Console.Tests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
global using NV.Templates.Backend.Console.General;
global using NV.Templates.Backend.Core.General;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using NV.Templates.Backend.Core.General;
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using Bogus;
using FluentAssertions;
using NV.Templates.Backend.Core.Framework.Continuation;
using Xunit;

namespace NV.Templates.Backend.Core.Tests.Framework.Continuation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using Bogus;
using FluentAssertions;
using NV.Templates.Backend.Core.Framework.Continuation;
using Xunit;

namespace NV.Templates.Backend.Core.Tests.Framework.Continuation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using NV.Templates.Backend.Core.Framework.Continuation;
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using NV.Templates.Backend.Core.Framework.DependencyInjection;

namespace NV.Templates.Backend.Core.General
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Security.Principal;
using Microsoft.Extensions.DependencyInjection;
using NV.Templates.Backend.Core.Framework.DependencyInjection;

namespace NV.Templates.Backend.Core.General
{
Expand Down
6 changes: 6 additions & 0 deletions src/Content/Backend/NV.Templates.Backend.Core/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
global using NV.Templates.Backend.Core.Configuration;
global using NV.Templates.Backend.Core.Framework.Continuation;
global using NV.Templates.Backend.Core.Framework.DependencyInjection;
global using NV.Templates.Backend.Core.Framework.HttpDependencies;
global using NV.Templates.Backend.Core.Framework.Json;
global using NV.Templates.Backend.Core.General;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using NV.Templates.Backend.Core.General;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using NV.Templates.Backend.Core.General;

namespace NV.Templates.Backend.Functions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using NV.Templates.Backend.Core.General;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using NV.Templates.Backend.Web.RestApi.General;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Threading.Tasks;
using FluentAssertions;
using Microsoft.AspNetCore.Http;
using NV.Templates.Backend.Web.RestApi.General;
using Refit;
using Xunit;
using Xunit.Abstractions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using NV.Templates.Backend.Core.Configuration;
using NV.Templates.Backend.Web.Framework.Middlewares;

namespace Microsoft.AspNetCore.Routing
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using NV.Templates.Backend.Core.Framework.Exceptions;
using NV.Templates.Backend.Core.General;

namespace NV.Templates.Backend.Web.Framework.Middlewares
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using NV.Templates.Backend.Core.General;

namespace NV.Templates.Backend.Web.Framework.Middlewares
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Linq;
using NV.Templates.Backend.Core.Framework.Continuation;

namespace NV.Templates.Backend.Web.Framework.Models
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using NV.Templates.Backend.Core.Framework.Continuation;

namespace NV.Templates.Backend.Web.Framework.Models
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
using NSwag;
using NSwag.Generation.Processors;
using NSwag.Generation.Processors.Contexts;
using NV.Templates.Backend.Web.Framework.Middlewares;
using NV.Templates.Backend.Web.Framework.Telemetry;

namespace NV.Templates.Backend.Web.Framework.OpenApi
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using NSwag;
using NSwag.Generation.Processors;
using NSwag.Generation.Processors.Contexts;
using NV.Templates.Backend.Web.Framework.Middlewares;

namespace NV.Templates.Backend.Web.Framework.OpenApi
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.Extensions.Configuration;
using NV.Templates.Backend.Core.General;
using NV.Templates.Backend.Web.Framework.Middlewares;
using NV.Templates.Backend.Web.Framework.OpenApi;

namespace Microsoft.Extensions.DependencyInjection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using HelpDeskId;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.Extensions.Configuration;
using NV.Templates.Backend.Web.Framework.Telemetry;

namespace Microsoft.Extensions.DependencyInjection
{
Expand Down
10 changes: 10 additions & 0 deletions src/Content/Backend/NV.Templates.Backend.Web/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
global using NV.Templates.Backend.Core.Configuration;
global using NV.Templates.Backend.Core.Framework.Continuation;
global using NV.Templates.Backend.Core.Framework.Exceptions;
global using NV.Templates.Backend.Core.Framework.Json;
global using NV.Templates.Backend.Core.General;
global using NV.Templates.Backend.Web.Framework.Middlewares;
global using NV.Templates.Backend.Web.Framework.Models;
global using NV.Templates.Backend.Web.Framework.OpenApi;
global using NV.Templates.Backend.Web.Framework.Telemetry;
global using NV.Templates.Backend.Web.RestApi;
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using NV.Templates.Backend.Core.General;

namespace NV.Templates.Backend.Web.RestApi.General
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.ComponentModel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NV.Templates.Backend.Core.General;

namespace NV.Templates.Backend.Web.RestApi.General
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#if Auth
using Microsoft.AspNetCore.Mvc.Authorization;
#endif
using NV.Templates.Backend.Core.Framework.Json;

namespace Microsoft.Extensions.DependencyInjection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.JsonPatch;
using Microsoft.AspNetCore.Mvc;
using NV.Templates.Backend.Core.Framework.Continuation;
using NV.Templates.Backend.Web.Framework.Models;

namespace NV.Templates.Backend.Web.RestApi
{
Expand Down
2 changes: 0 additions & 2 deletions src/Content/Backend/NV.Templates.Backend.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NV.Templates.Backend.Web.Framework.Middlewares;
using NV.Templates.Backend.Web.RestApi;

[assembly: ApiController]
[assembly: ApiConventionType(typeof(RestApiConventions))]
Expand Down

0 comments on commit 9ea8f35

Please sign in to comment.