• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dart-lang / native / 13907892100

17 Mar 2025 07:11PM UTC coverage: 86.63% (-0.04%) from 86.67%
13907892100

push

github

web-flow
[native_assets_cli] Separate out `json_syntax_generator` into separate package (#2101)

Bug: https://github.com/dart-lang/native/issues/1826

This refactors `package:hook`s `tool/generate_syntax.dart`.

* Moved into its own package `package:json_syntax_generator`.
* Documented the feature set: optional/required fields, subclassing, tagged unions, and enums.
* Refactored from a single-pass code generator, to a two step pipeline. (1) analyze the JSON schema and extra into a data structure, (2) generate code from the data structure.
* Sprinkled comments about the "why" on the most important classes and fields.

This PR is intended to be a NOP w.r.t. the syntax that's generated. (Some whitespace and `toString` changes.)

Having this as a separate package will enable us to reuse it for the syntax in different places. For now, we're not intending to publish it, instead we can use it as a git dependency in the dev dependencies (or we publish it unlisted). @mosuem Please let me know if it is possible for you to generate the syntax for the `FontAsset`s.

Open issue:

* The generated code requires a `utils/json.dart`. We should make the generated code be standalone. I'll do that in a follow up PR.

0 of 8 new or added lines in 1 file covered. (0.0%)

2 existing lines in 1 file now uncovered.

13283 of 15333 relevant lines covered (86.63%)

36.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

67.93
/pkgs/native_assets_cli/lib/src/code_assets/syntax.g.dart


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc