pubspeccheck 0.1.1

PubSpecCheck #

pub package

Utility to check the versions of packages in a pubspec.yaml file. Useful to see if there is a shift in major versions (ex: 0.7.0 to 0.8.0) so you can update your version rules inside the pubspec file.

Installation #

To install:

> pub global activate pubspeccheck

To update, run activate again:

> pub global activate pubspeccheck

Usage #

pubspec yourfile.yaml
pubspec -c yourfile.yaml
pubspec -a yourfile.yaml

Example #

If you run the utility on its own pubspec.yaml

> pubspec pubspec.yaml

You will get

[pubspec.yaml]
HostedDependency: ^2.1.15 => 2.1.15 	 yaml
HostedDependency: ^0.1.2+2 => 0.1.2+2 	 pubspec_parse
HostedDependency: ^3.0.0 => 3.0.2 	 pub_client
HostedDependency: ^1.5.0 => 1.5.0 	 args

If a major change is detected, it will give you the link to the changelog to see if there are any breaking changes. Here is an example:

--------- MAJOR DIFFERENCE ---------
Changelog: https://pub.dartlang.org/packages/flutter_inapp_purchase#-changelog-tab-
HostedDependency: 0.7.0 => 0.8.0         flutter_inapp_purchase
------------------------------------
HostedDependency: ^0.5.18 => 0.5.20      firebase_auth

Please note that if you don't use ^ in your yaml file, you will get a notification of a major difference as well.

--------- MAJOR DIFFERENCE ---------
Changelog: https://pub.dartlang.org/packages/flutter_inapp_purchase#-changelog-tab-
HostedDependency: 0.8.0 => 0.8.2         flutter_inapp_purchase
------------------------------------

Show all changelogs #

With the -c flag, all changelogs urls will be shown for packages where the versions are different from those found in the pubspec.yaml file.

With the -a flag, all changelogs will be shown, regardless of version numbers.

For example, when running this:

> pubspec -c pubspec.yaml

You might get something like:

------------------------------------
Changelog: https://pub.dartlang.org/packages/timeago#-changelog-tab-
HostedDependency: ^2.0.1 => 2.0.8        timeago

--------- MAJOR DIFFERENCE ---------
Changelog: https://pub.dartlang.org/packages/flutter_inapp_purchase#-changelog-tab-
HostedDependency: 0.8.0 => 0.8.2         flutter_inapp_purchase
------------------------------------
------------------------------------
No new version, no changelog needed
HostedDependency: ^0.3.2 => 0.3.2        package_info
------------------------------------

Notes #

There is little to no error handling of any kind, this is just a quick and dirty script 🙂

0.1.1 #

  • Checks for DEV dependencies

0.1.0 #

  • Version bump since everything seems fine for now

0.0.2 #

  • README fixes, code is the same

0.0.1 #

  • First version that can be run as a binary with command pubspec

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate pubspeccheck

2. Use it

The package has the following executables:


$ pubspec
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Jul 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Health suggestions

Fix bin/pubspec.dart. (-0.50 points)

Analysis of bin/pubspec.dart reported 1 hint:

line 107 col 19: Avoid empty catch blocks.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args ^1.5.0 1.5.2
pub_client ^3.0.0 3.0.3
pub_semver ^1.4.2 1.4.2
pubspec_parse ^0.1.2+2 0.1.4
yaml ^2.1.15 2.1.16
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.11
http 0.12.0+2
http_parser 3.1.3
json_annotation 2.4.0
meta 1.1.7
path 1.6.2
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6

Admin