-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fixes spaces in project name #176
Conversation
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.
Thanks @rin-st really nice!! and works great! And happy to merge as it 🙌
Was just researching on DX from other create CLI's
-
Regarding project path, I liked how create-next-app is validating the path.
- checkout this line
- and this their validate function
-
Initially I thought maybe we should ourselves trim leading and inital space (being forgiving) but looking at other CLI they don't do it and show Invalid project path like us now 🙌 so need to change anything.
On point 1 should we use that? Maybe it's a bit overpowered but worth it and more robust / future proof. Saying this because maybe in future user entering some weird path might break CLI (can be caused if use some other lib in create-eth cli is not able to parse or maybe some foundry changes)
Also its shows warning on specific stuff whats wrong:
Thanks Shiv! I copied their validate function so now cli shows all the errors at the start. But when prompting it shows only one error (same as in create-next-app) since if we want to show all it requires to add workarounds and I think it's not worth it. How it works now: Screen.Recording.2025-01-03.at.17.54.11.mov |
Yup yup not worth it and the current version feels nice too so no required! Thanks @rin-st!! Merging this 🙌 |
An error appears here only when used foundry with project name with spaces at the end. It throws because
/
(space +/
) is interpreted as separation between arguments. All other variants " a", "a b" etc works as expectedSo idea is to restrict space usage at the end of the project name and allow all others
I added a check when prompting for a name: you can't go the next steps until you have no spaces/tabs at the end of the project name. Also added project field reset for adventurers who will try to deceive cli and try to use something like
yarn cli "space-at-the-end "
Screen.Recording.2024-12-20.at.17.22.43.mov
how it looks with the extension
Fixes #150