Repository navigation
fix(create-astro): make --add stricter - #15419
Conversation
🦋 Changeset detectedLatest 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 |
f1e6142 to
e502924
Compare
e502924 to
fff4113
Compare
|
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. |
| child = spawn(command, flags, { | ||
| cwd: opts.cwd, | ||
| shell: true, | ||
| shell: false, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Changes
Closes #15420
I refactored the solution to make more generic and apply it to
--addandastro 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-astroandastrocan 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