pubspec_update 0.1.0+1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new50

pubspec_update

Update dependencies in pubspec.yaml to their latest versions.

Installing

The recommended way to get this package is through pub global.

# installs `pubspec-update` (note the hyphen)
> pub global activate pubspec_update

Usage

Usage: pubspec-update [arguments] [directory]

arguments
-c, --confirm    Update packages without prompting the user for confirmation.
-f, --force      Equivalent to --upgrade --confirm.
-g, --get        Run `pub get` or `flutter packages get` on the package before processing.
-h, --help       Print this help message.
-s, --silent     Suppress all output.
-u, --upgrade    Run `pub upgrade` or `flutter packages upgrade` on the package before processing. Overrides --get.

Screenshot

confirm.png

How it works

pubspec-update only parses the dependencies and dev_dependencies blocks of pubspec.yaml. It looks only at packages with a version string on the same line as the package, including any and empty version strings.

# All of these will be processed.
dependencies:
  intl: ^0.15.0
  frogs: any
  transmogrify:
  angular: '>=4.0.0 <5.0.0'
dev_dependencies:
  test: ^1.0.0
# None of these will be processed
dependencies:
  intl:
    path: ../intl
  frogs:
    git: github.com/frog-database/frogs.git
  transmogrify:
    hosted:
      name: transmogrify
      url: http://some-package-server.com
    version: ^1.0.0
dev_dependencies:
  flutter_test:
    sdk: flutter

# Section ignored
dependency_overrides:

It will then read the .packages file to find the latest version of each package, creating the file if it doesn't exist. Using the --get or --upgrade arguments will first run pub get or pub upgrade (or flutter equivalent) before parsing the .packages file.

Safety first

Before making any changes, it will show the user exactly what will change and give them a change to abort.

Limitations

While it can read any version constraints (">=1.0.0 <2.0.0"), it always uses caret syntax (^1.0.0) when updating version constraint. This is because it is the most widely used format and because it is much harder to try and intelligently add min and max versions that consider pre-release and build suffixes.

Specifically, the exact version from .packages is prefixed with a caret (^) to become the new version.

[0.1.0+1] - September 30, 2018

  • Fix README install command.

[0.1.0] - September 30, 2018

  • First release.

example/main.dart

// import 'package:pubspec_update/pubspec_update.dart';

main() {

}

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate pubspec_update

2. Use it

The package has the following executables:


$ pubspec-update
Version Uploaded Documentation Archive
0.1.0+1 Sep 30, 2018 Go to the documentation of pubspec_update 0.1.0+1 Download pubspec_update 0.1.0+1 archive
0.1.0 Sep 30, 2018 Go to the documentation of pubspec_update 0.1.0 Download pubspec_update 0.1.0 archive
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 Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args ^1.5.0 1.5.0
colorize ^2.0.0 2.0.0
Dev dependencies
test ^1.3.3