publican 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 33

publican Pub Package Build Status #

🧔 The package that will help you out with Dart's Pub 🎯

Getting started #

Bring publican to your global dependencies:

pub global activate publican

Commands #

I have an idea for a command

Documentation #

publican init #

Initializes a pubspec.yaml file.

mkdir my_awesome_app
cd  my_awesome_app
publican init

It will generate a pubspec.yaml file with the following defaults:

name: my_app
version: 0.1.0
description: My awesome Dart app

You can override default values throught the options:

-n, --name           (defaults to "my_app")
-v, --version        (defaults to "0.1.0")
-d, --description    (defaults to "My awesome Dart app")

Note: it will not override your current pubspec.yaml file, if you already have one, its safe.

publican add #

Adds a dependency to pubspec.yaml file.

publican add angular angular_components

Publican will already look for the latest stable version:

name: my_app
version: 0.1.0
description: My awesome Dart app

  angular_components: ^0.8.0
  angular: ^4.0.0+2

⚠️ Also, it will not change your previous YAML structure definitions, that is a key difference from Publican to other similar packages.

The --dev flag will add the dependencies to dev_dependencies key

publican add --dev build_runner build_web_compilers
name: my_app
version: 0.1.0
description: My awesome Dart app

  angular_components: ^0.8.0
  angular: ^4.0.0+2

  build_web_compilers: ^0.3.4+2
  build_runner: ^0.8.0

If you are not sure about the output, you can check it out before by adding the --dry-run flag, then it will print out what it would write.

You can also constraint a dependency to a specific version using an @ symbol:

publican add angular@^1.1.2+2

Want to try bleeding edge versions of you dependencies? Just add the -a or --alpha flag:

publican add -a angular
  angular: ^5.0.0-alpha+8

BSD 3-Clause License

Copyright (c) 2018, Leo Cavalcante All rights reserved.

0.2.0 #

  • Ready for Dart 2 and example added.


import 'dart:async';
import 'dart:io';

import 'package:args/command_runner.dart';
import 'package:publican/publican.dart';

Future<void> main() async {
  final File pubspec = new File('pubspec.yaml');

  final CommandRunner runner =
      new CommandRunner('publican_example', 'Publican example')
        ..addCommand(new InitCommand(pubspec))
        ..addCommand(new AddCommand(pubspec));


Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate publican

2. Use it

The package has the following executables:

$ publican

Use this package as a library

1. Depend on it

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

  publican: ^0.2.0

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:publican/publican.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 Jun 5, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Health suggestions

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

Analysis of bin/publican.dart reported 4 hints:

line 6 col 24: Unnecessary new keyword.

line 8 col 32: Unnecessary new keyword.

line 10 col 18: Unnecessary new keyword.

line 11 col 18: Unnecessary new keyword.

Fix lib/src/add.dart. (-1.49 points)

Analysis of lib/src/add.dart reported 3 hints:

line 52 col 7: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

line 62 col 32: Unnecessary new keyword.

line 77 col 9: Use isEmpty instead of length

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 (http).

Package is getting outdated. (-72.05 points)

The package was last published 89 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args ^1.5.0 1.6.0
http ^0.11.3+17 0.11.3+17 0.12.1
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.12
http_parser 3.1.4
meta 1.1.8
path 1.7.0
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
test ^1.3.2
yaml ^2.1.13