pq / pub_crawl

Crawls, fetches and queries published pub packages. 🍻

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

skip packages w/ no sdk constraint

pq opened this issue · comments

Omitting the SDK constraint is now an error. When the pubspec has no SDK constraint, pub get will fail. As a general rule, fetch should skip those packages.

See: https://dart.dev/tools/pub/pubspec#sdk-constraints

/fyi @@jonasfj

fwiw @stereotype441 this would help filter out the bogus packages your fetch attempt was grabbing

It is still possible to consume such packages. They are not broken.

dart pub only requires an SDK constraint in the root package. And all newly published packages.
But you can still have a git or path dependency on something that doesn't have an SDK constraint.

Generally, no SDK constraint implies Dart 1.x (if i recall correctly).


You'll also see a problem for packages with no lower bound SDK constraint. I think the default inferred is 2.10, if one is missing, but again omitting it is only allowed for existing published packages, path and git dependencies. Root packages and new published packages must have a lower bound SDK constraint.