Skip to content
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

Open
Abhijit-Revamp opened this issue Feb 13, 2024 · 6 comments · May be fixed by Stacked-Org/cli#54
Labels

Comments

@Abhijit-Revamp
Copy link

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

  1. stacked update
  2. stacked create app myTest
  3. stacked create app myTestWeb -t web

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

image

Additional Context

No response

@Abhijit-Revamp Abhijit-Revamp changed the title [bug]: app creation do not create android iOS and other code if name contains CAP letter [bug]: app creation do not create android iOS and other code if name contains upper case letter Feb 13, 2024
@FilledStacks
Copy link
Contributor

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.

@Pebkac03
Copy link

I'm on it! :)

@Pebkac03 Pebkac03 linked a pull request Dec 14, 2024 that will close this issue
@Pebkac03
Copy link

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.

@Abhijit-Revamp
Copy link
Author

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.
OR if you can ask for user confirmation about converting to lower case and snake_case, that will be stunning

@Pebkac03
Copy link

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.

@Pebkac03
Copy link

Pebkac03 commented Dec 14, 2024

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.
Line 2 is yellow, no change there, and the added last line is in red.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants