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

Improve logger (deduping, new help and version) #2737

Merged
merged 13 commits into from
Mar 9, 2022
Merged

Conversation

natemoo-re
Copy link
Member

@natemoo-re natemoo-re commented Mar 8, 2022

Changes

  • Updates Astro's logger to dedupe messages, appending (x2) to the end of duplicates
  • Improves hmr logging with specific update or reload messages
  • Updates astro --help output to match new logging style
  • Updates astro --version output to match new logging style

Old HMR
Screen Shot 2022-03-08 at 5 35 48 PM

New HMR
Screen Shot 2022-03-09 at 12 53 15 PM

New Help

On wide terminals

Screen Shot 2022-03-09 at 11 16 07 AM

On tall terminals
Screen Shot 2022-03-09 at 12 54 58 PM

New Version

Screen Shot 2022-03-09 at 12 57 19 PM

Testing

Tested manually + CLI tests updated

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Mar 8, 2022

🦋 Changeset detected

Latest commit: ded20ae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 8, 2022
@natemoo-re natemoo-re changed the title Feat/improve logger Improve logger with deduping Mar 8, 2022
packages/astro/src/vite-plugin-astro/index.ts Outdated Show resolved Hide resolved
packages/astro/src/vite-plugin-astro/hmr.ts Outdated Show resolved Hide resolved
packages/astro/src/core/logger.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot added the test label Mar 9, 2022
Copy link
Contributor

@tony-sull tony-sull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Big fan of the logging cleanup 🎉 Added one note on the HMR optimization

packages/astro/src/vite-plugin-astro/index.ts Outdated Show resolved Hide resolved
@natemoo-re natemoo-re self-assigned this Mar 9, 2022
@natemoo-re natemoo-re changed the title Improve logger with deduping Improve logger (deduping, new help and version) Mar 9, 2022
@tony-sull tony-sull self-requested a review March 9, 2022 20:01
Copy link
Contributor

@tony-sull tony-sull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@FredKSchott
Copy link
Member

LGTM! can we merge after #2705 ?

@natemoo-re
Copy link
Member Author

LGTM! can we merge after #2705 ?

Yep, that's the plan!

@natemoo-re natemoo-re force-pushed the feat/improve-logger branch 3 times, most recently from a86303a to 361fe5b Compare March 9, 2022 22:41
@natemoo-re natemoo-re merged commit e8d4e56 into main Mar 9, 2022
@natemoo-re natemoo-re deleted the feat/improve-logger branch March 9, 2022 23:38
This was referenced Mar 9, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* feat: improve logger by removing repeat messages

* feat(hmr): only send HMR updates when files change

* feat: improve hmr formatting

* feat(logger): improve welcome formatting

* feat(logger): improve hmr formatting

* chore(test): update cli test output

* feat(logger): improve logging output

* feat(logger): improve help/version flags

* chore: remove checksum checks

* fix(test): update cli tests

* refactor(test): cleanup astro dev cli tests

* chore: add changeset

* chore(test): skip doctype test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants