feat(mix_generator): generate spec stylers with parity coverage#923
Merged
Conversation
…ylerGenerator Extract deriveStylerName / extractSpecFields into shared field_model helpers (SpecGenerator and SpecStylerClassBuilder both call them now). SpecStylerClassBuilder: drop unused BuildStep field, emit @OverRide on each generated Prop<T>? field, collapse mixin/factory branch logic via _ownerMixinsForField, fail loudly via InvalidGenerationSource when a required mixin cannot be resolved from the spec library. MixinMethodCollector: name the public/concrete predicate. Add fail-loudly test + shared SpacingStyleMixin stub. Add logging dev dep used by SEVERE-log assertions. Drop unused painting.dart import from fixture; regenerate fixture .g.dart.
Switch auto_apply from 'dependents' to 'none'. Consumers must enable explicitly in their build.yaml. Documents the SharedPartBuilder import limitation in a yaml comment.
Switch from SharedPartBuilder to LibraryBuilder so the generated styler file owns its own imports. Single 'package:mix/mix.dart' import covers runtime symbols, style mixins, mix types, and exported spec types the generator references. Resolves audit finding F1 from .context/spec-styler-audit.md.
Standalone SpecStylerGenerator outputs now import package:mix/mix.dart, Flutter widget/foundation symbols, and the source spec file. This keeps generated styler libraries self-contained for test fixtures and specs that are not visible through the package barrel.
Generated styler now lives in box_spec_for_spike.styler.g.dart with its own imports. box_spec_for_spike.g.dart shrinks to just the SpecGenerator output. Equivalence test imports the sibling library directly; surface unchanged.
|
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
None.
Description
Adds the opt-in
SpecStylerGeneratorpipeline and cuts Mix specs over to generated.styler.g.dartstylers while preserving existing public styler behavior.Changes
MixableSpec/MixableFieldstyler metadata, generator builders, curated styler surface metadata, forwarder derivation, and widget-call helpers.Review Checklist
melos run gen:build,melos run analyze, andmelos run ci --no-select.Additional Information (optional)
The final cleanup keeps generated spec outputs byte-identical after regeneration.