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

Moving away from dcli #232

Open
1 of 10 tasks
passsy opened this issue May 30, 2023 · 3 comments
Open
1 of 10 tasks

Moving away from dcli #232

passsy opened this issue May 30, 2023 · 3 comments

Comments

@passsy
Copy link
Contributor

passsy commented May 30, 2023

dcli, has brought us more pain than it actually solved. Especially, because it continuously raised the minimum Dart SDK on patch releases without warning. We should try to move away from it completely and create or find replacements for the APIs provided by the package.

I set the target for sidekick: 3.0.0 which I prefer to have sooner than later.

##APIs we have to replace:

starting a child process

This is the most crucial one.

  • dcli.start, dcli.run to start a process and read stdout

Could be replaced with https://github.com/google/dart_cli_script. I even got a prototype. But is seem unmaintained and is a pure async API, unlike dcli which is synchronous by design

env and PATH

  • read write env
  • add to path (sidekick install-global)

Script path

  • DartScript.self.pathToScript one of the magics of dcli. Honestly, this function is great. It tells where the dart script that is currently being executed is located on disk.

interactivity

  • asks prompts, menu and confirm

sleep

  • a sleep function that waits real time

printing

  • printerr is helpful but can easily provided by us
  • red(), green(), yellow() and friends can be directly imported from https://pub.dev/packages/ansi

Pubspec

@Giuspepe
Copy link
Contributor

Giuspepe commented Jun 7, 2023

Regarding the task pubspec -> write into pubspec: we're only using this functionality from dcli in sidekick_test, so dcli is just a dev dependency there and thus we can ignore it

@danielmolnar
Copy link

I think with the introduction of Dart 3.3 this becomes more relevant than ever.
Sidekick update to the latest throws:

Synchronous waiting using dart:cli waitFor and C API Dart_WaitForEvent is deprecated and disabled by default. This feature will be fully removed in Dart 3.4 release. You can currently still enable it by passing --enable_deprecated_wait_for to the Dart VM. See https://dartbug.com/52121.
dart:cli-patch/cli_patch.dart 9    

Context: Dart 3.3: waitFor is now disabled by default, but can be temporarily enabled by passing the flag --enable_deprecated_wait_for to the VM / dart command

There are pre-releases of dcli that do no longer use waitFor though like 4.0.0

What do you think @passsy

@passsy
Copy link
Contributor Author

passsy commented Apr 5, 2024

Another incident #251

It's now time

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