feat(mix_schema): add Ack-backed styler schema contract package#928
Draft
leoafarias wants to merge 13 commits into
Draft
feat(mix_schema): add Ack-backed styler schema contract package#928leoafarias wants to merge 13 commits into
leoafarias wants to merge 13 commits into
Conversation
Make schema contract and registry builders single-use after freeze. Move invalid color and breakpoint payloads into constraint validation, clarify deferred Tailwinds scope, and keep merge-hardening simplifications covered by tests.
…ayloads Broaden mix_schema styler codecs and wire mix_tailwinds to emit schema-validated payloads for accepted utilities. - Box decoration codecs now cover border, borderRadius, shape, backgroundBlendMode, and boxShadow; box/flex_box/stack_box stylers gain transform and transformAlignment. - Add Matrix4, Offset, BorderSide, Border, BoxShadow, Shadow, and TextHeightBehavior codecs; text styler covers textHeightBehavior, textDirectives, and TextStyle shadows. - Rework box constraints with explicit min/max bound validation so inverted bounds and unbounded minimums fail with stable errors. - TwParser routes accepted utilities through mix_schema payloads via tw_schema_payload(_policy).dart and parse*Payload APIs; mix_schema becomes a production dependency of mix_tailwinds. - melos analyze/ci run with --no-select for non-interactive CI.
|
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
Pin TwParser resolved-spec behavior across every property family, borders, gradients, breakpoints, !important, transforms, and the variant/breakpoint x transform intersection. Asserts concrete Flutter values (Matrix4, colors, EdgeInsets) under forced widget states and width-controlled MediaQuery; styler ==/toString rejected as non-deterministic. Regression net for the parser de-duplication refactor.
Extract the duplicated-meaning phases shared by _parseFlexDirect and _parseBoxDirect into single owners, behavior-preserving: - _applyChildWithTransforms: breakpoint/variant transform propagation (copyTo/needsIdentity/flush), previously copy-pasted in two branches - _flushBaseTransforms: the finalize-transforms tail - _classifyTokens + _Accumulators: the per-token classify/accumulate loop; flex hasBaseFlex/column() kept explicit via an onToken hook Parallel-distinct code left untouched (property switches, variant maps). Border-side/shadow hoists not viable (Dart non-regular F-bound on the style mixins) and left inline. Verified: 414 tests pass (incl. 79-case oracle), analyze clean, 17->15 clones.
leoafarias
marked this pull request as draft
June 12, 2026 15:00
…n logic - Add baseTokenOutsideBrackets() helper to extract token segment after variant prefixes - Refactor findFirstColonOutsideBrackets() and findLastColonOutsideBrackets() to share common logic - Extract _applyAccumulatedBoxLikeDecorations() to reduce duplication in flex and box parsing - Add tests for new baseTokenOutsideBrackets() function - Replace inline token extraction logic with helper calls
Route _extractMargin through TwResolver so P/H/text-element margins match the parser's handling of scale, prefixed, and arbitrary values (e.g. mb-[10px], mb-[1rem]). Negative margins are skipped because Padding's RenderPadding asserts non-negative insets, so emitting them would crash. Replaces the hand-rolled scale-lookup chain with the shared resolver and adds regression tests for arbitrary and negative margins.
leoafarias
marked this pull request as ready for review
June 16, 2026 23:21
leoafarias
marked this pull request as draft
June 16, 2026 23:22
Extract parser, theme, and translate layers into separate directories, introduce typed tw_types, and add parser purity and variants test suites. Remove legacy schema payload and semantic files in favour of the new layout.
…sing - Route widget-layer utilities separately from schema values - Parse tokens through TailwindCandidateParser in widget layer - Expand variant/breakpoint routing with breakpoint-aware resolution - Add tests for div/span widget layer and candidate parser coverage - Update FLUTTER_ADAPTATIONS for hex colors and percent handling
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
N/A
Description
Adds
mix_schema, an Ack-backed package that encodes and decodes Mix stylers (box, text, flex, stack, icon, image, flex_box, stack_box) to validated JSON wire payloads through aMixSchemaContract, with stable public errors, payload limits, scoped registries, and a draft-07 JSON Schema export. It also wiresmix_tailwindsto route accepted utilities through these schema payloads via newparse*PayloadAPIs, makingmix_schemaa production dependency.Changes
mix_schemapackage:MixSchemaContract, per-styler codecs, variant codec, scoped registries, error mapper, payload limits, and JSON Schema export.transform/transformAlignment, text height behavior, text directives, text/box shadows, and validated box constraints (inverted/unbounded bounds fail with stable errors).mix_tailwindsemits schema-validated payloads for accepted utilities (parseBoxPayload/parseFlexPayload/parseTextPayload) and addstext-alignsupport; unsupported utilities stay parser diagnostics.analyze/cirun non-interactively with--no-select.Review Checklist
Additional Information (optional)
mix_schemamirrors pinned Ackflutter_codecshapes; the local mirrors are intended to be replaced byflutter_codecimports once that package merges (seepackages/mix_schema/REQUIREMENTS.md).