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

vue-cli shows "invalid project name" for project names or directories that have uppercase letters #2547

Closed
dumptyd opened this issue Sep 18, 2018 · 7 comments · Fixed by #6443

Comments

@dumptyd
Copy link

dumptyd commented Sep 18, 2018

Version

3.0.3

Node and OS info

Node 8.12.0 / yarn 1.9.4 / Ubuntu

Steps to reproduce

The issue can be reproduced by trying to initialize a project that has uppercase letters in its name. vue create Uppecase will give this error.

This is error isn't so obvious when you try to initialize a project with vue create . in the current directory which has uppercase letters in its name. In this case, it just says Invalid project name: ".".

What is expected?

vue-cli should allow me to create projects that have uppercase letters in their name.

What is actually happening?

vue-cli is not letting me create projects that have uppercase letters in their name.

@dumptyd
Copy link
Author

dumptyd commented Sep 18, 2018

If anyone's looking for a temporary solution, the check can be bypassed by editing the lib/create.js file. The file's path can be found by running readlink -f $(which vue). That's how I solved this for now.

@haoqunjiang
Copy link
Member

npm init does not support uppercase letters, neither does create-react-app.
See facebook/create-react-app#2165
I don't think we should support this use case. Though, the error message could be improved.

@dumptyd
Copy link
Author

dumptyd commented Sep 18, 2018

I think -f flag should still be provided. Not everyone wants to publish their projects to npm.

@BrandonYeager
Copy link
Contributor

As a beginner Vue developer coming from the desktop programming world, this caused a bunch of confusion for me. I always name my desktop projects in Pascal case and it took me a bunch of attempts to figure out why I was getting the error. I could see a user with less patience giving up.

I'm glad that I finally know the reasoning behind this, but I would still prefer to keep my normal development naming convention. My work-around has been to use the Vue CLI GUI (which doesn't seem to have the same limitation).

I would be happy with a -f flag or similar option. Either way, a more descriptive error message might prevent a lot of frustration from other developers that are not familiar with Vue naming conventions.

haoqunjiang added a commit to haoqunjiang/vue-cli that referenced this issue Jan 20, 2020
closes vuejs#2547
closes vuejs#5032

I'm still very hesitant on adding this feature, though.

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, vuejs#5022, vuejs#4424, vuejs#3665, vuejs#4174#issuecomment-569709494 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 to 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 intercept
the 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'll
have another edge case to test.
@haoqunjiang
Copy link
Member

haoqunjiang commented Jan 20, 2020

I've opened a PR implementing this but I haven't decided whether to merge it. #5096

Even if you don't need to publish the package to npm, there could still have edge cases with regard to path cases. It could be a real maintenance burden for us. (And it has already caused many issues).

@haoqunjiang
Copy link
Member

Using a PascalCase name is an aesthetic issue most of the time. But the problems it encountered in the Node.js ecosystem are real.

@DavidMulder0
Copy link

For whatever it's worth, some businesses have project name requirements that require capital names. Our work does, but sadly we don't use Vue at work, so it's not an issue, but I subconsciously followed our work naming scheme at home now and really think this is a bad idea.

haoqunjiang added a commit to haoqunjiang/vue-cli that referenced this issue Apr 26, 2021
Capital letters are no longer allowed.

Supersedes vuejs#5096 (see more reasoning in that PR)

closes vuejs#2547
closes vuejs#5032
closes vuejs#6436
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants