Skip to content

Commit 33cf35c

Browse files
thomhurstclaude
andcommitted
docs: add module data sharing, analyzers, and conditional dependencies to README
- Add "Modules Share Data" section with code example showing typed data flow - Add "Catch Mistakes at Compile Time" section highlighting Roslyn analyzers - Add new features to "Features at a Glance": module data sharing, Roslyn analyzers, conditional dependencies, retry policies Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 97d4a0d commit 33cf35c

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,40 @@ Inject services, configuration, and secrets the same way you do in ASP.NET Core.
6060
### Secrets Stay Secret
6161
Secrets are automatically obfuscated in logs. No more accidentally exposing API keys in build output.
6262

63+
### Modules Share Data
64+
Modules return strongly-typed results that other modules can consume. No shared mutable state - just clean data flow.
65+
66+
```csharp
67+
// BuildModule returns version info
68+
public class BuildModule : Module<BuildInfo>
69+
{
70+
protected override async Task<BuildInfo?> ExecuteAsync(IModuleContext context, CancellationToken cancellationToken)
71+
{
72+
await context.DotNet().Build(new DotNetBuildOptions { Project = "MyApp.csproj" }, cancellationToken);
73+
return new BuildInfo { Version = "1.0.0", OutputPath = "bin/Release" };
74+
}
75+
}
76+
77+
// PublishModule retrieves and uses it
78+
[DependsOn<BuildModule>]
79+
public class PublishModule : Module
80+
{
81+
protected override async Task ExecuteAsync(IModuleContext context, CancellationToken cancellationToken)
82+
{
83+
var buildResult = await GetModule<BuildModule>();
84+
var outputPath = buildResult.Value!.OutputPath; // Strongly-typed, compile-time checked
85+
// Publish using the build output...
86+
}
87+
}
88+
```
89+
90+
### Catch Mistakes at Compile Time
91+
Built-in Roslyn analyzers catch common mistakes before you even run:
92+
- Missing `[DependsOn]` when calling `GetModule<T>()`
93+
- Circular dependencies between modules
94+
- Forgetting to `await` module results
95+
- Using `Console.Write` instead of the logging system
96+
6397
## [Full Documentation](https://thomhurst.github.io/ModularPipelines)
6498

6599
## Quick Start
@@ -174,13 +208,17 @@ ModularPipelines takes a different approach: each unit of work is a self-contain
174208
## Features at a Glance
175209

176210
- **Parallel execution** - Automatic based on declared dependencies
211+
- **Module data sharing** - Strongly-typed results flow between modules
212+
- **Roslyn analyzers** - Catch mistakes at compile time, not runtime
213+
- **Conditional dependencies** - `DependsOnIf<T>()` for dynamic dependency graphs
177214
- **Dependency management** - Circular dependency detection built-in
178215
- **Strong typing** - Pass data between modules with compile-time safety
179216
- **Debug locally** - Set breakpoints, inspect variables, fix issues before pushing
180217
- **Build agent agnostic** - Same code runs on GitHub, Azure, TeamCity, or your laptop
181218
- **Secret obfuscation** - Automatic masking in logs
182219
- **Hooks** - Run code before/after any module
183220
- **Skip conditions** - Dynamically skip modules based on custom logic
221+
- **Retry policies** - Configurable retry with Polly integration
184222
- **Requirements validation** - Check prerequisites before running
185223
- **Progress reporting** - Real-time console output with parallel execution visualization
186224
- **Source controlled** - Your pipeline is code, version it like code

README_Template.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,40 @@ Inject services, configuration, and secrets the same way you do in ASP.NET Core.
6060
### Secrets Stay Secret
6161
Secrets are automatically obfuscated in logs. No more accidentally exposing API keys in build output.
6262

63+
### Modules Share Data
64+
Modules return strongly-typed results that other modules can consume. No shared mutable state - just clean data flow.
65+
66+
```csharp
67+
// BuildModule returns version info
68+
public class BuildModule : Module<BuildInfo>
69+
{
70+
protected override async Task<BuildInfo?> ExecuteAsync(IModuleContext context, CancellationToken cancellationToken)
71+
{
72+
await context.DotNet().Build(new DotNetBuildOptions { Project = "MyApp.csproj" }, cancellationToken);
73+
return new BuildInfo { Version = "1.0.0", OutputPath = "bin/Release" };
74+
}
75+
}
76+
77+
// PublishModule retrieves and uses it
78+
[DependsOn<BuildModule>]
79+
public class PublishModule : Module
80+
{
81+
protected override async Task ExecuteAsync(IModuleContext context, CancellationToken cancellationToken)
82+
{
83+
var buildResult = await GetModule<BuildModule>();
84+
var outputPath = buildResult.Value!.OutputPath; // Strongly-typed, compile-time checked
85+
// Publish using the build output...
86+
}
87+
}
88+
```
89+
90+
### Catch Mistakes at Compile Time
91+
Built-in Roslyn analyzers catch common mistakes before you even run:
92+
- Missing `[DependsOn]` when calling `GetModule<T>()`
93+
- Circular dependencies between modules
94+
- Forgetting to `await` module results
95+
- Using `Console.Write` instead of the logging system
96+
6397
## [Full Documentation](https://thomhurst.github.io/ModularPipelines)
6498

6599
## Quick Start
@@ -151,13 +185,17 @@ ModularPipelines takes a different approach: each unit of work is a self-contain
151185
## Features at a Glance
152186

153187
- **Parallel execution** - Automatic based on declared dependencies
188+
- **Module data sharing** - Strongly-typed results flow between modules
189+
- **Roslyn analyzers** - Catch mistakes at compile time, not runtime
190+
- **Conditional dependencies** - `DependsOnIf<T>()` for dynamic dependency graphs
154191
- **Dependency management** - Circular dependency detection built-in
155192
- **Strong typing** - Pass data between modules with compile-time safety
156193
- **Debug locally** - Set breakpoints, inspect variables, fix issues before pushing
157194
- **Build agent agnostic** - Same code runs on GitHub, Azure, TeamCity, or your laptop
158195
- **Secret obfuscation** - Automatic masking in logs
159196
- **Hooks** - Run code before/after any module
160197
- **Skip conditions** - Dynamically skip modules based on custom logic
198+
- **Retry policies** - Configurable retry with Polly integration
161199
- **Requirements validation** - Check prerequisites before running
162200
- **Progress reporting** - Real-time console output with parallel execution visualization
163201
- **Source controlled** - Your pipeline is code, version it like code

0 commit comments

Comments
 (0)