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

Show ✗ when choosing ‘no’ in interactive mode #553

Open
2 tasks done
Primajin opened this issue Jul 2, 2019 · 4 comments
Open
2 tasks done

Show ✗ when choosing ‘no’ in interactive mode #553

Primajin opened this issue Jul 2, 2019 · 4 comments

Comments

@Primajin
Copy link
Contributor

Primajin commented Jul 2, 2019

  • node version: v12.5.0
  • npm version: 6.9.2
  • npm-check-updates version: 3.1.13

Just curious about people's opinions, when choosing ‘no’ in interactive mode, we still put the green check mark in the front - how about we change that to a red x in that case?

Before:

✔️ Do you want to upgrade: axios ^0.18.1 → ^0.19.0? … no
✔ Do you want to upgrade: eslint ^5.16.0 → ^6.0.1? … yes
? Do you want to upgrade: eslint-plugin-flowtype 2.50.3 → 3.11.1? › (Y/n)

After:

✘ Do you want to upgrade: axios ^0.18.1 → ^0.19.0? … no
✔ Do you want to upgrade: eslint ^5.16.0 → ^6.0.1? … yes
? Do you want to upgrade: eslint-plugin-flowtype 2.50.3 → 3.11.1? › (Y/n)

Happy to create a PR if you like it.

Also: Should we imply -u when using interactive mode? I find it kind of counter intuitive when it asks me Do you want to upgrade: eslint ^5.16.0 → ^6.0.1? … yes and since I didn’t run it with -u it’s still on dry-run… 🤔

@raineorshine
Copy link
Owner

We should print an ✗ when the user chooses no. That's a bug (notice how it shows an ✗ if you kill the process, e.g. with Cmd + C, during a prompt). PR Welcome.

As for implying -u, that was exactly the behavior that -a had in ncu v2, and people got all sorts of confused. The package is upgraded if and only if -u is specified; simple. If anything, we could print a warning. Theoretically it's possible that a user may want to interactively run ncu and pipe the results of --jsonUpgraded somewhere without modifying the package.json.

@raineorshine raineorshine changed the title Discussion: How about changing the icon when choosing ‘no’ in interactive mode Show ✗ when choosing ‘no’ in interactive mode Jul 2, 2019
@Primajin
Copy link
Contributor Author

Primajin commented Jul 3, 2019

Alright fair enough, then I'll concentrate only on the ✗ part!

@Primajin
Copy link
Contributor Author

Primajin commented Jul 3, 2019

Hmmm this seems to be rather a problem with prompts

const prompts = require('prompts');

(async () => {
    const response = await prompts({
        type: 'confirm',
        name: 'value',
        message: 'Do you want to upgrade: stuff?',
        initial: true
    });

    console.log(response.value);
})();

Gives me

  • a no and a green check mark on N
  • a yes and a red cross on CTRL+C
  • a yes and a green check mark on enter
  • a yes and a green check mark on Y

while the last two are fine the first two are very weird 🤔

Screenshot 2019-07-03 at 15 42 21

EDIT: opened terkelg/prompts#180

@raineorshine
Copy link
Owner

Agreed! Thanks for following up on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants