Skip to content

[native_assets_cli] Reorganize extension schemas #2093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 17, 2025
Merged

[native_assets_cli] Reorganize extension schemas #2093

merged 3 commits into from
Mar 17, 2025

Conversation

dcharkes
Copy link
Collaborator

@dcharkes dcharkes commented Mar 11, 2025

Closes: #2085

This PR makes the code asset and data asset extension shared_definitions.schema.json only specify the schemas of the extensions. Not where they are applied in the base schema.

These extension definitions are then used to generate the syntax for the extensions, which means the syntax of the extensions no longer refers to the base protocol syntax. (The imports have disappeared.)

To document how the extension definitions extend the base protocol, this PR adds a code generator that generates the repetitive structure for combining the base protocol with the extension.

We're keeping these combined base + extension schemas because they are the best documentation for where the extensions fit on the base protocol. Also the schema tests keep using these.

@github-actions github-actions bot added type-infra A repository infrastructure change or enhancement package:hooks labels Mar 11, 2025
Copy link

PR Health

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/jni/lib/src/third_party/generated_bindings.dart
pkgs/objective_c/lib/src/ns_input_stream.dart

@dcharkes dcharkes requested review from mosuem and mkustermann March 11, 2025 20:12
@coveralls
Copy link

coveralls commented Mar 11, 2025

Coverage Status

coverage: 86.663% (-0.09%) from 86.751%
when pulling bae5f11 on subschemas
into 0cd2e55 on main.

@dcharkes dcharkes requested a review from jonasfj March 11, 2025 20:13
@dcharkes dcharkes marked this pull request as ready for review March 11, 2025 20:13
@dcharkes
Copy link
Collaborator Author

@jonasfj We decided to restructure slightly how extensions are modeled. PTAL.

@dcharkes dcharkes changed the title [native_assets_builder] Reorganize extension schemas [native_assets_cli] Reorganize extension schemas Mar 11, 2025
@dcharkes dcharkes requested a review from HosseinYousefi March 17, 2025 11:32
@dcharkes dcharkes merged commit 8abee90 into main Mar 17, 2025
38 checks passed
@dcharkes dcharkes deleted the subschemas branch March 17, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:hooks type-infra A repository infrastructure change or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[native_assets_cli] Should then protocol extension schemas not 'extend' the base schema?
3 participants