puma 0.6.3

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

pipeline status coverage report Pub

A simple cli tool to manage your project.

Dependencies management #

Install dependencie #

You can easily add package with puma.

puma package -i mongo_dart

Like that puma will automatically get the latest version of the package.

If you want a specific version of you package you specify the version like that

puma package -i mongo_dart:0.0.1

If you need to reference a package locally you can do

puma package -i ./mongo_dart

Add a dependencie to the dev_dependencies #

To add a dev dependencie you can add --dev to the command

puma package -i build_runner:^1.0.0 --dev

Remove dependencie #

To remove a dependencie you can do like that

puma package -d mongo_dart

Version management #

puma help you manage version management.

Breaking change #

If you do a breaking change in your project just run

puma version --breaking

To bump the version of your package.

Major change #

If you just need to bump the major version of your package you can do

puma version --major

Minor change #

If you just need to bump the minor version of your package you can do

puma version --minor

Patch change #

If you just need to bump the patch version of your package you can do

puma version --patch

Flutter management #

Add asset #

You can add Flutter asset by using this command

This will add one file :

puma flutter assets --add lib/main.dart

And this will add the entire folder :

puma flutter assets --add lib

0.6.1 #

  • add basic doc

0.6.0 #

  • add lot of test for the common path

0.5.2 #

  • remove debug

0.5.1 #

  • fix parsing local package
  • re-add bump version for major, minor and patch

0.5.0 #

  • refactor all the package
  • see the readme on how to use it due to lot of breaking change

0.4.3 #

  • fix indentation in yaml

0.4.2 #

  • add add-flutter-asset to the README
  • update CHANGELOG

0.4.1 #

  • fix usage

0.4.0 #

  • Add add-flutter-asset parameters

0.3.0 #

  • improve README.md
  • add run pub get as a command puma get

0.1.0 #

  • Initial version, created by Stagehand

example/example.dart

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

import 'package:puma/puma.dart';
import 'package:http/io_client.dart';
import 'package:yaml/yaml.dart' as yaml;

Future<void> main(List<String> args) async {
  final pubspecFile = File('pubspec.yaml');
  final pubspecContent = await pubspecFile.readAsString();
  PumaCommander(
    pubspecContent,
    IOClient(),
    getLocalPackageName,
    getAssetsList,
  )
    ..pubspec.listen((content) {
      pubspecFile.writeAsStringSync(content, mode: FileMode.write);
    })
    ..print.listen(print)
    ..needPubGet.listen((_) async {
      await pubGet();
    })
    ..run(args);
}

Future<String> getLocalPackageName(String path) async {
  final pubspecPath = '${path}pubspec.yaml';
  final otherPubspec = File(pubspecPath);
  final pubspecExist = await otherPubspec.exists();
  if (pubspecExist) {
    final otherYaml =
        yaml.loadYaml(await otherPubspec.readAsString()) as yaml.YamlMap;
    return otherYaml['name'];
  }
  return null;
}

Future<List<String>> getAssetsList(String path) async {
  final isDirectory = await FileSystemEntity.isDirectory(path);
  if (isDirectory) {
    final d = Directory(path);
    final paths = d.listSync(recursive: true)
      ..removeWhere((e) => e.statSync().type != FileSystemEntityType.file);
    final newAssets = paths.map((entity) => entity.path).toList();
    newAssets;
  }
  return [path];
}

Future<void> pubGet() async {
  final process = await Process.start('pub', ['get']);
  process.stdout.transform(utf8.decoder).listen(stdout.write);
}

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate puma

2. Use it

The package has the following executables:


$ puma

Use this package as a library

1. Depend on it

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


dependencies:
  puma: ^0.6.3

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:puma/puma.dart';
  
Version Uploaded Documentation Archive
0.6.3 Jan 13, 2019 Go to the documentation of puma 0.6.3 Download puma 0.6.3 archive
0.6.2 Jan 12, 2019 Go to the documentation of puma 0.6.2 Download puma 0.6.2 archive
0.6.1 Jan 10, 2019 Go to the documentation of puma 0.6.1 Download puma 0.6.1 archive
0.6.0 Jan 10, 2019 Go to the documentation of puma 0.6.0 Download puma 0.6.0 archive
0.5.2 Jan 9, 2019 Go to the documentation of puma 0.5.2 Download puma 0.5.2 archive
0.5.1 Jan 9, 2019 Go to the documentation of puma 0.5.1 Download puma 0.5.1 archive
0.5.0 Jan 8, 2019 Go to the documentation of puma 0.5.0 Download puma 0.5.0 archive
0.4.3 Jan 7, 2019 Go to the documentation of puma 0.4.3 Download puma 0.4.3 archive
0.4.2 Jan 7, 2019 Go to the documentation of puma 0.4.2 Download puma 0.4.2 archive
0.4.1 Jan 7, 2019 Go to the documentation of puma 0.4.1 Download puma 0.4.1 archive

All 14 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
49
Learn more about scoring.

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

  • Dart: 2.3.1
  • pana: 0.12.17

Platforms

Detected platforms: Flutter, other

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

Health suggestions

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

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

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

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

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

Fix bin/main.dart. (-0.50 points)

Analysis of bin/main.dart reported 1 hint:

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

Fix lib/src/command/package.dart. (-0.50 points)

Analysis of lib/src/command/package.dart reported 1 hint:

line 18 col 13: Don't explicitly initialize variables to null.

Fix additional 3 files with analysis or formatting issues. (-1.50 points)

Additional issues in the following files:

  • lib/src/commands.dart (1 hint)
  • lib/src/utils/get_command.dart (1 hint)
  • lib/src/utils/write_content.dart (1 hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args ^1.5.1 1.5.2
build_cli_annotations ^1.0.1 1.1.0
http ^0.12.0 0.12.0+2
meta ^1.1.7 1.1.7
pub_semver ^1.4.2 1.4.2
yaml ^2.1.15 2.1.15
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
path 1.6.2
pedantic 1.7.0
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_cli ^1.2.1
build_runner ^1.0.0
test ^1.0.0