dab 0.2.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

dab adds package dependencies to your pubspec, saving you a trip to pub.dev to look up the latest version.

setup #

Assuming the Dart SDK is available on your $PATH, to install (or update) the top-level dab command, run:

$ pub global activate dab

usage #

$ dab help
The dart+pub companion.  ヽ( •_)ᕗ

Usage: dab <command> [arguments]

Global options:
-h, --help         Print this usage information.
    --[no-]scp     Write ssh URLs with scp syntax.
                   (defaults to on)

-f, --filename     Pubspec file to edit
                   (defaults to "pubspec.yaml")

-n, --dry-run      Only print the modified pubspec, without overwriting the file.
-s, --[no-]sort    Sort list output alphabetically.
                   (defaults to on)

-u, --update       Run "pub get" with the new pubspec.

Available commands:
  add    Add a package dependency.
  help   Display help information for dab.
  rm     Remove a package from the pubspec.

Run "dab help <command>" for more information about a command.

known issues #

  • TODO: error handling
  • TODO: tests
  • It WILL eat the executables section, pending dart-lang/pubspec_parse#49.
  • It WILL eat comments.
  • It WILL sort dependencies alphabetically.

It's always a good idea review the changes: git diff pubspec.yaml.

hacking #

Run tool/gen_{once,watch} to update the generated code *.g.dart. This is idempotent.

see also #

0.2.1 #

  • fix crash parsing flutter fonts section

0.2.0 #

  • BREAKING subcommands dep, devdep became add [--dev]

0.1.0+2 #

  • pana fixes

0.1.0+1 #

  • fixed pubspec

0.1.0 #

  • initial release. Subcommands dep, devdep, rm.


usage #

$ dab add http
$ dab add --dev pedantic
$ dab rm json_serializable

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate dab

2. Use it

The package has the following executables:

$ dab

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  dab: ^0.2.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:dab/cmd.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.9+1

Analysis suggestions

Package not compatible with runtime flutter-web of web

Because of the import of dart:io via the import chain package:dab/cmd.dart->package:dab/src/cmd/remove.dart->package:dab/src/cmd/mixin.dart->dart:io

Package not compatible with runtime web

Because of the import of dart:io via the import chain package:dab/cmd.dart->package:dab/src/cmd/remove.dart->package:dab/src/cmd/mixin.dart->dart:io

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (json_annotation).


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
args ^1.5.2 1.6.0
build_cli_annotations ^1.1.0 1.2.0
http ^0.12.0 0.12.1
json_annotation ^2.0.0 2.4.0 3.0.1
logging ^0.11.3+2 0.11.4
pub_semver ^1.4.2 1.4.4
pubspec_parse ^0.1.4 0.1.5
yaml ^2.1.16 2.2.1
Transitive dependencies
charcode 1.1.3
checked_yaml 1.0.2
collection 1.14.13
http_parser 3.1.4
meta 1.1.8 1.2.0
path 1.7.0
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0
Dev dependencies
build_cli ^1.3.2
build_runner ^1.2.8
json_serializable ^3.0.0
pedantic ^1.0.0 1.9.0 1.9.1
test ^1.0.0