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.

example/example.md

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:


dependencies:
  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';
  
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]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Platform components identified in package: 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).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
args ^1.5.2 1.5.2
build_cli_annotations ^1.1.0 1.1.0
http ^0.12.0 0.12.0+2
json_annotation ^2.0.0 2.4.0 3.0.0
logging ^0.11.3+2 0.11.3+2
pub_semver ^1.4.2 1.4.2
pubspec_parse ^0.1.4 0.1.5
yaml ^2.1.16 2.2.0
Transitive dependencies
async 2.4.0
charcode 1.1.2
checked_yaml 1.0.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.7
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_cli ^1.3.2
build_runner ^1.2.8
json_serializable ^3.0.0
pedantic ^1.0.0 1.8.0+1
test ^1.0.0