Skip to content

Commit

Permalink
feat: rename the project and update all files
Browse files Browse the repository at this point in the history
- AspNetCore.RestFramework.Core is now NDjango.RestFramework.
- AspNetCore.RestFramework.Core.Test is now NDjango.RestFramework.Test.
- Update start-tests.sh and start-sonarcloud.sh.
- Update all namespaces to match current configuration.
  • Loading branch information
willianantunes committed Sep 17, 2024
1 parent e7c615d commit bf7258d
Show file tree
Hide file tree
Showing 42 changed files with 83 additions and 80 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- name: Generate package
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
dotnet pack -o out -p:PackageVersion=$TAG_NAME
dotnet pack -c Release -o out -p:PackageVersion=$TAG_NAME
- name: Push package
run: |
dotnet nuget push out/*.nupkg \
--api-key ${{ secrets.PUBLIC_NUGET_API_KEY }} \
--source "https://api.nuget.org/v3/index.json" \
--skip-duplicate
--api-key $PUBLIC_NUGET_API_KEY \
--source "https://api.nuget.org/v3/index.json" \
--skip-duplicate
4 changes: 2 additions & 2 deletions AspNetCore.RestFramework.sln → NDjango.RestFramework.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31424.327
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.RestFramework.Core.Test", "tests\AspNetCore.RestFramework.Core.Test\AspNetCore.RestFramework.Core.Test.csproj", "{5C337F78-3254-477E-9937-42FD595F9733}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NDjango.RestFramework.Test", "tests\NDjango.RestFramework.Test\NDjango.RestFramework.Test.csproj", "{5C337F78-3254-477E-9937-42FD595F9733}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspNetCore.RestFramework.Core", "src\AspNetCore.RestFramework.Core\AspNetCore.RestFramework.Core.csproj", "{CA09285F-319F-459A-844D-9AF468C0ABF5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NDjango.RestFramework", "src\NDjango.RestFramework\NDjango.RestFramework.csproj", "{CA09285F-319F-459A-844D-9AF468C0ABF5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AspNetCore.RestFramework
# NDjango.RestFramework

AspNetCore REST Framework makes you focus on business, not on boilerplate code. It's designed to follow the famous Django's slogan "The web framework for perfectionists with deadlines." 🤺
NDjango Rest Framework makes you focus on business, not on boilerplate code. It's designed to follow the famous Django's slogan "The web framework for perfectionists with deadlines." 🤺

This is a copy of the convention established by [Django REST framework](https://github.com/encode/django-rest-framework), though translated to C# and adapted to the .NET Core framework.

Expand Down
11 changes: 7 additions & 4 deletions scripts/start-sonarcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

set -eu -o pipefail

PROJECT_KEY="juntossomosmais_NDjango.RestFramework"
ORGANIZATION="juntossomosmais"

# You should start the scanner prior building your project and running your tests
if [ -n "${PR_SOURCE_BRANCH:-}" ]; then
dotnet sonarscanner begin \
/d:sonar.login="$SONAR_TOKEN" \
/k:"juntossomosmais_AspNetCore.RestFramework" \
/o:"juntossomosmais" \
/k:"$PROJECT_KEY" \
/o:"$ORGANIZATION" \
/d:sonar.host.url="https://sonarcloud.io" \
/d:sonar.cs.opencover.reportsPaths="**/*/coverage.opencover.xml" \
/d:sonar.cs.vstest.reportsPaths="**/*/*.trx" \
Expand All @@ -18,8 +21,8 @@ else
dotnet sonarscanner begin \
/d:sonar.login="$SONAR_TOKEN" \
/v:"$PROJECT_VERSION" \
/k:"juntossomosmais_AspNetCore.RestFramework" \
/o:"juntossomosmais" \
/k:"$PROJECT_KEY" \
/o:"$ORGANIZATION" \
/d:sonar.host.url="https://sonarcloud.io" \
/d:sonar.cs.opencover.reportsPaths="**/*/coverage.opencover.xml" \
/d:sonar.cs.vstest.reportsPaths="**/*/*.trx" \
Expand Down
2 changes: 1 addition & 1 deletion scripts/start-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

dotnet test tests/AspNetCore.RestFramework.Core.Test \
dotnet test tests/NDjango.RestFramework.Test \
--configuration Release \
--logger trx \
--logger "console;verbosity=normal" \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AspNetCore.RestFramework.Core.Base;
namespace NDjango.RestFramework.Base;

public class ActionOptions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AspNetCore.RestFramework.Core.Filters;
using AspNetCore.RestFramework.Core.Serializer;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using AspNetCore.RestFramework.Core.Errors;
using AspNetCore.RestFramework.Core.Helpers;
using NDjango.RestFramework.Errors;
using NDjango.RestFramework.Filters;
using NDjango.RestFramework.Helpers;
using NDjango.RestFramework.Serializer;

namespace AspNetCore.RestFramework.Core.Base
namespace NDjango.RestFramework.Base
{
[Produces("application/json")]
public abstract class BaseController<TOrigin, TDestination, TPrimaryKey, TContext> : ControllerBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AspNetCore.RestFramework.Core.Base
namespace NDjango.RestFramework.Base
{
public abstract class BaseDto<TPrimaryKey>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace AspNetCore.RestFramework.Core.Base
namespace NDjango.RestFramework.Base
{
public abstract class BaseErrorResponse<TError>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq;
using Microsoft.EntityFrameworkCore;

namespace AspNetCore.RestFramework.Core.Base;
namespace NDjango.RestFramework.Base;

public class BaseFilter<TContext, TEntity>
where TContext : DbContext
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AspNetCore.RestFramework.Core.Base;
namespace NDjango.RestFramework.Base;

public static class BaseMessages
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AspNetCore.RestFramework.Core.Base;
namespace NDjango.RestFramework.Base;

public abstract class BaseModel<TPrimaryKey>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AspNetCore.RestFramework.Core.Base;
namespace NDjango.RestFramework.Base;

public interface IBaseModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AspNetCore.RestFramework.Core.Base
namespace NDjango.RestFramework.Base
{
public class PagedBaseResponse<TData>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using AspNetCore.RestFramework.Core.Base;
using System.Collections.Generic;
using System.Collections.Generic;
using NDjango.RestFramework.Base;

namespace AspNetCore.RestFramework.Core.Errors
namespace NDjango.RestFramework.Errors
{
public class UnexpectedError : BaseErrorResponse<string>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using AspNetCore.RestFramework.Core.Base;
using System.Collections.Generic;
using System.Collections.Generic;
using NDjango.RestFramework.Base;

namespace AspNetCore.RestFramework.Core.Errors
namespace NDjango.RestFramework.Errors
{
public class ValidationErrors : BaseErrorResponse<string[]>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using AspNetCore.RestFramework.Core.Errors;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using System.Linq;
using NDjango.RestFramework.Errors;

namespace AspNetCore.RestFramework.Core.Extensions
namespace NDjango.RestFramework.Extensions
{
public static class ModelStateValidationExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Http;
using System.Linq;

namespace AspNetCore.RestFramework.Core.Filters
namespace NDjango.RestFramework.Filters
{
public abstract class Filter<TEntity>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Microsoft.EntityFrameworkCore;
using System.Linq;
using AspNetCore.RestFramework.Core.Base;
using NDjango.RestFramework.Base;

namespace AspNetCore.RestFramework.Core.Filters
namespace NDjango.RestFramework.Filters
{
public class FilterBuilder<TContext, TEntity> : BaseFilter<TContext, TEntity>
where TContext : DbContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Linq;
using System.Linq.Expressions;

namespace AspNetCore.RestFramework.Core.Filters
namespace NDjango.RestFramework.Filters
{
public class QueryStringFilter<TEntity> : Filter<TEntity>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AspNetCore.RestFramework.Core.Base;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using System;
using System.Linq;
using NDjango.RestFramework.Base;

namespace AspNetCore.RestFramework.Core.Filters
namespace NDjango.RestFramework.Filters
{
public class QueryStringIdRangeFilter<TEntity, TPrimaryKey> : Filter<TEntity>
where TEntity : BaseModel<TPrimaryKey>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Linq.Expressions;
using System.Reflection;

namespace AspNetCore.RestFramework.Core.Filters
namespace NDjango.RestFramework.Filters
{
public class QueryStringSearchFilter<TEntity> : Filter<TEntity>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Linq.Expressions;

namespace AspNetCore.RestFramework.Core.Filters
namespace NDjango.RestFramework.Filters
{
public class SortFilter<TEntity>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Linq;
using System.Linq.Expressions;

namespace AspNetCore.RestFramework.Core.Helpers
namespace NDjango.RestFramework.Helpers
{
[JsonConverter(typeof(PartialJsonObjectConverter))]
public class PartialJsonObject<T> : PartialJsonObject where T : class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<!-- Version is configured in the build pipeline -->
<PackageId>AspNetCore.RestFramework</PackageId>
<PackageId>NDjango.RestFramework</PackageId>
<Authors>andresantarosa,fabio_almeida100,phmonte,ricardochaves,willianantunes</Authors>
<Description>Don't code a bunch of code to create CRUD applications. Use AspNetCore REST Framework, inspired by Django REST framework! It aims to provide a robust and flexible foundation for building RESTful APIs using ASP.NET Core.</Description>
<PackageLicenseUrl>https://github.com/juntossomosmais/AspNetCore.RestFramework/blob/master/LICENSE</PackageLicenseUrl>
<Description>Don't code a bunch of code to create CRUD applications. Use NDjango Rest Framework, inspired by Django REST framework! It aims to provide a robust and flexible foundation for building RESTful APIs using ASP.NET Core.</Description>
<PackageLicenseUrl>https://github.com/juntossomosmais/AspNetCore.RestFramework/blob/main/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/juntossomosmais/AspNetCore.RestFramework</RepositoryUrl>
<PackageTags>api rest drf django pagination crud</PackageTags>
<PackageTags>api rest drf django ndjango pagination crud</PackageTags>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace AspNetCore.RestFramework.Core.Serializer;
namespace NDjango.RestFramework.Serializer;

public class JsonTransform : DefaultContractResolver
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AspNetCore.RestFramework.Core.Base;
using AspNetCore.RestFramework.Core.Helpers;
using NDjango.RestFramework.Base;
using NDjango.RestFramework.Helpers;

namespace AspNetCore.RestFramework.Core.Serializer
namespace NDjango.RestFramework.Serializer
{
public class Serializer<TOrigin, TDestination, TPrimaryKey, TContext>
where TDestination : BaseModel<TPrimaryKey>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
using System.Text;
using System.Threading.Tasks;
using System.Web;
using AspNetCore.RestFramework.Core.Base;
using AspNetCore.RestFramework.Core.Errors;
using AspNetCore.RestFramework.Core.Test.Support;
using NDjango.RestFramework.Base;
using NDjango.RestFramework.Errors;
using NDjango.RestFramework.Test.Support;
using FluentAssertions;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using Xunit;

namespace AspNetCore.RestFramework.Core.Test.Base;
namespace NDjango.RestFramework.Test.Base;

public class BaseControllerTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Collections.Generic;
using System.Linq;
using AspNetCore.RestFramework.Core.Helpers;
using NDjango.RestFramework.Helpers;
using FluentAssertions;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;

namespace AspNetCore.RestFramework.Core.Test.Helpers;
namespace NDjango.RestFramework.Test.Helpers;

public class PartialJsonObjectTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\AspNetCore.RestFramework.Core\AspNetCore.RestFramework.Core.csproj" />
<ProjectReference Include="..\..\src\NDjango.RestFramework\NDjango.RestFramework.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;

namespace AspNetCore.RestFramework.Core.Test.Support;
namespace NDjango.RestFramework.Test.Support;

public class AppDbContext : DbContext
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using AspNetCore.RestFramework.Core.Base;
using AspNetCore.RestFramework.Core.Filters;
using AspNetCore.RestFramework.Core.Serializer;
using NDjango.RestFramework.Base;
using NDjango.RestFramework.Filters;
using NDjango.RestFramework.Serializer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace AspNetCore.RestFramework.Core.Test.Support;
namespace NDjango.RestFramework.Test.Support;

#region Controllers

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using AspNetCore.RestFramework.Core.Base;
using NDjango.RestFramework.Base;

namespace AspNetCore.RestFramework.Core.Test.Support;
namespace NDjango.RestFramework.Test.Support;

public class CustomerDocumentDto : BaseDto<Guid>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Bogus;
using Bogus.Extensions.Brazil;

namespace AspNetCore.RestFramework.Core.Test.Support;
namespace NDjango.RestFramework.Test.Support;

public static class FakeDataGenerator
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.IO;
using System.Linq;
using AspNetCore.RestFramework.Core.Extensions;
using AspNetCore.RestFramework.Core.Serializer;
using AspNetCore.RestFramework.Core.Test.Support;
using NDjango.RestFramework.Extensions;
using NDjango.RestFramework.Serializer;
using NDjango.RestFramework.Test.Support;
using FluentValidation;
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Builder;
Expand Down
Loading

0 comments on commit bf7258d

Please sign in to comment.