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

Allow to have a different directory and project name #4411

Open
thewilli opened this issue Aug 8, 2019 · 5 comments
Open

Allow to have a different directory and project name #4411

thewilli opened this issue Aug 8, 2019 · 5 comments

Comments

@thewilli
Copy link

thewilli commented Aug 8, 2019

What problem does this feature solve?

Full stack projects might use a project structure where the web is only a certain part amongst e.g. the server, scripts, database definitions. Consider for example the default Go project structure. For such a project it is desirable to have the output of vue-cli generated in a specific folder (web/ in the case. of go) that is not named just as the whole project, while the actual name (package.json) should still be the one of the application. As of now, I would need to manually rename the folder:

# create a web named 'my-cool-app'
$ vue create my-cool-app
# rename the target folder to a more generic name
$ mv my-cool-app web

IMHO it would be a great benefit to allow to (optionally) provide a different project name to vue-cli, while the standard behaviour should remain (i.e. derive the project name from the output folder's name).

What does the proposed API look like?

#  create the web 'my-web' in the 'web' directory
$ vue create --name my-web web
@LinusBorg
Copy link
Member

I personally think renaming a folder is straightforward and was enough.

Adding another option for this does not add any considerable value.

@thewilli
Copy link
Author

thewilli commented Aug 10, 2019

@LinusBorg Adding another option for this does not add any considerable value.

IMHO the value is to have the code generator (that's how I see vue-cli) configurable in a way the output fits a common use-case without the need for additional interaction.

You could have argued the same for the --git <commit message> option, which is probably not used most times and could be easily done manually. Having name and output directory configurable isn't really something extraordinary, is it?

@LinusBorg
Copy link
Member

The --git option exists because vue-cli does the first commit for you, and this immand allows you to change the default message that is used. so actually, you can't do that manually as the commit already happened.

Anyway, I stated this is a personal opinion. I just feel like adding lots and lots of these "tiny" options to the cli will make it harder to find the ones that do more important/advanced things.

It may be argued that this is an arbitrary point to draw the line and that would be correct and I do not care too much either way.

@thewilli
Copy link
Author

[...] you can't do that manually as the commit already happened

well, even though you can of course change the last (first) commit message as easy as renaming a directory (i.e. git commit --amend), I must admin that my example wasn't chosen very well. My though was that adding files to a VCS isn't such a basic task as defining the output directory. It is easy, fast and can be done by any developer himself the way he/she wants it 😉.

I just feel like adding lots and lots of these "tiny" options to the cli will make it harder to find the ones that do more important/advanced things.

I can fully understand your point, and in general I'd agree with it. My use case arose from the situation that developers in a company I'm working for went through the options and as the only one was the output directory used that for the final name, instead of renaming the directory afterwards. We ended with lots of web webs...

@dsseng
Copy link

dsseng commented Aug 18, 2019

I'd prefer vue create my-app --dir web as a more convienient way to do this.

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

No branches or pull requests

3 participants