Skip to content

fix(create-astro): make --add stricter - #15419

Merged
ematipico merged 4 commits into
mainfrom
fix/create-astro-add
Feb 9, 2026
Merged

ematipico merged 4 commits into
mainfrom
fix/create-astro-add

Conversation

@ematipico

@ematipico ematipico commented Feb 5, 2026 •

Copy link
Copy Markdown
Member

Changes

Closes #15420

I refactored the solution to make more generic and apply it to --add and astro add. We have a generic regex that checks wether the name follows the npmjs naming convention. If not, we throw an error.

I preferred to have this regex inside the internal helpers, so both create-astro and astro can use the same source of truth.

Note

Solution designed by me. Code and tests generated via AI. I checked all the code

Testing

Added various tests.

Added new tests. Tested manually

Docs

N/A

@changeset-bot

changeset-bot Bot commented Feb 5, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: afe8503

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: create-astro Related to the `create-astro` package (scope) label Feb 5, 2026
@ematipico
ematipico force-pushed the fix/create-astro-add branch from f1e6142 to e502924 Compare February 5, 2026 15:21
@ematipico ematipico self-assigned this Feb 5, 2026
Comment thread packages/create-astro/src/actions/dependencies.ts Outdated
@ematipico
ematipico force-pushed the fix/create-astro-add branch from e502924 to fff4113 Compare February 6, 2026 14:12
@matthewp

matthewp commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

I don't think this will work, I didn't realize it but we support passing multiple integrations: https://docs.astro.build/en/guides/integrations-guide/#automatic-integration-setup

I think we'll need to do some sort of escaping.

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Feb 6, 2026
@codspeed

codspeed Bot commented Feb 6, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing fix/create-astro-add (afe8503) with main (10b0422)1

Open in CodSpeed

Footnotes

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

@Princesseuh Princesseuh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems fine to me!

Comment thread packages/create-astro/src/shell.ts Outdated
child = spawn(command, flags, {
cwd: opts.cwd,
shell: true,
shell: false,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, I'd check if there isn't a Windows nonsense that could happen here. I feel like I remember some Node update requiring shell true in some contexts on Windows.

@ematipico ematipico Feb 9, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I checked the history of the code, and I couldn't find anything related to windows, but I'll keep an eye in case there's some regression filed by users

EDIT: AH! Seems like there are some failures on Windows in CI

@ematipico
ematipico merged commit a18d727 into main Feb 9, 2026
28 checks passed
@ematipico
ematipico deleted the fix/create-astro-add branch February 9, 2026 10:26
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) pkg: create-astro Related to the `create-astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create-astro: --add input is interpreted as shell syntax

4 participants