diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2996a0b..5651a1b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,20 +10,34 @@ Thank you for helping. This guide applies to every DragoAnt repository that does ## Build and test -Most repositories import shared MSBuild files from a git submodule, so clone with submodules: +The shared build settings come from [MSBuildKit](https://github.com/DragoAnt/MSBuildKit), committed as plain files under `.toolkit/`, so a plain clone builds — no submodules, nothing restored from a private feed: ```sh -git clone --recurse-submodules https://github.com/DragoAnt/.git +git clone https://github.com/DragoAnt/.git ``` -Install the .NET SDK pinned in the repository's `global.json`, plus the runtimes of every target framework the projects list, then run the same steps as CI from the repository root: +Install the .NET SDK pinned in the repository's `global.json`, plus the runtimes of every target framework the projects list. `global.json` also selects Microsoft.Testing.Platform v2 as the test runner, so `dotnet test` takes the `.slnx` solution with `--solution`. From the repository root, run the same steps as CI: ```sh dotnet restore dotnet build -c Release --no-restore -dotnet test -c Release --no-build +dotnet test --solution .slnx -c Release --no-build ``` +Tests are xUnit v3 projects named `*.Tests`; the kit wires the test platform, coverage and reports into them. CI runs these steps through the shared [`dotnet-build.yml`](https://github.com/DragoAnt/.github/blob/main/.github/workflows/dotnet-build.yml) workflow, which also gates on coverage where the repository sets a threshold. + +### The build kit + +Don't edit `.toolkit/` by hand. Move to another kit release with its update script and commit the result in its own pull request: + +```sh +sh .toolkit/update.sh --version # or: pwsh .toolkit/update.ps1 -Version +``` + +Repository settings live next to it: `Directory.Build.props` (target frameworks, copyright), `Directory.Version.props` (the next release's `VersionPrefix`) and `Directory.Packages.props` (package versions). + +A repository that still has a `.sln` and no `.toolkit/` builds with the same three commands against its solution file; follow its own README where it differs. + ## Pull requests - Branch from the default branch and target it. @@ -35,7 +49,7 @@ dotnet test -c Release --no-build ## Releases -Maintainers publish packages to nuget.org by creating a GitHub release whose tag is the package version (`v1.2.3` or `v1.2.3-beta.1`). +Maintainers publish packages to nuget.org by creating a GitHub release whose tag is the package version (`v1.2.3` or `v1.2.3-beta.1`); the kit takes the version from the tag. Never push packages by hand. ## Code of conduct diff --git a/profile/README.md b/profile/README.md index 8a1da65..ba44e9f 100644 --- a/profile/README.md +++ b/profile/README.md @@ -1,22 +1,23 @@ # DragoAnt -Small, focused .NET libraries for System.Text.Json, Entity Framework Core and dependency injection — MIT-licensed and published on [nuget.org](https://www.nuget.org/profiles/DragoAnt). +Small, focused .NET libraries — MIT-licensed, published on [nuget.org](https://www.nuget.org/profiles/DragoAnt), built with one shared toolchain. ## Packages | Repository | What it is | NuGet | | --- | --- | --- | -| [Extensions.System.Text.Json](https://github.com/DragoAnt/Extensions.System.Text.Json) | Mask or extract JSON values by property-path rules in one streaming pass | [![NuGet](https://img.shields.io/nuget/v/DragoAnt.System.Text.Json.Observer?label=DragoAnt.System.Text.Json.Observer)](https://www.nuget.org/packages/DragoAnt.System.Text.Json.Observer) | -| [Extensions.EntityFrameworkCore](https://github.com/DragoAnt/Extensions.EntityFrameworkCore) | Conventions, static and historical migrations, entity definitions for EF Core | [![NuGet](https://img.shields.io/nuget/v/DragoAnt.EntityFrameworkCore?label=DragoAnt.EntityFrameworkCore)](https://www.nuget.org/packages/DragoAnt.EntityFrameworkCore) | -| [Extensions.DependencyInjection](https://github.com/DragoAnt/Extensions.DependencyInjection) | Extensions for `Microsoft.Extensions.DependencyInjection` | [![NuGet](https://img.shields.io/nuget/v/DragoAnt.Extensions.DependencyInjection?label=DragoAnt.Extensions.DependencyInjection)](https://www.nuget.org/packages/DragoAnt.Extensions.DependencyInjection) | -| [Shared](https://github.com/DragoAnt/Shared) | Common helpers, ASP.NET Core, CSV and Mermaid utilities | [![NuGet](https://img.shields.io/nuget/v/DragoAnt.Shared?label=DragoAnt.Shared)](https://www.nuget.org/packages/DragoAnt.Shared) | -| [Extensions.T4](https://github.com/DragoAnt/Extensions.T4) | Utilities for generating code with T4 templates | [![NuGet](https://img.shields.io/nuget/v/DragoAnt.Extensions.T4?label=DragoAnt.Extensions.T4)](https://www.nuget.org/packages/DragoAnt.Extensions.T4) | +| [Extensions.System.Text.Json](https://github.com/DragoAnt/Extensions.System.Text.Json) | Mask or extract JSON values by property-path rules in one streaming pass, no DOM. `Observer` for any JSON, `Observer.Http` for request/response bodies; ships [agent skills](https://github.com/DragoAnt/Extensions.System.Text.Json/blob/main/docs/skills.md) for AI coding assistants. | [![NuGet](https://img.shields.io/nuget/v/DragoAnt.System.Text.Json.Observer)](https://www.nuget.org/packages/DragoAnt.System.Text.Json.Observer) [![Downloads](https://img.shields.io/nuget/dt/DragoAnt.System.Text.Json.Observer)](https://www.nuget.org/packages/DragoAnt.System.Text.Json.Observer) | +| [SerilogSinksInMemory](https://github.com/DragoAnt/SerilogSinksInMemory) | Serilog in-memory sink for tests, with log assertions for FluentAssertions, AwesomeAssertions and Shouldly; `DragoAnt.Assertions` is the framework-agnostic adapter layer underneath. | [![NuGet](https://img.shields.io/nuget/v/DragoAnt.Serilog.Sinks.InMemory)](https://www.nuget.org/packages/DragoAnt.Serilog.Sinks.InMemory) [![Downloads](https://img.shields.io/nuget/dt/DragoAnt.Serilog.Sinks.InMemory)](https://www.nuget.org/packages/DragoAnt.Serilog.Sinks.InMemory) | +| [Extensions.DependencyInjection](https://github.com/DragoAnt/Extensions.DependencyInjection) | Source generator: attributes turn into `IServiceCollection` registrations and factories at compile time. | [![NuGet](https://img.shields.io/nuget/v/DragoAnt.Extensions.DependencyInjection)](https://www.nuget.org/packages/DragoAnt.Extensions.DependencyInjection) [![Downloads](https://img.shields.io/nuget/dt/DragoAnt.Extensions.DependencyInjection)](https://www.nuget.org/packages/DragoAnt.Extensions.DependencyInjection) | +| [Shared](https://github.com/DragoAnt/Shared) | Helpers for text building, CSV, ASP.NET Core and a C# builder for Mermaid flowcharts. | [![NuGet](https://img.shields.io/nuget/v/DragoAnt.Shared)](https://www.nuget.org/packages/DragoAnt.Shared) [![Downloads](https://img.shields.io/nuget/dt/DragoAnt.Shared)](https://www.nuget.org/packages/DragoAnt.Shared) | +| [Extensions.T4](https://github.com/DragoAnt/Extensions.T4) | Base class and helpers for runtime T4 templates with a typed data model. | [![NuGet](https://img.shields.io/nuget/v/DragoAnt.Extensions.T4)](https://www.nuget.org/packages/DragoAnt.Extensions.T4) [![Downloads](https://img.shields.io/nuget/dt/DragoAnt.Extensions.T4)](https://www.nuget.org/packages/DragoAnt.Extensions.T4) | +| [Extensions.EntityFrameworkCore](https://github.com/DragoAnt/Extensions.EntityFrameworkCore) | **Beta.** Static and historical migrations, entity conventions and entity definitions for EF Core (SQL Server, PostgreSQL). | [![NuGet](https://img.shields.io/nuget/vpre/DragoAnt.EntityFrameworkCore)](https://www.nuget.org/packages/DragoAnt.EntityFrameworkCore) [![Downloads](https://img.shields.io/nuget/dt/DragoAnt.EntityFrameworkCore)](https://www.nuget.org/packages/DragoAnt.EntityFrameworkCore) | -## Build tooling +## How the packages are built -- [MSBuildKit](https://github.com/DragoAnt/MSBuildKit) — build defaults, nuget.org-ready packaging, versioning from release tags, tests and coverage for .NET repositories. -- [MSBuild.Routine](https://github.com/DragoAnt/MSBuild.Routine) — the shared MSBuild files the DragoAnt repositories import as a submodule. -- [MonoRepo](https://github.com/DragoAnt/MonoRepo) — swaps `PackageReference` for `ProjectReference` to develop across several repositories at once. +[MSBuildKit](https://github.com/DragoAnt/MSBuildKit) [![Release](https://img.shields.io/github/v/release/DragoAnt/MSBuildKit)](https://github.com/DragoAnt/MSBuildKit/releases) — shared MSBuild settings committed as plain files: nuget.org-ready package metadata with build-time checks, versions from release tags, Microsoft.Testing.Platform tests with coverage. Extensions.System.Text.Json builds with it and the shared CI workflow in [DragoAnt/.github](https://github.com/DragoAnt/.github); the other repositories are moving over. + + ## Contributing