onepub-dev / dcli

An extensive library and tooling for building console/cli applications and scripts using the Dart programming language.
236 stars 26 forks source link

Resolving dependencies issue #219

Closed myThorsten closed 9 months ago

myThorsten commented 11 months ago

Hello, first, thank you very much for this great project. I was using dcli with great success until I upgraded the flutter version. I had to update a lot of dependencies, and now I am stuck with this: Because every version of flutter_test from sdk depends on test_api 0.5.1 and dcli >=3.0.2 depends on test_api ^0.6.0, flutter_test from sdk is incompatible with dcli >=3.0.2. and the version solving fails.

From the pubspec.yaml:

dev_dependencies:
  args: ^2.3.1
  build_runner: ^2.3.3
  custom_lint: ^0.4.0
  dart_appwrite: ^8.0.0
  dcli: ^3.0.3                                <-----
  flutter_launcher_icons: ^0.13.1
  flutter_lints: ^2.0.0
  flutter_native_splash: ^2.2.8
  flutter_test:                                <-----
    sdk: flutter
  freezed: ^2.1.1
  json_serializable: ^6.4.1
  mockito: ^5.3.2
  riverpod_generator: ^2.1.4
  riverpod_lint: ^1.1.6
  yaml: ^3.1.2

Flutter is on version 3.10.6.

Apparently I'm the only one having this problem, and I find that very strange, since any flutter application should have flutter_test and dcli interfering with each other. Anyway, it would be great if someone has a tip for me.

bsutton commented 11 months ago

just a note to let you know that I'm working on a fix.

Likely to take a couple of weeks as I have some dependencies issues blocking me doing an update.

petrleocompel commented 10 months ago

Why is test_api in dependencies? Is there really a need to specify it ?

Because if i remove test_api everything seems ok. No reference to this package. Otherwise it could be only a dev_dependency and this could be resolved. Because I do not think flutter_test is going to upgrade the test_api in few weeks.

Also is there really a need to specify vm_service? (Next conflict with flutter dependencies)

But I have also problem with http because that one is old. Current version is 1.1.x and seems compatible without issues so we could have http: <2.0.0 ?

petrleocompel commented 10 months ago

@bsutton any info on that ?

bsutton commented 10 months ago

Hoping to find time to this weekend

On Fri, 18 Aug 2023, 10:30 pm Petr Leo Compel, @.***> wrote:

@bsutton https://github.com/bsutton any info on that ?

— Reply to this email directly, view it on GitHub https://github.com/onepub-dev/dcli/issues/219#issuecomment-1683849524, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG32OHBL5LEKGYRDEHNV4TXV5N57ANCNFSM6AAAAAA2UCDZ6M . You are receiving this because you were mentioned.Message ID: @.***>

bsutton commented 10 months ago

Just an update. The blocking project is pubspec. I have multiple problems with the project and maintaining it is problematic (mass of untyped json parsing).

So I've decided to rewrite it and fix a number of issues on the way through (like the inability to preserve comments).

I'm about halfway through. I can read/write a pubspec.yaml saving comments (full line and inline) as well as preserving any non-speced pieces (the pubspec spec allows you to include non-defined pieces).

What is left is to flesh out is functionality that lets you modify the pubspec once it's loaded. There are a few tricky pieces (ensuring that comments remain attached to the correct section) but I believe I have a workable plan. I'm hoping to spend some time this week to get it completed. Once done I should be able to ship an updated dcli.

bsutton commented 10 months ago

Oh and test_api will be moved into dev_dependencies.

This problem was caused because I need to lock down the set of dependencies (including transient dependencies) to enusre that dcli compiles on every target - semantic versioning can't be trusted. The process that I use to lock the dependencies down has a bug that moves dev deps into the main dependencies section, instead of leaving them in the dev section. I will also need to fix this but it's a small bug.

petrleocompel commented 10 months ago

Perfect. We will be awaiting your changes.

I prepared upgrade for fsm library. https://github.com/onepub-dev/fsm2/commit/e3e796354739f1fef01b06e2e3584377816b3881

I will update and make pull request after dcli fix.

bsutton commented 9 months ago

So I've published dcli 3.1.0. This leaves some issues with pubspec parsing unresloved but I felt I need to get out a release that should fix most peoples issues so here it. If you have problems please raise a new issue and I will to get them resolved in a more timely fashion.