pana icon indicating copy to clipboard operation
pana copied to clipboard

Hybrid package incorrectly marked as Flutter-only

Open dnys1 opened this issue 1 year ago • 1 comments

Related to: https://github.com/dart-lang/pub/issues/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:

https://github.com/dart-lang/pana/blob/375a861a566e7d08872cb2d6fe47ef83ab12486e/lib/src/pubspec.dart#L63-L64

dnys1 avatar Apr 03 '24 22:04 dnys1

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

sigurdm avatar Apr 04 '24 12:04 sigurdm

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 avatar May 29 '24 17:05 dnys1