Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1.22 KB

01_melos_setup.md

File metadata and controls

55 lines (39 loc) · 1.22 KB

Melos Setup

Melos' Getting Started

To set up a Flutter project to use Melos:

  • Create a melos.yaml file in the root of the project (here, fl_template named). Within the melos.yaml file, add name and packages fields:
name: fl_template

packages:
  - packages/**
  • Bootstrap:
melos bootstrap

Melos Scripts

  • Add scripts to the "melos.yaml" to run them across all packages. For example,
scripts:
  analyze:
    run: |
      melos exec -c 1 -- \
        flutter analyze .
    description: |
      Run `dart analyze` in all packages.
       - Note: you can also rely on your IDEs Dart Analysis / Issues window.

  format:
    run: dart format -o write  --show all .
    description: Format all the code in this project.

  outdated:
    run: melos exec --file-exists="pubspec.yaml" -c 1 --fail-fast -- "flutter pub outdated && exit"
    description: Run `flutter pub outdated` in all packages.

  upgrade:
    run: melos exec --file-exists="pubspec.yaml" -c 1 --fail-fast -- "flutter pub upgrade && exit"
    description: Run `flutter pub upgrade` in all packages.

Test Run

melos run analyze

Test Run