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

Cosmetic suggestions to improve the logs #956

Open
yahiarefaiea opened this issue Oct 13, 2021 · 1 comment
Open

Cosmetic suggestions to improve the logs #956

yahiarefaiea opened this issue Oct 13, 2021 · 1 comment

Comments

@yahiarefaiea
Copy link

This is just a cosmetic suggestion when using ncu inside monorepo.

The current behavior when running ncu with upgrade and deep options logs something like:

Upgrading C:\path\to\project-name\package.json

All dependencies match the latest package versions :)
Upgrading C:\path\to\project-name\packages\package-name-1\package.json

All dependencies match the latest package versions :)
Upgrading C:\path\to\project-name\packages\package-name-2\package.json

No dependencies.
Upgrading C:\path\to\project-name\packages\package-name-3\package.json

No dependencies.
Upgrading C:\path\to\project-name\packages\package-name-4\package.json

All dependencies match the latest package versions :)
Upgrading C:\path\to\project-name\packages\package-name-5\package.json

All dependencies match the latest package versions :)
  • I suggest if we put the line with the result directly under the line with the path (without an empty line). And separate each package log with an empty line.
    Even that I come from a ux design background, it always looks very confusing to me. So the result of this cosmetic suggestion will be easier logs to navigate through.

  • I would also suggest using chalk not just to color the :) green smile at the end, but also to color everything else... especially the result. It will look like a mess if you used more colors (because you already have colors for major, minor, and patch versions) So I suggest coloring the result to be grey (only if dependencies are matched or there are no dependencies at all) Grey will tell the developer to skip those lines because there's no required action to take.

  • My last suggestion would be to add a summary at the end, that the developer can skip right to it to take all necessary actions. It would look something like a testing framework.

  • I still have many ideas in mind to improve the console like [1] simplifying paths and maybe [2] grouping the packages that required no action together with minimum logging and the ones that required actions with more details. [3] I would also suggest if the developer is using ncu with a monorepo, to add an option to their .ncurc file that says something like: monorepo: true so we can improve and minimize logging if so.

There are a lot of decisions to make here. I would be happy to dig in the package and create PR for you.

@raineorshine
Copy link
Owner

Thanks for the thoughtful suggestions!

  • I suggest if we put the line with the result directly under the line with the path (without an empty line). And separate each package log with an empty line.

Yes, that sounds good.

  • I would also suggest using chalk not just to color the :) green smile at the end, but also to color everything else... especially the result. It will look like a mess if you used more colors (because you already have colors for major, minor, and patch versions) So I suggest coloring the result to be grey (only if dependencies are matched or there are no dependencies at all) Grey will tell the developer to skip those lines because there's no required action to take.

I think gray would be appropriate for "No dependencies", but I prefer "All dependencies match" to use either the default text color or all green.

  • My last suggestion would be to add a summary at the end, that the developer can skip right to it to take all necessary actions. It would look something like a testing framework.

I would have to see a more explicit example of what you had in mind to consider this. My concern is that it just repeats what is above, which is already quite compact.

  • [1] simplifying paths

We could use relative paths for a cleaner look. I think we should use full paths when either the --packageFile or --cwd options are set.

[2] grouping the packages that required no action together with minimum logging and the ones that required actions with more details.

ncu avoids grouping results in favor of minimalism, so this suggestion is less likely to be approved. Provide me an example if you'd like and I will consider it.

  • [3] I would also suggest if the developer is using ncu with a monorepo, to add an option to their .ncurc file that says something like: monorepo: true so we can improve and minimize logging if so.

We can just check --deep, as I think the improved output will benefit all users.

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