Manage multiple Dart packages within a single repository.
> pub global activate mono_repo
> pub global run mono_repo
Or, once you've setup your PATH:
Prints the following help message:
Manage multiple packages in one source repository. Usage: mono_repo <command> [arguments] Global options: -h, --help Print this usage information. --version Prints the version of mono_repo. --[no-]recursive Whether to recursively walk sub-directorys looking for packages. Available commands: check Check the state of the repository. help Display help information for mono_repo. presubmit Run the travis presubmits locally. pub Run `pub get` or `pub upgrade` against all packages. travis Configure Travis-CI for child packages. Run "mono_repo help <command>" for more information about a command.
To configure a package directory to be included it must contain a
mono_pkg.yaml file (along with the normal
You can use an empty
mono_pkg.yaml file to enable the
presubmit, you must populate
details on how you'd like tests to be run.
# This key is required. It specifies the Dart SDKs your tests will run under # You can provide one or more value. # See https://docs.travis-ci.com/user/languages/dart#choosing-dart-versions-to-test-against # for valid values dart: - dev stages: # Register two jobs to run under the `analyze` stage. - analyze: - dartanalyzer - dartfmt - unit_test: - test
mono_repo travis in the root directory generates two files:
Look at these repositories for examples of
mono_config.yaml file is no longer used to configure which packages
are configured. Instead,
mono_pkg.yaml is required to be in each target
package directory. A package is considered published if it has a value for
The package configuration file is now
mono_pkg.yaml. If a legacy config file
.mono_repo.yml – is found, the command is canceled and a warning is
printed telling the user to rename the file.
descriptionkey for jobs within a stage, for example:
stages: - unit_test: - description: "chrome" test: -p chrome
pubcommand now runs with inherited standard IO. You now see colors!
Added support for the
group task, which accepts a list of tasks using the
normal format. This can be used to group multiple tasks in a single travis
job. All tasks will be ran, but if any of them fail then the whole job will
Example usage combining the analyzer/dartfmt tasks:
stages: - analyze_and_format: - group: - dartanalyzer - dartfmt
.travis.ymlfiles should be replaced with
.mono_repo.ymlfiles, which are a simplified format that supports travis build stages. A basic example file might look like this:
# List of the sdk versions you support dart: - dev - stable # Ordered list of all stages you want to run. stages: # A single stage, called `analyze_and_format` which runs the analyzer and # the formatter only. - analyze_and_format: - dartanalyzer: --hints-as-warnings . - dartfmt: sdk dart: - dev # Overrides the top level sdk default # Assuming everything analyzed correctly, runs a build. - build: - command: "pub run build_runner build" # And finally run tests, these are custom build_runner tests but the regular # `test` task is also supported. - unit_test: - command: "pub run build_runner test" - command: "pub run build_runner test -- -p chrome"
Make numbering more consistent and clean when there is more than one task with a given name.
Print out the full command that executed as part of a task.
List value for
Write ANSI escape sequences in
./tool/travis.sh as pre-escaped ASCII
--[no-]pretty-ansi flag to allow ANSI sequences to be optionally
before_script support to the
travis command. When that value is set in
travis.yml file, we will call the script before running any of the tasks
for that package.
recursive global flag. When set, we will walk all sub-directories
Support git dependencies in packages.
mono_repo.yaml as the configuration file name, instead of
You can install the package from the command line:
$ pub global activate mono_repo
The package has the following executables:
Add this to your package's pubspec.yaml file:
dependencies: mono_repo: ^1.2.1
You can install packages from the command line:
$ pub get
$ flutter packages get
Alternatively, your editor might support
pub get or
flutter packages get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|1.2.1||Oct 8, 2018|
|1.2.0||Sep 24, 2018|
|1.1.0||Aug 30, 2018|
|1.0.0||Aug 28, 2018|
|0.3.3||Jul 27, 2018|
|0.3.2+1||Jul 23, 2018|
|0.3.2||May 31, 2018|
|0.3.1||Feb 15, 2018|
|0.3.0||Feb 7, 2018|
|0.2.2||Jan 31, 2018|
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]
We analyzed this package on Feb 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, other
The package description is too short. (-13 points)
Add more detail to the
description field of
pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
mono_repo.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=2.0.0-dev.54 <3.0.0|