-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[CLI]: Upgrade from Listr
to Listr2
#6444
Conversation
@Tobbe, @cannikin, @peterp and @thedavidprice may be specifically interested given their CLI experience. Apologies to you all for any repeated notifications recently and sorry to anyone not mentioned. |
@jtoar pinging you too, because I know you're interested in the cli |
Why the other CI tests are failing I'm unsure. The error messages aren't that illuminating to me. |
Can I just confirm that the merge conflicts I fixed were done properly. I had issues like shown below and I just accepted the one in this branch rather than the main. These seemingly random number suffixes are important?
|
No, they're not important. Thanks for asking. Reaffirms my belief we should try to get rid of that. |
The only failing test doesn't appear to have failed for any reason related to these changes. |
Status update: We haven't forgotten about this one. Just waiting for the right time to merge this. It touches a lot of files, so want to limit the disturbance of other PRs. Don't worry though, we'll help you get it in if needed 🙂 |
@Josh-Walker-GM You've left a bunch of TODOs about supporting |
Okay I should mention that all the existing support for the verbose flag is maintained. The TODOs were simply extra so might correspond to commands which don't need them. I'll do a quick pass through and add or remove those TODOs. I'll also do a general preparation to get this more up to date with main. |
Yeah. Totally up to you to either implement the extra verbose support or jus remove the TODOs. The extra verbose support can come in a separate PR if you want. You decide 🙂 |
I have no idea what's going on here, but I can reproduce locally Locally I do (in the RW framework) And then I go to ~/some/path and run Just noticed that this other (unrelated) PR had the same issue #6494 wmhas seems to come from here https://github.com/zloirock/core-js/blob/0400deaa99b304f5a772f5c7cc7c622e10aa47f6/packages/core-js/internals/internal-state.js#L32 |
Brand new issue raised with |
@Josh-Walker-GM thanks for the link, that one's been resolved! |
We appear to have all green on the CI 🎉 Are we looking to get this in now or are hanging on for some more PRs before this one? There are one or two PR's I've spotted which might need updating if this one goes in first. |
@Josh-Walker-GM I'll try to get this one in asap |
@Tobbe the router "overlapping act() calls" strikes again - this isn't an issue here though am I right? |
@Josh-Walker-GM nah it's just something we've been seeing on and off for a while that we've tried to fix on and off for a while |
I was able to reproduce the "overlapping act() calls" locally by tweaking the timings in the router tests. I gave everything a little more wiggle room in this PR #6493 so hopefully it won't complain as much moving forward. |
Problem
The current
listr
CLI library has poor support for user input. This prevents prompts from working correctly given the prompt text is drawn over by the various tasks text. This restricts our ability to use prompts to interact with the user who runs commands.Solution
To update to use a different CLI library. Easiest and quickest way forward with this is to update to
listr2
a very popular alternative tolistr
which includes good support for user input via the, again very popular,enquirer
package. This PR upgrades the CLI to uselistr2
.Problems that remain
listr2
has not yet updated to fix listr2/listr2#296. The beta version does address this issue however the update has not yet been pushed to the main version. I don't see this as a deal breaker given we currently have to live with the existing issue anyway aslistr
has the same issue.Changes
listr2
and removed thelistr
and the associatedlist-verbose-renderer
which is no longer needed.listr
tolistr2
where necessary.collapse:false
to be within the requiredrendererOptions
config option.rendererOptions: {collapse: false}
in a few places it was previously not includedOutstanding work
listr
orlistr2
in the future. Given the apparent ease of thislistr
tolistr2
transition I felt comfortable enough making this PR anyway. Project leads will need to consider this change appropriate.listr
package. I am not experienced with testing and would require assistance confirming this is the case and with updating the tests as required.listr
this transition is made much easier and is appropriate.Updates
The number of tests failing has been dramatically reduced with the changes listed below. Provided these changes are correct then I do think the only remaining issue is related to the mocking.All tests pass, just need someone with experience to confirm the changes are valid.A CI test related to package versions fails but again I'm not familiar with this particular test.t.setRenderer("silent")
changed tot.options.renderer = "silent"
t._tasks
changed tot.tasks
jest.mock
increateYargsForComponentGeneration.test.js
src/commands/__tests__/build.test.js
and used the automatic one instead.