pubspeccheck 0.1.1

  • Readme
  • Changelog
  • Installing
  • 47

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]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
47
Learn more about scoring.

We analyzed this package on Apr 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

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

Analysis of bin/pubspec.dart reported 4 hints:

line 15 col 16: Unnecessary new keyword.

line 20 col 22: Unnecessary new keyword.

line 35 col 16: Unnecessary new keyword.

line 107 col 19: Avoid empty catch blocks.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: parsing /dart-sdk/lib/async/async.dart... parsing /dart-sdk/lib/collection/collection.dart... parsing /dart-sdk/lib/internal/internal.dart... parsing /dart-sdk/lib/convert/convert.dart... parsing /dart-sdk/lib/typed_data/typed_data.dart... parsing /dart-sdk/lib/core/core.dart... parsing /dart-sdk/lib/math/math.dart... parsing /dart-sdk/lib/developer/developer.dart... parsing /dart-sdk/lib/isolate/isolate.dart... parsing /dart-sdk/lib/ffi/ffi.dart... parsing /dart-sdk/lib/html/dart2js/html_dart2js.dart... parsing /dart-sdk/lib/html/html_common/html_common_dart2js.dart... parsing /dart-sdk/lib/web_gl/dart2js/web_gl_dart2js.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/native_typed_data.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/interceptors.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_helper.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/foreign_helper.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_names.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/rti.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart... parsing /dart-sdk/lib/js_util/dart2js/js_util_dart2js.dart... parsing /dart-sdk/lib/html/html_common/metadata.dart... parsing /dart-sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart... parsing /dart-sdk/lib/svg/dart2js/svg_dart2js.dart... parsing /dart-sdk/lib/web_audio/dart2js/web_audio_dart2js.dart... parsing /dart-sdk/lib/web_sql/dart2js/web_sql_dart2js.dart... parsing /dart-sdk/lib/_http/http.dart... parsing /dart-sdk/lib/io/io.dart... parsing /dart-sdk/lib/js/dart2js/js_dart2js.dart... parsing /dart-sdk/lib/js/_js.dart... parsing /dart-sdk/lib/mirrors/mirrors.dart... parsing /dart-sdk/lib/html/dartium/nativewrappers.dart... parsing /dart-sdk/lib/cli/cli.dart... parsing /dart-sdk/lib/wasm/wasm.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_primitives.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart... Initialized dartdoc with 37 libraries in 29.2 seconds documenting pubspeccheck Validating docs... no issues found Documented 0 public libraries in 1.5 seconds stderr: Documenting pubspeccheck... Unhandled exception: dartdoc could not find any libraries to document #0 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:196:7)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args ^1.5.0 1.6.0
pub_client ^3.0.0 3.0.3
pub_semver ^1.4.2 1.4.4
pubspec_parse ^0.1.2+2 0.1.5
yaml ^2.1.15 2.2.0
Transitive dependencies
async 2.4.1
charcode 1.1.3
checked_yaml 1.0.2
collection 1.14.12
http 0.12.0+4
http_parser 3.1.4
json_annotation 2.4.0 3.0.1
meta 1.1.8
path 1.6.4
pedantic 1.9.0
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6