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 a way to specify dependency versions for all packages in mono_repo.yaml. #456

Open
ykmnkmi opened this issue Jul 20, 2023 · 3 comments

Comments

@ykmnkmi
Copy link

ykmnkmi commented Jul 20, 2023

To use with mono_repo pub get and mono_repo pub upgrade.

@jakemac53
Copy link
Collaborator

jakemac53 commented Jul 20, 2023

Just to try and fill out how this feature might work, here is one idea:

  • Add a top level packages field to mono_repo.yaml. Or possibly a new file (mono_repo.packages.yaml?).
    • This would have the same format as a dependencies section in a pubspec.
  • The mono_repo generate command would modify all pubspec.yaml files in the repo to fill in the version constraint listed in this file for each dependency.
    • It would probably fail if a sub-package depends on a package not listed in this global list, and ask you to add it. Or if we got really fancy prompt if you want to add it.
  • Update the mono_repo validate command to ensure all the pubspecs were up to date (may get this for free?).
  • The mono_repo pub <command> commands continue to work as they do today, but get consistent versions.

@ykmnkmi
Copy link
Author

ykmnkmi commented Jul 23, 2023

Not only dependenies from pub.dev, but also git dependencies with certain commits. Currently, I am doing this manually, and it's not the first time.

I'm not sure where this feature would be most suitable, maybe pub feature: mono_repo pub upgrade --from-file=../root_pubspec.yaml.

@jakemac53
Copy link
Collaborator

The process I described above could work fine for git, path, or pub dependencies. It would just blindly copy the value, which could be anything.

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

2 participants