A CLEAN melos template. 🌊🏄♂️
Melos is a CLI tool used to help manage Dart projects with multiple packages (also known as mono-repos). It is currently still in active development however is in use on projects such as FlutterFire.
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. Melos helps solve these issues by allowing multiple packages to work together within one repository, whilst being totally independent of each other. Features include:
- Automatic versioning & changelog generation.
- Automated publishing of packages to pub.dev.
- Local package linking and installation.
- Executing simultaneous commands across packages.
- Listing of local packages & their dependencies.
- Melos also works great on CI/CD environments to help automate complex tasks and challenges.
Melos can be installed as a global package via pub.dev:
dart pub global activate melos
Once installed & setup, Melos needs to be bootstrapped. Bootstrapping has 2 primary roles:
- Installing all package dependencies (internally using pub get).
- Locally linking any packages together.
Clean and Bootstrap all packages:
melos clean_and_bootstrap
Perform buildrunner run:
melos build_runner:build
Run flutter test:
melos test:flutter