Description
very_good create does not generate projects from the template bundled in the CLI. Instead it fetches the
brick from the hosted registry (brickhub.dev) using a caret constraint, falling back to the bundle only
when offline.
In create_subcommand.dart, _getGeneratorForTemplate():
final brick = Brick.version(
name: template.bundle.name,
version: '^${template.bundle.version}', // e.g. ^1.3.3
);
return await _generatorFromBrick(brick); // hosted fetch
// bundle is only used if the fetch throws
Because the constraint is a caret, ^1.3.3 resolves to the latest compatible published version. The CLI
currently bundles very_good_core 1.3.3 but generates 1.4.0.
Impact
- The version we ship and test is not the version users get.
- create output is non-deterministic — a template publish changes results with no CLI release.
- Our e2e tests (online) validate the latest published brick, not the committed bundle.
- An upstream template release can change/break create silently.
Proposed fix
Always generate from the embedded MasonBundle and remove the hosted brick fetch:
Future<MasonGenerator> _getGeneratorForTemplate() async {
return _generatorFromBundle(template.bundle);
}
This makes create deterministic, offline-first, and faster, and makes the CLI the single source of truth
for template output. Template updates are then delivered via a CLI release (regenerate bundles with
tool/generate_bundles.sh).
Steps To Reproduce
You can see this affecting issues like #1624
Expected Behavior
Notes / alternatives considered
- Exact-pin the brick constraint (version: template.bundle.version) keeps the hosted-fetch architecture
but in lockstep with the bundle. Rejected here in favor of the simpler, fully deterministic bundle-only
approach.
Description
very_good create does not generate projects from the template bundled in the CLI. Instead it fetches the
brick from the hosted registry (brickhub.dev) using a caret constraint, falling back to the bundle only
when offline.
In create_subcommand.dart, _getGeneratorForTemplate():
Because the constraint is a caret, ^1.3.3 resolves to the latest compatible published version. The CLI
currently bundles very_good_core 1.3.3 but generates 1.4.0.
Impact
Proposed fix
Always generate from the embedded MasonBundle and remove the hosted brick fetch:
This makes create deterministic, offline-first, and faster, and makes the CLI the single source of truth
for template output. Template updates are then delivered via a CLI release (regenerate bundles with
tool/generate_bundles.sh).
Steps To Reproduce
You can see this affecting issues like #1624
Expected Behavior
unused/tested).
Notes / alternatives considered
but in lockstep with the bundle. Rejected here in favor of the simpler, fully deterministic bundle-only
approach.