lean_builder
1.2.2, released 3 months ago by codeness.ly
Lean Builder: a fast, efficient Dart build system for code generation
What it does
Lean Builder provides a streamlined alternative to the Dart build system, enabling fast incremental builds and hot reload for generators. It offers declarative builder configuration via annotations and supports shared part, library, and standard builders.
AI-written summary of version 1.2.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to create code generators with fast incremental builds
- You want a simpler, more performant alternative to build_runner
- You need watch mode with hot reload for generator development
Skip it when
- You require the full feature set of the official Dart build system
- Your project is already heavily dependent on build_runner and source_gen
Strengths
- Fast incremental builds
- Parallel processing for maximum efficiency
- Hot reload support in watch mode
- Simple declarative configuration using annotations
Weaknesses
- Not fully tested, active development
- Limited ecosystem compared to build_runner
- May lack some advanced features of the official build system
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 16
Add lean_builder as a dev_dependency in pubspec.yaml. Run commands like `dart run lean_builder build` or `dart run lean_builder watch`. No additional build_runner setup required.
```dart
@LeanGenerator({'.lib.dart'})
class MyGenerator extends GeneratorForAnnotatedClass<MyAnnotation> {
@override
Future<String> generateForClass(buildStep, element, annotation) async {
return '// Generated code for ${element.name}';
}
}
```Alternatives
Packages that do the same job and could replace lean_builder.
- build_runner
Standard, widely adopted build system with extensive ecosystem
93Compare - source_gen
Popular code generation library that works with build_runner
84Compare
Works with
Packages commonly used together with lean_builder: ones it builds on, ones built on it, and its own family.
- analyzerlean_builder depends on itPerforms static analysis of Dart code for tool integration and embedding.
- yamllean_builder depends on itA Dart library for parsing YAML documents into Dart data structures.
- stack_tracelean_builder depends on itProvides parsing, inspection, and readable formatting of Dart stack traces.
- globlean_builder depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- dart_stylelean_builder depends on itProvides an API and CLI to format Dart source code automatically.
- source_spanlean_builder depends on itStandard representation for source code locations, spans, and human-friendly error messages.
- watcherlean_builder depends on itMonitors file system changes and notifies when files are added, removed, or modified.
- frontend_server_clientlean_builder depends on itClient to interact with Dart SDK's frontend_server compiler.