Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
* text=auto

*.cs text diff=csharp
*.razor linguist-language=C#
*.verified.cs text eol=lf working-tree-encoding=UTF-8
*.cshtml text diff=html
*.csx text diff=csharp
*.sln text eol=crlf
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- v[0-9]+.[0-9]+.[0-9]+
paths:
- src/**
- Directory.build.packages
- Directory.Packages.props
permissions:
id-token: write
contents: read
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Pull Request
permissions:
contents: read
on:
pull_request:
branches:
Expand All @@ -9,11 +11,13 @@ on:
- Directory.Packages.props
types:
- opened
- synchronize
- ready_for_review
- review_requested
jobs:
pull_request:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: Actions/Checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down
15 changes: 6 additions & 9 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
<NoWarn>$(NoWarn);CS8509;IDE0039;IDE0130;IDE0290;IDE0060;RZ10012;IDE0052;BL0007;NU5128;IDE0079;CS8424;IDE0305</NoWarn>
<WarningsAsErrors>$(WarningsAsErrors);RZ2012</WarningsAsErrors>
<MinVerTagPrefix>v</MinVerTagPrefix>
<MinVerDefaultPreReleaseIdentifiers>dev</MinVerDefaultPreReleaseIdentifiers>
</PropertyGroup>

<!-- Artifacts -->
Expand All @@ -19,18 +21,14 @@
<UseArtifactsOutput>true</UseArtifactsOutput>
</PropertyGroup>

<!-- Versioning -->
<PropertyGroup>
<NBGV_EmitThisAssemblyClass>true</NBGV_EmitThisAssemblyClass>
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
</PropertyGroup>

<!-- Repository -->
<PropertyGroup>
<Authors>Heretic Software</Authors>
<Copyright>Copyright (c) $([System.DateTimeOffset]::UtcNow.ToString("yyyy")) $(Authors)</Copyright>
<Year>2026</Year>
<Copyright>Copyright (c) $(Year) $(Authors)</Copyright>
<OrganizationUrl>https://www.github.com/HereticSoftware</OrganizationUrl>
<RepositoryUrl>$(OrganizationUrl)/Pipelines</RepositoryUrl>
<RepositoryName>Pipelines</RepositoryName>
<RepositoryUrl>$(OrganizationUrl)/$(RepositoryName)</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryLicense>MIT</RepositoryLicense>
<RepositoryDescription></RepositoryDescription>
Expand Down Expand Up @@ -59,5 +57,4 @@
<None Include="$(MSBuildThisFileDirectory)\README.md" Pack="True" PackagePath="\" Visible="False" />
<!--<None Include="$(MSBuildThisFileDirectory)\Icon.png" Pack="True" PackagePath="\" Visible="False" />-->
</ItemGroup>

</Project>
15 changes: 8 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<!-- Packagges -->

<ItemGroup>
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.5" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
<PackageVersion Include="PolySharp" Version="1.15.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.10" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.6.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.6.0" />
</ItemGroup>

<!-- Versioning & SourceLink -->
<ItemGroup>
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.201" />
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.9.50" />
<GlobalPackageReference Include="ThisAssembly.AssemblyInfo" Version="2.1.2" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.301" />
<GlobalPackageReference Include="MinVer" Version="7.0.0" />
</ItemGroup>
</Project>
9 changes: 4 additions & 5 deletions benchmark/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@

<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.10" />
</ItemGroup>

<!-- Mediator packages -->
<ItemGroup>
<PackageVersion Include="DispatchR.Mediator" Version="2.1.1" />
<PackageVersion Include="LiteBus.Queries.Extensions.Microsoft.DependencyInjection" Version="4.3.0" />
<PackageVersion Include="MediatR" Version="14.1.0" />
<PackageVersion Include="DispatchR.Mediator" Version="2.3.1" />
<PackageVersion Include="LiteBus.Queries.Extensions.Microsoft.DependencyInjection" Version="5.0.0" />
<PackageVersion Include="MediatR" Version="14.2.0" />
<PackageVersion Include="Mediator.Abstractions" Version="3.0.2" />
<PackageVersion Include="Mediator.SourceGenerator" Version="3.0.2" />
</ItemGroup>

</Project>
25 changes: 17 additions & 8 deletions cake.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#!
#:sdk Cake.Sdk
#:property ManagePackageVersionsCentrally=false
#:package Cake.GitVersioning@3.9.50
#:package NuGet.Protocol@7.3.1

var target = Argument<string>("target");
var nugetApiKey = EnvironmentVariable("NUGET_API_KEY", string.Empty);
var nugetSource = EnvironmentVariable("NUGET_SOURCE", string.Empty);

var configuration = "Release";
var version = GitVersioningGetVersion();
Information("Version: {0}, Configuration: {1}", version.SemVer2, configuration);
var version = ThisAssembly.Info.InformationalVersion;

DirectoryPath[] srcProjects = [
"src/Pipelines",
Expand All @@ -23,6 +20,8 @@
.. testProjects
];

Information("Pipelines Version {0} Configuration {1}", version, configuration);

var restore = Task("Restore")
.DoesForEach(projects, dir =>
{
Expand Down Expand Up @@ -83,8 +82,8 @@ .. testProjects
.IsDependentOn(testNuget);

var publish = Task("Publish")
.WithCriteria(!string.IsNullOrEmpty(nugetSource), "Environment variable `NUGET_API_KEY` was not provided")
.WithCriteria(!string.IsNullOrEmpty(nugetApiKey), "Environment variable `NUGET_SOURCE` was not provided")
.WithCriteria(() => !string.IsNullOrEmpty(nugetSource), "Environment variable `NUGET_API_KEY` was not provided")
.WithCriteria(() => !string.IsNullOrEmpty(nugetApiKey), "Environment variable `NUGET_SOURCE` was not provided")
.IsDependentOn(build)
.IsDependentOn(test)
.IsDependentOn(testNuget)
Expand All @@ -96,4 +95,14 @@ .. testProjects
DotNetNuGetPush("packages/*.nupkg", new() { Source = nugetSource, ApiKey = nugetApiKey });
});

RunTarget(target);
try
{
RunTarget(target);
}
catch (Exception ex)
{
if (((int)Context.Log.Verbosity) > 2)
AnsiConsole.WriteException(ex);
else
Error(ex.Message);
}
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"allowPrerelease": false
},
"msbuild-sdks": {
"Cake.Sdk": "6.1.1",
"Microsoft.Build.Traversal": "4.1.0",
"Cake.Sdk": "6.2.0",
"ViHo.PackAsAnalyzer": "1.0.1"
},
"test": {
Expand Down
2 changes: 1 addition & 1 deletion sample/Blazor/Blazor.Client/Pages/Counter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

private async Task IncrementCount()
{
current = await pipeline.Request.Execute(new IncrementCounterRequest(current.Count));
current = await pipeline.Request(new IncrementCounterRequest(current.Count));
}
}
2 changes: 1 addition & 1 deletion sample/Blazor/Blazor/Components/Pages/Weather.razor
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ else
{
forecasts ??= [];

await foreach (var forecast in pipeline.Stream.Execute(new GetWeatherForecasts(5)))
await foreach (var forecast in pipeline.Stream(new GetWeatherForecasts(5)))
{
forecasts = forecasts.Value.Add(forecast);
this.StateHasChanged();
Expand Down
2 changes: 1 addition & 1 deletion sample/Console/ProgramRequests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static async Task Run(CancellationToken ct = default)

var id = 10;
var request = new Ping(id);
var response = await pipeline.Request.Execute(request, ct);
var response = await pipeline.Request(request, ct);

Console.WriteLine($"""
-----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion sample/Console/ProgramStreams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static async Task Run(CancellationToken ct = default)

var id = 20;
var request = new Ping(id);
await foreach (var response in pipeline.Stream.Execute(request, ct))
await foreach (var response in pipeline.Stream(request, ct))
{
Console.WriteLine($"""
-----------------------------------
Expand Down
2 changes: 2 additions & 0 deletions sample/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />

<ItemGroup>
</ItemGroup>
</Project>
11 changes: 6 additions & 5 deletions sample/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

<ItemGroup>
<PackageVersion Include="FluentValidation" Version="12.1.1" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.6" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.6" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.6" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.0.14" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.10" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.16.16" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion sample/WebApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
app.UseHttpsRedirection();

app
.MapGet("/weatherforecast", (Pipeline pipeline, CancellationToken ct) => pipeline.Request.Execute(new GetWeatherForecasts(), ct))
.MapGet("/weatherforecast", (Pipeline pipeline, CancellationToken ct) => pipeline.Request(new GetWeatherForecasts(), ct))
.WithName("Get Weather Forecast")
.WithDescription("Uses the Pipeline (mediator) type to send a request, since the request implements the IRequest interface the method only needs a new Instance of the request type.");

Expand Down
5 changes: 5 additions & 0 deletions sample/sample.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project Sdk="Microsoft.Build.Traversal">
<ItemGroup>
<ProjectReference Include="**\**\*.*proj" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />

<ItemGroup>
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Packages.props, $(MSBuildThisFileDirectory)..))" />

<ItemGroup>
<PackageVersion Include="PolySharp" Version="1.16.0" />
</ItemGroup>
</Project>
10 changes: 5 additions & 5 deletions src/Pipelines.Generator/Extensions/SourceBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void AutoGeneratedCodeHeader()
const string header = $"""
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by the Pipelines.Generator v{ThisAssembly.AssemblyInformationalVersion} source generator.
// This code was generated by the Pipelines.Generator v{ThisAssembly.Info.InformationalVersion} source generator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
Expand Down Expand Up @@ -67,10 +67,10 @@ public void UsingSystemCodeDomCompiler()
/// </summary>
public void GeneratedCodeAttribute(bool full = false)
{
if (full)
sb.Line(sb, $"""[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Pipelines.Generator", "{ThisAssembly.AssemblyInformationalVersion}")]""");
else
sb.Line(sb, $"""[GeneratedCodeAttribute("Pipelines.Generator", "{ThisAssembly.AssemblyInformationalVersion}")]""");
const string f = $"""[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Pipelines.Generator", "{ThisAssembly.Info.InformationalVersion}")]""";
const string s = $"""[GeneratedCodeAttribute("Pipelines.Generator", "{ThisAssembly.Info.InformationalVersion}")]""";

sb.Line(full ? f : s);
}

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion src/Pipelines.Generator/Pipelines.Generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<IncludeSymbols>false</IncludeSymbols>
<IsRoslynComponent>true</IsRoslynComponent>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<NBGV_EmitThisAssemblyClass>true</NBGV_EmitThisAssemblyClass>
</PropertyGroup>

<!-- This ensures the library will be packaged as a source generator when we use `dotnet pack` -->
Expand Down
12 changes: 12 additions & 0 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />

<ItemGroup>
<PackageReference Include="TUnit" />
</ItemGroup>

<ItemGroup>
<Using Include="TUnit" />
<Using Include="TUnit.Core" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions test/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Packages.props, $(MSBuildThisFileDirectory)..))" />

<ItemGroup>
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.5" />
<PackageVersion Include="System.Linq.AsyncEnumerable" Version="10.0.5" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.10" />
<PackageVersion Include="System.Linq.AsyncEnumerable" Version="10.0.10" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
<PackageVersion Include="TUnit" Version="1.37.0" />
<PackageVersion Include="TUnit" Version="1.61.29" />
<PackageVersion Include="Verify.SourceGenerators" Version="2.5.0" />
<PackageVersion Include="Verify.TUnit" Version="31.16.1" />
<PackageVersion Include="Verify.TUnit" Version="31.27.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="System.Linq.AsyncEnumerable" />
<PackageReference Include="TUnit" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="System.Linq.AsyncEnumerable" />
<PackageReference Include="TUnit" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="TUnit" />
<PackageReference Include="Verify.TUnit" />
<PackageReference Include="Verify.SourceGenerators" />
</ItemGroup>
Expand Down
18 changes: 0 additions & 18 deletions version.json

This file was deleted.