invertase / melos

πŸŒ‹ A tool for managing Dart projects with multiple packages. With IntelliJ and Vscode IDE support. Supports automated versioning, changelogs & publishing via Conventional Commits.
https://melos.invertase.dev/~melos-latest
Apache License 2.0
1.19k stars 206 forks source link
dart flutter hacktoberfest lerna monorepo pubdev

Melos

A tool for managing Dart projects with multiple packages, inspired by Lerna.

Melos docs.page Chat on Discord

DocumentationLicense


About

Splitting up large code bases into separate independently versioned packages is extremely useful for code sharing. However, making changes across many repositories is messy and difficult to track, and testing across repositories gets complicated really fast.

To solve these (and many other) problems, some projects will organize their code bases into multi-package repositories (sometimes called monorepos)

Melos is a tool that optimizes the workflow around managing multi-package repositories with git and Pub.

Github Action

If you're planning on using Melos in your GitHub Actions workflows, you can use the Melos Action to run Melos commands, this action also supports automatic versioning and publishing directly from your workflows.

What does a Melos workspace look like?

A default file structure looks something like this:

my-melos-repo/
  melos.yaml
  packages/
    package-1/
      pubspec.yaml
    package-2/
      pubspec.yaml

The location of your packages can be configured via the melos.yaml configuration file if the default is unsuitable.

What can Melos do?

Getting Started

Go to the Getting Started page of the documentation to start using Melos.

Who is using Melos?

The following projects are using Melos:

Submit a PR if you'd like to add your project to the list. Update the README.md and the docs.

You can also add a README badge to your projects README to let others know about Melos πŸ’™.

Documentation

Documentation is available at https://melos.invertase.dev.

Migrations

When migrating between major versions of Melos, please read the migration guide.

Commands

Full commands list and args can be viewed by running melos --help.

> melos --help

A CLI tool for managing Dart & Flutter projects with multiple packages.

Usage: melos <command> [arguments]

Global options:
-h, --help        Print this usage information.
    --verbose     Enable verbose logging.
    --sdk-path    Path to the Dart/Flutter SDK that should be used. This command line option has
                  precedence over the `sdkPath` option in the `melos.yaml` configuration file and the
                  `MELOS_SDK_PATH` environment variable. To use the system-wide SDK, provide the
                  special value "auto".

Available commands:
  analyze     Analyzes all packages in your project for potential issues in a single run. Optionally
              configure severity levels. Supports all package filtering options.
  bootstrap   Initialize the workspace, link local packages together and install remaining package
              dependencies. Supports all package filtering options.
  clean       Clean this workspace and all packages. This deletes the temporary pub & ide files such
              as ".packages" & ".flutter-plugins". Supports all package filtering options.
  exec        Execute an arbitrary command in each package. Supports all package filtering options.
  format      Idiomatically format Dart source code.
  list        List local packages in various output formats. Supports all package filtering options.
  publish     Publish any unpublished packages or package versions in your repository to pub.dev. Dry
              run is on by default.
  run         Run a script by name defined in the workspace melos.yaml config file.
  version     Automatically version and generate changelogs based on the Conventional Commits
              specification. Supports all package filtering options.

Run "melos help <command>" for more information about a command.

How to Contribute

To start making contributions please refer to CONTRIBUTING.md.

Lerna

This project is heavily inspired by Lerna.

README Badge

Using Melos? Add a README badge to show it off:

melos

[![melos](https://img.shields.io/badge/maintained%20with-melos-f700ff.svg?style=flat-square)](https://github.com/invertase/melos)

License


Built and maintained with πŸ’› by Invertase.

  Follow on Twitter

[melos-code]: https://marketplace.visualstudio.com/items?itemName=blaugold.melos-code