wasp
wasp copied to clipboard
Improve support for project names
Users can currently name their Wasp project using an arbitrary Wasp identifier:
The project's name must be a valid Wasp identifier:
- It can start with a letter or an underscore.
- It can contain only letters, numbers, or underscores.
- It can't be a Wasp keyword.
However, our users have pointed out that this isn't flexible enough. For example, many people would like to name wasp projects using kebab-case. We should:
- definitely support kebab case
- optionally support arbitrary strings
The main problem with allowing arbitrary strings arises because we use the user-provided project name as the name of the application (i.e., to generate the app declaration inside the main.wasp file). We can get around this limitation by "mapping" the project name provided by the user into a valid Wasp identifier (e.g., turning something-like-this into somethingLikeThis). We should only do this for the purposes of Wasp and leave the project directory's name should stay intact.
As a practical solution, we suggested we allow people to input valid Wasp identifiers with - in them. Then, we use such name to create project directory, and to name project in the .wasp, under the app.title field. However, for app <identifier, we use the version of that input where we convert from kebab-case to camelCase by just removing - and capitalizing the letters after it.
So, if user inputs TODO-app, we would create directory TODO-app, and would generate .wasp file with
app TODOApp {
title: "TODO-app"
...
}
...
Can I take this?
@pt2121 Sorry for the late response, the answer is "yes" :). I know see that you've already made a PR.
Great! Will check it out ASAP.