Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Melos for monorepo management #680

Open
jmatth opened this issue Jul 7, 2022 · 0 comments
Open

Add Melos for monorepo management #680

jmatth opened this issue Jul 7, 2022 · 0 comments
Assignees

Comments

@jmatth
Copy link
Contributor

jmatth commented Jul 7, 2022

Melos is a command line tool for managing Dart monorepos. The primary benefits it would provide for this repo are:

  1. Make development across projects easier. Currently some projects within the monorepo depend on the version in pub and others have dependency_overrides that have to be removed during publishing. Instead we could just have pub dependencies and Melos will transparently set overrides during local development.
  2. Use local dependencies during CI runs. This is really just an extension of the previous point, but currently the inconsistent dependencies on pub vs local packages means checks on pull requests can't always be trusted. Melos can be used during the CI run to make sure tests run with code from the commit and not pub.dev.
  3. Make publishing updates easier. Currently the varous dependency_overrides sections must be removed or pub publish will refuse to work. At time of writing this is step would be reduced to removing a single file, pubspec_overrides.yaml, from any packages to be published. Melos also has some convenience commands to do things like publish any packages that are newer than the version on pub, generate updated changelogs, etc. I personally find these a little fiddly to get working but they could be useful

Using melos would mean having developers install it with flutter pub global activate melos and then use it to install the projects' dependencies with melos bootstrap. CI tasks would be updated to do the same.

As an alternative, pubspec_overrides.yaml files could be added to each project instead and manually maintained. This mechanism for overriding dependencies during development was added in Dart 2.17 and is what Melos uses under the hood. Currently the presence of these files blocks pub publishing the same as using dependency_overrides, but future versions of pub should ignore the file entirely. This would lose some of the extra functionality provided by Melos but avoid a tool dependency while still solving the intra-repo dependency issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant