Anarchy.Toolkit.Build.Cli.Tool 1.0.0

Suggested Alternatives

Anarchy.Toolkit.Automation.Build.Cli

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global Anarchy.Toolkit.Build.Cli.Tool --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Anarchy.Toolkit.Build.Cli.Tool --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Anarchy.Toolkit.Build.Cli.Tool&version=1.0.0
                    
nuke :add-package Anarchy.Toolkit.Build.Cli.Tool --version 1.0.0
                    

Anarchy.Toolkit.Build.Cli.Tool

The anarchy-toolkit .NET global tool: bootstrap Anarchy-based solutions and scaffold APIs, jobs and UIs into them.

After the package is published to your configured NuGet feed, install and run it:

dotnet tool install --global Anarchy.Toolkit.Build.Cli.Tool
anarchy-toolkit

Without a command, the tool scaffolds into the solution in the current directory (or above), or bootstraps a new one if there is none.

Command What it does
anarchy-toolkit bootstrap Guided setup of a new solution.
anarchy-toolkit bootstrap <name> [--output <dir>] Creates the baseline solution without prompts, in an empty or new directory (default: the current one).
anarchy-toolkit scaffold Guided addition of an API, job or UI to the current solution.
anarchy-toolkit scaffold api\|job\|ui <Name> Adds one without prompts.

Bootstrap

The wizard asks for:

  1. the solution name;
  2. the output directory (default: the solution name under the current directory), which must be empty or not yet exist;
  3. how make check_layering finds each project's layer (see below);
  4. the layers, innermost first (default: Core, Infrastructure, Configuration, Hosting, Web). A library project is created per layer, each referencing the one below it;
  5. which kinds of application to start with, then a name for each one, as many as you like.

It then shows the plan, including each web application's local ports, and asks for confirmation before writing anything. Every solution also contains a Fallout build host, Makefile, scripts and configuration. Existing files are never overwritten; if a failure occurs after generation starts, inspect the destination before retrying.

Layering

By folder (default) By name prefix
Libraries src/Library/<Layer>/<Layer>.csproj src/<Layer>/<Layer>.csproj
API src/Api/<Name>, namespace Api.<Name> src/Web.Api.<Name>
Job src/Jobs/<Name>, namespace Jobs.<Name> src/Hosting.Job.<Name>
UI src/Ui/<Name>, namespace Ui.<Name> src/Web.Ui.<Name>

APIs and UIs belong to the Web layer and jobs to the Hosting layer; each references its layer's library. The layering settings are written to .fallout/parameters.json (LayeringLayers, LayeringByFolder, LayeringRoot and, by folder, LayeringApplicationFolders), where CheckLayering and anarchy-toolkit scaffold read them.

Applications

Kind Built on
API Anarchy.Toolkit.Web: REST API with JWT authorization and a /ping endpoint
Job Anarchy.Toolkit.Hosting: job entry point (e.g. an AWS Lambda handler) and service
UI Anarchy.Toolkit.Web.Ui: Blazor UI with cookie-session login and a home page

Applications are not packable, so Pack ignores them. Web applications get local ports from 5000 upwards, two per application, skipping ports already used in the solution. Review each application's settings (auth service URLs, client IDs and scopes) before running it.

Scaffold

Run anarchy-toolkit scaffold anywhere inside a solution created by bootstrap (or any solution whose .fallout/parameters.json names its solution file). It places the application according to the solution's layering settings, refuses names already used by a project, and adds it to the solution.

Requirements

The .NET 10 SDK is required to generate and build solutions. The generated projects reference the Anarchy.Toolkit.Build.Fallout, Anarchy.Toolkit.Web, Anarchy.Toolkit.Web.Ui and Anarchy.Toolkit.Hosting versions this tool was built with, which must be available on a configured NuGet feed. The generated nuget.config uses nuget.org by default; adjust it if using a private feed.

When releasing the tool, publish those packages first and wait for them to be available on the feed. A .NET tool declares no NuGet dependencies, so package dependency ordering alone does not enforce this.

To try the build (Bash and Make required):

cd MyApp
make compile
make check_layering

The bootstrapping and scaffolding live in Anarchy.Toolkit.Build.Cli; see the Fallout package README for the build targets.

Releases

1.0.0

  • Introduced the anarchy-toolkit tool with the bootstrap and scaffold commands, configurable layering, and API, job and UI templates.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Initial release.