|
| 1 | +# CreativeCoders.Core |
| 2 | + |
| 3 | +A collection of reusable .NET 10 libraries published as NuGet packages under the `CreativeCoders.*` namespace. Licensed under Apache 2.0. |
| 4 | + |
| 5 | +## Tech Stack |
| 6 | + |
| 7 | +- **Runtime:** .NET 10 (`net10.0`) |
| 8 | +- **Language:** C# (latest stable) |
| 9 | +- **SDK:** `10.0.100` (see `global.json`, rollForward: latestFeature) |
| 10 | +- **Build system:** Cake (Frosting) via `CreativeCoders.CakeBuild` — entry point is `build/Program.cs` |
| 11 | +- **Versioning:** GitVersion (ContinuousDeployment on `main`, ContinuousDelivery on feature branches) |
| 12 | +- **Package management:** Central Package Management (`Directory.Packages.props`) |
| 13 | +- **Testing:** xUnit, FakeItEasy, AwesomeAssertions, coverlet |
| 14 | +- **CI:** GitHub Actions (ubuntu, windows, macos) — workflows in `.github/workflows/` |
| 15 | +- **NuGet feed:** GitHub Packages (main builds), nuget.org (release builds) |
| 16 | + |
| 17 | +## Repository Layout |
| 18 | + |
| 19 | +``` |
| 20 | +Core.sln Solution file |
| 21 | +Directory.Build.props Shared MSBuild properties (TargetFramework, Authors) |
| 22 | +Directory.Packages.props Central NuGet version pins |
| 23 | +global.json SDK version constraint |
| 24 | +GitVersion.yml Versioning configuration |
| 25 | +build/ Cake Frosting build project |
| 26 | + Program.cs Build entry point (CakeHostBuilder) |
| 27 | + BuildContext.cs Build configuration (feeds, tools, settings) |
| 28 | +source/ Library source code (see below) |
| 29 | +tests/ Unit/integration test projects |
| 30 | +samples/ Sample applications |
| 31 | +.github/workflows/ CI/CD pipelines |
| 32 | +``` |
| 33 | + |
| 34 | +## Source Libraries |
| 35 | + |
| 36 | +| Area | Projects | Purpose | |
| 37 | +|------|----------|---------| |
| 38 | +| **Core** | `CreativeCoders.Core` | Ensure guards, collections, threading, enums, reflection, IO helpers, visitor pattern, object linking, dependency trees | |
| 39 | +| **AspNetCore** | `.AspNetCore`, `.Blazor`, `.TokenAuth.Jwt`, `.TokenAuthApi`, `.TokenAuthApi.Jwt` | ASP.NET Core extensions, Blazor helpers, JWT token auth | |
| 40 | +| **Cli** | `.Cli.Core`, `.Cli.Hosting` | CLI application framework with hosting support | |
| 41 | +| **SysConsole** | `.SysConsole.App`, `.Core`, `.Cli.Actions`, `.Cli.Parsing`, `.CliArguments` | Console applications with Spectre.Console, argument parsing, CLI actions | |
| 42 | +| **Data** | `.Data`, `.Data.EfCore`, `.Data.EfCore.SqlServer`, `.Data.Nhibernate`, `.Data.NoSql`, `.Data.NoSql.LiteDb` | Data access abstractions, EF Core, NHibernate, LiteDB | |
| 43 | +| **Net** | `.Net`, `.Net.Avm`, `.Net.JsonRpc`, `.Net.WebApi`, `.Net.XmlRpc`, `.Net.Servers.Http.AspNetCore` | Networking utilities, JSON-RPC, XML-RPC, WebApi client, HTTP server | |
| 44 | +| **Messaging** | `.Messaging.Core`, `.Messaging.DefaultMediator`, `.Messaging.DefaultMessageQueue` | In-process messaging, mediator pattern, message queues | |
| 45 | +| **Reactive** | `.Reactive.Messaging` | Reactive Extensions-based messaging | |
| 46 | +| **Config** | `.Config`, `.Config.Base`, `.Config.Sources` | Configuration abstraction layer | |
| 47 | +| **Configuration** | `.Configuration` | Microsoft.Extensions.Configuration integration | |
| 48 | +| **Options** | `.Options.Core`, `.Options.Serializers`, `.Options.Storage.FileSystem` | Options pattern with persistence | |
| 49 | +| **DependencyInjection** | `.DependencyInjection` | DI container extensions | |
| 50 | +| **Scripting** | `.Scripting.Base`, `.Scripting.CSharp` | C# scripting and source code generation | |
| 51 | +| **CodeCompilation** | `.CodeCompilation`, `.CodeCompilation.Roslyn` | Runtime code compilation via Roslyn | |
| 52 | +| **DynamicCode** | `.DynamicCode.Proxying` | Dynamic proxy generation (Castle.Core) | |
| 53 | +| **IO** | `.IO.Archives`, `.IO.Ports` | Archive handling, serial port abstractions | |
| 54 | +| **Localization** | `.Localization` | Microsoft.Extensions.Localization integration | |
| 55 | +| **Daemon** | `.Daemon`, `.Daemon.Linux`, `.Daemon.Windows` | Cross-platform daemon/service hosting (systemd, Windows Services) | |
| 56 | +| **ProcessUtils** | `.ProcessUtils` | Process execution utilities | |
| 57 | +| **UnitTests** | `.UnitTests` | Test helper library | |
| 58 | +| **CakeBuild** | `.CakeBuild` | Reusable Cake Frosting build tasks | |
| 59 | +| **NukeBuild** | `.NukeBuild`, `.NukeBuild.Components` | Nuke build system components | |
| 60 | + |
| 61 | +## Build & Test |
| 62 | + |
| 63 | +### Development |
| 64 | + |
| 65 | +Use standard `dotnet` commands for building, testing and restoring: |
| 66 | + |
| 67 | +```bash |
| 68 | +dotnet restore |
| 69 | +dotnet build |
| 70 | +dotnet test |
| 71 | +``` |
| 72 | + |
| 73 | +### Build Pipeline (Cake Frosting) |
| 74 | + |
| 75 | +The full CI pipeline uses Cake Frosting. These commands are intended for CI/CD and release workflows — not for day-to-day development: |
| 76 | + |
| 77 | +```bash |
| 78 | +./build.sh -t pack # Linux/macOS |
| 79 | +./build.cmd -t pack # Windows |
| 80 | +./build.sh -t test # Tests with coverage |
| 81 | +./build.cmd -t nugetpush # Full pipeline with NuGet push (CI only) |
| 82 | +``` |
| 83 | + |
| 84 | +Build targets are defined in `CreativeCoders.CakeBuild` and configured in `build/BuildContext.cs`. The build uses GitVersion for automatic semantic versioning and ReportGenerator for coverage reports (output: `.tests/coverage-report`). |
| 85 | + |
| 86 | +## CI/CD Workflows |
| 87 | + |
| 88 | +| Workflow | Trigger | Purpose | |
| 89 | +|----------|---------|---------| |
| 90 | +| `main.yml` | Push to `main` | Build, test, pack, push to NuGet (Linux pushes, Windows/macOS build+test only) | |
| 91 | +| `pull-request.yml` | PR to `main` | Build and test on all platforms | |
| 92 | +| `integration.yml` | Manual/schedule | Integration testing | |
| 93 | +| `release.yml` | Release event | Publish to nuget.org | |
| 94 | +| `dependabot-auto-merge.yml` | Dependabot PRs | Auto-merge dependency updates | |
| 95 | +| `sync-ai-config.yml` | Config sync | Synchronize AI configuration files | |
0 commit comments