publican 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 45

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

dependencies:
  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

dependencies:
  angular_components: ^0.8.0
  angular: ^4.0.0+2

dev_dependencies:
  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
dependencies:
  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.

example/publican.dart

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));

  await runner.run(['init']);
}

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:


dependencies:
  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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
75
Overall:
Weighted score of the above. [more]
45
Learn more about scoring.

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

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:publican/publican.dart with components: io.

Health suggestions

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

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

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

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. (-14.52 points)

The package was last published 59 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args ^1.5.0 1.5.2
http ^0.11.3+17 0.11.3+17 0.12.0+2
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
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
test ^1.3.2
yaml ^2.1.13