-
Notifications
You must be signed in to change notification settings - Fork 211
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
feat: Sync common dependency versions between packages #526
Conversation
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
Another question: should Melos maybe sync the Dart and Flutter version in environment as well? |
My two cents:
But all these are details, compared to the more important design decision of whether we want to share the root package's dependencies or use separate fiels as you have done. As I have already expressed in #94 (comment) , I am more in favour of new fields, but it would be nice to hear @blaugold 's opinion on this design choice. |
I would also love to hear what @blaugold has to say as I should have some time over to continue with this PR next week. |
Sorry for not responding earlier! 😔 The past few weeks have been really busy. @lohnn Thanks for working on this!
Great idea. I suspect it's just a question of time until someone asks for this, especially with support for common dependencies. @vkammerer Thanks for the detailed input. You convinced me that putting the common dependencies into the root pubspec is probably not a good idea. I feel like the next best option is to put them into Regarding naming, I would be fine with mirroring that of command:
bootstrap:
environment:
...
dependencies:
...
devDependencies:
... |
Heh, it's all good! I'm getting married soon and know exactly what you mean. Thankfully I can do some of this job during work hours (wish I could say the same for my own package, but we currently don't use it at work 😅)
Then I'll add it to the TODO list. Regarding putting the common dependencies in On the flip side, we all use IDEs and can collapse parts of the file if we want to make it more readable, so if you still wish for the common dependencies (and version number) to live in the
I imagine you mean it should be: command:
bootstrap:
environment:
...
dependencies:
...
dev_dependencies: # instead of devDependencies
... |
@lohnn I would much prefer the simplicity of a few lines added to Moreover, the argument about it belonging to melos responsibilities and therefore belonging to |
Check! I'll take it and update the code accordingly 👍 |
I believe the implementation of this is now implemented and fully functional. When updating dependencies or environment it will currently print this to show that pubspec has been updated: base_project
└> Updated environment
Updated 1 dependencies
Updated 1 dev_dependencies
screenshot_tests
└> Updated environment Untouched packages will not appear at all to not clutter logging unless a change is actually done.
Where can I find this to update accordingly? |
And regarding tests for this work. I should look into that I guess? |
I have now added a test to validate that the bootstrap dependency sync runs as intended, and the PR is now ready to be reviewed. |
Ping: I would love for this PR to be reviewed. |
@lohnn Sorry for the delay! I'll review it tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good mostly!
I've fixed the analyzer issues on main, so please rebase or merge to get the checks passing.
Thank you for your review and all your comments should now be taken care of :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! ❤️
I am trying to find this mechanism in the docs website, but there I can only see a |
NOTE: I'm adding this as a draft PR as docs and tests are not yet added and I haven't yet added feedback if the user turned on the flag but didn't provide the
common_packages.yaml
-file. But I wish for feedback on my solution anyways.Description
Added support for setting versions for common/shared dependencies that will be applied to all packages in a Melos monorepo project. Implements #94.
A new bootstrap config flag (
shareDependencies
) is added to start using this new feature, and then the dependency versions fordependencies
anddev_dependencies
incommon_packages.yaml
will be applied to all packages that contains said dependency.Type of Change
feat
-- New feature (non-breaking change which adds functionality)fix
-- Bug fix (non-breaking change which fixes an issue)!
-- Breaking change (fix or feature that would cause existing functionality to change)refactor
-- Code refactorci
-- Build configuration changedocs
-- Documentationchore
-- Chore