-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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(outdated): interactive update #27812
base: main
Are you sure you want to change the base?
Conversation
3df1283
to
4f71a95
Compare
4f71a95
to
bca1b57
Compare
out.flush()?; | ||
|
||
Ok(()) | ||
} |
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.
It might be better to switch this to https://github.com/dsherret/console_static_text with deno_terminal because then we don't need the crossterm dependency. Additionally, console_static_text
is already used by the draw thread for progress bars: https://github.com/denoland/deno/blob/main/cli/util/draw_thread.rs and in the future we could hook it up so that you can do stuff like show progress bars at the same time as having interaction https://david.deno.dev/posts/console-static-text/
That said, we probably still want something for handling key presses though... maybe the repl has some code that does that? Otherwise I guess we need to use crossterm.
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.
The repl uses rustyline
which has its own keypress handling AFAICT.
Did a quick check, this PR adds about 66 KiB to the binary - though not sure how much of that is crossterm. It does also add an extra version of mio
to our dependency tree because we're on an old tokio version – though when we upgrade tokio it'll remove that duplication
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.
For unix it probably wouldn't be too hard to roll our own, but no idea about windows
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.
I think at least here we should use deno_terminal and console_static_text to prevent having multiple implementations ending up in the executable. Maybe something for a follow-up though.
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.
For deno_terminal, it would help us re-use the logic we have for NO_COLOR and TERM styling, but I think crossterm handles that as well: https://github.com/denoland/deno_terminal/blob/main/src/colors.rs
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.
Nice! LGTM, but I think we could take advantage of some of the functionality in our other crates more.
major: u64, | ||
minor: u64, | ||
patch: u64, | ||
pre: Option<String>, |
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.
Should we be using deno_semver::Version
here? https://docs.rs/deno_semver/0.7.1/deno_semver/struct.Version.html
WIP. This is currently just an impl for the UI part. Finishing this out should just be a matter of tweaking the UI and wiring up the inputs and outputs (though writing tests will be a tricky part)