DevTools
coverage_manager Pro
- Tier
- Proversion 1.0.7
- Command
archipelago generate coverage_manager- Generates
devtools/scripts/coverage_manager
- Depends on
- monorepo_toolkitgenerate these first
Test coverage pipeline with configurable thresholds and exclusions. Adds the
coveragecommand (init/run/combine/check/full) to the basemonorepo_toolkit.
What it is / when to use it
A devtools CLI script (no DI, no app UI) — it registers a CoverageCommand with 5 subcommands in monorepo_toolkit's command_runner.dart, backed by a CoverageService that runs flutter test --coverage per package, merges the resulting lcov.info reports, and fails CI when combined coverage drops below a configured threshold. Requires the base monorepo_toolkit brick first.
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| appName | string | MyApp | The name of your application |
| isForMonorepo | boolean | true | Whether this is being generated as part of a monorepo |
Usage
Interactive
archipelago generate coverage_managerNon-interactive (CI)
archipelago generate coverage_manager --config my_config.jsonConfig Template
{
"@appName": "The name of your application",
"appName": "MyApp",
"@isForMonorepo": "Whether this is being generated as part of a monorepo",
"isForMonorepo": true
}Generated Structure
devtools/
└── scripts/
└── coverage_manager/
├── lib/
│ ├── coverage_manager.dart
│ └── src/
│ ├── commands/
│ │ ├── check_command.dart # coverage check — verify thresholds
│ │ ├── combine_command.dart # coverage combine — merge lcov reports
│ │ ├── coverage_command.dart # Parent `coverage` command, registers subcommands
│ │ ├── full_command.dart # coverage full — run + combine + check
│ │ ├── init_command.dart # coverage init — write coverage.yaml template
│ │ └── run_command.dart # coverage run — run tests with coverage
│ ├── models/
│ │ └── coverage_config.dart
│ └── services/
│ └── coverage_service.dart
└── pubspec.yamlCLI Usage
# Create a coverage.yaml config template at the workspace root
dart run monorepo_toolkit coverage init
# Run tests with coverage, optionally scoped to one package
dart run monorepo_toolkit coverage run --concurrency 4 --package features/auth/auth_impl
# Merge per-package lcov reports into one file
dart run monorepo_toolkit coverage combine --output coverage/lcov.info
# Verify combined coverage against coverage.yaml thresholds
dart run monorepo_toolkit coverage check
# Run + combine + check in one step (what CI typically calls)
dart run monorepo_toolkit coverage full --concurrency 4 --fail-fastrun and full both default --fail-fast to true and accept --concurrency/-j (default 1) for parallel per-package test execution.
How It Works
The post-generation hook:
- Adds the
coverage_managerpackage to the workspacepubspec.yaml - Adds the dependency to
monorepo_toolkit'spubspec.yaml - Injects
CoverageCommandintocommand_runner.dartat the// --- Pro Commands ---marker
Dependencies
monorepo_toolkit— must be generated first.shared_scripts— providesMonorepoFinder,CliLogger.
Changelog
Run archipelago brick info coverage_manager to see the latest published version. Enterprise customers can read the full CHANGELOG.md in the brick source repository.