-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
[bug]: app creation do not create android iOS and other code if name contains upper case letter #1081
Comments
We use the flutter command line tool to create the project. Flutter requires the projects to use snake_case for naming, when they implement it for different casing, then stacked will inherit that as well. A message would definitely be good. I'll keep it on the issues for someone in the open source community to pick it up. |
I'm on it! :) |
Just fixed it, haven't tested it as of now but opened a draft PR: Stacked-Org/cli#54 Right now the fix just uses the recase package to convert the app name to snake_case, do we want to provide a log message as well? The other alternative would be to throw an error, something like. error: app name has to be snake_case. |
Great. In may opinion, its a good idea to throw the error as there may things related to "name" and let the user decide it. |
Could you provide an example where it could be an issue? Since it is done before it's used for anything it behaves identically to writing the name in snake_case to begin with. |
Improved it as per your suggestion, this is how it looks when tested (ignore "dart run... create" instead of "stacked create", it's just cause I'm using my local repo): dart run "C:\path\to\user\then\my\projects\cli\bin\stacked.dart" create app myTestApp
No configuration file found. Default Stacked values will be used.
myTestApp is not snake_case as required by dart, did you mean my_test_app? [Y/N]
d
e
k
c
a
t
s
N
error: project name not snake_case Typing Y would rename it, Y/N is case insensitive, typing anything else would do nothing as seen above. |
Describe the bug
This is not a bug, however, if you can put an error it will be great.
I spent 2 hours trying to understand what was happening
using stacked version 1.12.6
if using "web" template then only lib, test and web folders are created
if using default template (mobile) then only lib and test folders are created
To reproduce
Expected behavior
If the app name contains capital case, give error and exit
use regex [a-z0-9_]
unless something can be really done
Screenshots
Additional Context
No response
The text was updated successfully, but these errors were encountered: