Skip to content

fix(create-astro): create astro uses correct project name when using directory "." - #17477

Open
alexanderdombroski wants to merge 2 commits into
withastro:mainfrom
alexanderdombroski:fix-empty-name
Open

fix(create-astro): create astro uses correct project name when using directory "."#17477
alexanderdombroski wants to merge 2 commits into
withastro:mainfrom
alexanderdombroski:fix-empty-name

Conversation

@alexanderdombroski

Copy link
Copy Markdown
Contributor

Changes

When running npm create astro@latest and then using . for the output directory, Astro generates a package.json with an empty "" package name. In contrast, running npm create astro . uses the current working directory's basename.

This PR makes both invocation styles behave consistently by always deriving the package name from the generated project's basename. This behavior is also consistent with Vite's, Nuxt's, and Next's npm create commands.

Before / After

Before package json After package json

Testing

I tested locally and added tests for npm create astro with dot for the project location prompt.

Docs

Sufficient docs exist for the create astro command.

@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ed91702

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

This PR includes changesets to release 1 package
Name Type
create-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: create-astro Related to the `create-astro` package (scope) label Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: create-astro Related to the `create-astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant