multipack 0.1.3

  • Readme
  • Changelog
  • Installing
  • 48

multipack #

A tool for monorepo management. Link local packages and execute commands in topological order.

MIT License PRs Welcome Watch on GitHub Star on GitHub Watch on GitHub Discord

This repo comes with an unpublished tool called multipack. To activate it run the following command.

pub global activate multipack

multipack provides a simple way of running commands in multiple packages at once. It builds a directed graph of packages to run commands in topological order.

Manage monorepo.

Usage: multipack <command> [arguments]

Global options:
-h, --help    Print this usage information.
-o, --only    Whitelist packages, skipping those not included for this command.
-s, --skip    Blacklist packages for this command.

Available commands:
  analyze   Run analyzer.
  exec      Execute any command.
  fmt       Run formatter.
  pub       Run pub.
  pubspec   Update pubspec.yaml

pubspec has 3 subcommands:

Available subcommands:
  bump-alpha      Bumps versions for alpha release.
  clean           cleans dependency overrides
  hard_override   overrides dependencies for local packages
  override        overrides dependencies for local packages
  sync-versions   Synchronizes dependency versions

Link all local packages by running

multipack pubspec override

Get all packages by running

multipack pub get

Clean up the pubspec file before publishing

multipack pubspec clean

Filtering #

multipack always recursively discovers all the packages from the current working directory to build a local dependency graph.

By default, multipack works in all the discovered packages, but that can be changed by using global options.

# only work in packages changed since `master`
multipack --since master pub --version 

# only work in packages `a`, `b` and `c`
multipack --only a,b,c fmt --version

# work in all discovered packages except `a`
multipack --skip a fmt --version

Design goals #

Make development and management of gql-dart/gql easier.

That implies the following properties:

  • knows about Dart and Flutter (in that order) tooling
  • knows about git
  • fine-tuned for use in GitHub Actions
  • packages follow a common "template"

Future plans #

# status of required tools
multipack doctor

# list packages and their names (may include more meta data)
multipack info
multipack info --format json
multipack info --format html
multipack info --format gviz

# temporarily checkout a different branch to get versions to compare to current version
multipack info --checkout stable --format json --output-file stable-info.json

# bump versions
multipack version bump patch
multipack version bump minor
multipack version bump major
multipack version bump breaking
multipack version bump pre --name alpha --with-timestamp

multipack version set 1.2.3-gamma.0+456789

multipack version --verify changelog

# link local packages
multipack dependencies link

# unlink local packages
multipack dependencies unlink

# find missing, under-promoted, over-promoted, and unused dependencies
multipack dependencies validate

# verify that local packages fall within other package dependency constraints
multipack dependencies validate-versions

# synchronize local package dependency versions
multipack dependencies sync-versions

# create new package (`gql_local_state_link`@`0.1.0`) in `./links/` from template (`gql_link`)
multipack create gql_link gql_local_state_link --version 0.1.0 --in ./links/

# Possibly hide flutter/dart differences for test and build
multipack test
multipack test --coverage
multipack build
multipack clean

singlepack #

Most of the commands also make sense in a single package context.

Other interesting tools: #

0.1.3 #

  • upgrade directed_graph: ^0.1.4

0.1.2 #

  • run only on changed packages using --since

0.1.1 #

  • fix readme link

0.1.0 #

  • the first published version

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate multipack

2. Use it

The package has the following executables:


$ multipack

Use this package as a library

1. Depend on it

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


dependencies:
  multipack: ^0.1.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:multipack/commands.dart';
import 'package:multipack/commands/analyze.dart';
import 'package:multipack/commands/common.dart';
import 'package:multipack/commands/exec.dart';
import 'package:multipack/commands/fmt.dart';
import 'package:multipack/commands/pub.dart';
import 'package:multipack/commands/pubspec.dart';
import 'package:multipack/commands/pubspec/bump_alpha.dart';
import 'package:multipack/commands/pubspec/clean.dart';
import 'package:multipack/commands/pubspec/hard_override.dart';
import 'package:multipack/commands/pubspec/override.dart';
import 'package:multipack/commands/pubspec/sync_versions.dart';
import 'package:multipack/package.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 Jul 14, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15

Analysis suggestions

Package not compatible with runtime flutter-web on Web

Because:

  • package:multipack/commands.dart that imports:
  • package:multipack/commands/pubspec.dart that imports:
  • package:multipack/package.dart that imports:
  • package:pubspec/pubspec.dart that imports:
  • package:pubspec/src/pubspec.dart that imports:
  • dart:io

Package not compatible with runtime js

Because:

  • package:multipack/commands.dart that imports:
  • package:multipack/commands/pubspec.dart that imports:
  • package:multipack/package.dart that imports:
  • package:pubspec/pubspec.dart that imports:
  • package:pubspec/src/pubspec.dart that imports:
  • dart:io

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and multipack.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.2 <3.0.0
ansicolor ^1.0.2 1.0.2
args ^1.6.0 1.6.0
directed_graph ^0.1.4 0.1.6
meta ^1.0.0 1.2.2 1.3.0-nullsafety
path ^1.6.4 1.7.0
pub_semver ^1.4.4 1.4.4
pubspec ^0.1.2 0.1.4
Transitive dependencies
charcode 1.1.3
collection 1.14.13 1.15.0-nullsafety
graphs 0.2.0
lazy_evaluation 0.0.6+3
matcher 0.12.9
quiver 2.1.3
source_span 1.7.0
stack_trace 1.9.5
string_scanner 1.0.5
term_glyph 1.1.0
uri 0.11.3+1
utf 0.9.0+5
yaml 2.2.1
Dev dependencies
gql_pedantic ^1.0.1