Skip to content

Commit 9c5007f

Browse files
committed
1.0 wip
1 parent 1fc684c commit 9c5007f

9 files changed

+101
-415
lines changed

.nuget/README.html

+15-397
Large diffs are not rendered by default.

.nuget/README.md

+55-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
**Sisk** is a **web development framework** that is lightweight, agnostic, easy, simple, and robust. The perfect choice for your next project.
22

3-
- [Discover Sisk](https://sisk.project-principium.dev/)
4-
- [Documentation](https://md.proj.pw/sisk-http/docs-v2/main)
3+
- [Discover Sisk](https://www.sisk-framework.org/)
4+
- [Documentation](https://docs.sisk-framework.org/)
55
- [Changelogs](https://github.com/sisk-http/archive/tree/master/changelogs)
66
- [Benchmarks](https://github.com/sisk-http/benchmarks)
77

@@ -50,4 +50,56 @@ Sisk can do web development the way you want. Create MVC, MVVC, SOLID applicatio
5050

5151
## Read More
5252

53-
Read more about Sisk at it's [repository](https://github.com/sisk-http/) or [website](https://sisk.project-principium.dev/).
53+
Read more about Sisk at it's [repository](https://github.com/sisk-http/) or [website](https://www.sisk-framework.org/).**Sisk** is a **web development framework** that is lightweight, agnostic, easy, simple, and robust. The perfect choice for your next project.
54+
55+
- [Discover Sisk](https://www.sisk-framework.org/)
56+
- [Documentation](https://docs.sisk-framework.org/)
57+
- [Changelogs](https://github.com/sisk-http/archive/tree/master/changelogs)
58+
- [Benchmarks](https://github.com/sisk-http/benchmarks)
59+
60+
## Documentation
61+
62+
You can get started with Sisk [here](https://md.proj.pw/sisk-http/docs-v2/main/) or build the documentation repository [here](https://github.com/sisk-http/docs-v2).
63+
64+
For information about release notes, changelogs and API breaking changes, see [docs/Changelog.md](https://github.com/sisk-http/docs/blob/master/Changelog.md).
65+
66+
The Sisk core idea is to create a service that runs on the internet and follows the pattern you define. Moreover, Sisk is a framework that adapts to how you want it to work, not the other way around.
67+
68+
Due to its explicit nature, its behavior is predictable. The main differentiator from ASP.NET is that Sisk can be up and running in very few lines of code, avoiding unnecessary configurations, and requiring the minimum setup to get your server working. Additionally, it does not demand any additional .NET SDK packages to develop, as the base package of .NET 6 is sufficient to start your development with Sisk.
69+
70+
It can handle multiple requests asynchronously, provides useful tools to manage and accelerate web development.
71+
72+
```c#
73+
using Sisk.Core.Http;
74+
using Sisk.Core.Routing;
75+
76+
namespace myProgram;
77+
78+
class Program
79+
{
80+
static void Main(string[] args)
81+
{
82+
var app = HttpServer.CreateBuilder();
83+
84+
app.Router += new Route(RouteMethod.Get, "/", request =>
85+
{
86+
return new HttpResponse(200)
87+
.WithContent("Hello, world!");
88+
});
89+
90+
app.Start();
91+
}
92+
}
93+
```
94+
95+
## Main features
96+
97+
Sisk can do web development the way you want. Create MVC, MVVC, SOLID applications, or any other design pattern you're interested in.
98+
99+
- **Lightweight:** robust projects tested in small, low-cost, low-performance environments and got good results.
100+
- **Open-source:** the entire Sisk ecosystem is open source, and all the libraries and technologies we use must be open source as well. Sisk is entirely distributed under the MIT License, which allows the commercial development.
101+
- **Sustainable:** you are the one who makes the project, Sisk gives you the tools. Because it is open source, the community (including you) can maintain, fix bugs and improve Sisk over time.
102+
103+
## Read More
104+
105+
Read more about Sisk at it's [repository](https://github.com/sisk-http/) or [website](https://www.sisk-framework.org/).

src/Entity/StringValue.cs

+14
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,20 @@ public Guid GetGuid()
252252
}
253253
}
254254

255+
#if NET7_0_OR_GREATER
256+
/// <summary>
257+
/// Gets the current value parsed by the provided <see cref="IParsable{TSelf}"/> at <typeparamref name="T"/>.
258+
/// </summary>
259+
/// <typeparam name="T">The type where the conversion will result into.</typeparam>
260+
/// <param name="fmtProvider">Optional. An object that provides culture-specific formatting information about the current value.</param>
261+
/// <returns>The result of parsing the current string value.</returns>
262+
public T GetParsable<T>(IFormatProvider? fmtProvider = null) where T : IParsable<T>
263+
{
264+
ThrowIfNull();
265+
return T.Parse(_ref!, fmtProvider);
266+
}
267+
#endif
268+
255269
/// <summary>
256270
/// Gets an not null value from the specified <typeparamref name="T"/>.
257271
/// </summary>

src/Http/HttpServer.cs

+11
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ static HttpServer()
5151
SiskVersion = assVersion;
5252
}
5353

54+
/// <summary>
55+
/// Gets an <see cref="bool"/> indicating if Sisk can be used with the current environment.
56+
/// </summary>
57+
public static bool IsSupported { get => HttpListener.IsSupported; }
58+
59+
/// <summary>
60+
/// Gets an <see cref="bool"/> indicating if the current environment supports dynamic code or it's running in
61+
/// an AOT assembly.
62+
/// </summary>
63+
public static bool IsDynamicCodeSupported { get => System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported; }
64+
5465
/// <summary>
5566
/// Builds an <see cref="HttpServerHostContext"/> context invoking the handler on it.
5667
/// </summary>

src/Http/HttpServerExecutionResult.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ public enum HttpServerExecutionStatus
126126
/// <summary>
127127
/// Indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
128128
/// </summary>
129-
MalformedRequest,
130-
131-
/// <summary>
132-
/// Indicates that the HTTP request exceeded the maximum running time defined on <see cref="HttpServerFlags.RouteActionTimeout"/>.
133-
/// </summary>
134-
RequestTimeout
129+
MalformedRequest
135130
}
136131
}

src/Internal/SR.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static partial class SR
5353
public const string HttpRequestEventSource_KeepAliveDisposed = "Cannot keep alive an instance that has it's connection disposed.";
5454

5555
public const string Router_AutoScanModules_RequiresUnreferencedCode = "This method needs to search for types in your assembly, which can be trimmed in an AOT compilation.";
56-
public const string Router_AutoScanModules_TModuleSameAssembly = "When T is RouterModule and an input assembly is not specified, no routes will be added to the router.";
56+
public const string Router_AutoScanModules_TModuleSameAssembly = "The TModule generic type must be a type that implements RouterModule and not RouterModule itself.";
5757
public const string Router_Set_Collision = "A possible route collision could happen between route {0} and route {1}. Please review the methods and paths of these routes.";
5858
public const string Router_Set_Exception = "Couldn't set method {0}.{1} as an route. See inner exception.";
5959
public const string Router_Set_InvalidRouteStart = "Route paths must start with /.";

src/Routing/RouterModule.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Sisk.Core.Routing;
1313
/// Indicates that extended class supports router modules, which allows the management of routes,
1414
/// request handlers and prefixes.
1515
/// </summary>
16-
public class RouterModule
16+
public abstract class RouterModule
1717
{
1818
/// <summary>
1919
/// Gets or sets the request handlers this class has implemented.

src/Routing/Router__CoreSetters.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ public bool IsDefined(RouteMethod method, string path)
6565
[RequiresUnreferencedCode(SR.Router_AutoScanModules_RequiresUnreferencedCode)]
6666
public void AutoScanModules<TModule>(Assembly assembly, bool activateInstances = true) where TModule : RouterModule
6767
{
68-
if (!RuntimeFeature.IsDynamicCodeSupported)
68+
if (typeof(TModule) == typeof(RouterModule))
6969
{
70-
throw new NotSupportedException(SR.Router_AutoScanModules_RequiresUnreferencedCode);
70+
throw new InvalidOperationException(SR.Router_AutoScanModules_TModuleSameAssembly);
7171
}
7272
Type tType = typeof(TModule);
7373
var types = assembly.GetTypes();
@@ -110,10 +110,6 @@ Abstract classes should not be included on the router.
110110
[RequiresUnreferencedCode(SR.Router_AutoScanModules_RequiresUnreferencedCode)]
111111
public void AutoScanModules<TModule>() where TModule : RouterModule
112112
{
113-
if (typeof(TModule) == typeof(RouterModule))
114-
{
115-
throw new InvalidOperationException(SR.Router_AutoScanModules_TModuleSameAssembly);
116-
}
117113
AutoScanModules<TModule>(typeof(TModule).Assembly);
118114
}
119115

src/Sisk.Core.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<AssemblyVersion>1.0.0.0</AssemblyVersion>
3333
<FileVersion>1.0.0.0</FileVersion>
34-
<Version>1.0.0.0</Version>
34+
<Version>1.0.0.0-rc1</Version>
3535

3636
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
3737
<SignAssembly>False</SignAssembly>

0 commit comments

Comments
 (0)