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

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

Closed
gspencergoog opened this issue Mar 5, 2020 · 6 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@gspencergoog
Copy link

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.

@gspencergoog
Copy link
Author

/cc @stuartmorgan

@stuartmorgan
Copy link

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.

@jonasfj jonasfj added the type-enhancement A request for a change that isn't a bug label Mar 10, 2020
@stuartmorgan
Copy link

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.

@robert-ancell
Copy link

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

@azchohfi
Copy link

azchohfi commented Feb 7, 2022

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

@stuartmorgan
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants