Skip to content

feat: Add Vite version & integration versions to astro info#14300

Merged
ematipico merged 40 commits intowithastro:mainfrom
louisescher:feat/more-info-for-info
Sep 12, 2025
Merged

feat: Add Vite version & integration versions to astro info#14300
ematipico merged 40 commits intowithastro:mainfrom
louisescher:feat/more-info-for-info

Conversation

@louisescher
Copy link
Copy Markdown
Member

Changes

This PR adds information about the versions of Vite and the installed integrations when running astro info. It does so by modifying the current info command and resolving the package.json files of both Astro and the integrations using the createRequire function.

In cases where the name of the integration does not match the package's name, no version information is displayed.

Testing

A new test was added to check whether the correct version of Vite is displayed.

Docs

The output on https://docs.astro.build/en/reference/cli-reference/#astro-info is now (even more) outdated.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 1, 2025

🦋 Changeset detected

Latest commit: b1b7905

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

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 Sep 1, 2025
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Sep 1, 2025

CodSpeed Performance Report

Merging #14300 will not alter performance

Comparing louisescher:feat/more-info-for-info (b1b7905) with main (13f7d36)1

Summary

✅ 6 untouched

Footnotes

  1. No successful run was found on main (c54b11e) during the generation of this report, so 13f7d36 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@ematipico
Copy link
Copy Markdown
Member

@louisescher can you please show us a snapshot of the result?

Copy link
Copy Markdown
Member

@Fryuni Fryuni left a comment

Choose a reason for hiding this comment

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

Forgot to mark as request changes. My bad.

@louisescher
Copy link
Copy Markdown
Member Author

louisescher commented Sep 2, 2025

@louisescher can you please show us a snapshot of the result?

This is what is now output by the examples/framework-react site:

Astro                    v5.13.5
Vite                     Astro: v6.3.4
Node                     v22.18.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/react (v4.3.0)

I'll see what I can do about the requests by Luiz and then post another snapshot in here once that's ready.

@louisescher louisescher requested a review from Fryuni September 2, 2025 20:03
@louisescher
Copy link
Copy Markdown
Member Author

louisescher commented Sep 2, 2025

@ematipico
Adjusted this now so that the package manager is used instead of createRequire. Here's what the output looks like now when ran from examples/framework-react using pnpm:

Astro                    v5.13.5
Vite                     Local
Node                     v22.18.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/react (Local)

For context, since pnpm uses a link for workspace packages, I was unable to properly resolve them. They thus show up as local, which I think makes sense.
Running astro info using npm gives the following (same example):

Astro                    v5.13.5
Vite                     v6.3.5
Node                     v22.18.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/react (v4.3.0)

Edit: No clue why tests are failing. Seems to just be a timeout issue.

Copy link
Copy Markdown
Member

@Fryuni Fryuni left a comment

Choose a reason for hiding this comment

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

I still think it would be best to show all installed versions of Astro, but for the intended scope of the PR this is fine. Just sent some small fixes/simplifications

louisescher and others added 2 commits September 2, 2025 22:56
Co-authored-by: Luiz Ferraz <luiz@lferraz.com>
Co-authored-by: Luiz Ferraz <luiz@lferraz.com>
@louisescher
Copy link
Copy Markdown
Member Author

Seen and applied, thank you. Just wondering what to do about tests now. I'm a bit out of my depth here, since just simply testing the CLI output that is tested currently doesn't really suffice anymore? Plus, testing with npm is fine, but testing with yarn is pretty annoying/difficult even when doing so manually. I'd appreciate some guidance on that.

@Adammatthiesen
Copy link
Copy Markdown
Member

(merged main at Lou's request)

Copy link
Copy Markdown
Member

@Fryuni Fryuni left a comment

Choose a reason for hiding this comment

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

Seems good. With everything passing this is a yes from me :)

@louisescher
Copy link
Copy Markdown
Member Author

Astro                    v5.13.7
Vite                     v6.3.6
Node                     v20.11.0
System                   Windows (x64)
Package Manager          pnpm
Output                   static
Adapter                  @astrojs/node (v9.4.0)
Integrations             @astrojs/react (v4.3.0)

Here's what will be shown as the new output (for example)!

Copy link
Copy Markdown
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

All good! I would handle the bun case. We shouldn't do anything fancy since we don't officially support it, but handling it safely should help

@ematipico ematipico merged commit bd4a70b into withastro:main Sep 12, 2025
21 of 22 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Sep 12, 2025
@louisescher louisescher deleted the feat/more-info-for-info branch September 15, 2025 16:34
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.

5 participants