cfpb / generator-cf

Yeoman generator for Capital Framework
http://cfpb.github.io/capital-framework/getting-started/
Creative Commons Zero v1.0 Universal
9 stars 13 forks source link

Install Capital Framework in its own folder #31

Closed KimberlyMunoz closed 9 years ago

KimberlyMunoz commented 9 years ago

Right now, the easy two-step installation results in getting a bunch of files installed in your Sites folder.

The typical behavior for cloning/generating a framework to set up a project usually creates a folder for your project, so as CP gets more use, I can see more folks making the mistake of accidentally installing yo cf in their root project folder.

We ask for project name in the first step, we should have it create a folder with that name.

Alternative suggestion: In our documentation, can we change:

$ npm install -g yo generator-cf
$ yo cf

to

~/yourProject $ npm install -g yo generator-cf
~/yourProject $ yo cf
Scotchester commented 9 years ago

:+1: We ran into this just the other day; forgot to make an issue for it. I think it's better to change the default behavior to create a new directory.

jimmynotjim commented 9 years ago

When we were building the Evolved generator, we went through a similar plan but abandoned it because existing directories became messy. It's hard to tell user intent so if a directory already exists should it be updated with new changes in the framework or should the process be aborted. If we do decide to create/overwrite, it isn't hard to use glob to add a checker for an existing directory, and if it comes back true to confirm with the user.

KimberlyMunoz commented 9 years ago

Good call about the check.

And so long as the error message when you find an existing directory is useful ("Directory already exists. Please select another project name.") then it should be easy for the end-user to figure out what they want to do.

jimmynotjim commented 9 years ago

There should probably be an option to continue with the installation, otherwise you'll never be able to update an existing project to the latest changes in CF.

jimmynotjim commented 9 years ago

The more I use this the more I'm not so sure we should be generating a project folder for the user. Most generators don't and it might be confusing if we don't adhere to the expected behavior.

We should definitely update the instructions to tell the user to mkdir for the project and then cd to that directory before running the generator.

KimberlyMunoz commented 9 years ago

:+1: to making the documentation a little clearer.

Scotchester commented 9 years ago

Gonna reopen this until the CF homepage is updated: http://cfpb.github.io/capital-framework/