feat: convert project name to lowercase and warn on creation #5096
+20
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #2547
closes #5032
I'm still very hesitant about adding this feature, though.
Aside from the reasons mentioned in facebook/create-react-app#2165, here are my thoughts:
First, this change allows project creation in a folder with uppercase
letters in its name. It is strongly discouraged and may cause many
weird issues all over the ecosystem.
For example, #5022, #4424, #3665, #4174 are all
caused by case issues. Adding support for uppercase project names will
only worsen this situation.
Secondly, it adds a lot of maintenance burden on us. As noted in the
comments, these prompts are hard to test right now (because
createTestProject
runs in another process so it's hard to interceptthe prompts). Even if such test utilities are added in the future, it's
still very tedious to take care of all the case issues in the test
suite.
What's worse is that we can affect the project folders created by
@vue/cli by converting the project name to lower case. But for
vue create .
, we cannot change the current folder's name. So, we'llhave another edge case to test (projectName != folderName).
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
Other information: