-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
refactor(cli): improve output aesthetics #6997
Conversation
Nice! Good to try new things here. Some comments about the changes:
|
Perhaps another thing to consider is how this would look with plugins that add other CLI entries, e.g. vite-plugin-inspect and vite-plugin-qrcode. With this change they may look slightly out of place. Design-wise I still prefer the old one, but mostly for nostalgia reasons 😄 |
That is a good point @bluwy. Maybe we could merge this PR (with modifications), or other PRs when we are in the Vite 3.0 beta? I think it may help then to have a refreshed CLI look. And plugins and frameworks would also be able to better target the style for the major |
The background color of Otherwise I like it, especially that it now is a bit (2 lines) smaller |
Hey all, there's a lot of valid feedback, thanks!
I had the intent to PR On this note, I found out that the new line at the end of the default logging design denies a potentially interesting design for plugins, which would be to simply add a line after the default ones: I'm thinking that Vite could offer a basic API to add plugin-specific logging like this, instead of having to hook into
Good point! I'm not sure how to handle this because I only use standard terminal escape codes, which don't render the same depending on your terminal theme. In this case, I used 1️⃣ Here is what it looks like with VSC's default theme: 2️⃣ Here is an alternative design which uses
Honestly that was the hardest part of the design haha. I took inspiration from Vitest on this one. I like the contrast between the header part and the rest of the data. 3️⃣ Here is something that looks more like the current output: 4️⃣ Or with an offset:
5️⃣ Something like this? Personal thoughts on your feedback (thanks again!):
|
From the screenshots, I also like 4️⃣ the most |
I think design 4 looks great (also 5 to me looks equally good)! And I like your idea of letting plugins like inspect provide other URLs to add to the list. About using a background, I think it would look better if the font color will be black instead of white. I think Vitest is using that design as a play with the typical PASS, FAIL.
IMO,
|
I personally have the feeling like white is clearer - but both gray and white don't pass WCAG AAA anyway :/
I am neutral about the casing of (I didn't realize the new port was a leet version of Vite haha) |
It is kind of a secret, dont tell others. I vote for all caps 😁 |
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.
Love it! Also nice to have it as 3.0 so ppl could perceive more on the improvements 🫣
Totally! With this and the new docs, the impression of Vite will be different and that is good not only for the perceived progress. I think it is also good for users to easily identify if they are running v2 or v3 (or are reading the v2 or v3 docs) |
packages/vite/src/node/logger.ts
Outdated
) | ||
urls.forEach(({ label, url: text }) => { | ||
info( | ||
` ${colors.green('➜')} ${colors.bold(label)}: ${' '.repeat( |
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.
Love the design. I prefer 2 spaces here like in No.3 design since I think the extra 2 spaces don't provide special meaning here.
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 also prefer 2 spaces here. It is just a detail but aligning with the start of VITE
feels nicer.
We talked about the PR in today's team meeting, let's do this! ❤️ |
Personally I prefer it indented since it creates a sort of block. I like the look of the indentation. That being said I'm totally fine with only two spaces. Whichever you chose, I'm not home until Monday so I can't update the PR - anyone with write access to the target branch, feel free to update my PR :p I also dig the idea to provide an API to inject lines to the output! And I agree it's out of scope there and should be discussed in another PR. |
I can update the PR to what we decide 👍🏼, don't worry. Thanks again for pushing for this change! I see your point about creating a block. But to me with fewer spaces you also get a block because the arrows are small and your eyes focus on the start of |
Haha, I'm fine with either honestly. So if the majority prefers 2, let's do 2. I like 3 as well. :p Maybe we can vote?
|
I'll take the "I'm feeling lucky, let's ship it" option 🎲 |
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. Thanks for merging! |
Thank you for pushing this to the finish line @innocenzi 🙌🏼 |
Description
This PR is a minor improvement to the CLI output of the development server. While working on a plugin, I wanted to add some useful information to the terminal, and I thought the current output could be improved a bit.
Note: don't feel bad for straight up closing this PR - this is a small proposal and it would be totally fine if it was refused. Also I'm totally open on iterating over the design.
Output after this PR
Initial suggestion
Current output
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).