Skip to content
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

Hybrid package incorrectly marked as Flutter-only #1351

Closed
dnys1 opened this issue Apr 3, 2024 · 2 comments · Fixed by celest-dev/celest#142
Closed

Hybrid package incorrectly marked as Flutter-only #1351

dnys1 opened this issue Apr 3, 2024 · 2 comments · Fixed by celest-dev/celest#142
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) type-enhancement A request for a change that isn't a bug

Comments

@dnys1
Copy link

dnys1 commented Apr 3, 2024

Related to: dart-lang/pub#3563

I recently published native_storage which is a hybrid package, capable of being used in Dart-only and Flutter contexts. It has no direct or transitive dependencies on the Flutter SDK.

It does, however, declare a flutter manifest in the pubspec.yaml for the cases in which the host project is a Flutter app:

https://github.com/celest-dev/celest/blob/32f3c44241468951e07470109f1dc4f1fc266283/packages/native/storage/pubspec.yaml#L45-L49

This causes pana to label the package as Flutter-only due to the following:

bool get usesFlutter =>
dependsOnFlutterSdk || dependsOnFlutterPackage || hasFlutterKey;

@sigurdm
Copy link
Contributor

sigurdm commented Apr 4, 2024

Yeah we don't have a good story for hybrid packages yet.

@sigurdm sigurdm added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) type-enhancement A request for a change that isn't a bug labels Apr 4, 2024
@dnys1
Copy link
Author

dnys1 commented May 29, 2024

A related issue to this is that if a Dart package depends on a package which contains an environment.flutter key, but does not itself have one, pub will allow the package to be published, but pana completely flips out:

https://pub.dev/packages/celest/score

Screenshot 2024-05-29 at 10 34 00 AM

dnys1 added a commit to celest-dev/celest that referenced this issue May 29, 2024
dnys1 added a commit to celest-dev/celest that referenced this issue May 29, 2024
dnys1 added a commit to celest-dev/celest that referenced this issue May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants