dart-lang/pub

Pub should have a way to specify which platforms a package is intended for.

Closed this issue · 6 comments

If I implement a package (not a plugin) only in Dart, but it only makes sense to run it on a particular platform, there's no way to tell pub that this is the case.

For instance, if I implement a Dart package that talks to a Linux-only service, it only makes sense to run it on Linux, but when searching for packages, it will show up for people who aren't looking interested in Linux.

It would be good to be able to indicate which platforms a package "makes sense" on.

FFI (talking to system libraries, rather than something bundled) will be a common way of getting into the situation of having a Dart package that only works on some platforms.

Another use case is to override the transitive platform filtering that pub.dev does. E.g., a package that works on all platforms but uses a mobile-only plugin as part of its mobile implementation. If it could explicitly declare support for desktop and web, pub.dev wouldn't show incorrect badges.

Is this resolved by dart-lang/pana#889?

Yes, it seems like it does. I'm just not sure if pub.dev is respecting this already, but I believe it is.

I'm just not sure if pub.dev is respecting this already, but I believe it is.

It is; https://pub.dev/packages/xdg_directories is a live working example.