Repository navigation
v0.1
TinyPreprocessor v0.1.0 — Initial preview (2026-01-09)
A lightweight, extensible preprocessing library for .NET that resolves dependencies, merges resources, and generates source maps.
Highlights
- Recursive dependency resolution with cycle detection
- Extensible pipeline: bring your own directive parser, resource resolver, and merge strategy
- Source maps for tracing generated output back to original sources
- Diagnostics-first design with “continue on error” support
- Thread-safe concurrent
ProcessAsynccalls (isolated per-call state)
What’s included
- Core abstractions:
ResourceId,IResource,IDirective,IDirectiveParser<TDirective>,IResourceResolver - Preprocessor orchestrator:
Preprocessor<TDirective, TContext>.ProcessAsync(...) - Dependency graph:
ResourceDependencyGraph(cycle detection + topological ordering) - Diagnostics:
DiagnosticCollection+ built-in diagnostics for common failure modes - Source mapping:
SourceMap/SourceMapBuilderwith query support - Default merge strategy:
ConcatenatingMergeStrategy<TContext>(concatenation + directive stripping + line mappings)
Install
dotnet add package TinyPreprocessor --version 0.1.0
Requirements
- .NET 8+ (
net8.0)
Notes / Known limitations
DeduplicateIncludesis currently effectively always-on (resources are cached per call and won’t be merged multiple times, even if set tofalse).- If cycles are present, a circular-dependency diagnostic is emitted; merged output may be incomplete or not strictly dependency-correct.
Documentation
- See the docs folder in the repo: core abstractions, diagnostics, dependency graph, source mapping, merge system, and orchestrator design.