-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix(create-astro): use CLI version tag to determine astro
version
#12529
base: main
Are you sure you want to change the base?
Conversation
create-astro
create-astro
ref
passed by user to get version in create-astro
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 don't think this is quite right. The ref is a specifier for a git ref, eg the "next" branch. The specifier used to fetch versions is the npm tag, so it doesn't necessarily match
Thanks for reviewing this! Could you clarify what should be the correct tag value for the next branch? I was under the impression that the 'next' tag is currently being used for pre-releases. I referred to the CONTRIBUTING.md |
Currently, we are using |
ref
passed by user to get version in create-astro
ref
passed by user to get version in create-astro
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 agree with @bluwy: the --ref
flag is intended to select the version of templates from GitHub based on branch naming. For example, if there was a 2025
template being developed on a new-template
branch, you could use pnpm create astro --ref new-template --template 2025
to scaffold a project using it.
In the current moment, the next
branch happens to align with the beta
tag on npm (more or less, because the branch can also be slightly ahead), but it's not always the case.
Is there a situation where the current use of (edit: I should read the issue first) I think Bjorn's suggestion there is to use the tag in the command --ref next
doesn't already pick up the beta version of Astro? I'd expect the versions specified in the template package.json
to be used.create astro@beta
. Not sure if we'd have direct access to that — might need parsing from the raw args.
Makes sense. |
This does work (apart from the “Welcome” message from Houston saying v4) — it pulls the templates from the Running One fix might be to remove the version from the “Welcome to Astro vX.X.X, NAME” message. At that point in the process we don’t know the Astro version yet. That said, it’s only an issue right now because we’re in a beta stage. But once Astro v5 is released, that message will again be correct for almost all users again. (Outside of this pre-release period, using |
Thanks for the detailed explanation. Is there a way to determine the correct version to installed later in the process? If so, perhaps we could remove the Astro version number at the start and display it later in the process? |
I guess once the template is downloaded we'd know from the |
I think my initial idea for That way we're reading the npm tag for |
0ca408a
to
cfd35f5
Compare
ref
passed by user to get version in create-astro
astro
version
astro
versionastro
version
Thanks to both of you for your great suggestions. |
Changes
Closes #12506
This PR fixes issues with installation messages in
create-astro
by using the tag provided in CLI arguments (e.g.@beta
) for determiningastro
version.All these commands now show the correct version of Astro in installation.
[
installation.message.fix.mov
](url)
Testing
Manually tested by running local package with and without
@beta
Docs
N/A bug fix