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 create . does not allow upper case letters. Causes headaches when integrating into existing project #5032

Closed
MarkBMtz opened this issue Jan 5, 2020 · 3 comments · Fixed by #6443

Comments

@MarkBMtz
Copy link

MarkBMtz commented Jan 5, 2020

What problem does this feature solve?

When integrating vue into existing web frameworks like Aspnet you cannot install into the root web project unless your aspnet web projects folder is all lower case.

Most guidelines on the web say to make a sub folder called app that you stuff everything into. That seems like a hack. I assume the casing restriction is due to npm package.json restrictions.

What does the proposed API look like?

Allow users to create a package.json file ahead of time and take the name from that instead.

So steps to add vue to existing project could be

npm init --yes

vue create .

If the naming restriction goes beyond package.json, just add a --lower-name flag or something.

@haoqunjiang
Copy link
Member

Makes sense.
Though npm does not support upper case letters, it automatically turns them into lower case and goes on.
Also, most use cases of upper case letters are for folder names, not for the name property in package.json. I'll submit a PR for it.

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

After a second thought, I'm now hesitant about adding this feature. See the notes at #5096

@ghost
Copy link

ghost commented Oct 22, 2020

Any more considerations on this? My current solution is to simply rename the directory Vue gives me after I run vue create some-app to SomeApp. Works, of course, however this is just my personal project directory for a standalone app so the restriction on naming seems a little out of place here.

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
Labels
None yet
Projects
None yet
2 participants