From 09250198cdd7a7c13bc50664ef3c8b51bdc1ea8b Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sat, 19 Nov 2022 14:03:54 +0700 Subject: feat: Release v1.0.0 --- src/EndpointGenerator.cs | 81 +++--------------------------------------------- src/I2R.Endpoints.csproj | 13 +++++++- 2 files changed, 17 insertions(+), 77 deletions(-) diff --git a/src/EndpointGenerator.cs b/src/EndpointGenerator.cs index 58dbff6..c0b7c1b 100644 --- a/src/EndpointGenerator.cs +++ b/src/EndpointGenerator.cs @@ -1,5 +1,3 @@ -using System.Text; -using System.Text.Json; using System.Text.RegularExpressions; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -62,6 +60,7 @@ public class EndpointGenerator : ISourceGenerator private string GetSyncSource(string className, string namespaceName) { return $@" +{SourceGenereatedComment} namespace {namespaceName}; public static partial class SyncEndpoint {{ @@ -100,6 +99,7 @@ public static partial class SyncEndpoint private string GetAsyncSource(string className, string namespaceName) { return $@" +{SourceGenereatedComment} namespace {namespaceName}; public static partial class AsyncEndpoint {{ @@ -146,11 +146,11 @@ public static partial class AsyncEndpoint static string GetNamespace(BaseTypeSyntax syntax) { // If we don't have a namespace at all we'll return an empty string // This accounts for the "default namespace" case - string nameSpace = string.Empty; + var nameSpace = string.Empty; // Get the containing syntax node for the type declaration // (could be a nested type, for example) - SyntaxNode? potentialNamespaceParent = syntax.Parent; + var potentialNamespaceParent = syntax.Parent; // Keep moving "out" of nested classes etc until we get to a namespace // or until we run out of parents @@ -181,75 +181,4 @@ public static partial class AsyncEndpoint // return the final namespace return nameSpace; } -} - - -/* - public static class Req : BaseEndpoint - { - public abstract class Res : BaseEndpoint - { - public abstract Task HandleAsync( - TRequest request, - CancellationToken cancellationToken = default - ); - } - - public abstract class NoRes - { - public abstract Task HandleAsync( - TRequest request, - CancellationToken cancellationToken = default - ); - } - } - - public static class NoReq - { - public abstract class Res - { - public abstract Task HandleAsync( - CancellationToken cancellationToken = default - ); - } - - public abstract class NoRes - { - public abstract Task HandleAsync( - CancellationToken cancellationToken = default - ); - } - } - */ - -/* - public static class Req - { - public abstract class Res - { - public abstract TResponse Handle( - TRequest request - ); - } - - public abstract class NoRes - { - public abstract void Handle( - TRequest request - ); - } - } - - public static class NoReq - { - public abstract class Res - { - public abstract TResponse Handle(); - } - - public abstract class NoRes - { - public abstract void Handle(); - } - } - */ \ No newline at end of file +} \ No newline at end of file diff --git a/src/I2R.Endpoints.csproj b/src/I2R.Endpoints.csproj index c4d4c67..4948bed 100644 --- a/src/I2R.Endpoints.csproj +++ b/src/I2R.Endpoints.csproj @@ -2,7 +2,18 @@ net7.0 enable - + https://git.ivar.systems/dotnet-endpoints + https://git.ivar.systems/dotnet-endpoints/tree/COPYING + https://git.ivar.systems/dotnet-endpoints + git + 1.0.0 + I2R.Endpoints + Ivar Løvlie + A library that enables single file endpoints (or whatever). + Ivar Løvlie + + Initial realease. + -- cgit v1.3