Open LongXiangGuo opened 1 year ago
Does't can also support query parents package in the rootPackage. When change one of the package, can be clearly known how many packages will be affect.
flutter pub show --name=childPackage parentDeps --rootPackage={rootPackage}
childPackage -->parentA-->parentB
parentA-->parentC
parentC --->parentD
Add futter pub get --platforms command to obtain dependencies from different platforms, reducing the number of dependencies, so that unused platforms should not broken currently used platforms.
This sounds like a duplicate of this request: https://github.com/dart-lang/pub/issues/3969 . We have no current plans for such a feature.
Addflutter search {package} {package_version} to query the dependencies of the specified library.
You can get a dependency tree of your packages with dart pub deps
- currently we don't have a way to show this tree for just a single package, opened https://github.com/dart-lang/pub/issues/3991 for this.
For upgrading many packages at once, have you tried: dart pub upgrade --major-versions
?
Our project has hundreds of packages(Actually, there are over 500 packages), the dart pub upgrade not work for it, and there are also sub packages in the project that referenced by path (208 packages). Once encountering a major version error, it automatically terminated, upgrading such a project is a relatively great work.
the dart pub upgrade not work for it
Can you describe what goes wrong?, maybe we can improve it.
Below is some of the errors, we can see it blocked when one of the packages conflicted. when resolved this package, we need to start flutter upgrade
again until all the package conflict resolved. The problem is our project has too many dependencies, it hard to known which version should be upgrade to at the first time, use this method need to try many times many time flutter upgrade
commands.
Since there are hundreds of packages, we need lock the basic packages dependency about the new flutter version firstly. Then search the parent deps to decide which package should be upgrade or overrides. If there is tools could automatic processing those package dependencies and give some recommendation which packages should be upgrade or override, the work will be more easy. e.g.
flutter pub upgrade --basic-packages={ meta: 18.0, collection: 1.7.1, analyzer: '^5.0.0'} --package-root={package-root} --platforms={platforms} --custom-packages={custom packages}
The command base on the basic package list to upgrade the project, and use the platform parameter to ignore give some override suggestions when there is conflict for third party package that the developer could not modify the source code directly, the custom packages means that owned by the developers and they can fix it for any conflicts.
The out pub will show a report for upgrade
Is there an existing issue for this?
Use case
As shown in the figure, upgrading so many dependencies in the root package. When there is base package upgrade,It's needed to try the pub get and fix the package dependencies one by one, even some of the package are not used in current platform.
third_party_dependencies.txt
image is too big, you can rename the third_party_dependencies.txt to third_party_dependencies.dot and run
dot -Tsvg -o third_party_dependencies.dot dot -Tsvg -o third_party_dependencies.svg
generated it.Proposal
Add
futter pub get --platforms
command to obtain dependencies from different platforms, reducing the number of dependencies, so that unused platforms should not broken currently used platforms.Add
flutter search {package} {package_version}
to query the dependencies of the specified library.