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

[discussion] Find a way to coordinate / share / merge with Melos #8

Open
Salakar opened this issue Jan 28, 2021 · 13 comments
Open

[discussion] Find a way to coordinate / share / merge with Melos #8

Salakar opened this issue Jan 28, 2021 · 13 comments

Comments

@Salakar
Copy link

Salakar commented Jan 28, 2021

Hey 👋

I came across multipack today whilst searching on pub.dev for monorepo tools.

This is purely speculation, but I thought it might be worth at least discussing if you'd be interested in collaboration here; I'm the author of Melos and as far as I can see Melos mostly covers the design goals of multipack so this may be an opportunity to reduce maintenance burdens for both our projects by collaborating.

Thoughts? Happy to answer any questions, I'm also on the Discord server (Salakar#1337) should you wish to chat that way.

@klavs
Copy link
Contributor

klavs commented Feb 12, 2021

Hey @Salakar!

I am more then happy to see multipack disappear. Especially if you can help us adopt melos.

That said, I am a bit worried about "Conventional Commits". I wonder if that's mandatory with melos.

@Salakar
Copy link
Author

Salakar commented Feb 12, 2021

I am more then happy to see multipack disappear. Especially if you can help us adopt melos.

Happy to help

That said, I am a bit worried about "Conventional Commits". I wonder if that's mandatory with melos.

Nope it's not mandatory, only need to use it if you wanted automated version bumping and change logs.

@klavs
Copy link
Contributor

klavs commented Feb 12, 2021

@klavs
Copy link
Contributor

klavs commented Feb 12, 2021

@Salakar I got stuck pretty early. gql-dart/gql#192

melos bs returns

melos bootstrap
   └> /media/storage/WebstormProjects/klavs/gql

Running "pub get" in workspace packages...

Linking workspace packages...
  > SUCCESS

Generating IntelliJ IDE files...
  > SUCCESS

 -> 0 plugins bootstrapped

@Salakar
Copy link
Author

Salakar commented Feb 12, 2021

Left a review comment on the PR, patterns needed tweaking slightly;

image

@Salakar
Copy link
Author

Salakar commented Feb 12, 2021

Based on the readme also here's some quick info/points:


Link all local packages by running

multipack pubspec override

Get all packages by running

multipack pub get

Covered by melos bootstrap.


Clean up the pubspec file before publishing

multipack pubspec clean

Covered by melos clean, you could also add a postclean hook script definition to melos.yaml scripts that melos clean will automatically run after it's done it's own cleaning if you wanted to clean anything additional, e.g.:
https://github.com/FirebaseExtended/flutterfire/blob/master/melos.yaml#L169-L171

@Salakar
Copy link
Author

Salakar commented Feb 12, 2021

I'd also recommend committing this for any of the devs to this project using Vscode: https://github.com/FirebaseExtended/flutterfire/blob/master/.vscode/settings.json

And for IntelliJ, making sure you have these git ignores:

*.iml
.idea/

@klavs
Copy link
Contributor

klavs commented Feb 12, 2021

Thanks!

One thing I had implemented in multipack was listing the packages as graphviz dotfile. https://github.com/gql-dart/multipack/blob/master/lib/commands/info.dart

It gives me a quick overview of the monorepo: https://github.com/gql-dart/gql/blob/master/docs/gql.svg
It's not the prettiest, but it gets the job done.

The implementation is very simple. Are you open to adding it to melos, let's say, as melos list --gviz?

@Salakar
Copy link
Author

Salakar commented Feb 12, 2021

The implementation is very simple. Are you open to adding it to melos, let's say, as melos list --gviz?

Yes definitely :)

@klavs
Copy link
Contributor

klavs commented Feb 12, 2021

One of the design goals for multipack was not requiring flutter where possible.

With melos it seems that I have to do melos --scope $PACKAGE bootstrap where $PACKAGE is a dart package to avoid melos crashing because flutter is not available.

https://github.com/gql-dart/gql/pull/192/checks?check_run_id=1889415286

@Salakar
Copy link
Author

Salakar commented Feb 12, 2021

One of the design goals for multipack was not requiring flutter where possible.

With melos it seems that I have to do melos --scope $PACKAGE bootstrap where $PACKAGE is a dart package to avoid melos crashing because flutter is not available.

Melos auto-detects if flutter is being depended on by any of your packages in the workspace, if any package does depend on it then it switches to to using flutter pub get for pub installs, I was under the impression if you depend on flutter packages you had to use flutter pub get instead - I could have made a wrong assumption or perhaps a broad one - not sure. If you need this to be more flexible then we can change this on Melos itself

@klavs
Copy link
Contributor

klavs commented Feb 12, 2021

I was under the impression if you depend on flutter packages you had to use flutter pub get instead - I could have made a wrong assumption or perhaps a broad one - not sure.

Let me list some examples to consider.

We can take https://github.com/gql-dart/gql as en example. It consists of Dart packages and a single gql_example_flutter package which is there just as an example that shows how all the those packages can be used in flutter as well.

Additionally, contributors might have access to a device which for whatever reason does not have flutter installed. They should be able to contribute to the part of the monorepo which does not require flutter. (I actually had this play out when I wanted to code using a laptop I had available at the time. With limited connectivity, downloading dart is quicker than downloading flutter)

Another use case is actually a CI system which could get away with lighter google/dart:latest in some cases.

For multipack I created uni which can detect both system restrictions (available binaries) and package restrictions.

@smkhalsa
Copy link
Member

I've migrated the ferry packages to use melos. So far, everything is working well.

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

No branches or pull requests

3 participants